From 55c256654b1940b331edb61220b33e30109658d5 Mon Sep 17 00:00:00 2001 From: freefire Date: Sun, 28 Jun 2026 17:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=9D=BF=E5=9D=97=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E4=B8=8E=E4=B8=BB=E9=A2=98=E8=89=B2=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=EF=BC=8C=E5=B9=B6=E4=BC=98=E5=8C=96=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=B8=8E=E6=9C=AA=E4=BF=9D=E5=AD=98=E7=A6=BB?= =?UTF-8?q?=E5=BC=80=E6=8F=90=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增后端图标校验与色槽规范化,前端展示 BoardBadge/骨架屏,发帖与板块管理页增加未保存确认。 Co-authored-by: Cursor --- ...E8jZ9.js => AdminCommentsPage-B23tMV_-.js} | 2 +- ...zcB-.js => AdminDashboardPage-C2c-F2-X.js} | 2 +- .../spa/assets/AdminPostsPage--PeUmtdb.js | 1 - .../spa/assets/AdminPostsPage-Boh0BdYW.js | 1 + ...MNTuF.js => AdminSettingsPage-BKTiLKhD.js} | 2 +- ...YBnRhF6k.js => AdminUsersPage-GP-G5C8H.js} | 2 +- .../spa/assets/BoardsManagePage-DXFAZqh1.js | 1 - .../spa/assets/BoardsManagePage-DxLu9n3N.js | 1 + ...ge-BiusUtIm.js => ComposePage-eRDSuLA7.js} | 178 +++--- ...-BrE1xy6C.js => FavoritesPage-rLr3pZbU.js} | 2 +- .../static/spa/assets/HomePage-B75SKkZF.js | 1 + .../static/spa/assets/HomePage-DC4iWqJT.js | 1 - ...Page-sbkZASpH.js => LoginPage-jlZcJP-F.js} | 2 +- .../static/spa/assets/PinnedIcon-Dc0ZpCCq.js | 1 + .../static/spa/assets/PinnedIcon-_RgLYKvd.js | 1 - .../spa/assets/PostDetailPage-BjTvWYTM.js | 14 - .../spa/assets/PostDetailPage-Ca0chGU-.js | 14 + ...ge-DiORLSTl.js => ProfilePage-BxbMpG9W.js} | 2 +- ...e-D4yO0Lp-.js => RegisterPage-g5r_djmM.js} | 2 +- ...g-D0wiVaPM.js => alert-dialog-C2PKamsV.js} | 2 +- .../{badge-CS5odIe6.js => badge-xzbTTsRq.js} | 2 +- .../static/spa/assets/dialog-CtQqbmck.js | 1 - .../static/spa/assets/dialog-DXwuwWJi.js | 1 + .../{form-cra7lKcv.js => form-DggfNWHU.js} | 2 +- .../static/spa/assets/index-2yIymxOj.css | 1 - .../static/spa/assets/index-Cp7Ff9NP.js | 2 + .../static/spa/assets/index-CucHNnyZ.js | 2 - .../static/spa/assets/index-xhm8HZjc.css | 1 + .../{input-DOedlbiC.js => input-y6vZyHhN.js} | 2 +- .../spa/assets/react-vendor-1fwFMt02.js | 67 -- .../spa/assets/react-vendor-BdyZmpPe.js | 68 ++ ...tarea-CwI-oiTC.js => textarea-Dcf0-FNg.js} | 2 +- .../static/spa/assets/ui-vendor-B26O8baZ.js | 456 ++++++++++++++ .../static/spa/assets/ui-vendor-Gb6mai95.js | 356 ----------- ...DDSEW9eW.js => virtual-vendor-rtLkLCpN.js} | 2 +- embed_static/static/spa/index.html | 8 +- frontend/src/App.tsx | 60 +- frontend/src/api/client.ts | 4 +- frontend/src/api/types.ts | 2 + .../src/components/BoardAppearancePicker.tsx | 93 +++ frontend/src/components/BoardBadge.tsx | 18 + frontend/src/components/BoardIconDisplay.tsx | 14 + frontend/src/components/FeedHeader.tsx | 22 +- frontend/src/components/PostListItem.tsx | 17 +- frontend/src/components/PostListSkeleton.tsx | 30 + frontend/src/components/RightPanel.tsx | 45 +- frontend/src/components/Sidebar.tsx | 40 +- .../src/components/UnsavedChangesDialog.tsx | 45 ++ frontend/src/components/VirtualPostList.tsx | 76 +-- frontend/src/components/ui/skeleton.tsx | 7 + frontend/src/hooks/useUnsavedChangesGuard.ts | 79 +++ frontend/src/layouts/MainLayout.tsx | 24 +- frontend/src/pages/BoardsManagePage.tsx | 79 ++- frontend/src/pages/ComposePage.tsx | 62 +- frontend/src/pages/HomePage.tsx | 28 +- frontend/src/pages/PostDetailPage.tsx | 3 +- frontend/src/styles/global.css | 586 +++++++++++++++++- frontend/src/utils/boardTheme.ts | 71 +++ handler/admin.go | 6 +- handler/api.go | 8 +- model/models.go | 2 + service/board.go | 18 +- service/board_icon.go | 36 ++ 63 files changed, 1966 insertions(+), 714 deletions(-) rename embed_static/static/spa/assets/{AdminCommentsPage-CQrE8jZ9.js => AdminCommentsPage-B23tMV_-.js} (80%) rename embed_static/static/spa/assets/{AdminDashboardPage-Co9xzcB-.js => AdminDashboardPage-C2c-F2-X.js} (78%) delete mode 100644 embed_static/static/spa/assets/AdminPostsPage--PeUmtdb.js create mode 100644 embed_static/static/spa/assets/AdminPostsPage-Boh0BdYW.js rename embed_static/static/spa/assets/{AdminSettingsPage-B63MNTuF.js => AdminSettingsPage-BKTiLKhD.js} (91%) rename embed_static/static/spa/assets/{AdminUsersPage-YBnRhF6k.js => AdminUsersPage-GP-G5C8H.js} (84%) delete mode 100644 embed_static/static/spa/assets/BoardsManagePage-DXFAZqh1.js create mode 100644 embed_static/static/spa/assets/BoardsManagePage-DxLu9n3N.js rename embed_static/static/spa/assets/{ComposePage-BiusUtIm.js => ComposePage-eRDSuLA7.js} (61%) rename embed_static/static/spa/assets/{FavoritesPage-BrE1xy6C.js => FavoritesPage-rLr3pZbU.js} (81%) create mode 100644 embed_static/static/spa/assets/HomePage-B75SKkZF.js delete mode 100644 embed_static/static/spa/assets/HomePage-DC4iWqJT.js rename embed_static/static/spa/assets/{LoginPage-sbkZASpH.js => LoginPage-jlZcJP-F.js} (85%) create mode 100644 embed_static/static/spa/assets/PinnedIcon-Dc0ZpCCq.js delete mode 100644 embed_static/static/spa/assets/PinnedIcon-_RgLYKvd.js delete mode 100644 embed_static/static/spa/assets/PostDetailPage-BjTvWYTM.js create mode 100644 embed_static/static/spa/assets/PostDetailPage-Ca0chGU-.js rename embed_static/static/spa/assets/{ProfilePage-DiORLSTl.js => ProfilePage-BxbMpG9W.js} (98%) rename embed_static/static/spa/assets/{RegisterPage-D4yO0Lp-.js => RegisterPage-g5r_djmM.js} (79%) rename embed_static/static/spa/assets/{alert-dialog-D0wiVaPM.js => alert-dialog-C2PKamsV.js} (83%) rename embed_static/static/spa/assets/{badge-CS5odIe6.js => badge-xzbTTsRq.js} (85%) delete mode 100644 embed_static/static/spa/assets/dialog-CtQqbmck.js create mode 100644 embed_static/static/spa/assets/dialog-DXwuwWJi.js rename embed_static/static/spa/assets/{form-cra7lKcv.js => form-DggfNWHU.js} (99%) delete mode 100644 embed_static/static/spa/assets/index-2yIymxOj.css create mode 100644 embed_static/static/spa/assets/index-Cp7Ff9NP.js delete mode 100644 embed_static/static/spa/assets/index-CucHNnyZ.js create mode 100644 embed_static/static/spa/assets/index-xhm8HZjc.css rename embed_static/static/spa/assets/{input-DOedlbiC.js => input-y6vZyHhN.js} (77%) delete mode 100644 embed_static/static/spa/assets/react-vendor-1fwFMt02.js create mode 100644 embed_static/static/spa/assets/react-vendor-BdyZmpPe.js rename embed_static/static/spa/assets/{textarea-CwI-oiTC.js => textarea-Dcf0-FNg.js} (73%) create mode 100644 embed_static/static/spa/assets/ui-vendor-B26O8baZ.js delete mode 100644 embed_static/static/spa/assets/ui-vendor-Gb6mai95.js rename embed_static/static/spa/assets/{virtual-vendor-DDSEW9eW.js => virtual-vendor-rtLkLCpN.js} (99%) create mode 100644 frontend/src/components/BoardAppearancePicker.tsx create mode 100644 frontend/src/components/BoardBadge.tsx create mode 100644 frontend/src/components/BoardIconDisplay.tsx create mode 100644 frontend/src/components/PostListSkeleton.tsx create mode 100644 frontend/src/components/UnsavedChangesDialog.tsx create mode 100644 frontend/src/components/ui/skeleton.tsx create mode 100644 frontend/src/hooks/useUnsavedChangesGuard.ts create mode 100644 frontend/src/utils/boardTheme.ts create mode 100644 service/board_icon.go diff --git a/embed_static/static/spa/assets/AdminCommentsPage-CQrE8jZ9.js b/embed_static/static/spa/assets/AdminCommentsPage-B23tMV_-.js similarity index 80% rename from embed_static/static/spa/assets/AdminCommentsPage-CQrE8jZ9.js rename to embed_static/static/spa/assets/AdminCommentsPage-B23tMV_-.js index 804b9ad..183bfce 100644 --- a/embed_static/static/spa/assets/AdminCommentsPage-CQrE8jZ9.js +++ b/embed_static/static/spa/assets/AdminCommentsPage-B23tMV_-.js @@ -1 +1 @@ -import{e as A,r as i,j as e}from"./react-vendor-1fwFMt02.js";import{i as D,S as C,B as d,a as m,n as c}from"./index-CucHNnyZ.js";import{B as N}from"./badge-CS5odIe6.js";import{A as y,a as b,b as k,c as S,d as _,e as z,f as B,g as E,h as P}from"./alert-dialog-D0wiVaPM.js";import"./ui-vendor-Gb6mai95.js";function G(){const j=A(),{ready:r}=D(),[o,g]=i.useState([]),[p,h]=i.useState(!0),[a,u]=i.useState(1),[l,f]=i.useState(1),n=(s=a)=>{h(!0),m.adminComments(s).then(t=>{g(t.comments??[]),u(t.page),f(t.total_pages)}).catch(t=>c.error(t.message)).finally(()=>h(!1))};i.useEffect(()=>{r&&n(1)},[r]);const v=async s=>{try{await m.adminDeleteComment(s),c.success("评论已删除"),n()}catch(t){c.error(t instanceof Error?t.message:"删除失败")}};return r?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"评论管理"}),e.jsx("p",{children:"查看与删除楼层评论"})]}),e.jsx("div",{className:"admin-card",children:p?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(C,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"楼层"}),e.jsx("th",{children:"帖子"}),e.jsx("th",{children:"作者"}),e.jsx("th",{children:"内容"}),e.jsx("th",{children:"私密"}),e.jsx("th",{children:"时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:o.map(s=>{var t,x;return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{children:["#",s.floor]}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>j(`/post/${s.post_id}`),children:((t=s.post)==null?void 0:t.title)??`#${s.post_id}`})}),e.jsx("td",{children:((x=s.user)==null?void 0:x.nickname)||s.guest_nick||"游客"}),e.jsx("td",{className:"max-w-[200px] truncate",children:s.content}),e.jsx("td",{children:s.is_private?e.jsx(N,{variant:"secondary",children:"是"}):"—"}),e.jsx("td",{children:new Date(s.created_at).toLocaleString("zh-CN")}),e.jsx("td",{children:e.jsxs(y,{children:[e.jsx(b,{asChild:!0,children:e.jsx(d,{size:"sm",variant:"ghost",className:"text-destructive",children:"删除"})}),e.jsxs(k,{children:[e.jsxs(S,{children:[e.jsx(_,{children:"确定删除该评论?"}),e.jsx(z,{children:"此操作不可恢复。"})]}),e.jsxs(B,{children:[e.jsx(E,{children:"取消"}),e.jsx(P,{onClick:()=>v(s.id),children:"删除"})]})]})]})})]},s.id)})})]}),o.length===0&&e.jsx("div",{className:"admin-empty",children:"暂无评论"}),l>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(d,{size:"sm",variant:"outline",disabled:a<=1,onClick:()=>n(a-1),children:"上一页"}),e.jsxs("span",{children:["第 ",a," / ",l," 页"]}),e.jsx(d,{size:"sm",variant:"outline",disabled:a>=l,onClick:()=>n(a+1),children:"下一页"})]})]})})]}):null}export{G as default}; +import{e as A,r as i,j as e}from"./react-vendor-BdyZmpPe.js";import{m as D,S as C,B as d,b as x,n as c}from"./index-Cp7Ff9NP.js";import{B as N}from"./badge-xzbTTsRq.js";import{A as y,g as b,a as k,b as S,c as _,d as z,e as B,f as E,h as P}from"./alert-dialog-C2PKamsV.js";import"./ui-vendor-B26O8baZ.js";function G(){const j=A(),{ready:r}=D(),[o,g]=i.useState([]),[p,h]=i.useState(!0),[a,u]=i.useState(1),[l,f]=i.useState(1),n=(s=a)=>{h(!0),x.adminComments(s).then(t=>{g(t.comments??[]),u(t.page),f(t.total_pages)}).catch(t=>c.error(t.message)).finally(()=>h(!1))};i.useEffect(()=>{r&&n(1)},[r]);const v=async s=>{try{await x.adminDeleteComment(s),c.success("评论已删除"),n()}catch(t){c.error(t instanceof Error?t.message:"删除失败")}};return r?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"评论管理"}),e.jsx("p",{children:"查看与删除楼层评论"})]}),e.jsx("div",{className:"admin-card",children:p?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(C,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"楼层"}),e.jsx("th",{children:"帖子"}),e.jsx("th",{children:"作者"}),e.jsx("th",{children:"内容"}),e.jsx("th",{children:"私密"}),e.jsx("th",{children:"时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:o.map(s=>{var t,m;return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{children:["#",s.floor]}),e.jsx("td",{children:e.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>j(`/post/${s.post_id}`),children:((t=s.post)==null?void 0:t.title)??`#${s.post_id}`})}),e.jsx("td",{children:((m=s.user)==null?void 0:m.nickname)||s.guest_nick||"游客"}),e.jsx("td",{className:"max-w-[200px] truncate",children:s.content}),e.jsx("td",{children:s.is_private?e.jsx(N,{variant:"secondary",children:"是"}):"—"}),e.jsx("td",{children:new Date(s.created_at).toLocaleString("zh-CN")}),e.jsx("td",{children:e.jsxs(y,{children:[e.jsx(b,{asChild:!0,children:e.jsx(d,{size:"sm",variant:"ghost",className:"text-destructive",children:"删除"})}),e.jsxs(k,{children:[e.jsxs(S,{children:[e.jsx(_,{children:"确定删除该评论?"}),e.jsx(z,{children:"此操作不可恢复。"})]}),e.jsxs(B,{children:[e.jsx(E,{children:"取消"}),e.jsx(P,{onClick:()=>v(s.id),children:"删除"})]})]})]})})]},s.id)})})]}),o.length===0&&e.jsx("div",{className:"admin-empty",children:"暂无评论"}),l>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(d,{size:"sm",variant:"outline",disabled:a<=1,onClick:()=>n(a-1),children:"上一页"}),e.jsxs("span",{children:["第 ",a," / ",l," 页"]}),e.jsx(d,{size:"sm",variant:"outline",disabled:a>=l,onClick:()=>n(a+1),children:"下一页"})]})]})})]}):null}export{G as default}; diff --git a/embed_static/static/spa/assets/AdminDashboardPage-Co9xzcB-.js b/embed_static/static/spa/assets/AdminDashboardPage-C2c-F2-X.js similarity index 78% rename from embed_static/static/spa/assets/AdminDashboardPage-Co9xzcB-.js rename to embed_static/static/spa/assets/AdminDashboardPage-C2c-F2-X.js index 584119b..26a5859 100644 --- a/embed_static/static/spa/assets/AdminDashboardPage-Co9xzcB-.js +++ b/embed_static/static/spa/assets/AdminDashboardPage-C2c-F2-X.js @@ -1 +1 @@ -import{e as h,r as n,j as s}from"./react-vendor-1fwFMt02.js";import{i as o,a as x,S as j}from"./index-CucHNnyZ.js";import{B as u}from"./badge-CS5odIe6.js";import"./ui-vendor-Gb6mai95.js";function f(){const i=h(),{ready:t}=o(),[e,d]=n.useState(null),[r,c]=n.useState(!0);if(n.useEffect(()=>{t&&x.adminDashboard().then(d).finally(()=>c(!1))},[t]),!t||r)return s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(j,{size:"lg"})});if(!e)return null;const m=[{label:"注册用户",value:e.users,cls:"admin-stat-users"},{label:"帖子总数",value:e.posts,cls:"admin-stat-posts"},{label:"板块数量",value:e.boards,cls:"admin-stat-boards"},{label:"评论总数",value:e.comments,cls:"admin-stat-comments"},{label:"当前在线",value:e.online,cls:"admin-stat-online"}];return s.jsxs("div",{className:"admin-page",children:[s.jsxs("div",{className:"admin-page-head",children:[s.jsx("h1",{children:"仪表盘"}),s.jsx("p",{children:"论坛运行概览与最新帖子"})]}),s.jsx("div",{className:"admin-stat-grid",children:m.map(a=>s.jsxs("div",{className:`admin-stat-card ${a.cls}`,children:[s.jsx("div",{className:"admin-stat-value",children:a.value}),s.jsx("div",{className:"admin-stat-label",children:a.label})]},a.label))}),s.jsxs("div",{className:"admin-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"最新帖子"}),s.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>i("/admin/posts"),children:"查看全部 →"})]}),s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"ID"}),s.jsx("th",{children:"标题"}),s.jsx("th",{children:"作者"}),s.jsx("th",{children:"置顶"}),s.jsx("th",{children:"时间"})]})}),s.jsx("tbody",{children:e.recent_posts.map(a=>{var l;return s.jsxs("tr",{children:[s.jsx("td",{children:a.id}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>i(`/post/${a.id}`),children:a.title})}),s.jsx("td",{children:((l=a.user)==null?void 0:l.nickname)??"—"}),s.jsx("td",{children:a.pinned?s.jsx(u,{variant:"orange",children:"是"}):"—"}),s.jsx("td",{children:new Date(a.created_at).toLocaleString("zh-CN")})]},a.id)})})]}),e.recent_posts.length===0&&s.jsx("div",{className:"admin-empty",children:"暂无帖子"})]})]})}export{f as default}; +import{e as h,r as n,j as s}from"./react-vendor-BdyZmpPe.js";import{m as o,b as x,S as j}from"./index-Cp7Ff9NP.js";import{B as u}from"./badge-xzbTTsRq.js";import"./ui-vendor-B26O8baZ.js";function f(){const l=h(),{ready:t}=o(),[e,d]=n.useState(null),[r,c]=n.useState(!0);if(n.useEffect(()=>{t&&x.adminDashboard().then(d).finally(()=>c(!1))},[t]),!t||r)return s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(j,{size:"lg"})});if(!e)return null;const m=[{label:"注册用户",value:e.users,cls:"admin-stat-users"},{label:"帖子总数",value:e.posts,cls:"admin-stat-posts"},{label:"板块数量",value:e.boards,cls:"admin-stat-boards"},{label:"评论总数",value:e.comments,cls:"admin-stat-comments"},{label:"当前在线",value:e.online,cls:"admin-stat-online"}];return s.jsxs("div",{className:"admin-page",children:[s.jsxs("div",{className:"admin-page-head",children:[s.jsx("h1",{children:"仪表盘"}),s.jsx("p",{children:"论坛运行概览与最新帖子"})]}),s.jsx("div",{className:"admin-stat-grid",children:m.map(a=>s.jsxs("div",{className:`admin-stat-card ${a.cls}`,children:[s.jsx("div",{className:"admin-stat-value",children:a.value}),s.jsx("div",{className:"admin-stat-label",children:a.label})]},a.label))}),s.jsxs("div",{className:"admin-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"最新帖子"}),s.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>l("/admin/posts"),children:"查看全部 →"})]}),s.jsxs("table",{className:"admin-table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"ID"}),s.jsx("th",{children:"标题"}),s.jsx("th",{children:"作者"}),s.jsx("th",{children:"置顶"}),s.jsx("th",{children:"时间"})]})}),s.jsx("tbody",{children:e.recent_posts.map(a=>{var i;return s.jsxs("tr",{children:[s.jsx("td",{children:a.id}),s.jsx("td",{children:s.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>l(`/post/${a.id}`),children:a.title})}),s.jsx("td",{children:((i=a.user)==null?void 0:i.nickname)??"—"}),s.jsx("td",{children:a.pinned?s.jsx(u,{variant:"orange",children:"是"}):"—"}),s.jsx("td",{children:new Date(a.created_at).toLocaleString("zh-CN")})]},a.id)})})]}),e.recent_posts.length===0&&s.jsx("div",{className:"admin-empty",children:"暂无帖子"})]})]})}export{f as default}; diff --git a/embed_static/static/spa/assets/AdminPostsPage--PeUmtdb.js b/embed_static/static/spa/assets/AdminPostsPage--PeUmtdb.js deleted file mode 100644 index 2a90dcb..0000000 --- a/embed_static/static/spa/assets/AdminPostsPage--PeUmtdb.js +++ /dev/null @@ -1 +0,0 @@ -import{e as _,r as i,j as e}from"./react-vendor-1fwFMt02.js";import{i as P,B as n,S as z,a as x,n as r,c as E}from"./index-CucHNnyZ.js";import{I as L}from"./input-DOedlbiC.js";import{B as j}from"./badge-CS5odIe6.js";import{A as T,a as F,b as B,c as I,d as G,e as H,f as K,g as O,h as R}from"./alert-dialog-D0wiVaPM.js";import{i as $}from"./content-BrFHUpp8.js";import{l as q,ai as J,E as M}from"./ui-vendor-Gb6mai95.js";function N(o){const c=new Date(o);return Number.isNaN(c.getTime())?o:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function ee(){const o=_(),{ready:c}=P(),[u,k]=i.useState([]),[b,g]=i.useState(!0),[d,w]=i.useState(1),[m,A]=i.useState(1),[f,p]=i.useState(""),[h,v]=i.useState(""),l=(s=d,t=h)=>{g(!0),x.adminPosts({page:s,keyword:t}).then(a=>{k(a.posts??[]),w(a.page),A(a.total_pages)}).catch(a=>r.error(a.message)).finally(()=>g(!1))};i.useEffect(()=>{c&&l(1,h)},[c,h]);const D=async s=>{try{const t=await x.adminPinPost(s.id,!s.pinned);E(),window.dispatchEvent(new Event("posts-refresh")),r.success(t.message),l()}catch(t){r.error(t instanceof Error?t.message:"操作失败")}},C=async s=>{try{const t=await x.adminLockPost(s.id,!s.edit_locked);r.success(t.message),l()}catch(t){r.error(t instanceof Error?t.message:"操作失败")}},S=async s=>{try{await x.adminDeletePost(s),r.success("帖子已删除"),l()}catch(t){r.error(t instanceof Error?t.message:"删除失败")}};return c?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"帖子管理"}),e.jsx("p",{children:"置顶、锁定编辑、删除帖子;支持按标题、标签或正文关键词搜索"})]}),e.jsxs("form",{className:"admin-search-bar",onSubmit:s=>{s.preventDefault(),v(f.trim())},children:[e.jsx(L,{value:f,onChange:s=>p(s.target.value),placeholder:"搜索标题、标签或正文…"}),e.jsxs(n,{type:"submit",children:[e.jsx(q,{size:16}),"搜索"]}),h&&e.jsx(n,{type:"button",variant:"outline",onClick:()=>{p(""),v("")},children:"清除"})]}),e.jsx("div",{className:"admin-card",children:b?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(z,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"标题"}),e.jsx("th",{children:"板块"}),e.jsx("th",{children:"作者"}),e.jsx("th",{children:"标签"}),e.jsx("th",{children:"评论"}),e.jsx("th",{children:"置顶"}),e.jsx("th",{children:"锁定"}),e.jsx("th",{children:"点赞"}),e.jsx("th",{children:"浏览"}),e.jsx("th",{children:"时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:u.map(s=>{var a,y;const t=s.updated_at&&$(s.created_at,s.updated_at);return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{className:"max-w-[200px] truncate",children:[e.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>o(`/post/${s.id}`),children:s.title}),t&&e.jsx(j,{variant:"secondary",className:"ml-1",children:"已编辑"})]}),e.jsx("td",{children:((a=s.board)==null?void 0:a.name)??"—"}),e.jsx("td",{children:((y=s.user)==null?void 0:y.nickname)??"—"}),e.jsx("td",{className:"max-w-[120px] truncate text-muted-foreground",children:s.tags||"—"}),e.jsx("td",{children:s.comment_count??0}),e.jsx("td",{children:s.pinned?e.jsx(j,{variant:"orange",children:"是"}):"—"}),e.jsx("td",{children:s.edit_locked?e.jsx(j,{variant:"destructive",children:"是"}):"—"}),e.jsx("td",{children:s.like_count}),e.jsx("td",{children:s.view_count}),e.jsxs("td",{className:"text-sm whitespace-nowrap",children:[e.jsx("span",{children:N(s.created_at)}),t&&s.updated_at&&e.jsxs("span",{className:"block text-muted-foreground text-xs",children:["改于 ",N(s.updated_at)]})]}),e.jsx("td",{children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx(n,{size:"sm",variant:"outline",onClick:()=>D(s),children:s.pinned?"取消置顶":"置顶"}),e.jsx(n,{size:"sm",variant:"outline",onClick:()=>C(s),children:s.edit_locked?e.jsxs(e.Fragment,{children:[e.jsx(J,{size:14})," 解锁"]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{size:14})," 锁定"]})}),e.jsxs(T,{children:[e.jsx(F,{asChild:!0,children:e.jsx(n,{size:"sm",variant:"ghost",className:"text-destructive",children:"删除"})}),e.jsxs(B,{children:[e.jsxs(I,{children:[e.jsx(G,{children:"确定删除该帖子?"}),e.jsx(H,{children:"相关评论也将一并删除,不可恢复。"})]}),e.jsxs(K,{children:[e.jsx(O,{children:"取消"}),e.jsx(R,{onClick:()=>S(s.id),children:"删除"})]})]})]})]})})]},s.id)})})]}),u.length===0&&e.jsx("div",{className:"admin-empty",children:"没有找到帖子"}),m>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(n,{size:"sm",variant:"outline",disabled:d<=1,onClick:()=>l(d-1),children:"上一页"}),e.jsxs("span",{children:["第 ",d," / ",m," 页"]}),e.jsx(n,{size:"sm",variant:"outline",disabled:d>=m,onClick:()=>l(d+1),children:"下一页"})]})]})})]}):null}export{ee as default}; diff --git a/embed_static/static/spa/assets/AdminPostsPage-Boh0BdYW.js b/embed_static/static/spa/assets/AdminPostsPage-Boh0BdYW.js new file mode 100644 index 0000000..3025a6c --- /dev/null +++ b/embed_static/static/spa/assets/AdminPostsPage-Boh0BdYW.js @@ -0,0 +1 @@ +import{e as _,r as i,j as e}from"./react-vendor-BdyZmpPe.js";import{m as P,B as n,S as z,b as x,n as r,a as E}from"./index-Cp7Ff9NP.js";import{I as L}from"./input-y6vZyHhN.js";import{B as j}from"./badge-xzbTTsRq.js";import{A as T,g as F,a as B,b as I,c as G,d as H,e as K,f as O,h as R}from"./alert-dialog-C2PKamsV.js";import{i as $}from"./content-BrFHUpp8.js";import{E as q,aC as J,aa as M}from"./ui-vendor-B26O8baZ.js";function N(o){const c=new Date(o);return Number.isNaN(c.getTime())?o:c.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function ee(){const o=_(),{ready:c}=P(),[u,k]=i.useState([]),[b,g]=i.useState(!0),[d,w]=i.useState(1),[m,A]=i.useState(1),[f,p]=i.useState(""),[h,v]=i.useState(""),l=(s=d,t=h)=>{g(!0),x.adminPosts({page:s,keyword:t}).then(a=>{k(a.posts??[]),w(a.page),A(a.total_pages)}).catch(a=>r.error(a.message)).finally(()=>g(!1))};i.useEffect(()=>{c&&l(1,h)},[c,h]);const D=async s=>{try{const t=await x.adminPinPost(s.id,!s.pinned);E(),window.dispatchEvent(new Event("posts-refresh")),r.success(t.message),l()}catch(t){r.error(t instanceof Error?t.message:"操作失败")}},C=async s=>{try{const t=await x.adminLockPost(s.id,!s.edit_locked);r.success(t.message),l()}catch(t){r.error(t instanceof Error?t.message:"操作失败")}},S=async s=>{try{await x.adminDeletePost(s),r.success("帖子已删除"),l()}catch(t){r.error(t instanceof Error?t.message:"删除失败")}};return c?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"帖子管理"}),e.jsx("p",{children:"置顶、锁定编辑、删除帖子;支持按标题、标签或正文关键词搜索"})]}),e.jsxs("form",{className:"admin-search-bar",onSubmit:s=>{s.preventDefault(),v(f.trim())},children:[e.jsx(L,{value:f,onChange:s=>p(s.target.value),placeholder:"搜索标题、标签或正文…"}),e.jsxs(n,{type:"submit",children:[e.jsx(q,{size:16}),"搜索"]}),h&&e.jsx(n,{type:"button",variant:"outline",onClick:()=>{p(""),v("")},children:"清除"})]}),e.jsx("div",{className:"admin-card",children:b?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(z,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"标题"}),e.jsx("th",{children:"板块"}),e.jsx("th",{children:"作者"}),e.jsx("th",{children:"标签"}),e.jsx("th",{children:"评论"}),e.jsx("th",{children:"置顶"}),e.jsx("th",{children:"锁定"}),e.jsx("th",{children:"点赞"}),e.jsx("th",{children:"浏览"}),e.jsx("th",{children:"时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:u.map(s=>{var a,y;const t=s.updated_at&&$(s.created_at,s.updated_at);return e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsxs("td",{className:"max-w-[200px] truncate",children:[e.jsx("button",{type:"button",className:"admin-text-link",onClick:()=>o(`/post/${s.id}`),children:s.title}),t&&e.jsx(j,{variant:"secondary",className:"ml-1",children:"已编辑"})]}),e.jsx("td",{children:((a=s.board)==null?void 0:a.name)??"—"}),e.jsx("td",{children:((y=s.user)==null?void 0:y.nickname)??"—"}),e.jsx("td",{className:"max-w-[120px] truncate text-muted-foreground",children:s.tags||"—"}),e.jsx("td",{children:s.comment_count??0}),e.jsx("td",{children:s.pinned?e.jsx(j,{variant:"orange",children:"是"}):"—"}),e.jsx("td",{children:s.edit_locked?e.jsx(j,{variant:"destructive",children:"是"}):"—"}),e.jsx("td",{children:s.like_count}),e.jsx("td",{children:s.view_count}),e.jsxs("td",{className:"text-sm whitespace-nowrap",children:[e.jsx("span",{children:N(s.created_at)}),t&&s.updated_at&&e.jsxs("span",{className:"block text-muted-foreground text-xs",children:["改于 ",N(s.updated_at)]})]}),e.jsx("td",{children:e.jsxs("div",{className:"flex gap-1",children:[e.jsx(n,{size:"sm",variant:"outline",onClick:()=>D(s),children:s.pinned?"取消置顶":"置顶"}),e.jsx(n,{size:"sm",variant:"outline",onClick:()=>C(s),children:s.edit_locked?e.jsxs(e.Fragment,{children:[e.jsx(J,{size:14})," 解锁"]}):e.jsxs(e.Fragment,{children:[e.jsx(M,{size:14})," 锁定"]})}),e.jsxs(T,{children:[e.jsx(F,{asChild:!0,children:e.jsx(n,{size:"sm",variant:"ghost",className:"text-destructive",children:"删除"})}),e.jsxs(B,{children:[e.jsxs(I,{children:[e.jsx(G,{children:"确定删除该帖子?"}),e.jsx(H,{children:"相关评论也将一并删除,不可恢复。"})]}),e.jsxs(K,{children:[e.jsx(O,{children:"取消"}),e.jsx(R,{onClick:()=>S(s.id),children:"删除"})]})]})]})]})})]},s.id)})})]}),u.length===0&&e.jsx("div",{className:"admin-empty",children:"没有找到帖子"}),m>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(n,{size:"sm",variant:"outline",disabled:d<=1,onClick:()=>l(d-1),children:"上一页"}),e.jsxs("span",{children:["第 ",d," / ",m," 页"]}),e.jsx(n,{size:"sm",variant:"outline",disabled:d>=m,onClick:()=>l(d+1),children:"下一页"})]})]})})]}):null}export{ee as default}; diff --git a/embed_static/static/spa/assets/AdminSettingsPage-B63MNTuF.js b/embed_static/static/spa/assets/AdminSettingsPage-BKTiLKhD.js similarity index 91% rename from embed_static/static/spa/assets/AdminSettingsPage-B63MNTuF.js rename to embed_static/static/spa/assets/AdminSettingsPage-BKTiLKhD.js index e7ee6b8..86bf971 100644 --- a/embed_static/static/spa/assets/AdminSettingsPage-B63MNTuF.js +++ b/embed_static/static/spa/assets/AdminSettingsPage-BKTiLKhD.js @@ -1,3 +1,3 @@ -import{r as t,j as s}from"./react-vendor-1fwFMt02.js";import{i as B,a as u,S as z,B as g,n as d,l as I}from"./index-CucHNnyZ.js";import{I as L}from"./input-DOedlbiC.js";import{T as M}from"./textarea-CwI-oiTC.js";import{as as A,at as W,au as Y,av as $}from"./ui-vendor-Gb6mai95.js";const f=[{id:"rule",title:"编辑规则",summary:"控制普通用户修改自己帖子的时限",rows:[{key:"post_edit_window_hours",label:"可编辑时限",unit:"小时",hint:"0 = 不限",min:0}]},{id:"rate",title:"操作限流",summary:"同一用户或 IP 在窗口期内的最大请求次数",rows:[{key:"rate_limit_window_sec",label:"限流窗口",unit:"秒",min:10},{key:"rate_limit_post",label:"发帖",unit:"次",min:1},{key:"rate_limit_comment",label:"评论",unit:"次",min:1},{key:"rate_limit_register",label:"注册",unit:"次",min:1},{key:"rate_limit_login",label:"登录",unit:"次",min:1}]},{id:"content",title:"内容长度",summary:"发帖与评论的字数上限,服务端强制校验",rows:[{key:"post_title_max",label:"帖子标题",unit:"字",min:1},{key:"post_tags_max",label:"帖子标签",unit:"字",hint:"0 = 不限",min:0},{key:"post_content_max",label:"帖子正文",unit:"字",hint:"0 = 不限",min:0},{key:"comment_max",label:"评论内容",unit:"字",min:1}]},{id:"search",title:"搜索与列表",summary:"关键词长度与帖子列表分页",rows:[{key:"search_keyword_min",label:"关键词最短",unit:"字",min:0},{key:"search_keyword_max",label:"关键词最长",unit:"字",min:1},{key:"page_size_default",label:"默认每页",unit:"条",min:1},{key:"page_size_max",label:"最大每页",unit:"条",min:1},{key:"feed_max_pages",label:"首页自动加载页数",unit:"页",hint:"超出后需手动加载",min:1},{key:"feed_max_items",label:"首页自动加载条数",unit:"条",hint:"与页数取先到上限",min:1}]},{id:"user",title:"用户账号",summary:"注册、改密与头像上传限制",rows:[{key:"password_min_len",label:"密码最短",unit:"位",min:4},{key:"avatar_max_mb",label:"头像上限",unit:"MB",min:1}]}],D=[{id:"limits",label:"论坛限制",icon:A},{id:"filter",label:"敏感词",icon:W},{id:"system",label:"系统维护",icon:Y}];function H({sections:r,limits:l,onChange:c}){return s.jsx("div",{className:"admin-settings-sections",children:r.map(a=>s.jsxs("section",{className:"admin-settings-section",id:`settings-${a.id}`,children:[s.jsxs("div",{className:"admin-settings-section-head",children:[s.jsx("h3",{children:a.title}),s.jsx("p",{children:a.summary})]}),s.jsx("div",{className:"admin-settings-table",role:"group","aria-label":a.title,children:a.rows.map(i=>s.jsxs("div",{className:"admin-settings-row",children:[s.jsx("label",{htmlFor:`limit-${i.key}`,className:"admin-settings-row-label",children:i.label}),s.jsxs("div",{className:"admin-settings-row-input",children:[s.jsx(L,{id:`limit-${i.key}`,type:"number",min:i.min??0,value:l[i.key],onChange:m=>c(i.key,m.target.value),className:"admin-settings-input"}),i.unit&&s.jsx("span",{className:"admin-settings-unit",children:i.unit})]}),s.jsx("span",{className:"admin-settings-row-hint",children:i.hint??""})]},i.key))})]},a.id))})}function R(){const{ready:r}=B(),[l,c]=t.useState(null),[a,i]=t.useState(null),[m,j]=t.useState(""),[o,_]=t.useState("limits"),[N,v]=t.useState(!0),[k,p]=t.useState(!1),[S,y]=t.useState(!1),[w,b]=t.useState(!1);t.useEffect(()=>{r&&u.adminSettings().then(e=>{c(e),i(e.limits),j(e.filter_words)}).finally(()=>v(!1))},[r]);const C=(e,n)=>{const h=parseInt(n,10);Number.isNaN(h)||i(x=>x&&{...x,[e]:h})},F=async()=>{if(a){y(!0);try{const e=await u.adminUpdateForumSettings(a);d.success(e.message),I(),i(e.limits),c(n=>n&&{...n,limits:e.limits})}catch(e){d.error(e instanceof Error?e.message:"保存失败")}finally{y(!1)}}},T=async()=>{b(!0);try{const e=await u.adminUpdateFilterWords(m);d.success(e.message),c(n=>n&&{...n,filter_words:m,filter_word_count:e.word_count})}catch(e){d.error(e instanceof Error?e.message:"保存失败")}finally{b(!1)}},E=async()=>{p(!0);try{const e=await u.adminBackup();d.success(e.message),window.location.href=e.download}catch(e){d.error(e instanceof Error?e.message:"备份失败")}finally{p(!1)}};return!r||N?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(z,{size:"lg"})}):!l||!a?null:s.jsxs("div",{className:"admin-settings-page",children:[s.jsxs("header",{className:"admin-page-head",children:[s.jsx("h1",{children:"系统设置"}),s.jsx("p",{children:"管理论坛运行规则、敏感词过滤与数据维护"})]}),s.jsx("nav",{className:"admin-settings-tabs","aria-label":"设置分类",children:D.map(({id:e,label:n,icon:h})=>s.jsxs("button",{type:"button",className:`admin-settings-tab${o===e?" active":""}`,onClick:()=>_(e),"aria-selected":o===e,children:[s.jsx(h,{size:15}),n]},e))}),o==="limits"&&s.jsxs("div",{className:"admin-settings-panel",children:[s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"论坛限制"}),s.jsxs("span",{className:"admin-settings-card-badge",children:["共 ",f.length," 组"]})]}),s.jsx("div",{className:"admin-card-body",children:s.jsx(H,{sections:f,limits:a,onChange:C})})]}),s.jsxs("div",{className:"admin-settings-bar",children:[s.jsx("p",{children:"修改后请点击保存,新规则立即对全部用户生效"}),s.jsx(g,{onClick:F,loading:S,children:"保存论坛限制"})]})]}),o==="filter"&&s.jsxs("div",{className:"admin-settings-panel",children:[s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"敏感词过滤"}),s.jsxs("span",{className:"admin-settings-card-badge",children:[l.filter_word_count," 个词条"]})]}),s.jsxs("div",{className:"admin-card-body admin-settings-filter-body",children:[s.jsxs("p",{className:"admin-settings-filter-tip",children:["每行一个词,",s.jsx("code",{children:"#"})," 开头为注释。保存后写入 ",s.jsx("code",{children:"filter_words.txt"})," 并立即生效。"]}),s.jsx(M,{rows:16,value:m,onChange:e=>j(e.target.value),className:"admin-settings-filter-textarea",spellCheck:!1,placeholder:`# 示例 +import{r as t,j as s}from"./react-vendor-BdyZmpPe.js";import{m as B,b as u,S as z,B as g,n as d,t as I}from"./index-Cp7Ff9NP.js";import{I as M}from"./input-y6vZyHhN.js";import{T as L}from"./textarea-Dcf0-FNg.js";import{aM as A,aN as W,aO as Y,aP as $}from"./ui-vendor-B26O8baZ.js";const f=[{id:"rule",title:"编辑规则",summary:"控制普通用户修改自己帖子的时限",rows:[{key:"post_edit_window_hours",label:"可编辑时限",unit:"小时",hint:"0 = 不限",min:0}]},{id:"rate",title:"操作限流",summary:"同一用户或 IP 在窗口期内的最大请求次数",rows:[{key:"rate_limit_window_sec",label:"限流窗口",unit:"秒",min:10},{key:"rate_limit_post",label:"发帖",unit:"次",min:1},{key:"rate_limit_comment",label:"评论",unit:"次",min:1},{key:"rate_limit_register",label:"注册",unit:"次",min:1},{key:"rate_limit_login",label:"登录",unit:"次",min:1}]},{id:"content",title:"内容长度",summary:"发帖与评论的字数上限,服务端强制校验",rows:[{key:"post_title_max",label:"帖子标题",unit:"字",min:1},{key:"post_tags_max",label:"帖子标签",unit:"字",hint:"0 = 不限",min:0},{key:"post_content_max",label:"帖子正文",unit:"字",hint:"0 = 不限",min:0},{key:"comment_max",label:"评论内容",unit:"字",min:1}]},{id:"search",title:"搜索与列表",summary:"关键词长度与帖子列表分页",rows:[{key:"search_keyword_min",label:"关键词最短",unit:"字",min:0},{key:"search_keyword_max",label:"关键词最长",unit:"字",min:1},{key:"page_size_default",label:"默认每页",unit:"条",min:1},{key:"page_size_max",label:"最大每页",unit:"条",min:1},{key:"feed_max_pages",label:"首页自动加载页数",unit:"页",hint:"超出后需手动加载",min:1},{key:"feed_max_items",label:"首页自动加载条数",unit:"条",hint:"与页数取先到上限",min:1}]},{id:"user",title:"用户账号",summary:"注册、改密与头像上传限制",rows:[{key:"password_min_len",label:"密码最短",unit:"位",min:4},{key:"avatar_max_mb",label:"头像上限",unit:"MB",min:1}]}],D=[{id:"limits",label:"论坛限制",icon:A},{id:"filter",label:"敏感词",icon:W},{id:"system",label:"系统维护",icon:Y}];function H({sections:r,limits:l,onChange:c}){return s.jsx("div",{className:"admin-settings-sections",children:r.map(a=>s.jsxs("section",{className:"admin-settings-section",id:`settings-${a.id}`,children:[s.jsxs("div",{className:"admin-settings-section-head",children:[s.jsx("h3",{children:a.title}),s.jsx("p",{children:a.summary})]}),s.jsx("div",{className:"admin-settings-table",role:"group","aria-label":a.title,children:a.rows.map(i=>s.jsxs("div",{className:"admin-settings-row",children:[s.jsx("label",{htmlFor:`limit-${i.key}`,className:"admin-settings-row-label",children:i.label}),s.jsxs("div",{className:"admin-settings-row-input",children:[s.jsx(M,{id:`limit-${i.key}`,type:"number",min:i.min??0,value:l[i.key],onChange:m=>c(i.key,m.target.value),className:"admin-settings-input"}),i.unit&&s.jsx("span",{className:"admin-settings-unit",children:i.unit})]}),s.jsx("span",{className:"admin-settings-row-hint",children:i.hint??""})]},i.key))})]},a.id))})}function R(){const{ready:r}=B(),[l,c]=t.useState(null),[a,i]=t.useState(null),[m,j]=t.useState(""),[o,_]=t.useState("limits"),[N,v]=t.useState(!0),[k,p]=t.useState(!1),[S,b]=t.useState(!1),[w,y]=t.useState(!1);t.useEffect(()=>{r&&u.adminSettings().then(e=>{c(e),i(e.limits),j(e.filter_words)}).finally(()=>v(!1))},[r]);const C=(e,n)=>{const h=parseInt(n,10);Number.isNaN(h)||i(x=>x&&{...x,[e]:h})},F=async()=>{if(a){b(!0);try{const e=await u.adminUpdateForumSettings(a);d.success(e.message),I(),i(e.limits),c(n=>n&&{...n,limits:e.limits})}catch(e){d.error(e instanceof Error?e.message:"保存失败")}finally{b(!1)}}},T=async()=>{y(!0);try{const e=await u.adminUpdateFilterWords(m);d.success(e.message),c(n=>n&&{...n,filter_words:m,filter_word_count:e.word_count})}catch(e){d.error(e instanceof Error?e.message:"保存失败")}finally{y(!1)}},E=async()=>{p(!0);try{const e=await u.adminBackup();d.success(e.message),window.location.href=e.download}catch(e){d.error(e instanceof Error?e.message:"备份失败")}finally{p(!1)}};return!r||N?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(z,{size:"lg"})}):!l||!a?null:s.jsxs("div",{className:"admin-settings-page",children:[s.jsxs("header",{className:"admin-page-head",children:[s.jsx("h1",{children:"系统设置"}),s.jsx("p",{children:"管理论坛运行规则、敏感词过滤与数据维护"})]}),s.jsx("nav",{className:"admin-settings-tabs","aria-label":"设置分类",children:D.map(({id:e,label:n,icon:h})=>s.jsxs("button",{type:"button",className:`admin-settings-tab${o===e?" active":""}`,onClick:()=>_(e),"aria-selected":o===e,children:[s.jsx(h,{size:15}),n]},e))}),o==="limits"&&s.jsxs("div",{className:"admin-settings-panel",children:[s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"论坛限制"}),s.jsxs("span",{className:"admin-settings-card-badge",children:["共 ",f.length," 组"]})]}),s.jsx("div",{className:"admin-card-body",children:s.jsx(H,{sections:f,limits:a,onChange:C})})]}),s.jsxs("div",{className:"admin-settings-bar",children:[s.jsx("p",{children:"修改后请点击保存,新规则立即对全部用户生效"}),s.jsx(g,{onClick:F,loading:S,children:"保存论坛限制"})]})]}),o==="filter"&&s.jsxs("div",{className:"admin-settings-panel",children:[s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsxs("div",{className:"admin-card-head",children:[s.jsx("span",{children:"敏感词过滤"}),s.jsxs("span",{className:"admin-settings-card-badge",children:[l.filter_word_count," 个词条"]})]}),s.jsxs("div",{className:"admin-card-body admin-settings-filter-body",children:[s.jsxs("p",{className:"admin-settings-filter-tip",children:["每行一个词,",s.jsx("code",{children:"#"})," 开头为注释。保存后写入 ",s.jsx("code",{children:"filter_words.txt"})," 并立即生效。"]}),s.jsx(L,{rows:16,value:m,onChange:e=>j(e.target.value),className:"admin-settings-filter-textarea",spellCheck:!1,placeholder:`# 示例 违禁词 广告刷单`})]})]}),s.jsxs("div",{className:"admin-settings-bar",children:[s.jsx("p",{children:"敏感词会在发帖、评论、昵称等文本中自动替换为 *"}),s.jsx(g,{onClick:T,loading:w,children:"保存敏感词"})]})]}),o==="system"&&s.jsxs("div",{className:"admin-settings-panel",children:[s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsx("div",{className:"admin-card-head",children:"运行信息"}),s.jsx("div",{className:"admin-card-body",children:s.jsxs("dl",{className:"admin-settings-info",children:[s.jsxs("div",{className:"admin-settings-info-row",children:[s.jsx("dt",{children:"数据目录"}),s.jsx("dd",{children:s.jsx("code",{children:l.data_dir})})]}),s.jsxs("div",{className:"admin-settings-info-row",children:[s.jsx("dt",{children:"数据库"}),s.jsx("dd",{children:s.jsx("code",{children:l.db_path})})]}),s.jsxs("div",{className:"admin-settings-info-row",children:[s.jsx("dt",{children:"敏感词文件"}),s.jsx("dd",{children:s.jsx("code",{children:l.filter_path})})]}),s.jsxs("div",{className:"admin-settings-info-row",children:[s.jsx("dt",{children:"监听端口"}),s.jsx("dd",{children:l.port})]})]})})]}),s.jsxs("div",{className:"admin-card admin-settings-card",children:[s.jsx("div",{className:"admin-card-head",children:"数据备份"}),s.jsxs("div",{className:"admin-card-body admin-settings-backup-body",children:[s.jsx("p",{children:"导出当前 SQLite 数据库副本,便于迁移或灾难恢复。"}),s.jsxs("p",{className:"admin-settings-backup-name",children:["文件名:",s.jsx("code",{children:"jiang13_backup_YYYYMMDD_HHMMSS.db"})]}),s.jsxs(g,{onClick:E,loading:k,children:[s.jsx($,{size:16}),"立即备份并下载"]})]})]})]})]})}export{R as default}; diff --git a/embed_static/static/spa/assets/AdminUsersPage-YBnRhF6k.js b/embed_static/static/spa/assets/AdminUsersPage-GP-G5C8H.js similarity index 84% rename from embed_static/static/spa/assets/AdminUsersPage-YBnRhF6k.js rename to embed_static/static/spa/assets/AdminUsersPage-GP-G5C8H.js index 14465df..2f61053 100644 --- a/embed_static/static/spa/assets/AdminUsersPage-YBnRhF6k.js +++ b/embed_static/static/spa/assets/AdminUsersPage-GP-G5C8H.js @@ -1 +1 @@ -import{r as i,j as e}from"./react-vendor-1fwFMt02.js";import{i as v,S as y,B as l,a as j,n as r}from"./index-CucHNnyZ.js";import{B as h}from"./badge-CS5odIe6.js";import"./ui-vendor-Gb6mai95.js";function z(){const{ready:d}=v(),[o,m]=i.useState([]),[g,x]=i.useState(!0),[n,p]=i.useState(1),[c,f]=i.useState(1),t=(s=n)=>{x(!0),j.adminUsers(s).then(a=>{m(a.users??[]),p(a.page),f(a.total_pages)}).catch(a=>r.error(a.message)).finally(()=>x(!1))};i.useEffect(()=>{d&&t(1)},[d]);const u=async s=>{if(s.role==="admin"){r.warning("不能禁言管理员");return}try{const a=await j.adminBanUser(s.id,!s.banned);r.success(a.message),t()}catch(a){r.error(a instanceof Error?a.message:"操作失败")}};return d?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"用户管理"}),e.jsx("p",{children:"查看注册用户,禁言或解除禁言"})]}),e.jsx("div",{className:"admin-card",children:g?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(y,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"用户名"}),e.jsx("th",{children:"昵称"}),e.jsx("th",{children:"角色"}),e.jsx("th",{children:"状态"}),e.jsx("th",{children:"注册时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:o.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsx("td",{children:s.username}),e.jsx("td",{children:s.nickname}),e.jsx("td",{children:s.role==="admin"?e.jsx(h,{variant:"orange",children:"管理员"}):e.jsx(h,{variant:"secondary",children:"用户"})}),e.jsx("td",{children:s.banned?e.jsx(h,{variant:"destructive",children:"已禁言"}):"正常"}),e.jsx("td",{children:s.created_at?new Date(s.created_at).toLocaleString("zh-CN"):"—"}),e.jsx("td",{children:s.role!=="admin"&&e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s),children:s.banned?"解除禁言":"禁言"})})]},s.id))})]}),o.length===0&&e.jsx("div",{className:"admin-empty",children:"暂无用户"}),c>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(l,{size:"sm",variant:"outline",disabled:n<=1,onClick:()=>t(n-1),children:"上一页"}),e.jsxs("span",{children:["第 ",n," / ",c," 页"]}),e.jsx(l,{size:"sm",variant:"outline",disabled:n>=c,onClick:()=>t(n+1),children:"下一页"})]})]})})]}):null}export{z as default}; +import{r as i,j as e}from"./react-vendor-BdyZmpPe.js";import{m as v,S as y,B as l,b as m,n as r}from"./index-Cp7Ff9NP.js";import{B as h}from"./badge-xzbTTsRq.js";import"./ui-vendor-B26O8baZ.js";function z(){const{ready:d}=v(),[o,j]=i.useState([]),[g,x]=i.useState(!0),[n,p]=i.useState(1),[c,f]=i.useState(1),t=(s=n)=>{x(!0),m.adminUsers(s).then(a=>{j(a.users??[]),p(a.page),f(a.total_pages)}).catch(a=>r.error(a.message)).finally(()=>x(!1))};i.useEffect(()=>{d&&t(1)},[d]);const u=async s=>{if(s.role==="admin"){r.warning("不能禁言管理员");return}try{const a=await m.adminBanUser(s.id,!s.banned);r.success(a.message),t()}catch(a){r.error(a instanceof Error?a.message:"操作失败")}};return d?e.jsxs("div",{className:"admin-page",children:[e.jsxs("div",{className:"admin-page-head",children:[e.jsx("h1",{children:"用户管理"}),e.jsx("p",{children:"查看注册用户,禁言或解除禁言"})]}),e.jsx("div",{className:"admin-card",children:g?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(y,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs("table",{className:"admin-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"ID"}),e.jsx("th",{children:"用户名"}),e.jsx("th",{children:"昵称"}),e.jsx("th",{children:"角色"}),e.jsx("th",{children:"状态"}),e.jsx("th",{children:"注册时间"}),e.jsx("th",{children:"操作"})]})}),e.jsx("tbody",{children:o.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:s.id}),e.jsx("td",{children:s.username}),e.jsx("td",{children:s.nickname}),e.jsx("td",{children:s.role==="admin"?e.jsx(h,{variant:"orange",children:"管理员"}):e.jsx(h,{variant:"secondary",children:"用户"})}),e.jsx("td",{children:s.banned?e.jsx(h,{variant:"destructive",children:"已禁言"}):"正常"}),e.jsx("td",{children:s.created_at?new Date(s.created_at).toLocaleString("zh-CN"):"—"}),e.jsx("td",{children:s.role!=="admin"&&e.jsx(l,{size:"sm",variant:"outline",onClick:()=>u(s),children:s.banned?"解除禁言":"禁言"})})]},s.id))})]}),o.length===0&&e.jsx("div",{className:"admin-empty",children:"暂无用户"}),c>1&&e.jsxs("div",{className:"admin-pagination",children:[e.jsx(l,{size:"sm",variant:"outline",disabled:n<=1,onClick:()=>t(n-1),children:"上一页"}),e.jsxs("span",{children:["第 ",n," / ",c," 页"]}),e.jsx(l,{size:"sm",variant:"outline",disabled:n>=c,onClick:()=>t(n+1),children:"下一页"})]})]})})]}):null}export{z as default}; diff --git a/embed_static/static/spa/assets/BoardsManagePage-DXFAZqh1.js b/embed_static/static/spa/assets/BoardsManagePage-DXFAZqh1.js deleted file mode 100644 index fd0c26b..0000000 --- a/embed_static/static/spa/assets/BoardsManagePage-DXFAZqh1.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,j as e,e as M}from"./react-vendor-1fwFMt02.js";import{_ as O,Z as P,u as Z,a as G,F as V,b as u,c as g,d as b,e as y,f as N,o as q,s as C}from"./form-cra7lKcv.js";import{f as d,i as J,S as A,B as h,a as p,n as c}from"./index-CucHNnyZ.js";import{I as F}from"./input-DOedlbiC.js";import{T as K}from"./textarea-CwI-oiTC.js";import{B as Q}from"./badge-CS5odIe6.js";import{D as U,a as W,b as X,c as Y,e as $}from"./dialog-CtQqbmck.js";import{A as ee,a as se,b as ae,c as re,d as te,e as ne,f as le,g as ie,h as oe}from"./alert-dialog-D0wiVaPM.js";import{m as ce}from"./ui-vendor-Gb6mai95.js";function de(a){return O(P,a)}const S=n.forwardRef(({className:a,...r},t)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:t,className:d("w-full caption-bottom text-sm",a),...r})}));S.displayName="Table";const _=n.forwardRef(({className:a,...r},t)=>e.jsx("thead",{ref:t,className:d("[&_tr]:border-b",a),...r}));_.displayName="TableHeader";const B=n.forwardRef(({className:a,...r},t)=>e.jsx("tbody",{ref:t,className:d("[&_tr:last-child]:border-0",a),...r}));B.displayName="TableBody";const w=n.forwardRef(({className:a,...r},t)=>e.jsx("tr",{ref:t,className:d("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...r}));w.displayName="TableRow";const i=n.forwardRef(({className:a,...r},t)=>e.jsx("th",{ref:t,className:d("h-10 px-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",a),...r}));i.displayName="TableHead";const o=n.forwardRef(({className:a,...r},t)=>e.jsx("td",{ref:t,className:d("p-3 align-middle [&:has([role=checkbox])]:pr-0",a),...r}));o.displayName="TableCell";const me=q({name:C().min(1,"请输入名称").max(64),description:C().max(500).optional(),sort_order:de().min(0)});function Ne(){M();const{ready:a}=J(),[r,t]=n.useState([]),[E,v]=n.useState(!0),[R,m]=n.useState(!1),[j,D]=n.useState(null),[k,T]=n.useState(!1),l=Z({resolver:G(me),defaultValues:{name:"",description:"",sort_order:1}}),f=()=>{v(!0),p.boards().then(s=>t(s.boards??[])).catch(s=>c.error(s.message)).finally(()=>v(!1))};n.useEffect(()=>{a&&f()},[a]);const H=()=>{D(null),l.reset({name:"",description:"",sort_order:r.length+1}),m(!0)},I=s=>{D(s),l.reset({name:s.name,description:s.description??"",sort_order:s.sort_order}),m(!0)},z=async s=>{T(!0);try{j?(await p.updateBoard(j.id,s),c.success("板块已更新")):(await p.createBoard(s),c.success("板块已创建")),m(!1),f(),window.dispatchEvent(new Event("boards-refresh"))}catch(x){c.error(x instanceof Error?x.message:"操作失败")}finally{T(!1)}},L=async s=>{try{await p.deleteBoard(s),c.success("板块已删除"),f(),window.dispatchEvent(new Event("boards-refresh"))}catch(x){c.error(x instanceof Error?x.message:"删除失败")}};return a?e.jsxs("div",{className:"admin-page",children:[e.jsx("div",{className:"admin-page-head",children:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("h1",{children:"板块管理"}),e.jsx("p",{children:"创建、编辑或删除论坛板块,用户发帖前需先有板块"})]}),e.jsxs(h,{onClick:H,children:[e.jsx(ce,{}),"新建板块"]})]})}),e.jsx("div",{className:"admin-card",children:E?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(A,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs(S,{children:[e.jsx(_,{children:e.jsxs(w,{children:[e.jsx(i,{className:"w-[60px]",children:"ID"}),e.jsx(i,{children:"名称"}),e.jsx(i,{children:"简介"}),e.jsx(i,{className:"w-[70px]",children:"排序"}),e.jsx(i,{className:"w-[80px]",children:"帖子数"}),e.jsx(i,{className:"w-[160px]",children:"操作"})]})}),e.jsx(B,{children:r.map(s=>e.jsxs(w,{children:[e.jsx(o,{children:s.id}),e.jsx(o,{children:e.jsx("strong",{children:s.name})}),e.jsx(o,{className:"max-w-[200px] truncate",children:s.description}),e.jsx(o,{children:s.sort_order}),e.jsx(o,{children:e.jsx(Q,{variant:"secondary",children:s.post_count??0})}),e.jsx(o,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:()=>I(s),children:"编辑"}),e.jsxs(ee,{children:[e.jsx(se,{asChild:!0,children:e.jsx(h,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",children:"删除"})}),e.jsxs(ae,{children:[e.jsxs(re,{children:[e.jsx(te,{children:"确定删除该板块?"}),e.jsx(ne,{children:"删除后该板块下的帖子将无法通过板块筛选,此操作不可撤销。"})]}),e.jsxs(le,{children:[e.jsx(ie,{children:"取消"}),e.jsx(oe,{onClick:()=>L(s.id),children:"删除"})]})]})]})]})})]},s.id))})]}),r.length===0&&e.jsx("div",{className:"empty-state",children:e.jsx("p",{children:"还没有板块,点击右上角创建第一个"})})]})}),e.jsx(U,{open:R,onOpenChange:m,children:e.jsxs(W,{children:[e.jsx(X,{children:e.jsx(Y,{children:j?"编辑板块":"新建板块"})}),e.jsx(V,{...l,children:e.jsxs("form",{onSubmit:l.handleSubmit(z),className:"space-y-4",children:[e.jsx(u,{control:l.control,name:"name",render:({field:s})=>e.jsxs(g,{children:[e.jsx(b,{children:"板块名称"}),e.jsx(y,{children:e.jsx(F,{maxLength:64,placeholder:"如:技术交流",...s})}),e.jsx(N,{})]})}),e.jsx(u,{control:l.control,name:"description",render:({field:s})=>e.jsxs(g,{children:[e.jsx(b,{children:"简介"}),e.jsx(y,{children:e.jsx(K,{rows:3,maxLength:500,placeholder:"板块说明(可选)",...s})}),e.jsx(N,{})]})}),e.jsx(u,{control:l.control,name:"sort_order",render:({field:s})=>e.jsxs(g,{children:[e.jsx(b,{children:"排序"}),e.jsx(y,{children:e.jsx(F,{type:"number",min:0,...s})}),e.jsx(N,{})]})}),e.jsxs($,{children:[e.jsx(h,{type:"button",variant:"outline",onClick:()=>m(!1),children:"取消"}),e.jsx(h,{type:"submit",loading:k,children:j?"保存":"创建"})]})]})})]})})]}):e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(A,{size:"lg"})})}export{Ne as default}; diff --git a/embed_static/static/spa/assets/BoardsManagePage-DxLu9n3N.js b/embed_static/static/spa/assets/BoardsManagePage-DxLu9n3N.js new file mode 100644 index 0000000..23e2054 --- /dev/null +++ b/embed_static/static/spa/assets/BoardsManagePage-DxLu9n3N.js @@ -0,0 +1 @@ +import{r as n,j as e}from"./react-vendor-BdyZmpPe.js";import{_ as Z,Z as G,u as J,a as V,F as q,b,c as u,d as f,e as g,f as N,o as K,s as D}from"./form-DggfNWHU.js";import{c as i,j as Q,i as S,k as U,l as W,m as X,S as A,B as _,o as Y,b as y,n as j}from"./index-Cp7Ff9NP.js";import{I as k}from"./input-y6vZyHhN.js";import{T as ee}from"./textarea-Dcf0-FNg.js";import{B as se}from"./badge-xzbTTsRq.js";import{D as re,a as ae,b as oe,c as ne,e as ie}from"./dialog-DXwuwWJi.js";import{A as te,g as le,a as ce,b as de,c as xe,d as me,e as he,f as je,h as pe}from"./alert-dialog-C2PKamsV.js";import{J as be}from"./ui-vendor-B26O8baZ.js";function E(r){return Z(G,r)}const F=n.forwardRef(({className:r,...a},o)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:o,className:i("w-full caption-bottom text-sm",r),...a})}));F.displayName="Table";const R=n.forwardRef(({className:r,...a},o)=>e.jsx("thead",{ref:o,className:i("[&_tr]:border-b",r),...a}));R.displayName="TableHeader";const O=n.forwardRef(({className:r,...a},o)=>e.jsx("tbody",{ref:o,className:i("[&_tr:last-child]:border-0",r),...a}));O.displayName="TableBody";const I=n.forwardRef(({className:r,...a},o)=>e.jsx("tr",{ref:o,className:i("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",r),...a}));I.displayName="TableRow";const m=n.forwardRef(({className:r,...a},o)=>e.jsx("th",{ref:o,className:i("h-10 px-3 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",r),...a}));m.displayName="TableHead";const h=n.forwardRef(({className:r,...a},o)=>e.jsx("td",{ref:o,className:i("p-3 align-middle [&:has([role=checkbox])]:pr-0",r),...a}));h.displayName="TableCell";function ue({value:r,onChange:a,board:o}){const p={id:o.id,icon:r||void 0,color_index:o.color_index},t=Q(p),v=S(p);return e.jsxs("div",{className:"board-appearance-picker",children:[e.jsxs("div",{className:"board-appearance-picker__preview",children:[e.jsx("span",{className:i("board-appearance-picker__preview-icon",`sidebar-board-icon--${v}`),children:e.jsx(t,{"aria-hidden":!0})}),e.jsx("span",{className:"board-appearance-picker__preview-hint",children:"预览"})]}),e.jsxs("div",{className:"board-icon-grid",role:"listbox","aria-label":"选择板块图标",children:[e.jsx("button",{type:"button",role:"option","aria-selected":!r,className:i("board-icon-option",!r&&"board-icon-option--active"),title:"自动(按板块 ID)",onClick:()=>a(""),children:e.jsx("span",{className:"board-icon-option__auto",children:"A"})}),U.map(({key:l,label:c,Icon:w})=>e.jsx("button",{type:"button",role:"option","aria-selected":r===l,"aria-label":c,title:c,className:i("board-icon-option",r===l&&"board-icon-option--active"),onClick:()=>a(l),children:e.jsx(w,{"aria-hidden":!0})},l))]})]})}function fe({value:r,onChange:a,boardId:o}){return e.jsxs("div",{className:"board-color-grid",role:"listbox","aria-label":"选择板块色标",children:[e.jsx("button",{type:"button",role:"option","aria-selected":r<0,className:i("board-color-option board-color-option--auto",r<0&&"board-color-option--active"),title:"自动(按板块 ID)",onClick:()=>a(-1),children:"A"}),Array.from({length:W},(p,t)=>e.jsx("button",{type:"button",role:"option","aria-selected":r===t,className:i("board-color-option",`board-color-option--${t}`,r===t&&"board-color-option--active"),title:`色标 ${t+1}`,onClick:()=>a(t)},t))]})}const ge=K({name:D().min(1,"请输入名称").max(64),description:D().max(500).optional(),sort_order:E().min(0),icon:D().max(64).optional(),color_index:E().min(-1).max(7)});function Be(){const{ready:r}=X(),[a,o]=n.useState([]),[p,t]=n.useState(!0),[v,l]=n.useState(!1),[c,w]=n.useState(null),[P,T]=n.useState(!1),d=J({resolver:V(ge),defaultValues:{name:"",description:"",sort_order:1,icon:"",color_index:-1}}),H=d.watch("color_index"),B=(c==null?void 0:c.id)??a.length+1,C=()=>{t(!0),y.boards().then(s=>o(s.boards??[])).catch(s=>j.error(s.message)).finally(()=>t(!1))};n.useEffect(()=>{r&&C()},[r]);const L=()=>{w(null),d.reset({name:"",description:"",sort_order:a.length+1,icon:"",color_index:-1}),l(!0)},z=s=>{w(s),d.reset({name:s.name,description:s.description??"",sort_order:s.sort_order,icon:s.icon??"",color_index:s.color_index??-1}),l(!0)},$=async s=>{T(!0);try{const x={name:s.name,description:s.description??"",sort_order:s.sort_order,icon:s.icon??"",color_index:s.color_index??-1};c?(await y.updateBoard(c.id,x),j.success("板块已更新")):(await y.createBoard(x),j.success("板块已创建")),l(!1),C(),window.dispatchEvent(new Event("boards-refresh"))}catch(x){j.error(x instanceof Error?x.message:"操作失败")}finally{T(!1)}},M=async s=>{try{await y.deleteBoard(s),j.success("板块已删除"),C(),window.dispatchEvent(new Event("boards-refresh"))}catch(x){j.error(x instanceof Error?x.message:"删除失败")}};return r?e.jsxs("div",{className:"admin-page",children:[e.jsx("div",{className:"admin-page-head",children:e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[e.jsxs("div",{children:[e.jsx("h1",{children:"板块管理"}),e.jsx("p",{children:"创建、编辑或删除论坛板块;可为每个板块自定义图标与色标"})]}),e.jsxs(_,{onClick:L,children:[e.jsx(be,{}),"新建板块"]})]})}),e.jsx("div",{className:"admin-card",children:p?e.jsx("div",{className:"flex justify-center py-12",children:e.jsx(A,{size:"lg"})}):e.jsxs(e.Fragment,{children:[e.jsxs(F,{children:[e.jsx(R,{children:e.jsxs(I,{children:[e.jsx(m,{className:"w-[60px]",children:"ID"}),e.jsx(m,{className:"w-[52px]",children:"图标"}),e.jsx(m,{children:"名称"}),e.jsx(m,{children:"简介"}),e.jsx(m,{className:"w-[70px]",children:"排序"}),e.jsx(m,{className:"w-[80px]",children:"帖子数"}),e.jsx(m,{className:"w-[160px]",children:"操作"})]})}),e.jsx(O,{children:a.map(s=>{const x=S(s);return e.jsxs(I,{children:[e.jsx(h,{children:s.id}),e.jsx(h,{children:e.jsx("span",{className:i("board-table-icon",`sidebar-board-icon--${x}`),children:e.jsx(Y,{board:s})})}),e.jsx(h,{children:e.jsx("strong",{children:s.name})}),e.jsx(h,{className:"max-w-[200px] truncate",children:s.description}),e.jsx(h,{children:s.sort_order}),e.jsx(h,{children:e.jsx(se,{variant:"secondary",children:s.post_count??0})}),e.jsx(h,{children:e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(_,{variant:"ghost",size:"sm",onClick:()=>z(s),children:"编辑"}),e.jsxs(te,{children:[e.jsx(le,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",children:"删除"})}),e.jsxs(ce,{children:[e.jsxs(de,{children:[e.jsx(xe,{children:"确定删除该板块?"}),e.jsx(me,{children:"删除后该板块下的帖子将无法通过板块筛选,此操作不可撤销。"})]}),e.jsxs(he,{children:[e.jsx(je,{children:"取消"}),e.jsx(pe,{onClick:()=>M(s.id),children:"删除"})]})]})]})]})})]},s.id)})})]}),a.length===0&&e.jsx("div",{className:"empty-state",children:e.jsx("p",{children:"还没有板块,点击右上角创建第一个"})})]})}),e.jsx(re,{open:v,onOpenChange:l,children:e.jsxs(ae,{className:"board-manage-dialog",children:[e.jsx(oe,{children:e.jsx(ne,{children:c?"编辑板块":"新建板块"})}),e.jsx(q,{...d,children:e.jsxs("form",{onSubmit:d.handleSubmit($),className:"space-y-4",children:[e.jsx(b,{control:d.control,name:"name",render:({field:s})=>e.jsxs(u,{children:[e.jsx(f,{children:"板块名称"}),e.jsx(g,{children:e.jsx(k,{maxLength:64,placeholder:"如:技术交流",...s})}),e.jsx(N,{})]})}),e.jsx(b,{control:d.control,name:"description",render:({field:s})=>e.jsxs(u,{children:[e.jsx(f,{children:"简介"}),e.jsx(g,{children:e.jsx(ee,{rows:3,maxLength:500,placeholder:"板块说明(可选)",...s})}),e.jsx(N,{})]})}),e.jsx(b,{control:d.control,name:"icon",render:({field:s})=>e.jsxs(u,{children:[e.jsx(f,{children:"板块图标"}),e.jsx(g,{children:e.jsx(ue,{value:s.value??"",onChange:s.onChange,board:{id:B,color_index:H}})}),e.jsx(N,{})]})}),e.jsx(b,{control:d.control,name:"color_index",render:({field:s})=>e.jsxs(u,{children:[e.jsx(f,{children:"色标颜色"}),e.jsx(g,{children:e.jsx(fe,{value:s.value??-1,onChange:s.onChange,boardId:B})}),e.jsx(N,{})]})}),e.jsx(b,{control:d.control,name:"sort_order",render:({field:s})=>e.jsxs(u,{children:[e.jsx(f,{children:"排序"}),e.jsx(g,{children:e.jsx(k,{type:"number",min:0,...s})}),e.jsx(N,{})]})}),e.jsxs(ie,{children:[e.jsx(_,{type:"button",variant:"outline",onClick:()=>l(!1),children:"取消"}),e.jsx(_,{type:"submit",loading:P,children:c?"保存":"创建"})]})]})})]})})]}):e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(A,{size:"lg"})})}export{Be as default}; diff --git a/embed_static/static/spa/assets/ComposePage-BiusUtIm.js b/embed_static/static/spa/assets/ComposePage-eRDSuLA7.js similarity index 61% rename from embed_static/static/spa/assets/ComposePage-BiusUtIm.js rename to embed_static/static/spa/assets/ComposePage-eRDSuLA7.js index 27c4980..6e2d077 100644 --- a/embed_static/static/spa/assets/ComposePage-BiusUtIm.js +++ b/embed_static/static/spa/assets/ComposePage-eRDSuLA7.js @@ -1,4 +1,4 @@ -var ap=Object.defineProperty;var cp=(n,e,t)=>e in n?ap(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var V=(n,e,t)=>cp(n,typeof e!="symbol"?e+"":e,t);import{r as N,k as Ft,j as b,a as up,m as dp,e as hp,w as fp,i as pp}from"./react-vendor-1fwFMt02.js";import{B as gi,f as Yl,a as en,n as He,h as mp,u as gp,S as Xl}from"./index-CucHNnyZ.js";import{P as lu,r as yp,i as kp}from"./postContent-ClrHK1rL.js";import{p as au}from"./purify-vendor-Cx4rtWv4.js";import{O as to,Q as bp,V as Ql,W as Zl,Y as ea,Z as ta,_ as na,$ as ra,a0 as sa,a1 as ia,a2 as oa,a3 as la,a4 as aa,a5 as xp,a6 as Sp,B as wp,D as vp,A as Ep,x as Cp,a7 as Tp}from"./ui-vendor-Gb6mai95.js";import{D as Mp,a as Ap,b as Np,c as Op,d as Rp,e as Ip}from"./dialog-CtQqbmck.js";import{I as Dp}from"./input-DOedlbiC.js";var cu={exports:{}},uu={};/** +var ap=Object.defineProperty;var cp=(n,e,t)=>e in n?ap(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var _=(n,e,t)=>cp(n,typeof e!="symbol"?e+"":e,t);import{r as T,z as up,k as Vt,j as k,a as dp,m as hp,e as fp,y as pp,i as mp}from"./react-vendor-BdyZmpPe.js";import{B as Zr,c as ea,b as sn,n as We,h as gp,u as yp,S as ta}from"./index-Cp7Ff9NP.js";import{P as du,r as kp,i as bp}from"./postContent-ClrHK1rL.js";import{p as hu}from"./purify-vendor-Cx4rtWv4.js";import{ad as io,ae as xp,af as na,ag as ra,ah as sa,ai as ia,aj as oa,ak as la,al as aa,am as ca,an as ua,ao as da,ap as ha,aq as Sp,ar as wp,a8 as vp,a9 as Ep,Q as Cp,a4 as Tp,as as Mp}from"./ui-vendor-B26O8baZ.js";import{D as Ap,a as Np,b as Op,c as Rp,d as Dp,e as Ip}from"./dialog-DXwuwWJi.js";import{I as Lp}from"./input-y6vZyHhN.js";import{A as Pp,a as zp,b as Bp,c as $p,d as Fp,e as jp,f as Hp}from"./alert-dialog-C2PKamsV.js";function _p({isDirty:n}){const[e,t]=T.useState(!1),r=T.useRef(null),s=T.useRef(!1),i=n&&!s.current,o=up(()=>n&&!s.current);T.useEffect(()=>{o.state==="blocked"&&t(!0)},[o.state]),T.useEffect(()=>{if(!i)return;const d=h=>{h.preventDefault(),h.returnValue=""};return window.addEventListener("beforeunload",d),()=>window.removeEventListener("beforeunload",d)},[i]);const l=T.useCallback(()=>{var d;t(!1),r.current=null,o.state==="blocked"&&((d=o.reset)==null||d.call(o))},[o]),a=T.useCallback(()=>{var h;if(t(!1),s.current=!0,o.state==="blocked"){(h=o.proceed)==null||h.call(o);return}const d=r.current;r.current=null,d==null||d()},[o]),c=T.useCallback(d=>{if(!i){d();return}r.current=d,t(!0)},[i]),u=T.useCallback(()=>{s.current=!0},[]);return{dialogOpen:e,stayOnPage:l,discardAndLeave:a,requestLeave:c,markSaved:u}}var fu={exports:{}},pu={};/** * @license React * use-sync-external-store-shim.production.js * @@ -6,21 +6,21 @@ var ap=Object.defineProperty;var cp=(n,e,t)=>e in n?ap(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var hn=N;function Lp(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Pp=typeof Object.is=="function"?Object.is:Lp,zp=hn.useState,Bp=hn.useEffect,$p=hn.useLayoutEffect,Fp=hn.useDebugValue;function Hp(n,e){var t=e(),r=zp({inst:{value:t,getSnapshot:e}}),s=r[0].inst,i=r[1];return $p(function(){s.value=t,s.getSnapshot=e,yi(s)&&i({inst:s})},[n,t,e]),Bp(function(){return yi(s)&&i({inst:s}),n(function(){yi(s)&&i({inst:s})})},[n]),Fp(t),t}function yi(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Pp(n,t)}catch{return!0}}function _p(n,e){return e()}var jp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?_p:Hp;uu.useSyncExternalStore=hn.useSyncExternalStore!==void 0?hn.useSyncExternalStore:jp;cu.exports=uu;var qo=cu.exports;function ae(n){this.content=n}ae.prototype={constructor:ae,find:function(n){for(var e=0;e>1}};ae.from=function(n){if(n instanceof ae)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ae(e)};function du(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&h>0&&c[d-1]==u[h-1];)d--,h--,t--,r--;return d&&h&&d=56320&&n<57344}function pu(n){return n>=55296&&n<56320}let w=class ke{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new ke(r,s)}cutByIndex(e,t){return e==t?ke.empty:e==0&&t==this.content.length?this:new ke(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new ke(s,i)}addToStart(e){return new ke([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ke(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Or(t+1,i):Or(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ke.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return ke.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ke.empty;let t,r=0;for(let s=0;sthis.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-s.type.rank),t}};W.none=[];let cr=class extends Error{},A=class tn{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=gu(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new tn(r,this.openStart,this.openEnd)}removeBetween(e,t){return new tn(mu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return tn.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new tn(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new tn(e,r,s)}};A.empty=new A(w.empty,0,0);function mu(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(mu(i.content,e-s-1,t-s-1)))}function gu(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=gu(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Vp(n,e,t){if(t.openStart>n.depth)throw new cr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new cr("Inconsistent open depths");return yu(n,e,t,0)}function yu(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Yn(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&(Lt(n.nodeAfter,r),i++));for(let l=i;ls&&ro(n,e,s+1),o=r.depth>s&&ro(t,r,s+1),l=[];return Yn(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(ku(i,o),Lt(Pt(i,bu(n,e,t,r,s+1)),l)):(i&&Lt(Pt(i,cs(n,e,s+1)),l),Yn(e,t,s,l),o&&Lt(Pt(o,cs(t,r,s+1)),l)),Yn(r,null,s,l),new w(l)}function cs(n,e,t){let r=[];if(Yn(null,n,t,r),n.depth>t){let s=ro(n,e,t+1);Lt(Pt(s,cs(n,e,t+1)),r)}return Yn(e,null,t,r),new w(r)}function Wp(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class ur{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new us(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new ur(t,r,i)}static resolveCached(e,t){let r=ca.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),xu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};gt.prototype.text=void 0;class ds extends gt{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ds(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ds(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function xu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Ht{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Jp(e,t);if(r.next==null)return Ht.empty;let s=Su(r);r.next&&r.err("Unexpected trailing text");let i=tm(em(s));return nm(i,r),i}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return i}).join(` -`)}}Ht.empty=new Ht(!0);class Jp{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Su(n){let e=[];do e.push(Gp(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Gp(n){let e=[];do e.push(Yp(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Yp(n){let e=Zp(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Xp(n,e);else break;return e}function ua(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Xp(n,e){let t=ua(n),r=t;return n.eat(",")&&(n.next!="}"?r=ua(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Qp(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function Zp(n){if(n.eat("(")){let e=Su(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Qp(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function em(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Ht(r.indexOf(n.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Eu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new gt(this,this.computeAttrs(e),w.from(t),W.setFrom(r))}createChecked(e=null,t,r){return t=w.from(t),this.checkContent(t),new gt(this,this.computeAttrs(e),t,W.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=w.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(w.empty,!0);return i?new gt(this,e,t.append(i),W.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[i]=new Mu(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function rm(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class sm{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?rm(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ei{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=Tu(e,s.attrs),this.excluded=null;let i=vu(this.attrs);this.instance=i?new W(this,i):null}create(e=null){return!e&&this.instance?this.instance:new W(this,Eu(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new ei(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class Au{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=ae.from(e.nodes),t.marks=ae.from(e.marks||{}),this.nodes=ha.compile(this.spec.nodes,this),this.marks=ei.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Ht.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?fa(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:fa(this,o.split(" "))}this.nodeFromJSON=s=>gt.fromJSON(this,s),this.markFromJSON=s=>W.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ha){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new ds(r,r.defaultAttrs,e,W.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function fa(n,e){let t=[];for(let r=0;r-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function im(n){return n.tag!=null}function om(n){return n.style!=null}let Xn=class io{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(im(s))this.tags.push(s);else if(om(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new ma(this,t,!1);return r.addAll(e,W.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ma(this,t,!0);return r.addAll(e,W.none,t.from,t.to),A.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;se.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o{r(o=ga(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=ga(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new io(e,io.schemaRules(e)))}};const Nu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},lm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ou={ol:!0,ul:!0},dr=1,oo=2,Qn=4;function pa(n,e,t){return e!=null?(e?dr:0)|(e==="full"?oo:0):n&&n.whitespace=="pre"?dr|oo:t&~Qn}class Rr{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=W.none,this.match=i||(o&Qn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&dr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Nu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ma{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=pa(null,t.preserveWhitespace,0)|(r?Qn:0);s?i=new Rr(s.type,s.attrs,W.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Rr(null,null,W.none,!0,null,o):i=new Rr(e.schema.topNodeType,null,W.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&oo?"full":this.localPreserveWS||(s.options&dr)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,` -`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):ya(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Rr(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=dr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function am(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ou.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function cm(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ga(n){let e={};for(let t in n)e[t]=n[t];return e}function ya(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a{if(i.length||o.marks.length){let l=0,a=0;for(;l=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&Gr(Ir(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return typeof t=="string"?{dom:e.createTextNode(t)}:Gr(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Kt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ka(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return ka(e.marks)}}function ka(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ir(n){return n.document||window.document}const ba=new WeakMap;function um(n){let e=ba.get(n);return e===void 0&&ba.set(n,e=dm(n)),e}function dm(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof h=="string")a.appendChild(n.createTextNode(h));else{let{dom:f,contentDOM:p}=Gr(n,h,t,r);if(a.appendChild(f),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Ru=65535,Iu=Math.pow(2,16);function hm(n,e){return n+e*Iu}function xa(n){return n&Ru}function fm(n){return(n-(n&Ru))/Iu}const Du=1,Lu=2,Yr=4,Pu=8;let lo=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Pu)>0}get deletedBefore(){return(this.delInfo&(Du|Yr))>0}get deletedAfter(){return(this.delInfo&(Lu|Yr))>0}get deletedAcross(){return(this.delInfo&Yr)>0}},_t=class nn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&nn.empty)return nn.empty}recover(e){let t=0,r=xa(e);if(!this.inverted)for(let s=0;se)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:hm(l/3,e-a),m=e==a?Lu:e==d?Du:Yr;return(t<0?e!=a:e!=d)&&(m|=Pu),new lo(f,m,p)}s+=u-c}return r?e+s:new lo(e+s,0,null)}touches(e,t){let r=0,s=xa(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new hr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ri&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return xe.fromReplace(e,this.from,this.to,i)}invert(){return new vn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Dn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Dn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Dn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Dn(t.from,t.to,e.markFromJSON(t.mark))}};me.jsonID("addMark",Ko);let vn=class Ln extends me{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new A(Uo(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return xe.fromReplace(e,this.from,this.to,r)}invert(){return new Ko(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ln(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ln&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ln(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ln(t.from,t.to,e.markFromJSON(t.mark))}};me.jsonID("removeMark",vn);let Jo=class Pn extends me{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return xe.fromReplace(e,this.pos,this.pos+1,new A(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;sr.pos?null:new Xr(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Xr(t.from,t.to,t.gapFrom,t.gapTo,A.fromJSON(e,t.slice),t.insert,!!t.structure)}};me.jsonID("replaceAround",Ae);function co(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function pm(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;mn.step(a)),i.forEach(a=>n.step(a))}function mm(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof ei){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new vn(o.from,o.to,o.style)))}function Go(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a=0;a--)n.step(o[a])}function gm(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function En(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(rt;p--)m||r.index(p)>0?(m=!0,u=w.from(r.node(p).copy(u)),d++):a--;let h=w.empty,f=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=w.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Ae(s,i,s,i,new A(r,0,0),t.length,!0))}function Sm(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&wm(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&Bu(n,o,l,i),Go(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),h=u.map(l+o.nodeSize,1);return n.step(new Ae(d,h,d+1,h-1,new A(w.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&zu(n,o,l,i),!1}})}function zu(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Bu(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(` -`))}})}function wm(n,e,t){let r=n.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,t)}function vm(n,e,t,r,s){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let o=t.create(r,null,s||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,o);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ae(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new A(w.from(o),0,0),1,!0))}function tt(n,e,t=1,r){let s=n.resolve(e),i=s.depth-t,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=t-2;c>i;c--,u--){let d=s.node(c),h=s.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),p=r&&r[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(f))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function Em(n,e,t=1,r){let s=n.doc.resolve(e),i=w.empty,o=w.empty;for(let l=s.depth,a=s.depth-t,c=t-1;l>a;l--,c--){i=w.from(s.node(l).copy(i));let u=r&&r[c];o=w.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}n.step(new Pe(e,e,new A(i.append(o),t,t),!0))}function vt(n,e){let t=n.resolve(e),r=t.index();return $u(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Cm(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let s=0;s0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&$u(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=t<0?r.before(s):r.after(s)}}function Tm(n,e,t){let r=null,{linebreakReplacement:s}=n.doc.type.schema,i=n.doc.resolve(e-t),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(s);u&&!d?r=!1:!u&&d&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Bu(n,u.node(),u.before(),l)}o.inlineContent&&Go(n,e+t-1,o,i.node().contentMatchAt(i.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new Pe(c,a.map(e+t,-1),A.empty,!0)),r===!0){let u=n.doc.resolve(c);zu(n,u.node(),u.before(),n.steps.length)}return n}function Mm(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,t))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,t))return r.after(s+1);if(i=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let d=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function ni(n,e,t=e,r=A.empty){if(e==t&&!r.size)return null;let s=n.resolve(e),i=n.resolve(t);return Hu(s,i,r)?new Pe(e,t,r):new Am(s,i,r).fit()}function Hu(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Am{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=w.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=w.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new A(i,o,l);return e>-1?new Ae(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Pe(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,s=this.unplaced.openEnd;r1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=xi(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(w.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=xi(e,t);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new A(e,t+1,Math.max(r,s.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=xi(e,t);if(s.childCount<=1&&t>0){let i=e.size-t<=t+s.size;this.unplaced=new A(zn(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new A(zn(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:s,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(_u(m.mark(h.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?f:-1)))}let p=c==l.childCount;p||(f=-1),this.placed=Bn(this.placed,t,w.from(u)),this.frontier[t].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:s}=this.frontier[t],i=t=0;l--){let{match:a,type:c}=this.frontier[l],u=Si(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Bn(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,t=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Bn(this.placed,this.depth,w.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(w.empty,!0);t.childCount&&(this.placed=Bn(this.placed,this.frontier.length,t))}}function zn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(zn(n.firstChild.content,e-1,t)))}function Bn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Bn(n.lastChild.content,e-1,t)))}function xi(n,e){for(let t=0;t1&&(r=r.replaceChild(0,_u(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(w.empty,!0)))),n.copy(r)}function Si(n,e,t,r,s){let i=n.node(e),o=s?n.indexAfter(e):n.index(e);if(o==i.childCount&&!t.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!Nm(t,i.content,o)?l:null}function Nm(n,e,t){for(let r=t;r0;h--,f--){let p=s.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(h)>-1?l=h:s.before(h)==f&&o.splice(1,0,-h)}let a=o.indexOf(l),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let p=h.firstChild;if(c.push(p),f==r.openStart)break;h=p.content}for(let h=u-1;h>=0;h--){let f=c[h],p=Om(f.type);if(p&&!f.sameMarkup(s.node(Math.abs(l)-1)))u=h;else if(p||!f.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let f=(h+u+1)%(r.openStart+1),p=c[f];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));h--){let f=o[h];f<0||(e=s.before(f),t=i.after(f))}}function ju(n,e,t,r,s){if(er){let i=s.contentMatchAt(0),o=i.fillBefore(n).append(n);n=o.append(i.matchFragment(o).fillBefore(w.empty,!0))}return n}function Im(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let s=Mm(n.doc,e,r.type);s!=null&&(e=t=s)}n.replaceRange(e,t,new A(w.from(r),0,0))}function Dm(n,e,t){let r=n.doc.resolve(e),s=n.doc.resolve(t);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(t),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&t==s.start(a);a--)t=s.before(a);r=n.doc.resolve(e),s=n.doc.resolve(t)}}let i=Vu(r,s);for(let o=0;o0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return n.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&s.end(o)-t!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return n.delete(r.before(o),t);n.delete(e,t)}function Vu(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let s=r;s>=0;s--){let i=n.start(s);if(ie.pos+(e.depth-s)||n.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==n.depth&&s==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&t.push(s)}return t}let Wu=class Qr extends me{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return xe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let s=t.type.create(r,null,t.marks);return xe.fromReplace(e,this.pos,this.pos+1,new A(w.from(s),0,t.isLeaf?0:1))}getMap(){return _t.empty}invert(e){return new Qr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Qr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qr(t.pos,t.attr,t.value)}};me.jsonID("attr",Wu);let qu=class uo extends me{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return xe.ok(r)}getMap(){return _t.empty}invert(e){return new uo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new uo(t.attr,t.value)}};me.jsonID("docAttr",qu);let fn=class extends Error{};fn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};fn.prototype=Object.create(Error.prototype);fn.prototype.constructor=fn;fn.prototype.name="TransformError";class Uu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new hr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new fn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let r=0;r{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=A.empty){let s=ni(this.doc,e,t,r);return s&&this.step(s),this}replaceWith(e,t,r){return this.replace(e,t,new A(w.from(r),0,0))}delete(e,t){return this.replace(e,t,A.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Rm(this,e,t,r),this}replaceRangeWith(e,t,r){return Im(this,e,t,r),this}deleteRange(e,t){return Dm(this,e,t),this}lift(e,t){return ym(this,e,t),this}join(e,t=1){return Tm(this,e,t),this}wrap(e,t){return xm(this,e,t),this}setBlockType(e,t=e,r,s=null){return Sm(this,e,t,r,s),this}setNodeMarkup(e,t,r=null,s){return vm(this,e,t,r,s),this}setNodeAttribute(e,t,r){return this.step(new Wu(e,t,r)),this}setDocAttribute(e,t){return this.step(new qu(e,t)),this}addNodeMark(e,t){return this.step(new Jo(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof W)t.isInSet(r.marks)&&this.step(new hs(e,t));else{let s=r.marks,i,o=[];for(;i=t.isInSet(s);)o.push(new hs(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,r){return Em(this,e,t,r),this}addMark(e,t,r){return pm(this,e,t,r),this}removeMark(e,t,r){return mm(this,e,t,r),this}clearIncompatible(e,t,r){return Go(this,e,t,r),this}}const wi=Object.create(null);let z=class{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Lm(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let o=t<0?rn(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):rn(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new nt(e.node(0))}static atStart(e){return rn(e,e,0,0,1)||new nt(e)}static atEnd(e){return rn(e,e,e.content.size,e.childCount,-1)||new nt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=wi[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in wi)throw new RangeError("Duplicate use of selection JSON ID "+e);return wi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return P.between(this.$anchor,this.$head).getBookmark()}};z.prototype.visible=!0;let Lm=class{constructor(e,t){this.$from=e,this.$to=t}},wa=!1;function va(n){!wa&&!n.parent.inlineContent&&(wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}let P=class $n extends z{constructor(e,t=e){va(e),va(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return z.near(r);let s=e.resolve(t.map(this.anchor));return new $n(s.parent.inlineContent?s:r,r)}replace(e,t=A.empty){if(super.replace(e,t),t==A.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof $n&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ku(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new $n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let s=e.resolve(t);return new this(s,r==t?s:e.resolve(r))}static between(e,t,r){let s=e.pos-t.pos;if((!r||s)&&(r=s>=0?1:-1),!t.parent.inlineContent){let i=z.findFrom(t,r,!0)||z.findFrom(t,-r,!0);if(i)t=i.$head;else return z.near(t,r)}return e.parent.inlineContent||(s==0?e=t:(e=(z.findFrom(e,-r,!0)||z.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&I.isSelectable(l))return I.create(n,t-(s<0?l.nodeSize:0))}else{let a=rn(n,l,t+s,s<0?l.childCount:0,s,i);if(a)return a}t+=l.nodeSize*s}return null}function Ea(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(z.near(n.doc.resolve(o),t))}const Ca=1,Dr=2,Ta=4;class Bm extends Uu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Dr,this}ensureMarks(e){return W.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Dr)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Dr,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||W.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let s=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(t);i=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,s.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ta,this}get scrolledIntoView(){return(this.updated&Ta)>0}}function Ma(n,e){return!e||!n?n:n.bind(e)}let Hn=class{constructor(e,t,r){this.name=e,this.init=Ma(t.init,r),this.apply=Ma(t.apply,r)}};const $m=[new Hn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Hn("selection",{init(n,e){return n.selection||z.atStart(e.doc)},apply(n){return n.selection}}),new Hn("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Hn("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class vi{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=$m.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Hn(r.key,r.spec.state,r))})}}class dn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(t[r]=i.toJSON.call(s,this[s.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new vi(e.schema,e.plugins),i=new dn(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=gt.fromJSON(e.schema,t.doc);else if(o.name=="selection")i.selection=z.fromJSON(i.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){i[o.name]=c.fromJSON.call(a,e,t[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function Yu(n,e,t){for(let r in n){let s=n[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=Yu(s,e,{})),t[r]=s}return t}class G{constructor(e){this.spec=e,this.props={},e.props&&Yu(e.props,this,this.props),this.key=e.key?e.key.key:Xu("plugin")}getState(e){return e[this.key]}}const Ei=Object.create(null);function Xu(n){return n in Ei?n+"$"+ ++Ei[n]:(Ei[n]=0,n+"$")}class re{constructor(e="key"){this.key=Xu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Qu=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function Zu(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const ed=(n,e,t)=>{let r=Zu(n,t);if(!r)return!1;let s=Xo(r);if(!s){let o=r.blockRange(),l=o&&En(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(cd(n,s,e,-1))return!0;if(r.parent.content.size==0&&(pn(i,"end")||I.isSelectable(i)))for(let o=r.depth;;o--){let l=ni(n.doc,r.before(o),r.after(o),A.empty);if(l&&l.slice.size1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(n.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},Fm=(n,e,t)=>{let r=Zu(n,t);if(!r)return!1;let s=Xo(r);return s?td(n,s,e):!1},Hm=(n,e,t)=>{let r=rd(n,t);if(!r)return!1;let s=Qo(r);return s?td(n,s,e):!1};function td(n,e,t){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=ni(n.doc,i,a,A.empty);if(!c||c.from!=i||c instanceof Pe&&c.slice.size>=a-i)return!1;if(t){let u=n.tr.step(c);u.setSelection(P.create(u.doc,i)),t(u.scrollIntoView())}return!0}function pn(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const nd=(n,e,t)=>{let{$head:r,empty:s}=n.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=Xo(r)}let o=i&&i.nodeBefore;return!o||!I.isSelectable(o)?!1:(e&&e(n.tr.setSelection(I.create(n.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function Xo(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function rd(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=rd(n,t);if(!r)return!1;let s=Qo(r);if(!s)return!1;let i=s.nodeAfter;if(cd(n,s,e,1))return!0;if(r.parent.content.size==0&&(pn(i,"start")||I.isSelectable(i))){let o=ni(n.doc,r.before(),r.after(),A.empty);if(o&&o.slice.size{let{$head:r,empty:s}=n.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof I,s;if(r){if(t.node.isTextblock||!vt(n.doc,t.from))return!1;s=t.from}else if(s=ti(n.doc,t.from,-1),s==null)return!1;if(e){let i=n.tr.join(s);r&&i.setSelection(I.create(i.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},jm=(n,e)=>{let t=n.selection,r;if(t instanceof I){if(t.node.isTextblock||!vt(n.doc,t.to))return!1;r=t.to}else if(r=ti(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Vm=(n,e)=>{let{$from:t,$to:r}=n.selection,s=t.blockRange(r),i=s&&En(s);return i==null?!1:(e&&e(n.tr.lift(s,i).scrollIntoView()),!0)},od=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` -`).scrollIntoView()),!0)};function Zo(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let s=t.node(-1),i=t.indexAfter(-1),o=Zo(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,o.createAndFill());a.setSelection(z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},ld=(n,e)=>{let t=n.selection,{$from:r,$to:s}=t;if(t instanceof nt||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=Zo(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(tt(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),s=r&&En(r);return s==null?!1:(e&&e(n.tr.lift(r,s).scrollIntoView()),!0)};function qm(n){return(e,t)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof I&&e.selection.node.isBlock)return!r.parentOffset||!tt(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){a=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),l=Zo(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(a&&l?{type:l}:null),o=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof P||e.selection instanceof nt)&&u.deleteSelection();let d=u.mapping.map(r.pos),h=tt(u.doc,d,i.length,i);if(h||(i[0]=l?{type:l}:null,h=tt(u.doc,d,i.length,i)),!h)return!1;if(u.split(d,i.length,i),!a&&c&&r.node(o).type!=l){let f=u.mapping.map(r.before(o)),p=u.doc.resolve(f);l&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return t&&t(u.scrollIntoView()),!0}}const Um=qm(),Km=(n,e)=>{let{$from:t,to:r}=n.selection,s,i=t.sharedDepth(r);return i==0?!1:(s=t.before(i),e&&e(n.tr.setSelection(I.create(n.doc,s))),!0)};function Jm(n,e,t){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||vt(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function cd(n,e,t,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&Jm(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,p=w.empty;for(let y=o.length-1;y>=0;y--)p=w.from(o[y].create(null,p));p=w.from(s.copy(p));let m=n.tr.step(new Ae(e.pos-1,f,e.pos,f,new A(p,1,0),o.length,!0)),g=m.doc.resolve(f+2*o.length);g.nodeAfter&&g.nodeAfter.type==s.type&&vt(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:z.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&En(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(c&&pn(i,"start",!0)&&pn(s,"end")){let f=s,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(t){let y=w.empty;for(let C=p.length-1;C>=0;C--)y=w.from(p[C].copy(y));let x=n.tr.step(new Ae(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new A(y,p.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function ud(n){return function(e,t){let r=e.selection,s=n<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(t&&t(e.tr.setSelection(P.create(e.doc,n<0?s.start(i):s.end(i)))),!0):!1}}const Gm=ud(-1),Ym=ud(1);function Xm(n,e=null){return function(t,r){let{$from:s,$to:i}=t.selection,o=s.blockRange(i),l=o&&Yo(o,n,e);return l?(r&&r(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Aa(n,e=null){return function(t,r){let s=!1;for(let i=0;i{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)s=!0;else{let u=t.doc.resolve(c),d=u.index();s=u.parent.canReplaceWith(d,d+1,n)}})}if(!s)return!1;if(r){let i=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new us(a,a,e.depth),e.endIndex=0;u--)i=w.from(t[u].type.create(t[u].attrs,i));n.step(new Ae(e.start-(r?2:0),e.end,e.start,e.end,new A(i,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?ng(e,t,n,i):rg(e,t,i):!0:!1}}function ng(n,e,t,r){let s=n.tr,i=r.end,o=r.$to.end(r.depth);im;p--)f-=s.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(t.start),o=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?w.empty:w.from(s))))return!1;let d=i.pos,h=d+o.nodeSize;return r.step(new Ae(d-(l?1:0),h+(a?1:0),d+1,h-1,new A((l?w.empty:w.from(s.copy(w.empty))).append(a?w.empty:w.from(s.copy(w.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function sg(n){return function(e,t){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==n);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=w.from(c?n.create():null),d=new A(w.from(n.create(null,w.from(l.type.create(null,u)))),c?3:1,0),h=i.start,f=i.end;t(e.tr.step(new Ae(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}const ce=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},mn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let ho=null;const Qe=function(n,e,t){let r=ho||(ho=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},ig=function(){ho=null},jt=function(n,e,t,r){return t&&(Na(n,e,t,r,-1)||Na(n,e,t,r,1))},og=/^(img|br|input|textarea|hr)$/i;function Na(n,e,t,r,s){for(var i;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Ie(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Er(n)||og.test(n.nodeName)||n.contentEditable=="false")return!1;e=ce(n)+(s<0?0:1),n=o}else if(n.nodeType==1){let o=n.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else n=o,e=s<0?Ie(n):0}else return!1}}function Ie(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function lg(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Ie(n)}else if(n.parentNode&&!Er(n))e=ce(n),n=n.parentNode;else return null}}function ag(n,e){for(;;){if(n.nodeType==3&&e2),Re=gn||(qe?/Mac/.test(qe.platform):!1),fd=qe?/Win/.test(qe.platform):!1,Ze=/Android \d/.test(Et),Cr=!!Oa&&"webkitFontSmoothing"in Oa.documentElement.style,hg=Cr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function fg(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ke(n,e){return typeof n=="number"?n:n[e]}function pg(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Ra(n,e,t){let r=n.someProp("scrollThreshold")||0,s=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(o.nodeType!=1){o=mn(o);continue}let l=o,a=l==i.body,c=a?fg(i):pg(l),u=0,d=0;if(e.topc.bottom-Ke(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Ke(s,"top")-c.top:e.bottom-c.bottom+Ke(s,"bottom")),e.leftc.right-Ke(r,"right")&&(u=e.right-c.right+Ke(s,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let m=l.scrollLeft-f,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let h=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:mn(o)}}function mg(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=t+1;o=t-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:pd(n.dom)}}function pd(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=mn(r));return e}function gg({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;md(t,r==0?0:r-e)}function md(n,e){for(let t=0;t=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!t&&a&&(t=a,s=c,r=0),t&&t.nodeType==3?kg(t,s):!t||r&&t.nodeType==1?{node:n,offset:i}:gd(t,s)}function kg(n,e){let t=n.nodeValue.length,r=document.createRange(),s;for(let i=0;i=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:n,offset:0}}function tl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function bg(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,s,i)}function Sg(n,e,t,r){let s=-1;for(let i=e,o=!1;i!=n.dom;){let l=n.docView.nearestDesc(i,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right-1?s:n.docView.posFromDOM(e,t,-1)}function yd(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&s++}let c;Cr&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==n.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=Sg(n,r,s,e))}l==null&&(l=xg(n,o,e));let a=n.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Ia(n){return n.top=0&&s==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Tn(ut(Qe(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(t<0||s==Ie(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return Ci(a.getBoundingClientRect(),!1)}if(i==null&&s=0)}if(i==null&&s&&(t<0||s==Ie(r))){let a=r.childNodes[s-1],c=a.nodeType==3?Qe(a,Ie(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Tn(ut(c,1),!1)}if(i==null&&s=0)}function Tn(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function Ci(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function bd(n,e,t){let r=n.state,s=n.root.activeElement;r!=e&&n.updateState(e),s!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),s!=n.dom&&s&&s.focus()}}function Eg(n,e,t){let r=e.selection,s=t=="up"?r.$from:r.$to;return bd(n,e,()=>{let{node:i}=n.docView.domFromPos(s.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=kd(n,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Qe(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Cg=/[\u0590-\u08ac]/;function Tg(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=n.domSelection();return l?!Cg.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?i:o:bd(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",t,"character");let f=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let Da=null,La=null,Pa=!1;function Mg(n,e,t){return Da==e&&La==t?Pa:(Da=e,La=t,Pa=t=="up"||t=="down"?Eg(n,e,t):Tg(n,e,t))}const Le=0,za=1,Nt=2,Ue=3;class Tr{constructor(e,t,r,s){this.parent=e,this.children=t,this.dom=r,this.contentDOM=s,this.dirty=Le,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tce(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&t==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!t||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||o instanceof Sd){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof xd&&i.side>=0;r--);if(t<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&t&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?ce(i.dom)+1:0}}else{let i,o=!0;for(;i=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=o;for(let d=l;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){s=ce(h.dom)+1;break}e-=h.size}s==-1&&(s=0)}if(s>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&ot){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,s=0;s=r:er){let l=r+i.border,a=o-i.border;if(e>=l&&t<=a){this.dirty=e==r||t==o?Nt:za,e==l&&t==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ue:i.markDirty(e-l,t-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Nt:Ue}r=o}this.dirty=Nt}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Nt:za;t.dirty{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Le&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Ag extends Tr{constructor(e,t,r,s){super(e,[],t,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Vt extends Tr{constructor(e,t,r,s,i){super(e,[],r,s),this.mark=t,this.spec=i}static create(e,t,r,s){let i=s.nodeViews[t.type.name],o=i&&i(t,s,r);return(!o||!o.dom)&&(o=Kt.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Vt(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ue||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ue&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Le){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=yo(i,0,e,r));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Kt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Ed(u,r,t),c?a=new Ng(e,t,r,s,u,d||null,h,c,i,o+1):t.isText?new si(e,t,r,s,u,h,i):new kt(e,t,r,s,u,d||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>w.empty)}return e}matchesNode(e,t,r){return this.dirty==Le&&e.eq(this.node)&&fs(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,s=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new Rg(this,o&&o.node,e);Lg(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?W.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,d,h)=>{a.syncToMarks(c.marks,r,e,h);let f;a.findNodeMatch(c,u,d,h)||l&&e.state.selection.from>s&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,f,e)||a.updateNextNode(c,u,d,e,h,s)||a.addNode(c,u,d,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Nt)&&(o&&this.protectLocalComposition(e,o),wd(this.contentDOM,this.children,e),gn&&Pg(this.dom))}localCompositionInfo(e,t){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof P)||rt+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=zg(this.node.content,o,r-t,s-t);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:s}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ag(this,i,t,s);e.input.compositionNodes.push(o),this.children=yo(this.children,r,r+s.length,e,o)}update(e,t,r,s){return this.dirty==Ue||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,s),!0)}updateInner(e,t,r,s){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=Le}updateOuterDeco(e){if(fs(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=vd(this.dom,this.nodeDOM,go(this.outerDeco,this.node,t),go(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ba(n,e,t,r,s){Ed(r,e,n);let i=new kt(void 0,n,e,t,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class si extends kt{constructor(e,t,r,s,i,o,l){super(e,t,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,s){return this.dirty==Ue||this.dirty!=Le&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Le||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=Le,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let s=this.node.cut(e,t),i=document.createTextNode(s.text);return new si(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ue)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Sd extends Tr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Le&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Ng extends kt{constructor(e,t,r,s,i,o,l,a,c,u){super(e,t,r,s,i,o,l,c,u),this.spec=a}update(e,t,r,s){if(this.dirty==Ue)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,s){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function wd(n,e,t){let r=n.firstChild,s=!1;for(let i=0;i>1,l=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Vt.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Vt)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function Dg(n,e){return n.type.side-e.type.side}function Lg(n,e,t,r){let s=e.locals(n),i=0;if(s.length==0){for(let c=0;ci;)l.push(s[o++]);let p=i+h.nodeSize;if(h.isText){let g=p;o!g.inline):l.slice();r(h,m,e.forChild(i,h),f),i=p}}function Pg(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function zg(n,e,t,r){for(let s=0,i=0;s=t){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function yo(n,e,t,r,s){let i=[];for(let o=0,l=0;o=t||u<=e?i.push(a):(ct&&i.push(a.slice(t-c,a.size,r)))}return i}function nl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let s=n.docView.nearestDesc(t.focusNode),i=s&&s.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(ri(t)){for(a=o;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&I.isSelectable(d)&&s.parent&&!(d.isInline&&cg(t.focusNode,t.focusOffset,s.dom))){let h=s.posBefore;c=new I(o==h?l:r.resolve(h))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,h=o;for(let f=0;f{(t.anchorNode!=r||t.anchorOffset!=s)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Cd(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function $g(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,ce(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&Me&&yt<=11&&(t.disabled=!0,t.disabled=!1)}function Td(n,e){if(e instanceof I){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ja(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ja(n)}function ja(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function rl(n,e,t,r){return n.someProp("createSelectionBetween",s=>s(n,e,t))||P.between(e,t,r)}function Va(n){return n.editable&&!n.hasFocus()?!1:Md(n)}function Md(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Fg(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return jt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function ko(n,e){let{$anchor:t,$head:r}=n.selection,s=e>0?t.max(r):t.min(r),i=s.parent.inlineContent?s.depth?n.doc.resolve(e>0?s.after():s.before()):null:s;return i&&z.findFrom(i,e)}function ht(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Wa(n,e,t){let r=n.state.selection;if(r instanceof P)if(t.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=n.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return ht(n,new P(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let s=ko(n.state,e);return s&&s instanceof I?ht(n,s):!1}else if(!(Re&&t.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?I.isSelectable(i)?ht(n,new I(e<0?n.state.doc.resolve(s.pos-i.nodeSize):s)):Cr?ht(n,new P(n.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof I&&r.node.isInline)return ht(n,new P(e>0?r.$to:r.$from));{let s=ko(n.state,e);return s?ht(n,s):!1}}}function ps(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function er(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Qt(n,e){return e<0?Hg(n):_g(n)}function Hg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s,i,o=!1;for(De&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(er(l,-1))s=t,i=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Ad(t))break;{let l=t.previousSibling;for(;l&&er(l,-1);)s=t.parentNode,i=ce(l),l=l.previousSibling;if(l)t=l,r=ps(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?bo(n,t,r):s&&bo(n,s,i)}function _g(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s=ps(t),i,o;for(;;)if(r{n.state==s&&rt(n)},50)}function qa(n,e){let t=n.state.doc.resolve(e);if(!(oe||fd)&&t.parent.inlineContent){let s=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o1)return i.lefts.top&&o1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Ua(n,e,t){let r=n.state.selection;if(r instanceof P&&!r.empty||t.indexOf("s")>-1||Re&&t.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=ko(n.state,e);if(o&&o instanceof I)return ht(n,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof nt?z.near(o,e):z.findFrom(o,e);return l?ht(n,l):!1}return!1}function Ka(n,e){if(!(n.state.selection instanceof P))return!0;let{$head:t,$anchor:r,empty:s}=n.state.selection;if(!t.sameParent(r))return!0;if(!s)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let o=n.state.tr;return e<0?o.delete(t.pos-i.nodeSize,t.pos):o.delete(t.pos,t.pos+i.nodeSize),n.dispatch(o),!0}return!1}function Ja(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Wg(n){if(!pe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ja(n,r,"true"),setTimeout(()=>Ja(n,r,"false"),20)}return!1}function qg(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Ug(n,e){let t=e.keyCode,r=qg(e);if(t==8||Re&&t==72&&r=="c")return Ka(n,-1)||Qt(n,-1);if(t==46&&!e.shiftKey||Re&&t==68&&r=="c")return Ka(n,1)||Qt(n,1);if(t==13||t==27)return!0;if(t==37||Re&&t==66&&r=="c"){let s=t==37?qa(n,n.state.selection.from)=="ltr"?-1:1:-1;return Wa(n,s,r)||Qt(n,s)}else if(t==39||Re&&t==70&&r=="c"){let s=t==39?qa(n,n.state.selection.from)=="ltr"?1:-1:1;return Wa(n,s,r)||Qt(n,s)}else{if(t==38||Re&&t==80&&r=="c")return Ua(n,-1,r)||Qt(n,-1);if(t==40||Re&&t==78&&r=="c")return Wg(n)||Ua(n,1,r)||Qt(n,1);if(r==(Re?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function sl(n,e){n.someProp("transformCopied",f=>{e=f(e,n)});let t=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let f=r.firstChild;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=n.someProp("clipboardSerializer")||Kt.fromSchema(n.state.schema),l=Ld(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Dd[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=l.createElement(u[f]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",f=>f(e,n))||e.content.textBetween(0,e.content.size,` + */var gn=T;function Vp(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var Wp=typeof Object.is=="function"?Object.is:Vp,qp=gn.useState,Up=gn.useEffect,Kp=gn.useLayoutEffect,Jp=gn.useDebugValue;function Gp(n,e){var t=e(),r=qp({inst:{value:t,getSnapshot:e}}),s=r[0].inst,i=r[1];return Kp(function(){s.value=t,s.getSnapshot=e,Si(s)&&i({inst:s})},[n,t,e]),Up(function(){return Si(s)&&i({inst:s}),n(function(){Si(s)&&i({inst:s})})},[n]),Jp(t),t}function Si(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!Wp(n,t)}catch{return!0}}function Yp(n,e){return e()}var Xp=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Yp:Gp;pu.useSyncExternalStore=gn.useSyncExternalStore!==void 0?gn.useSyncExternalStore:Xp;fu.exports=pu;var Go=fu.exports;function ae(n){this.content=n}ae.prototype={constructor:ae,find:function(n){for(var e=0;e>1}};ae.from=function(n){if(n instanceof ae)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new ae(e)};function mu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){let o=s.text,l=i.text,a=0;for(;o[a]==l[a];a++)t++;return a&&a0&&h>0&&c[d-1]==u[h-1];)d--,h--,t--,r--;return d&&h&&d=56320&&n<57344}function ku(n){return n>=55296&&n<56320}let w=class ke{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;re&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new ke(r,s)}cutByIndex(e,t){return e==t?ke.empty:e==0&&t==this.content.length?this:new ke(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new ke(s,i)}addToStart(e){return new ke([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ke(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Lr(t+1,i):Lr(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ke.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return ke.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ke.empty;let t,r=0;for(let s=0;sthis.type.rank&&(t||(t=e.slice(0,s)),t.push(this),r=!0),t&&t.push(i)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-s.type.rank),t}};V.none=[];let fr=class extends Error{},N=class on{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=xu(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new on(r,this.openStart,this.openEnd)}removeBetween(e,t){return new on(bu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return on.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new on(w.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new on(e,r,s)}};N.empty=new N(w.empty,0,0);function bu(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(bu(i.content,e-s-1,t-s-1)))}function xu(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=xu(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}function Qp(n,e,t){if(t.openStart>n.depth)throw new fr("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new fr("Inconsistent open depths");return Su(n,e,t,0)}function Su(n,e,t,r){let s=n.index(r),i=n.node(r);if(s==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function er(n,e,t,r){let s=(e||n).node(t),i=0,o=e?e.index(t):s.childCount;n&&(i=n.index(t),n.depth>t?i++:n.textOffset&&($t(n.nodeAfter,r),i++));for(let l=i;ls&&lo(n,e,s+1),o=r.depth>s&&lo(t,r,s+1),l=[];return er(null,n,s,l),i&&o&&e.index(s)==t.index(s)?(wu(i,o),$t(Ft(i,vu(n,e,t,r,s+1)),l)):(i&&$t(Ft(i,ps(n,e,s+1)),l),er(e,t,s,l),o&&$t(Ft(o,ps(t,r,s+1)),l)),er(r,null,s,l),new w(l)}function ps(n,e,t){let r=[];if(er(null,n,t,r),n.depth>t){let s=lo(n,e,t+1);$t(Ft(s,ps(n,e,t+1)),r)}return er(e,null,t,r),new w(r)}function Zp(n,e){let t=e.depth-n.openStart,s=e.node(t).copy(n.content);for(let i=t-1;i>=0;i--)s=e.node(i).copy(w.from(s));return{start:s.resolveNoCache(n.openStart+t),end:s.resolveNoCache(s.content.size-n.openEnd-t)}}class pr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=e.child(t);return r?e.child(t).cut(r):s}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],s=t==0?0:this.path[t*3-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ms(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],s=0,i=t;for(let o=e;;){let{index:l,offset:a}=o.content.findIndex(i),c=i-a;if(r.push(o,l,s+a),!c||(o=o.child(l),o.isText))break;i=c-1,s+=a+1}return new pr(t,r,i)}static resolveCached(e,t){let r=fa.get(e);if(r)for(let i=0;ie&&this.nodesBetween(e,t,i=>(r.isInSet(i.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Eu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=w.empty,s=0,i=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,s,i),l=o&&o.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=s;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let s=w.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,s,r);return i.type.checkAttrs(i.attrs),i}};xt.prototype.text=void 0;class gs extends xt{constructor(e,t,r,s){if(super(e,t,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Eu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new gs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Eu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Wt{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new rm(e,t);if(r.next==null)return Wt.empty;let s=Cu(r);r.next&&r.err("Unexpected trailing text");let i=um(cm(s));return dm(i,r),i}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let s=0;s{let i=s+(r.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(r.next[o].next);return i}).join(` +`)}}Wt.empty=new Wt(!0);class rm{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Cu(n){let e=[];do e.push(sm(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function sm(n){let e=[];do e.push(im(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function im(n){let e=am(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=om(n,e);else break;return e}function pa(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function om(n,e){let t=pa(n),r=t;return n.eat(",")&&(n.next!="}"?r=pa(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function lm(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let s=[];for(let i in t){let o=t[i];o.isInGroup(e)&&s.push(o)}return s.length==0&&n.err("No node type or group '"+e+"' found"),s}function am(n){if(n.eat("(")){let e=Cu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=lm(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function cm(n){let e=[[]];return s(i(n,0),t()),e;function t(){return e.push([])-1}function r(o,l,a){let c={term:a,to:l};return e[o].push(c),c}function s(o,l){o.forEach(a=>a.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((a,c)=>a.concat(i(c,l)),[]);if(o.type=="seq")for(let a=0;;a++){let c=i(o.exprs[a],l);if(a==o.exprs.length-1)return c;s(c,l=t())}else if(o.type=="star"){let a=t();return r(l,a),s(i(o.expr,a),a),[r(a)]}else if(o.type=="plus"){let a=t();return s(i(o.expr,l),a),s(i(o.expr,a),a),[r(a)]}else{if(o.type=="opt")return[r(l)].concat(i(o.expr,l));if(o.type=="range"){let a=l;for(let c=0;c{n[o].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||s.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new Wt(r.indexOf(n.length-1)>-1);for(let o=0;o-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Au(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new xt(this,this.computeAttrs(e),w.from(t),V.setFrom(r))}createChecked(e=null,t,r){return t=w.from(t),this.checkContent(t),new xt(this,this.computeAttrs(e),t,V.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=w.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let s=this.contentMatch.matchFragment(t),i=s&&s.fillBefore(w.empty,!0);return i?new xt(this,e,t.append(i),V.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[i]=new Ru(i,t,o));let s=t.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let i in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function hm(n,e,t){let r=t.split("|");return s=>{let i=s===null?"null":typeof s;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${i}`)}}class fm{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?hm(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class ii{constructor(e,t,r,s){this.name=e,this.rank=t,this.schema=r,this.spec=s,this.attrs=Ou(e,s.attrs),this.excluded=null;let i=Mu(this.attrs);this.instance=i?new V(this,i):null}create(e=null){return!e&&this.instance?this.instance:new V(this,Au(this.attrs,e))}static compile(e,t){let r=Object.create(null),s=0;return e.forEach((i,o)=>r[i]=new ii(i,s++,t,o)),r}removeFromSet(e){for(var t=0;t-1}}class Du{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let s in e)t[s]=e[s];t.nodes=ae.from(e.nodes),t.marks=ae.from(e.marks||{}),this.nodes=ga.compile(this.spec.nodes,this),this.marks=ii.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let i=this.nodes[s],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=r[o]||(r[o]=Wt.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?ya(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let s in this.marks){let i=this.marks[s],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:ya(this,o.split(" "))}this.nodeFromJSON=s=>xt.fromJSON(this,s),this.markFromJSON=s=>V.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,s){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ga){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,s)}text(e,t){let r=this.nodes.text;return new gs(r,r.defaultAttrs,e,V.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ya(n,e){let t=[];for(let r=0;r-1)&&t.push(o=a)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function pm(n){return n.tag!=null}function mm(n){return n.style!=null}let tr=class co{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(s=>{if(pm(s))this.tags.push(s);else if(mm(s)){let i=/[^=]*/.exec(s.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let i=e.nodes[s.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new ba(this,t,!1);return r.addAll(e,V.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ba(this,t,!0);return r.addAll(e,V.none,t.from,t.to),N.maxOpen(r.finish())}matchTag(e,t,r){for(let s=r?this.tags.indexOf(r)+1:0;se.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(o.getAttrs){let a=o.getAttrs(t);if(a===!1)continue;o.attrs=a||void 0}return o}}}static schemaRules(e){let t=[];function r(s){let i=s.priority==null?50:s.priority,o=0;for(;o{r(o=xa(o)),o.mark||o.ignore||o.clearMark||(o.mark=s)})}for(let s in e.nodes){let i=e.nodes[s].spec.parseDOM;i&&i.forEach(o=>{r(o=xa(o)),o.node||o.ignore||o.mark||(o.node=s)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new co(e,co.schemaRules(e)))}};const Iu={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},gm={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Lu={ol:!0,ul:!0},mr=1,uo=2,nr=4;function ka(n,e,t){return e!=null?(e?mr:0)|(e==="full"?uo:0):n&&n.whitespace=="pre"?mr|uo:t&~nr}class Pr{constructor(e,t,r,s,i,o){this.type=e,this.attrs=t,this.marks=r,this.solid=s,this.options=o,this.content=[],this.activeMarks=V.none,this.match=i||(o&nr?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(w.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(e.type))?(this.match=r,s):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&mr)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-s[0].length))}}let t=w.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(w.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Iu.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ba{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=t.topNode,i,o=ka(null,t.preserveWhitespace,0)|(r?nr:0);s?i=new Pr(s.type,s.attrs,V.none,!0,t.topMatch||s.type.contentMatch,o):r?i=new Pr(null,null,V.none,!0,null,o):i=new Pr(e.schema.topNodeType,null,V.none,!0,null,o),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,s=this.top,i=s.options&uo?"full":this.localPreserveWS||(s.options&mr)>0,{schema:o}=this.parser;if(i==="full"||s.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)if(i==="full")r=r.replace(/\r\n?/g,` +`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let a=0;a!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,s){let i,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(o,t.attrs||null,r,t.preserveWhitespace);a&&(i=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(s)this.addElement(e,r,s);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}i&&this.sync(l)&&this.open--}addAll(e,t,r,s){let i=r||0;for(let o=r?e.childNodes[r]:e.firstChild,l=s==null?null:e.childNodes[s];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,t);this.findAtPoint(e,i)}findPlace(e,t,r){let s,i;for(let o=this.open,l=0;o>=0;o--){let a=this.nodes[o],c=a.findWrapping(e);if(c&&(!s||s.length>c.length+l)&&(s=c,i=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!s)return null;this.sync(i);for(let o=0;o(o.type?o.type.allowsMarkType(c.type):Sa(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Pr(e,t,a,s,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=mr)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let s=r.length-1;s>=0;s--)e+=r[s].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(s?0:1),o=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=i;a--)if(o(l-1,a))return!0;return!1}else{let u=a>0||a==0&&s?this.nodes[a].type:r&&a>=i?r.node(a-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function ym(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Lu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function km(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function xa(n){let e={};for(let t in n)e[t]=n[t];return e}function Sa(n,e){let t=e.schema.nodes;for(let r in t){let s=t[r];if(!s.allowsMarkType(n))continue;let i=[],o=l=>{i.push(l);for(let a=0;a{if(i.length||o.marks.length){let l=0,a=0;for(;l=0;s--){let i=this.serializeMark(e.marks[s],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,t,r={}){let s=this.marks[e.type.name];return s&&es(zr(r),s(e,t),null,e.attrs)}static renderSpec(e,t,r=null,s){return typeof t=="string"?{dom:e.createTextNode(t)}:es(e,t,r,s)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Xt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=wa(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return wa(e.marks)}}function wa(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function zr(n){return n.document||window.document}const va=new WeakMap;function bm(n){let e=va.get(n);return e===void 0&&va.set(n,e=xm(n)),e}function xm(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let s=0;s-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=s.indexOf(" ");o>0&&(t=s.slice(0,o),s=s.slice(o+1));let l,a=t?n.createElementNS(t,s):n.createElement(s),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let h=d.indexOf(" ");h>0?a.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):d=="style"&&a.style?a.style.cssText=c[d]:a.setAttribute(d,c[d])}}for(let d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else if(typeof h=="string")a.appendChild(n.createTextNode(h));else{let{dom:f,contentDOM:p}=es(n,h,t,r);if(a.appendChild(f),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}const Pu=65535,zu=Math.pow(2,16);function Sm(n,e){return n+e*zu}function Ea(n){return n&Pu}function wm(n){return(n-(n&Pu))/zu}const Bu=1,$u=2,ts=4,Fu=8;let ho=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Fu)>0}get deletedBefore(){return(this.delInfo&(Bu|ts))>0}get deletedAfter(){return(this.delInfo&($u|ts))>0}get deletedAcross(){return(this.delInfo&ts)>0}},qt=class ln{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ln.empty)return ln.empty}recover(e){let t=0,r=Ea(e);if(!this.inverted)for(let s=0;se)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:Sm(l/3,e-a),m=e==a?$u:e==d?Bu:ts;return(t<0?e!=a:e!=d)&&(m|=Fu),new ho(f,m,p)}s+=u-c}return r?e+s:new ho(e+s,0,null)}touches(e,t){let r=0,s=Ea(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s=0;t--){let s=e.getMirror(t);this.appendMap(e._maps[t].invert(),s!=null&&s>t?r-s-1:void 0)}}invert(){let e=new gr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ri&&a!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return xe.fromReplace(e,this.from,this.to,i)}invert(){return new Mn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Bn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Bn(t.from,t.to,e.markFromJSON(t.mark))}};me.jsonID("addMark",Xo);let Mn=class $n extends me{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new N(Yo(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return xe.fromReplace(e,this.from,this.to,r)}invert(){return new Xo(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new $n(t.pos,r.pos,this.mark)}merge(e){return e instanceof $n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new $n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new $n(t.from,t.to,e.markFromJSON(t.mark))}};me.jsonID("removeMark",Mn);let Qo=class Fn extends me{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return xe.fromReplace(e,this.pos,this.pos+1,new N(w.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;sr.pos?null:new ns(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ns(t.from,t.to,t.gapFrom,t.gapTo,N.fromJSON(e,t.slice),t.insert,!!t.structure)}};me.jsonID("replaceAround",Oe);function po(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}function vm(n,e,t,r){let s=[],i=[],o,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+a.nodeSize,t),p=r.addToSet(d);for(let m=0;mn.step(a)),i.forEach(a=>n.step(a))}function Em(n,e,t,r){let s=[],i=0;n.doc.nodesBetween(e,t,(o,l)=>{if(!o.isInline)return;i++;let a=null;if(r instanceof ii){let c=o.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(a=[r]):a=o.marks;if(a&&a.length){let c=Math.min(l+o.nodeSize,t);for(let u=0;un.step(new Mn(o.from,o.to,o.style)))}function Zo(n,e,t,r=t.contentMatch,s=!0){let i=n.doc.nodeAt(e),o=[],l=e+1;for(let a=0;a=0;a--)n.step(o[a])}function Cm(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function An(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,s=0,i=0;;--r){let o=n.$from.node(r),l=n.$from.index(r)+s,a=n.$to.indexAfter(r)-i;if(rt;p--)m||r.index(p)>0?(m=!0,u=w.from(r.node(p).copy(u)),d++):a--;let h=w.empty,f=0;for(let p=i,m=!1;p>t;p--)m||s.after(p+1)=0;o--){if(r.size){let l=t[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=w.from(t[o].type.create(t[o].attrs,r))}let s=e.start,i=e.end;n.step(new Oe(s,i,s,i,new N(r,0,0),t.length,!0))}function Om(n,e,t,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(e,t,(o,l)=>{let a=typeof s=="function"?s(o):s;if(o.isTextblock&&!o.hasMarkup(r,a)&&Rm(n.doc,n.mapping.slice(i).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let f=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);f&&!p?c=!1:!f&&p&&(c=!0)}c===!1&&Hu(n,o,l,i),Zo(n,n.mapping.slice(i).map(l,1),r,void 0,c===null);let u=n.mapping.slice(i),d=u.map(l,1),h=u.map(l+o.nodeSize,1);return n.step(new Oe(d,h,d+1,h-1,new N(w.from(r.create(a,null,o.marks)),0,0),1,!0)),c===!0&&ju(n,o,l,i),!1}})}function ju(n,e,t,r){e.forEach((s,i)=>{if(s.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(s.text);){let a=n.mapping.slice(r).map(t+1+i+o.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Hu(n,e,t,r){e.forEach((s,i)=>{if(s.type==s.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+i);n.replaceWith(o,o+1,e.type.schema.text(` +`))}})}function Rm(n,e,t){let r=n.resolve(e),s=r.index();return r.parent.canReplaceWith(s,s+1,t)}function Dm(n,e,t,r,s){let i=n.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");t||(t=i.type);let o=t.create(r,null,s||i.marks);if(i.isLeaf)return n.replaceWith(e,e+i.nodeSize,o);if(!t.validContent(i.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Oe(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new N(w.from(o),0,0),1,!0))}function it(n,e,t=1,r){let s=n.resolve(e),i=s.depth-t,o=r&&r[r.length-1]||s.parent;if(i<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!o.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let c=s.depth-1,u=t-2;c>i;c--,u--){let d=s.node(c),h=s.index(c);if(d.type.spec.isolating)return!1;let f=d.content.cutByIndex(h,d.childCount),p=r&&r[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(f))return!1}let l=s.indexAfter(i),a=r&&r[0];return s.node(i).canReplaceWith(l,l,a?a.type:s.node(i+1).type)}function Im(n,e,t=1,r){let s=n.doc.resolve(e),i=w.empty,o=w.empty;for(let l=s.depth,a=s.depth-t,c=t-1;l>a;l--,c--){i=w.from(s.node(l).copy(i));let u=r&&r[c];o=w.from(u?u.type.create(u.attrs,o):s.node(l).copy(o))}n.step(new $e(e,e,new N(i.append(o),t,t),!0))}function Mt(n,e){let t=n.resolve(e),r=t.index();return _u(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Lm(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let s=0;s0?(i=r.node(s+1),l++,o=r.node(s).maybeChild(l)):(i=r.node(s).maybeChild(l-1),o=r.node(s+1)),i&&!i.isTextblock&&_u(i,o)&&r.node(s).canReplace(l,l+1))return e;if(s==0)break;e=t<0?r.before(s):r.after(s)}}function Pm(n,e,t){let r=null,{linebreakReplacement:s}=n.doc.type.schema,i=n.doc.resolve(e-t),o=i.node().type;if(s&&o.inlineContent){let u=o.whitespace=="pre",d=!!o.contentMatch.matchType(s);u&&!d?r=!1:!u&&d&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Hu(n,u.node(),u.before(),l)}o.inlineContent&&Zo(n,e+t-1,o,i.node().contentMatchAt(i.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new $e(c,a.map(e+t,-1),N.empty,!0)),r===!0){let u=n.doc.resolve(c);ju(n,u.node(),u.before(),n.steps.length)}return n}function zm(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let i=r.index(s);if(r.node(s).canReplaceWith(i,i,t))return r.before(s+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let i=r.indexAfter(s);if(r.node(s).canReplaceWith(i,i,t))return r.after(s+1);if(i=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,a=r.index(o)+(l>0?1:0),c=r.node(o),u=!1;if(i==1)u=c.canReplace(a,a,s);else{let d=c.contentMatchAt(a).findWrapping(s.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function li(n,e,t=e,r=N.empty){if(e==t&&!r.size)return null;let s=n.resolve(e),i=n.resolve(t);return Wu(s,i,r)?new $e(e,t,r):new Bm(s,i,r).fit()}function Wu(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class Bm{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=w.empty;for(let s=0;s<=e.depth;s++){let i=e.node(s);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(s))})}for(let s=e.depth;s>0;s--)this.placed=w.from(e.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(e<0?this.$to:r.doc.resolve(e));if(!s)return null;let i=this.placed,o=r.depth,l=s.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let a=new N(i,o,l);return e>-1?new Oe(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new $e(r.pos,s.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,s=this.unplaced.openEnd;r1&&(s=0),i.type.spec.isolating&&s<=r){e=r;break}t=i.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let s,i=null;r?(i=Ei(this.unplaced.content,r-1).firstChild,s=i.content):s=this.unplaced.content;let o=s.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(o?c.matchType(o.type)||(d=c.fillBefore(w.from(o),!1)):i&&a.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:d};if(t==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=Ei(e,t);return!s.childCount||s.firstChild.isLeaf?!1:(this.unplaced=new N(e,t+1,Math.max(r,s.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,s=Ei(e,t);if(s.childCount<=1&&t>0){let i=e.size-t<=t+s.size;this.unplaced=new N(jn(e,t-1,1),t-1,i?t-1:r)}else this.unplaced=new N(jn(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:s,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(qu(m.mark(h.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?f:-1)))}let p=c==l.childCount;p||(f=-1),this.placed=Hn(this.placed,t,w.from(u)),this.frontier[t].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:s}=this.frontier[t],i=t=0;l--){let{match:a,type:c}=this.frontier[l],u=Ci(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Hn(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let s=e.node(r),i=s.type.contentMatch.fillBefore(s.content,!0,e.index(r));this.openFrontierNode(s.type,s.attrs,i)}return e}openFrontierNode(e,t=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(e),this.placed=Hn(this.placed,this.depth,w.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(w.empty,!0);t.childCount&&(this.placed=Hn(this.placed,this.frontier.length,t))}}function jn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(jn(n.firstChild.content,e-1,t)))}function Hn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Hn(n.lastChild.content,e-1,t)))}function Ei(n,e){for(let t=0;t1&&(r=r.replaceChild(0,qu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(w.empty,!0)))),n.copy(r)}function Ci(n,e,t,r,s){let i=n.node(e),o=s?n.indexAfter(e):n.index(e);if(o==i.childCount&&!t.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,o);return l&&!$m(t,i.content,o)?l:null}function $m(n,e,t){for(let r=t;r0;h--,f--){let p=s.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(h)>-1?l=h:s.before(h)==f&&o.splice(1,0,-h)}let a=o.indexOf(l),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let p=h.firstChild;if(c.push(p),f==r.openStart)break;h=p.content}for(let h=u-1;h>=0;h--){let f=c[h],p=Fm(f.type);if(p&&!f.sameMarkup(s.node(Math.abs(l)-1)))u=h;else if(p||!f.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let f=(h+u+1)%(r.openStart+1),p=c[f];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));h--){let f=o[h];f<0||(e=s.before(f),t=i.after(f))}}function Uu(n,e,t,r,s){if(er){let i=s.contentMatchAt(0),o=i.fillBefore(n).append(n);n=o.append(i.matchFragment(o).fillBefore(w.empty,!0))}return n}function Hm(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let s=zm(n.doc,e,r.type);s!=null&&(e=t=s)}n.replaceRange(e,t,new N(w.from(r),0,0))}function _m(n,e,t){let r=n.doc.resolve(e),s=n.doc.resolve(t);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let o=r.sharedDepth(t),l=!1;for(let a=r.depth;a>o;a--)r.node(a).type.spec.isolating&&(l=!0);for(let a=s.depth;a>o;a--)s.node(a).type.spec.isolating&&(l=!0);if(!l){for(let a=r.depth;a>0&&e==r.start(a);a--)e=r.before(a);for(let a=s.depth;a>0&&t==s.start(a);a--)t=s.before(a);r=n.doc.resolve(e),s=n.doc.resolve(t)}}let i=Ku(r,s);for(let o=0;o0&&(a||r.node(l-1).canReplace(r.index(l-1),s.indexAfter(l-1))))return n.delete(r.before(l),s.after(l))}for(let o=1;o<=r.depth&&o<=s.depth;o++)if(e-r.start(o)==r.depth-o&&t>r.end(o)&&s.end(o)-t!=s.depth-o&&r.start(o-1)==s.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),s.index(o-1)))return n.delete(r.before(o),t);n.delete(e,t)}function Ku(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let s=r;s>=0;s--){let i=n.start(s);if(ie.pos+(e.depth-s)||n.node(s).type.spec.isolating||e.node(s).type.spec.isolating)break;(i==e.start(s)||s==n.depth&&s==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&s&&e.start(s-1)==i-1)&&t.push(s)}return t}let Ju=class rs extends me{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return xe.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let s=t.type.create(r,null,t.marks);return xe.fromReplace(e,this.pos,this.pos+1,new N(w.from(s),0,t.isLeaf?0:1))}getMap(){return qt.empty}invert(e){return new rs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new rs(t.pos,t.attr,t.value)}};me.jsonID("attr",Ju);let Gu=class mo extends me{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return xe.ok(r)}getMap(){return qt.empty}invert(e){return new mo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new mo(t.attr,t.value)}};me.jsonID("docAttr",Gu);let yn=class extends Error{};yn=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};yn.prototype=Object.create(Error.prototype);yn.prototype.constructor=yn;yn.prototype.name="TransformError";class Yu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new gr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new yn(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let r=0;r{e=Math.min(e,l),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=N.empty){let s=li(this.doc,e,t,r);return s&&this.step(s),this}replaceWith(e,t,r){return this.replace(e,t,new N(w.from(r),0,0))}delete(e,t){return this.replace(e,t,N.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return jm(this,e,t,r),this}replaceRangeWith(e,t,r){return Hm(this,e,t,r),this}deleteRange(e,t){return _m(this,e,t),this}lift(e,t){return Tm(this,e,t),this}join(e,t=1){return Pm(this,e,t),this}wrap(e,t){return Nm(this,e,t),this}setBlockType(e,t=e,r,s=null){return Om(this,e,t,r,s),this}setNodeMarkup(e,t,r=null,s){return Dm(this,e,t,r,s),this}setNodeAttribute(e,t,r){return this.step(new Ju(e,t,r)),this}setDocAttribute(e,t){return this.step(new Gu(e,t)),this}addNodeMark(e,t){return this.step(new Qo(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof V)t.isInSet(r.marks)&&this.step(new ys(e,t));else{let s=r.marks,i,o=[];for(;i=t.isInSet(s);)o.push(new ys(e,i)),s=i.removeFromSet(s);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,t=1,r){return Im(this,e,t,r),this}addMark(e,t,r){return vm(this,e,t,r),this}removeMark(e,t,r){return Em(this,e,t,r),this}clearIncompatible(e,t,r){return Zo(this,e,t,r),this}}const Ti=Object.create(null);let P=class{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Vm(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let o=t<0?an(e.node(0),e.node(i),e.before(i+1),e.index(i),t,r):an(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,r);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new ot(e.node(0))}static atStart(e){return an(e,e,0,0,1)||new ot(e)}static atEnd(e){return an(e,e,e.content.size,e.childCount,-1)||new ot(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ti[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Ti)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ti[e]=t,t.prototype.jsonID=e,t}getBookmark(){return I.between(this.$anchor,this.$head).getBookmark()}};P.prototype.visible=!0;let Vm=class{constructor(e,t){this.$from=e,this.$to=t}},Ta=!1;function Ma(n){!Ta&&!n.parent.inlineContent&&(Ta=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}let I=class _n extends P{constructor(e,t=e){Ma(e),Ma(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return P.near(r);let s=e.resolve(t.map(this.anchor));return new _n(s.parent.inlineContent?s:r,r)}replace(e,t=N.empty){if(super.replace(e,t),t==N.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof _n&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Xu(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new _n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let s=e.resolve(t);return new this(s,r==t?s:e.resolve(r))}static between(e,t,r){let s=e.pos-t.pos;if((!r||s)&&(r=s>=0?1:-1),!t.parent.inlineContent){let i=P.findFrom(t,r,!0)||P.findFrom(t,-r,!0);if(i)t=i.$head;else return P.near(t,r)}return e.parent.inlineContent||(s==0?e=t:(e=(P.findFrom(e,-r,!0)||P.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&R.isSelectable(l))return R.create(n,t-(s<0?l.nodeSize:0))}else{let a=an(n,l,t+s,s<0?l.childCount:0,s,i);if(a)return a}t+=l.nodeSize*s}return null}function Aa(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(P.near(n.doc.resolve(o),t))}const Na=1,Br=2,Oa=4;class Um extends Yu{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Br,this}ensureMarks(e){return V.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Br)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~Br,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||V.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let s=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(s.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),!e)return this.deleteRange(t,r);let i=this.storedMarks;if(!i){let o=this.doc.resolve(t);i=r==t?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,s.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(P.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Oa,this}get scrolledIntoView(){return(this.updated&Oa)>0}}function Ra(n,e){return!e||!n?n:n.bind(e)}let Wn=class{constructor(e,t,r){this.name=e,this.init=Ra(t.init,r),this.apply=Ra(t.apply,r)}};const Km=[new Wn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Wn("selection",{init(n,e){return n.selection||P.atStart(e.doc)},apply(n){return n.selection}}),new Wn("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Wn("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class Mi{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Km.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Wn(r.key,r.spec.state,r))})}}class mn{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=e[r],i=s.spec.state;i&&i.toJSON&&(t[r]=i.toJSON.call(s,this[s.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let s=new Mi(e.schema,e.plugins),i=new mn(s);return s.fields.forEach(o=>{if(o.name=="doc")i.doc=xt.fromJSON(e.schema,t.doc);else if(o.name=="selection")i.selection=P.fromJSON(i.doc,t.selection);else if(o.name=="storedMarks")t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){i[o.name]=c.fromJSON.call(a,e,t[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function ed(n,e,t){for(let r in n){let s=n[r];s instanceof Function?s=s.bind(e):r=="handleDOMEvents"&&(s=ed(s,e,{})),t[r]=s}return t}class G{constructor(e){this.spec=e,this.props={},e.props&&ed(e.props,this,this.props),this.key=e.key?e.key.key:td("plugin")}getState(e){return e[this.key]}}const Ai=Object.create(null);function td(n){return n in Ai?n+"$"+ ++Ai[n]:(Ai[n]=0,n+"$")}class se{constructor(e="key"){this.key=td(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const nd=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function rd(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const sd=(n,e,t)=>{let r=rd(n,t);if(!r)return!1;let s=tl(r);if(!s){let o=r.blockRange(),l=o&&An(o);return l==null?!1:(e&&e(n.tr.lift(o,l).scrollIntoView()),!0)}let i=s.nodeBefore;if(fd(n,s,e,-1))return!0;if(r.parent.content.size==0&&(kn(i,"end")||R.isSelectable(i)))for(let o=r.depth;;o--){let l=li(n.doc,r.before(o),r.after(o),N.empty);if(l&&l.slice.size1)break}return i.isAtom&&s.depth==r.depth-1?(e&&e(n.tr.delete(s.pos-i.nodeSize,s.pos).scrollIntoView()),!0):!1},Jm=(n,e,t)=>{let r=rd(n,t);if(!r)return!1;let s=tl(r);return s?id(n,s,e):!1},Gm=(n,e,t)=>{let r=ld(n,t);if(!r)return!1;let s=nl(r);return s?id(n,s,e):!1};function id(n,e,t){let r=e.nodeBefore,s=r,i=e.pos-1;for(;!s.isTextblock;i--){if(s.type.spec.isolating)return!1;let u=s.lastChild;if(!u)return!1;s=u}let o=e.nodeAfter,l=o,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=li(n.doc,i,a,N.empty);if(!c||c.from!=i||c instanceof $e&&c.slice.size>=a-i)return!1;if(t){let u=n.tr.step(c);u.setSelection(I.create(u.doc,i)),t(u.scrollIntoView())}return!0}function kn(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const od=(n,e,t)=>{let{$head:r,empty:s}=n.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;i=tl(r)}let o=i&&i.nodeBefore;return!o||!R.isSelectable(o)?!1:(e&&e(n.tr.setSelection(R.create(n.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function tl(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function ld(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=ld(n,t);if(!r)return!1;let s=nl(r);if(!s)return!1;let i=s.nodeAfter;if(fd(n,s,e,1))return!0;if(r.parent.content.size==0&&(kn(i,"start")||R.isSelectable(i))){let o=li(n.doc,r.before(),r.after(),N.empty);if(o&&o.slice.size{let{$head:r,empty:s}=n.selection,i=r;if(!s)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof R,s;if(r){if(t.node.isTextblock||!Mt(n.doc,t.from))return!1;s=t.from}else if(s=oi(n.doc,t.from,-1),s==null)return!1;if(e){let i=n.tr.join(s);r&&i.setSelection(R.create(i.doc,s-n.doc.resolve(s).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},Xm=(n,e)=>{let t=n.selection,r;if(t instanceof R){if(t.node.isTextblock||!Mt(n.doc,t.to))return!1;r=t.to}else if(r=oi(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},Qm=(n,e)=>{let{$from:t,$to:r}=n.selection,s=t.blockRange(r),i=s&&An(s);return i==null?!1:(e&&e(n.tr.lift(s,i).scrollIntoView()),!0)},ud=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` +`).scrollIntoView()),!0)};function rl(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let s=t.node(-1),i=t.indexAfter(-1),o=rl(s.contentMatchAt(i));if(!o||!s.canReplaceWith(i,i,o))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,o.createAndFill());a.setSelection(P.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},dd=(n,e)=>{let t=n.selection,{$from:r,$to:s}=t;if(t instanceof ot||r.parent.inlineContent||s.parent.inlineContent)return!1;let i=rl(s.parent.contentMatchAt(s.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!r.parentOffset&&s.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let i=t.before();if(it(n.doc,i))return e&&e(n.tr.split(i).scrollIntoView()),!0}let r=t.blockRange(),s=r&&An(r);return s==null?!1:(e&&e(n.tr.lift(r,s).scrollIntoView()),!0)};function eg(n){return(e,t)=>{let{$from:r,$to:s}=e.selection;if(e.selection instanceof R&&e.selection.node.isBlock)return!r.parentOffset||!it(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let i=[],o,l,a=!1,c=!1;for(let f=r.depth;;f--)if(r.node(f).isBlock){a=r.end(f)==r.pos+(r.depth-f),c=r.start(f)==r.pos-(r.depth-f),l=rl(r.node(f-1).contentMatchAt(r.indexAfter(f-1))),i.unshift(a&&l?{type:l}:null),o=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof I||e.selection instanceof ot)&&u.deleteSelection();let d=u.mapping.map(r.pos),h=it(u.doc,d,i.length,i);if(h||(i[0]=l?{type:l}:null,h=it(u.doc,d,i.length,i)),!h)return!1;if(u.split(d,i.length,i),!a&&c&&r.node(o).type!=l){let f=u.mapping.map(r.before(o)),p=u.doc.resolve(f);l&&r.node(o-1).canReplaceWith(p.index(),p.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(o)),l)}return t&&t(u.scrollIntoView()),!0}}const tg=eg(),ng=(n,e)=>{let{$from:t,to:r}=n.selection,s,i=t.sharedDepth(r);return i==0?!1:(s=t.before(i),e&&e(n.tr.setSelection(R.create(n.doc,s))),!0)};function rg(n,e,t){let r=e.nodeBefore,s=e.nodeAfter,i=e.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(s.isTextblock||Mt(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function fd(n,e,t,r){let s=e.nodeBefore,i=e.nodeAfter,o,l,a=s.type.spec.isolating||i.type.spec.isolating;if(!a&&rg(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(o=(l=s.contentMatchAt(s.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,p=w.empty;for(let y=o.length-1;y>=0;y--)p=w.from(o[y].create(null,p));p=w.from(s.copy(p));let m=n.tr.step(new Oe(e.pos-1,f,e.pos,f,new N(p,1,0),o.length,!0)),g=m.doc.resolve(f+2*o.length);g.nodeAfter&&g.nodeAfter.type==s.type&&Mt(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&a?null:P.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&An(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(c&&kn(i,"start",!0)&&kn(s,"end")){let f=s,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,m.content)){if(t){let y=w.empty;for(let C=p.length-1;C>=0;C--)y=w.from(p[C].copy(y));let x=n.tr.step(new Oe(e.pos-p.length,e.pos+i.nodeSize,e.pos+g,e.pos+i.nodeSize-g,new N(y,p.length,0),0,!0));t(x.scrollIntoView())}return!0}}return!1}function pd(n){return function(e,t){let r=e.selection,s=n<0?r.$from:r.$to,i=s.depth;for(;s.node(i).isInline;){if(!i)return!1;i--}return s.node(i).isTextblock?(t&&t(e.tr.setSelection(I.create(e.doc,n<0?s.start(i):s.end(i)))),!0):!1}}const sg=pd(-1),ig=pd(1);function og(n,e=null){return function(t,r){let{$from:s,$to:i}=t.selection,o=s.blockRange(i),l=o&&el(o,n,e);return l?(r&&r(t.tr.wrap(o,l).scrollIntoView()),!0):!1}}function Da(n,e=null){return function(t,r){let s=!1;for(let i=0;i{if(s)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)s=!0;else{let u=t.doc.resolve(c),d=u.index();s=u.parent.canReplaceWith(d,d+1,n)}})}if(!s)return!1;if(r){let i=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=o.resolve(e.start-2);i=new ms(a,a,e.depth),e.endIndex=0;u--)i=w.from(t[u].type.create(t[u].attrs,i));n.step(new Oe(e.start-(r?2:0),e.end,e.start,e.end,new N(i,0,0),t.length,!0));let o=0;for(let u=0;uo.childCount>0&&o.firstChild.type==n);return i?t?r.node(i.depth-1).type==n?dg(e,t,n,i):hg(e,t,i):!0:!1}}function dg(n,e,t,r){let s=n.tr,i=r.end,o=r.$to.end(r.depth);im;p--)f-=s.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(t.start),o=i.nodeAfter;if(r.mapping.map(t.end)!=t.start+i.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==s.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(l?0:1),u+1,o.content.append(a?w.empty:w.from(s))))return!1;let d=i.pos,h=d+o.nodeSize;return r.step(new Oe(d-(l?1:0),h+(a?1:0),d+1,h-1,new N((l?w.empty:w.from(s.copy(w.empty))).append(a?w.empty:w.from(s.copy(w.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function fg(n){return function(e,t){let{$from:r,$to:s}=e.selection,i=r.blockRange(s,c=>c.childCount>0&&c.firstChild.type==n);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,a=l.child(o-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=w.from(c?n.create():null),d=new N(w.from(n.create(null,w.from(l.type.create(null,u)))),c?3:1,0),h=i.start,f=i.end;t(e.tr.step(new Oe(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}const ce=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},bn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let go=null;const nt=function(n,e,t){let r=go||(go=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},pg=function(){go=null},Ut=function(n,e,t,r){return t&&(Ia(n,e,t,r,-1)||Ia(n,e,t,r,1))},mg=/^(img|br|input|textarea|hr)$/i;function Ia(n,e,t,r,s){for(var i;;){if(n==t&&e==r)return!0;if(e==(s<0?0:Pe(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Ar(n)||mg.test(n.nodeName)||n.contentEditable=="false")return!1;e=ce(n)+(s<0?0:1),n=o}else if(n.nodeType==1){let o=n.childNodes[e+(s<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=s;else return!1;else n=o,e=s<0?Pe(n):0}else return!1}}function Pe(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function gg(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Pe(n)}else if(n.parentNode&&!Ar(n))e=ce(n),n=n.parentNode;else return null}}function yg(n,e){for(;;){if(n.nodeType==3&&e2),Le=xn||(Ge?/Mac/.test(Ge.platform):!1),yd=Ge?/Win/.test(Ge.platform):!1,rt=/Android \d/.test(At),Nr=!!La&&"webkitFontSmoothing"in La.documentElement.style,Sg=Nr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wg(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Xe(n,e){return typeof n=="number"?n:n[e]}function vg(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Pa(n,e,t){let r=n.someProp("scrollThreshold")||0,s=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let o=t||n.dom;o;){if(o.nodeType!=1){o=bn(o);continue}let l=o,a=l==i.body,c=a?wg(i):vg(l),u=0,d=0;if(e.topc.bottom-Xe(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Xe(s,"top")-c.top:e.bottom-c.bottom+Xe(s,"bottom")),e.leftc.right-Xe(r,"right")&&(u=e.right-c.right+Xe(s,"right")),u||d)if(a)i.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let m=l.scrollLeft-f,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let h=a?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(h))break;o=h=="absolute"?o.offsetParent:bn(o)}}function Eg(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,s;for(let i=(e.left+e.right)/2,o=t+1;o=t-20){r=l,s=a.top;break}}return{refDOM:r,refTop:s,stack:kd(n.dom)}}function kd(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=bn(r));return e}function Cg({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;bd(t,r==0?0:r-e)}function bd(n,e){for(let t=0;t=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!t&&a&&(t=a,s=c,r=0),t&&t.nodeType==3?Mg(t,s):!t||r&&t.nodeType==1?{node:n,offset:i}:xd(t,s)}function Mg(n,e){let t=n.nodeValue.length,r=document.createRange(),s;for(let i=0;i=(o.left+o.right)/2?1:0)};break}}return r.detach(),s||{node:n,offset:0}}function il(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Ag(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(o.left+o.right)/2?1:-1}return n.docView.posFromDOM(r,s,i)}function Og(n,e,t,r){let s=-1;for(let i=e,o=!1;i!=n.dom;){let l=n.docView.nearestDesc(i,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&a.left>r.left||a.top>r.top?s=l.posBefore:(!o&&a.right-1?s:n.docView.posFromDOM(e,t,-1)}function Sd(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&s++}let c;Nr&&s&&r.nodeType==1&&(c=r.childNodes[s-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&s--,r==n.dom&&s==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(s==0||r.nodeType!=1||r.childNodes[s-1].nodeName!="BR")&&(l=Og(n,r,s,e))}l==null&&(l=Ng(n,o,e));let a=n.docView.nearestDesc(o,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function za(n){return n.top=0&&s==r.nodeValue.length?(a--,u=1):t<0?a--:c++,On(pt(nt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&s&&(t<0||s==Pe(r))){let a=r.childNodes[s-1];if(a.nodeType==1)return Ni(a.getBoundingClientRect(),!1)}if(i==null&&s=0)}if(i==null&&s&&(t<0||s==Pe(r))){let a=r.childNodes[s-1],c=a.nodeType==3?nt(a,Pe(a)-(o?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return On(pt(c,1),!1)}if(i==null&&s=0)}function On(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function Ni(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function vd(n,e,t){let r=n.state,s=n.root.activeElement;r!=e&&n.updateState(e),s!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),s!=n.dom&&s&&s.focus()}}function Ig(n,e,t){let r=e.selection,s=t=="up"?r.$from:r.$to;return vd(n,e,()=>{let{node:i}=n.docView.domFromPos(s.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=wd(n,s.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=nt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Lg=/[\u0590-\u08ac]/;function Pg(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,i=!s,o=s==r.parent.content.size,l=n.domSelection();return l?!Lg.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?i:o:vd(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),h=l.caretBidiLevel;l.modify("move",t,"character");let f=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!f.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return h!=null&&(l.caretBidiLevel=h),g}):r.pos==r.start()||r.pos==r.end()}let Ba=null,$a=null,Fa=!1;function zg(n,e,t){return Ba==e&&$a==t?Fa:(Ba=e,$a=t,Fa=t=="up"||t=="down"?Ig(n,e,t):Pg(n,e,t))}const Be=0,ja=1,It=2,Ye=3;class Or{constructor(e,t,r,s){this.parent=e,this.children=t,this.dom=r,this.contentDOM=s,this.dirty=Be,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tce(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!1;break}if(i.previousSibling)break}if(s==null&&t==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){s=!0;break}if(i.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,s=e;s;s=s.parentNode){let i=this.getDesc(s),o;if(i&&(!t||i.node))if(r&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let s=e;s;s=s.parentNode){let i=this.getDesc(s);if(i)return i.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||o instanceof Cd){s=e-i;break}i=l}if(s)return this.children[r].domFromPos(s-this.children[r].border,t);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof Ed&&i.side>=0;r--);if(t<=0){let i,o=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,o=!1);return i&&t&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,t):{node:this.contentDOM,offset:i?ce(i.dom)+1:0}}else{let i,o=!0;for(;i=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=o;for(let d=l;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){s=ce(h.dom)+1;break}e-=h.size}s==-1&&(s=0)}if(s>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&ot){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,s=0;s=r:er){let l=r+i.border,a=o-i.border;if(e>=l&&t<=a){this.dirty=e==r||t==o?It:ja,e==l&&t==a&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Ye:i.markDirty(e-l,t-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?It:Ye}r=o}this.dirty=It}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?It:ja;t.dirty{if(!i)return s;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Be&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Bg extends Or{constructor(e,t,r,s){super(e,[],t,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Kt extends Or{constructor(e,t,r,s,i){super(e,[],r,s),this.mark=t,this.spec=i}static create(e,t,r,s){let i=s.nodeViews[t.type.name],o=i&&i(t,s,r);return(!o||!o.dom)&&(o=Xt.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new Kt(e,t,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Ye||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ye&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Be){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(i=So(i,0,e,r));for(let l=0;l{if(!a)return o;if(a.parent)return a.parent.posBeforeChild(a)},r,s),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Xt.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Ad(u,r,t),c?a=new $g(e,t,r,s,u,d||null,h,c,i,o+1):t.isText?new ci(e,t,r,s,u,h,i):new wt(e,t,r,s,u,d||null,h,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>w.empty)}return e}matchesNode(e,t,r){return this.dirty==Be&&e.eq(this.node)&&ks(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,s=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,a=new jg(this,o&&o.node,e);Vg(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e,u):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?V.none:this.node.child(u).marks,r,e,u),a.placeWidget(c,e,s)},(c,u,d,h)=>{a.syncToMarks(c.marks,r,e,h);let f;a.findNodeMatch(c,u,d,h)||l&&e.state.selection.from>s&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,f,e)||a.updateNextNode(c,u,d,e,h,s)||a.addNode(c,u,d,e,s),s+=c.nodeSize}),a.syncToMarks([],r,e,0),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==It)&&(o&&this.protectLocalComposition(e,o),Td(this.contentDOM,this.children,e),xn&&Wg(this.dom))}localCompositionInfo(e,t){let{from:r,to:s}=e.state.selection;if(!(e.state.selection instanceof I)||rt+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=qg(this.node.content,o,r-t,s-t);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:s}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Bg(this,i,t,s);e.input.compositionNodes.push(o),this.children=So(this.children,r,r+s.length,e,o)}update(e,t,r,s){return this.dirty==Ye||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,s),!0)}updateInner(e,t,r,s){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=Be}updateOuterDeco(e){if(ks(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Md(this.dom,this.nodeDOM,xo(this.outerDeco,this.node,t),xo(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ha(n,e,t,r,s){Ad(r,e,n);let i=new wt(void 0,n,e,t,r,r,r,s,0);return i.contentDOM&&i.updateChildren(s,0),i}class ci extends wt{constructor(e,t,r,s,i,o,l){super(e,t,r,s,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,s){return this.dirty==Ye||this.dirty!=Be&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Be||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=e,this.dirty=Be,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let s=this.node.cut(e,t),i=document.createTextNode(s.text);return new ci(this.parent,s,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ye)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Cd extends Or{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Be&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class $g extends wt{constructor(e,t,r,s,i,o,l,a,c,u){super(e,t,r,s,i,o,l,c,u),this.spec=a}update(e,t,r,s){if(this.dirty==Ye)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,s),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,s){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Td(n,e,t){let r=n.firstChild,s=!1;for(let i=0;i>1,l=Math.min(o,e.length);for(;i-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let u=Kt.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,s){let i=-1,o;if(s>=this.preMatch.index&&(o=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Kt)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(s-1))break;--s,i.set(l,s),o.push(l)}}return{index:s,matched:i,matches:o.reverse()}}function _g(n,e){return n.type.side-e.type.side}function Vg(n,e,t,r){let s=e.locals(n),i=0;if(s.length==0){for(let c=0;ci;)l.push(s[o++]);let p=i+h.nodeSize;if(h.isText){let g=p;o!g.inline):l.slice();r(h,m,e.forChild(i,h),f),i=p}}function Wg(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function qg(n,e,t,r){for(let s=0,i=0;s=t){if(i>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function So(n,e,t,r,s){let i=[];for(let o=0,l=0;o=t||u<=e?i.push(a):(ct&&i.push(a.slice(t-c,a.size,r)))}return i}function ol(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let s=n.docView.nearestDesc(t.focusNode),i=s&&s.size==0,o=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let l=r.resolve(o),a,c;if(ai(t)){for(a=o;s&&!s.node;)s=s.parent;let d=s.node;if(s&&d.isAtom&&R.isSelectable(d)&&s.parent&&!(d.isInline&&kg(t.focusNode,t.focusOffset,s.dom))){let h=s.posBefore;c=new R(o==h?l:r.resolve(h))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=o,h=o;for(let f=0;f{(t.anchorNode!=r||t.anchorOffset!=s)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Nd(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Kg(n){let e=n.domSelection();if(!e)return;let t=n.cursorWrapper.dom,r=t.nodeName=="IMG";r?e.collapse(t.parentNode,ce(t)+1):e.collapse(t,0),!r&&!n.state.selection.visible&&Ne&&St<=11&&(t.disabled=!0,t.disabled=!1)}function Od(n,e){if(e instanceof R){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Ua(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Ua(n)}function Ua(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function ll(n,e,t,r){return n.someProp("createSelectionBetween",s=>s(n,e,t))||I.between(e,t,r)}function Ka(n){return n.editable&&!n.hasFocus()?!1:Rd(n)}function Rd(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Jg(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Ut(e.node,e.offset,t.anchorNode,t.anchorOffset)}function wo(n,e){let{$anchor:t,$head:r}=n.selection,s=e>0?t.max(r):t.min(r),i=s.parent.inlineContent?s.depth?n.doc.resolve(e>0?s.after():s.before()):null:s;return i&&P.findFrom(i,e)}function gt(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Ja(n,e,t){let r=n.state.selection;if(r instanceof I)if(t.indexOf("s")>-1){let{$head:s}=r,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=n.state.doc.resolve(s.pos+i.nodeSize*(e<0?-1:1));return gt(n,new I(r.$anchor,o))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let s=wo(n.state,e);return s&&s instanceof R?gt(n,s):!1}else if(!(Le&&t.indexOf("m")>-1)){let s=r.$head,i=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?s.pos-i.nodeSize:s.pos;return i.isAtom||(o=n.docView.descAt(l))&&!o.contentDOM?R.isSelectable(i)?gt(n,new R(e<0?n.state.doc.resolve(s.pos-i.nodeSize):s)):Nr?gt(n,new I(n.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof R&&r.node.isInline)return gt(n,new I(e>0?r.$to:r.$from));{let s=wo(n.state,e);return s?gt(n,s):!1}}}function bs(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function sr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function nn(n,e){return e<0?Gg(n):Yg(n)}function Gg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s,i,o=!1;for(ze&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(sr(l,-1))s=t,i=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Dd(t))break;{let l=t.previousSibling;for(;l&&sr(l,-1);)s=t.parentNode,i=ce(l),l=l.previousSibling;if(l)t=l,r=bs(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}o?vo(n,t,r):s&&vo(n,s,i)}function Yg(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let s=bs(t),i,o;for(;;)if(r{n.state==s&<(n)},50)}function Ga(n,e){let t=n.state.doc.resolve(e);if(!(oe||yd)&&t.parent.inlineContent){let s=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>s.top&&o1)return i.lefts.top&&o1)return i.left>s.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Ya(n,e,t){let r=n.state.selection;if(r instanceof I&&!r.empty||t.indexOf("s")>-1||Le&&t.indexOf("m")>-1)return!1;let{$from:s,$to:i}=r;if(!s.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let o=wo(n.state,e);if(o&&o instanceof R)return gt(n,o)}if(!s.parent.inlineContent){let o=e<0?s:i,l=r instanceof ot?P.near(o,e):P.findFrom(o,e);return l?gt(n,l):!1}return!1}function Xa(n,e){if(!(n.state.selection instanceof I))return!0;let{$head:t,$anchor:r,empty:s}=n.state.selection;if(!t.sameParent(r))return!0;if(!s)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(i&&!i.isText){let o=n.state.tr;return e<0?o.delete(t.pos-i.nodeSize,t.pos):o.delete(t.pos,t.pos+i.nodeSize),n.dispatch(o),!0}return!1}function Qa(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Zg(n){if(!pe||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Qa(n,r,"true"),setTimeout(()=>Qa(n,r,"false"),20)}return!1}function ey(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function ty(n,e){let t=e.keyCode,r=ey(e);if(t==8||Le&&t==72&&r=="c")return Xa(n,-1)||nn(n,-1);if(t==46&&!e.shiftKey||Le&&t==68&&r=="c")return Xa(n,1)||nn(n,1);if(t==13||t==27)return!0;if(t==37||Le&&t==66&&r=="c"){let s=t==37?Ga(n,n.state.selection.from)=="ltr"?-1:1:-1;return Ja(n,s,r)||nn(n,s)}else if(t==39||Le&&t==70&&r=="c"){let s=t==39?Ga(n,n.state.selection.from)=="ltr"?1:-1:1;return Ja(n,s,r)||nn(n,s)}else{if(t==38||Le&&t==80&&r=="c")return Ya(n,-1,r)||nn(n,-1);if(t==40||Le&&t==78&&r=="c")return Zg(n)||Ya(n,1,r)||nn(n,1);if(r==(Le?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function al(n,e){n.someProp("transformCopied",f=>{e=f(e,n)});let t=[],{content:r,openStart:s,openEnd:i}=e;for(;s>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,i--;let f=r.firstChild;t.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let o=n.someProp("clipboardSerializer")||Xt.fromSchema(n.state.schema),l=$d(),a=l.createElement("div");a.appendChild(o.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=Bd[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=l.createElement(u[f]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${s} ${i}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",f=>f(e,n))||e.content.textBetween(0,e.content.size,` -`);return{dom:a,text:h,slice:e}}function Nd(n,e,t,r,s){let i=s.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(r||i||!t);if(a){if(n.someProp("transformPastedText",h=>{e=h(e,i||r,n)}),i)return l=new A(w.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0),n.someProp("transformPasted",h=>{l=h(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",h=>h(e,s,r,n));if(d)l=d;else{let h=s.marks(),{schema:f}=n.state,p=Kt.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=Yg(t),Cr&&Xg(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Xn.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!Kg.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=Qg(Ga(l,+u[1],+u[2]),u[4]);else if(l=A.maxOpen(Jg(l.content,s),!0),l.openStart||l.openEnd){let d=0,h=0;for(let f=l.content.firstChild;d{l=d(l,n,a)}),l}const Kg=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Jg(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),i,o=[];if(n.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Rd(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=Id(o[o.length-1],i.length));let u=Od(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return w.from(o)}return n}function Od(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,w.from(n));return n}function Rd(n,e,t,r,s){if(s1&&(i=0),s=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(w.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Ga(n,e,t){return et})),Mi.createHTML(n)):n}function Yg(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Ld().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),s;if((s=r&&Dd[r[1].toLowerCase()])&&(n=s.map(i=>"<"+i+">").join("")+n+s.map(i=>"").reverse().join("")),t.innerHTML=Gg(n),s)for(let i=0;i=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=w.from(a.create(r[l+1],s)),i++,o++}return new A(s,i,o)}const ve={},Ee={},Zg={touchstart:!0,touchmove:!0};class ey{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function ty(n){for(let e in ve){let t=ve[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{ry(n,r)&&!il(n,r)&&(n.editable||!(r.type in Ee))&&t(n,r)},Zg[e]?{passive:!0}:void 0)}pe&&n.dom.addEventListener("input",()=>null),So(n)}function et(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function ny(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function So(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>il(n,r))})}function il(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function ry(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function sy(n,e){!il(n,e)&&ve[e.type]&&(n.editable||!(e.type in Ee))&&ve[e.type](n,e)}Ee.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!$d(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Ze&&oe&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),gn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",s=>s(n,Mt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Ug(n,t)?t.preventDefault():et(n,"key")};Ee.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ee.keypress=(n,e)=>{let t=e;if($d(n)||!t.charCode||t.ctrlKey&&!t.altKey||Re&&t.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof P)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(t.charCode),i=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,s,i))&&n.dispatch(i()),t.preventDefault()}};function Mr(n){return{left:n.clientX,top:n.clientY}}function iy(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function ol(n,e,t,r,s){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(n.someProp(e,l=>o>i.depth?l(n,t,i.nodeAfter,i.before(o),s,!0):l(n,t,i.node(o),i.before(o),s,!1)))return!0;return!1}function Ar(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function oy(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&I.isSelectable(r)?(Ar(n,new I(t)),!0):!1}function ly(n,e){if(e==-1)return!1;let t=n.state.selection,r,s;t instanceof I&&(r=t.node);let i=n.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(I.isSelectable(l)){r&&t.$from.depth>0&&o>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?s=i.before(t.$from.depth):s=i.before(o);break}}return s!=null?(Ar(n,I.create(n.state.doc,s)),!0):!1}function ay(n,e,t,r,s){return ol(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(s?ly(n,t):oy(n,t))}function cy(n,e,t,r){return ol(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",s=>s(n,e,r))}function uy(n,e,t,r){return ol(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",s=>s(n,e,r))||dy(n,t,r)}function dy(n,e,t){if(t.button!=0)return!1;let r=Pd(n,e,!0),s=n.state.doc;return r?(Ar(n,r),r instanceof P&&s.eq(n.state.doc)&&(n.input.mouseDown=new fy(n,r)),!0):!1}function Pd(n,e,t){let r=n.state.doc;if(e==-1)return r.inlineContent?P.create(r,0,r.content.size):null;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)return P.create(r,l+1,l+1+o.content.size);if(t&&I.isSelectable(o))return I.create(r,l)}return null}function ll(n){return ms(n)}const zd=Re?"metaKey":"ctrlKey";ve.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=ll(n),s=Date.now(),i="singleClick";s-n.input.lastClick.time<500&&iy(t,n.input.lastClick)&&!t[zd]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:i,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(Mr(t));o&&(i=="singleClick"?n.input.mouseDown=new hy(n,o,t,!!r):(i=="doubleClick"?cy:uy)(n,o.pos,o.inside,t)?t.preventDefault():et(n,"pointer"))};class Bd{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class hy extends Bd{constructor(e,t,r,s){super(e),this.pos=t,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[zd],this.allowDefault=r.shiftKey;let i,o;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof I&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&De&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),et(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||rt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Mr(e))),this.updateAllowDefault(e),this.allowDefault||!t?et(this.view,"pointer"):ay(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pe&&this.mightDrag&&!this.mightDrag.node.isAtom||oe&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Ar(this.view,z.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):et(this.view,"pointer")}move(e){this.updateAllowDefault(e),et(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class fy extends Bd{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),et(this.view,"pointer");let t=this.view.posAtCoords(Mr(e)),r=t&&Pd(this.view,t.inside,!1);if(!r)return;let{doc:s}=this.view.state,i=this.startSelection,[o,l]=r.from{n.input.lastTouch=Date.now(),ll(n),et(n,"pointer")};ve.touchmove=n=>{n.input.lastTouch=Date.now(),et(n,"pointer")};ve.contextmenu=n=>ll(n);function $d(n,e){return n.composing?!0:pe&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const py=Ze?5e3:-1;Ee.compositionstart=Ee.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof P&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||oe&&fd&&my(n)))n.markCursor=n.state.storedMarks||t.marks(),ms(n,!0),n.markCursor=null;else if(ms(n,!e.selection.empty),De&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}n.input.composing=!0}Fd(n,py)};function my(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}Ee.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Fd(n,20))};function Fd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>ms(n),e))}function Hd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function gy(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=lg(e.focusNode,e.focusOffset),r=ag(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let s=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return r}}return t||r}function ms(n,e=!1){if(!(Ze&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Hd(n),e||n.docView&&n.docView.dirty){let t=nl(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function yy(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const fr=Me&&yt<15||gn&&hg<604;ve.copy=Ee.cut=(n,e)=>{let t=e,r=n.state.selection,s=t.type=="cut";if(r.empty)return;let i=fr?null:t.clipboardData,o=r.content(),{dom:l,text:a}=sl(n,o);i?(t.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):yy(n,l),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function ky(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function by(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?pr(n,r.value,null,s,e):pr(n,r.textContent,r.innerHTML,s,e)},50)}function pr(n,e,t,r,s){let i=Nd(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,s,i||A.empty)))return!0;if(!i)return!1;let o=ky(i),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function _d(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ee.paste=(n,e)=>{let t=e;if(n.composing&&!Ze)return;let r=fr?null:t.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&pr(n,_d(r),r.getData("text/html"),s,t)?t.preventDefault():by(n,t)};class jd{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const xy=Re?"altKey":"ctrlKey";function Vd(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[xy]}ve.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s=n.state.selection,i=s.empty?null:n.posAtCoords(Mr(t)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof I?s.to-1:s.to))){if(r&&r.mightDrag)o=I.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=I.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=sl(n,l);(!t.dataTransfer.files.length||!oe||hd>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(fr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",fr||t.dataTransfer.setData("text/plain",c),n.dragging=new jd(u,Vd(n,t),o)};ve.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ee.dragover=Ee.dragenter=(n,e)=>e.preventDefault();Ee.drop=(n,e)=>{try{Sy(n,e,n.dragging)}finally{n.dragging=null}};function Sy(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(Mr(e));if(!r)return;let s=n.state.doc.resolve(r.pos),i=t&&t.slice;i?n.someProp("transformPasted",f=>{i=f(i,n,!1)}):i=Nd(n,_d(e.dataTransfer),fr?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(t&&Vd(n,e));if(n.someProp("handleDrop",f=>f(n,e,i||A.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?Fu(n.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=n.state.tr;if(o){let{node:f}=t;f?f.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(d))return;let h=a.doc.resolve(c);if(u&&I.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new I(h));else{let f=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),a.setSelection(rl(n,h,a.doc.resolve(f)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}ve.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&rt(n)},20))};ve.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};ve.beforeinput=(n,e)=>{if(oe&&Ze&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Mt(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in Ee)ve[n]=Ee[n];function mr(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class gs{constructor(e,t){this.toDOM=e,this.spec=t||zt,this.side=this.spec.side||0}map(e,t,r,s){let{pos:i,deleted:o}=e.mapResult(t.from+s,this.side<0?-1:1);return o?null:new Se(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof gs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&mr(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class bt{constructor(e,t){this.attrs=e,this.spec=t||zt}map(e,t,r,s){let i=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new Se(i,o,this)}valid(e,t){return t.from=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,s+l,i)}}map(e,t,r){return this==he||e.maps.length==0?this:this.mapInner(e,t,0,0,r||zt)}mapInner(e,t,r,s,i){let o;for(let l=0;l{let c=a+r,u;if(u=qd(t,l,c)){for(s||(s=this.children.slice());il&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+t.content.size;for(let l=0;li&&a.type instanceof bt){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;cs.map(e,t,zt));return mt.from(r)}forChild(e,t){if(t.isLeaf)return K.empty;let r=[];for(let s=0;st instanceof K)?e:e.reduce((t,r)=>t.concat(r instanceof K?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(f-h);for(let y=0;yx+u-d)continue;let C=l[y]+u-d;f>=C?l[y+1]=h<=C?-2:-1:h>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let h=t.map(n[c+1]+i,-1),f=h-s,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==f){let y=l[c+2].mapInner(t,g,u+1,n[c]+i+1,o);y!=he?(l[c]=d,l[c+1]=f,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=vy(l,n,e,t,s,i,o),u=ys(c,r,0,o);e=u.local;for(let d=0;dt&&o.to{let c=qd(n,l,a+t);if(c){i=!0;let u=ys(c,l,t+a+1,r);u!=he&&s.push(a,a+l.nodeSize,u)}});let o=Wd(i?Ud(n):n,-t).sort(Bt);for(let l=0;l0;)e++;n.splice(e,0,t)}function Ai(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=he&&e.push(r)}),n.cursorWrapper&&e.push(K.create(n.state.doc,[n.cursorWrapper.deco])),mt.from(e)}const Ey={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Cy=Me&&yt<=11;class Ty{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class My{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ty,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;ss.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():pe&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Cy&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ey)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Va(this.view)){if(this.suppressingSelectionUpdates)return rt(this.view);if(Me&&yt<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&jt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=mn(i))t.add(i);for(let i=e.anchorNode;i;i=mn(i))if(t.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Va(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||oe&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(De&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,h]=u;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of u){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||Oy(e,d)!=f)&&h.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||s)&&(i>-1&&(e.docView.markDirty(i,o),Ay(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Ry(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||rt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;us;g--){let y=r.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){i=g;break}if(!x||x.size)break}let d=n.state.doc,h=n.someProp("domParser")||Xn.fromSchema(n.state.schema),f=d.resolve(o),p=null,m=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Dy,context:f});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+o,head:y+o}}return{doc:m,sel:p,from:o,to:l}}function Dy(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(pe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||pe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Ly=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Py(n,e,t,r,s){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let T=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,L=nl(n,T);if(L&&!n.state.selection.eq(L)){if(oe&&Ze&&n.input.lastKeyCode===13&&Date.now()-100$(n,Mt(13,"Enter"))))return;let O=n.state.tr.setSelection(L);T=="pointer"?O.setMeta("pointer",!0):T=="key"&&O.scrollIntoView(),i&&O.setMeta("composition",i),n.dispatch(O)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Iy(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),h,f;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Ze)&&s.some(T=>T.nodeType==1&&!Ly.test(T.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",T=>T(n,Mt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof P&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let T=tc(n,n.state.doc,c.sel);if(T&&!T.eq(n.state.selection)){let L=n.state.tr.setSelection(T);i&&L.setMeta("composition",i),n.dispatch(L)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),Me&&yt<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((gn&&n.input.lastIOSEnter>Date.now()-225&&(!x||s.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!x&&m.posT(n,Mt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&By(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",T=>T(n,Mt(8,"Backspace")))){Ze&&oe&&n.domObserver.suppressSelectionUpdates();return}oe&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),Ze&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(T){return T(n,Mt(13,"Enter"))})},20));let C=p.start,v=p.endA,k=T=>{let L=T||n.state.tr.replace(C,v,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let O=tc(n,L.doc,c.sel);O&&!(oe&&n.composing&&O.empty&&(p.start!=p.endB||n.input.lastChromeDeletert(n),20));let T=k(n.state.tr.delete(C,v)),L=u.resolve(p.start).marksAcross(u.resolve(p.endA));L&&T.ensureMarks(L),n.dispatch(T)}else if(p.endA==p.endB&&(M=zy(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let T=k(n.state.tr);M.type=="add"?T.addMark(C,v,M.mark):T.removeMark(C,v,M.mark),n.dispatch(T)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let T=m.parent.textBetween(m.parentOffset,g.parentOffset),L=()=>k(n.state.tr.insertText(T,C,v));n.someProp("handleTextInput",O=>O(n,C,v,T,L))||n.dispatch(L())}else n.dispatch(k());else n.dispatch(k())}function tc(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:rl(n,e.resolve(t.anchor),e.resolve(t.head))}function zy(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,s=t,i=r,o,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||Ni(o,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,s++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function $y(n,e,t,r,s){let i=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(i==null)return null;let{a,b:c}=n.findDiffEnd(e,o,l);if(s=="end"){let u=Math.max(0,i-Math.min(a,c));r-=a+u-i}if(a=a?i-r:0;i-=u,c=i+(c-a),a=i}else if(c=c?i-r:0;i-=u,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}class Kd{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ey,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(oc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=sc(this),rc(this),this.nodeViews=ic(this),this.docView=Ba(this.state.doc,nc(this),Ai(this),this.dom,this),this.domObserver=new My(this,(r,s,i,o)=>Py(this,r,s,i,o)),this.domObserver.start(),ty(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&So(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Hd(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=ic(this);Hy(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&So(this),this.editable=sc(this),rc(this);let a=Ai(this),c=nc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(s.selection))&&(o=!0);let h=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&mg(this);if(o){this.domObserver.stop();let f=d&&(Me||oe)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Fy(s.selection,e.selection);if(d){let m=oe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=gy(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Ba(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}let p=this.input.mouseDown;f||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Fg(this)&&p.delaySelUpdate())?rt(this,f):(Td(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&gg(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof I){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Ra(this,t.getBoundingClientRect(),e)}else Ra(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&it.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return wg(this,e)}coordsAtPos(e,t=1){return kd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let s=this.docView.posFromDOM(e,t,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,t){return Mg(this,t||this.state,e)}pasteHTML(e,t){return pr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return pr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return sl(this,e)}destroy(){this.docView&&(ny(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ai(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ig())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return sy(this,e)}domSelectionRange(){let e=this.domSelection();return e?pe&&this.root.nodeType===11&&ug(this.dom.ownerDocument)==this.dom&&Ny(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Kd.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function nc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Se.node(0,n.state.doc.content.size,e)]}function rc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Se.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function sc(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Fy(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function ic(n){let e=Object.create(null);function t(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function Hy(n,e){let t=0,r=0;for(let s in n){if(n[s]!=e[s])return!0;t++}for(let s in e)r++;return t!=r}function oc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var xt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ks={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},_y=typeof navigator<"u"&&/Mac/.test(navigator.platform),jy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ue=0;ue<10;ue++)xt[48+ue]=xt[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)xt[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)xt[ue]=String.fromCharCode(ue+32),ks[ue]=String.fromCharCode(ue);for(var Oi in xt)ks.hasOwnProperty(Oi)||(ks[Oi]=xt[Oi]);function Vy(n){var e=_y&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||jy&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ks:xt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Wy=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),qy=typeof navigator<"u"&&/Win/.test(navigator.platform);function Uy(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,s,i,o;for(let l=0;l{for(var t in e)Gy(n,t,{get:e[t],enumerable:!0})};function ii(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:s}=t,{storedMarks:i}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=t.selection,s=t.doc,i=t.storedMarks,t}}}var oi=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:s}=t,i=this.buildProps(s);return Object.fromEntries(Object.entries(n).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:i}=r,o=[],l=!!n,a=n||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(t).map(([d,h])=>[d,(...p)=>{const m=this.buildProps(a,e),g=h(...p)(m);return o.push(g),u}])),run:c};return u}createCan(n){const{rawCommands:e,state:t}=this,r=!1,s=n||t.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:i}=r,o={tr:n,editor:r,view:i,state:ii({state:s,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},Gd={};ul(Gd,{blur:()=>Yy,clearContent:()=>Xy,clearNodes:()=>Qy,command:()=>Zy,createParagraphNear:()=>ek,cut:()=>tk,deleteCurrentNode:()=>nk,deleteNode:()=>rk,deleteRange:()=>sk,deleteSelection:()=>lk,enter:()=>ak,exitCode:()=>ck,extendMarkRange:()=>uk,first:()=>dk,focus:()=>fk,forEach:()=>pk,insertContent:()=>mk,insertContentAt:()=>kk,joinBackward:()=>Sk,joinDown:()=>xk,joinForward:()=>wk,joinItemBackward:()=>vk,joinItemForward:()=>Ek,joinTextblockBackward:()=>Ck,joinTextblockForward:()=>Tk,joinUp:()=>bk,keyboardShortcut:()=>Ak,lift:()=>Nk,liftEmptyBlock:()=>Ok,liftListItem:()=>Rk,newlineInCode:()=>Ik,resetAttributes:()=>Dk,scrollIntoView:()=>Lk,selectAll:()=>Pk,selectNodeBackward:()=>zk,selectNodeForward:()=>Bk,selectParentNode:()=>$k,selectTextblockEnd:()=>Fk,selectTextblockStart:()=>Hk,setContent:()=>_k,setMark:()=>cb,setMeta:()=>ub,setNode:()=>db,setNodeSelection:()=>hb,setTextDirection:()=>fb,setTextSelection:()=>pb,sinkListItem:()=>mb,splitBlock:()=>gb,splitListItem:()=>yb,toggleList:()=>bb,toggleMark:()=>xb,toggleNode:()=>Sb,toggleWrap:()=>wb,undoInputRule:()=>vb,unsetAllMarks:()=>Eb,unsetMark:()=>Cb,unsetTextDirection:()=>Tb,updateAttributes:()=>Mb,wrapIn:()=>Ab,wrapInList:()=>Nb});var Yy=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),Xy=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),Qy=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:s}=r;return t&&s.forEach(({$from:i,$to:o})=>{n.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),h=c.resolve(u.map(a+l.nodeSize)),f=d.blockRange(h);if(!f)return;const p=En(f);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,m)}(p||p===0)&&e.lift(f,p)})}),!0},Zy=n=>e=>n(e),ek=()=>({state:n,dispatch:e})=>ld(n,e),tk=(n,e)=>({editor:t,tr:r})=>{const{state:s}=t,i=s.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new P(r.doc.resolve(Math.max(o-1,0)))),!0},nk=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const s=n.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);n.delete(l,a).scrollIntoView()}return!0}return!1};function te(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var rk=n=>({tr:e,state:t,dispatch:r})=>{const s=te(n,t.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},sk=n=>({tr:e,dispatch:t})=>{const{from:r,to:s}=n;return t&&e.delete(r,s),!0},ik=n=>n.content?/^text(\*|\+)/.test(n.content):!1,lc=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos{const r=lc(n,t,"left"),s=lc(e,t,"right");return{from:r,to:s}},lk=()=>({state:n,dispatch:e})=>{const{$from:t,$to:r}=n.selection;if(n.selection.empty)return!1;const{from:s,to:i}=ok(t,r,n.schema);return e&&(n.tr.deleteRange(s,i).scrollIntoView(),e(n.tr)),!0},ak=()=>({commands:n})=>n.keyboardShortcut("Enter"),ck=()=>({state:n,dispatch:e})=>Wm(n,e);function dl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function bs(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>t.strict?e[s]===n[s]:dl(e[s])?e[s].test(n[s]):e[s]===n[s]):!0}function Yd(n,e,t={}){return n.find(r=>r.type===e&&bs(Object.fromEntries(Object.keys(t).map(s=>[s,r.attrs[s]])),t))}function ac(n,e,t={}){return!!Yd(n,e,t)}function hl(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!t){const c=r.node.marks.find(u=>u.type===e);c&&(t=c.attrs)}if(!Yd([...r.node.marks],e,t))return;let i=r.index,o=n.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&ac([...n.parent.child(i-1).marks],e,t);)i-=1,o-=n.parent.child(i).nodeSize;for(;l({tr:t,state:r,dispatch:s})=>{const i=it(n,r.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:u}=l;if(s){const d=hl(a,i,e);if(d&&d.from<=c&&d.to>=u){const h=P.create(o,d.from,d.to);t.setSelection(h)}}return!0},dk=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(gr()||wo())&&r.dom.focus(),hk()&&!gr()&&!wo()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(i&&n===null&&!fl(t.state.selection))return o(),!0;const l=Xd(s.doc,n)||t.state.selection,a=t.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},pk=(n,e)=>t=>n.every((r,s)=>e(r,{...t,index:s})),mk=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),Qd=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&Qd(r)}return n};function Lr(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return Qd(t)}function yr(n,e,t){if(n instanceof gt||n instanceof w)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,s=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return w.fromArray(n.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(n);return t.errorOnInvalidContent&&o.check(),o}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),yr("",e,t)}if(s){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Au({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Xn.fromSchema(a).parseSlice(Lr(n),t.parseOptions):Xn.fromSchema(a).parse(Lr(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=Xn.fromSchema(e);return t.slice?i.parseSlice(Lr(n),t.parseOptions).content:i.parse(Lr(n),t.parseOptions)}return yr("",e,t)}function gk(n,e,t){const r=n.steps.length-1;if(r{o===0&&(o=u)}),n.setSelection(z.near(n.doc.resolve(o),t))}var yk=n=>!("type"in n),kk=(n,e,t)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){t={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{yr(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=yr(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(g){return a(g),!1}let{from:u,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,f=!0;if((yk(l)?l:[l]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),u===d&&f){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let m;if(h){if(Array.isArray(e))m=e.map(g=>g.text||"").join("");else if(e instanceof w){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,u,d)}else{m=l;const g=r.doc.resolve(u),y=g.node(),x=g.parentOffset===0,C=y.isText||y.isTextblock,v=y.content.size>0;x&&C&&v&&f&&(u=Math.max(0,u-1)),r.replaceWith(u,d,m)}t.updateSelection&&gk(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:m}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:m})}return!0},bk=()=>({state:n,dispatch:e})=>_m(n,e),xk=()=>({state:n,dispatch:e})=>jm(n,e),Sk=()=>({state:n,dispatch:e})=>ed(n,e),wk=()=>({state:n,dispatch:e})=>sd(n,e),vk=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ti(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Ek=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ti(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Ck=()=>({state:n,dispatch:e})=>Fm(n,e),Tk=()=>({state:n,dispatch:e})=>Hm(n,e);function Zd(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Mk(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,s,i,o;for(let l=0;l({editor:e,view:t,tr:r,dispatch:s})=>{const i=Mk(n).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function St(n,e,t={}){const{from:r,to:s,empty:i}=n.selection,o=e?te(e,n.schema):null,l=[];n.doc.nodesBetween(r,s,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(s,h+d.nodeSize);l.push({node:d,from:f,to:p})});const a=s-r,c=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>bs(d.node.attrs,t,{strict:!1}));return i?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=a}var Nk=(n,e={})=>({state:t,dispatch:r})=>{const s=te(n,t.schema);return St(t,s,e)?Vm(t,r):!1},Ok=()=>({state:n,dispatch:e})=>ad(n,e),Rk=n=>({state:e,dispatch:t})=>{const r=te(n,e.schema);return tg(r)(e,t)},Ik=()=>({state:n,dispatch:e})=>od(n,e);function li(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function cc(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,s)=>(t.includes(s)||(r[s]=n[s]),r),{})}var Dk=(n,e)=>({tr:t,state:r,dispatch:s})=>{let i=null,o=null;const l=li(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=te(n,r.schema)),l==="mark"&&(o=it(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{i&&i===u.type&&(a=!0,s&&t.setNodeMarkup(d,void 0,cc(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&(a=!0,s&&t.addMark(d,d+u.nodeSize,o.create(cc(h.attrs,e))))})})}),a},Lk=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Pk=()=>({tr:n,dispatch:e})=>{if(e){const t=new nt(n.doc);n.setSelection(t)}return!0},zk=()=>({state:n,dispatch:e})=>nd(n,e),Bk=()=>({state:n,dispatch:e})=>id(n,e),$k=()=>({state:n,dispatch:e})=>Km(n,e),Fk=()=>({state:n,dispatch:e})=>Ym(n,e),Hk=()=>({state:n,dispatch:e})=>Gm(n,e);function vo(n,e,t={},r={}){return yr(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}var _k=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=vo(n,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return o&&i.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function eh(n,e){const t=it(e,n.schema),{from:r,to:s,empty:i}=n.selection,o=[];i?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function th(n,e){const t=new Uu(n);return e.forEach(r=>{r.steps.forEach(s=>{t.step(s)})}),t}function jk(n){for(let e=0;e{t(s)&&r.push({node:s,pos:i})}),r}function Wk(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function ai(n){return e=>Wk(e.$from,n)}function R(n,e,t){return n.config[e]===void 0&&n.parent?R(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?R(n.parent,e,t):null}):n.config[e]}function pl(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},r=R(e,"addExtensions",t);return r?[e,...pl(r())]:e}).flat(10)}function ml(n,e){const t=Kt.fromSchema(e).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}function nh(n){return typeof n=="function"}function j(n,e=void 0,...t){return nh(n)?e?n.bind(e)(...t):n(...t):n}function qk(n={}){return Object.keys(n).length===0&&n.constructor===Object}function yn(n){const e=n.filter(s=>s.type==="extension"),t=n.filter(s=>s.type==="node"),r=n.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function rh(n){const e=[],{nodeExtensions:t,markExtensions:r}=yn(n),s=[...t,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return n.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},d=R(c,"addGlobalAttributes",u);if(!d)return;d().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=a:f.types==="nodes"?p=o:f.types==="marks"?p=l:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{e.push({type:m,name:g,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},d=R(c,"addAttributes",u);if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...i,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:c.name,name:f,attribute:m})})}),e}function Uk(n){const e=[];let t="",r=!1,s=!1,i=0;const o=n.length;for(let l=0;l0){i-=1,t+=a;continue}if(a===";"&&i===0){e.push(t),t="";continue}}t+=a}return t&&e.push(t),e}function uc(n){const e=[],t=Uk(n||""),r=t.length;for(let s=0;s!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...uc(r[s]),...uc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function kn(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>J(t,r),{})}function Kk(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function dc(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):Kk(t.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function hc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&qk(t)?!1:t!=null))}function fc(n){var e,t;const r={};return!((e=n==null?void 0:n.attribute)!=null&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(r.default=n.attribute.default),((t=n==null?void 0:n.attribute)==null?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function Jk(n,e){var t;const r=rh(n),{nodeExtensions:s,markExtensions:i}=yn(n),o=(t=s.find(c=>R(c,"topNode")))==null?void 0:t.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=n.reduce((y,x)=>{const C=R(x,"extendNodeSchema",d);return{...y,...C?C(c):{}}},{}),f=hc({...h,content:j(R(c,"content",d)),marks:j(R(c,"marks",d)),group:j(R(c,"group",d)),inline:j(R(c,"inline",d)),atom:j(R(c,"atom",d)),selectable:j(R(c,"selectable",d)),draggable:j(R(c,"draggable",d)),code:j(R(c,"code",d)),whitespace:j(R(c,"whitespace",d)),linebreakReplacement:j(R(c,"linebreakReplacement",d)),defining:j(R(c,"defining",d)),isolating:j(R(c,"isolating",d)),attrs:Object.fromEntries(u.map(fc))}),p=j(R(c,"parseHTML",d));p&&(f.parseDOM=p.map(y=>dc(y,u)));const m=R(c,"renderHTML",d);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:kn(y,u)}));const g=R(c,"renderText",d);return g&&(f.toText=g),[c.name,f]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=n.reduce((g,y)=>{const x=R(y,"extendMarkSchema",d);return{...g,...x?x(c):{}}},{}),f=hc({...h,inclusive:j(R(c,"inclusive",d)),excludes:j(R(c,"excludes",d)),group:j(R(c,"group",d)),spanning:j(R(c,"spanning",d)),code:j(R(c,"code",d)),attrs:Object.fromEntries(u.map(fc))}),p=j(R(c,"parseHTML",d));p&&(f.parseDOM=p.map(g=>dc(g,u)));const m=R(c,"renderHTML",d);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:kn(g,u)})),[c.name,f]}));return new Au({topNode:o,nodes:l,marks:a})}function Gk(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function tr(n){return n.sort((t,r)=>{const s=R(t,"priority")||100,i=R(r,"priority")||100;return s>i?-1:sr.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function ih(n,e,t){const{from:r,to:s}=e,{blockSeparator:i=` +`);return{dom:a,text:h,slice:e}}function Id(n,e,t,r,s){let i=s.parent.type.spec.code,o,l;if(!t&&!e)return null;let a=!!e&&(r||i||!t);if(a){if(n.someProp("transformPastedText",h=>{e=h(e,i||r,n)}),i)return l=new N(w.from(n.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0),n.someProp("transformPasted",h=>{l=h(l,n,!0)}),l;let d=n.someProp("clipboardTextParser",h=>h(e,s,r,n));if(d)l=d;else{let h=s.marks(),{schema:f}=n.state,p=Xt.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(f.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=iy(t),Nr&&oy(o);let c=o&&o.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||tr.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!!(a||u),context:s,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!ny.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)l=ly(Za(l,+u[1],+u[2]),u[4]);else if(l=N.maxOpen(ry(l.content,s),!0),l.openStart||l.openEnd){let d=0,h=0;for(let f=l.content.firstChild;d{l=d(l,n,a)}),l}const ny=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ry(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let s=e.node(t).contentMatchAt(e.index(t)),i,o=[];if(n.forEach(l=>{if(!o)return;let a=s.findWrapping(l.type),c;if(!a)return o=null;if(c=o.length&&i.length&&Pd(a,i,l,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=zd(o[o.length-1],i.length));let u=Ld(l,a);o.push(u),s=s.matchType(u.type),i=a}}),o)return w.from(o)}return n}function Ld(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,w.from(n));return n}function Pd(n,e,t,r,s){if(s1&&(i=0),s=t&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=s).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(w.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,o.copy(l))}function Za(n,e,t){return et})),Ri.createHTML(n)):n}function iy(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=$d().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),s;if((s=r&&Bd[r[1].toLowerCase()])&&(n=s.map(i=>"<"+i+">").join("")+n+s.map(i=>"").reverse().join("")),t.innerHTML=sy(n),s)for(let i=0;i=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;s=w.from(a.create(r[l+1],s)),i++,o++}return new N(s,i,o)}const ve={},Ee={},ay={touchstart:!0,touchmove:!0};class cy{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function uy(n){for(let e in ve){let t=ve[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{hy(n,r)&&!cl(n,r)&&(n.editable||!(r.type in Ee))&&t(n,r)},ay[e]?{passive:!0}:void 0)}pe&&n.dom.addEventListener("input",()=>null),Co(n)}function st(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function dy(n){n.input.mouseDown&&n.input.mouseDown.done(),n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Co(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>cl(n,r))})}function cl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function hy(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function fy(n,e){!cl(n,e)&&ve[e.type]&&(n.editable||!(e.type in Ee))&&ve[e.type](n,e)}Ee.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!_d(n)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(rt&&oe&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),xn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",s=>s(n,Rt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||ty(n,t)?t.preventDefault():st(n,"key")};Ee.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ee.keypress=(n,e)=>{let t=e;if(_d(n)||!t.charCode||t.ctrlKey&&!t.altKey||Le&&t.metaKey)return;if(n.someProp("handleKeyPress",s=>s(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof I)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(t.charCode),i=()=>n.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,s,i))&&n.dispatch(i()),t.preventDefault()}};function Rr(n){return{left:n.clientX,top:n.clientY}}function py(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function ul(n,e,t,r,s){if(r==-1)return!1;let i=n.state.doc.resolve(r);for(let o=i.depth+1;o>0;o--)if(n.someProp(e,l=>o>i.depth?l(n,t,i.nodeAfter,i.before(o),s,!0):l(n,t,i.node(o),i.before(o),s,!1)))return!0;return!1}function Dr(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function my(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&R.isSelectable(r)?(Dr(n,new R(t)),!0):!1}function gy(n,e){if(e==-1)return!1;let t=n.state.selection,r,s;t instanceof R&&(r=t.node);let i=n.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(R.isSelectable(l)){r&&t.$from.depth>0&&o>=t.$from.depth&&i.before(t.$from.depth+1)==t.$from.pos?s=i.before(t.$from.depth):s=i.before(o);break}}return s!=null?(Dr(n,R.create(n.state.doc,s)),!0):!1}function yy(n,e,t,r,s){return ul(n,"handleClickOn",e,t,r)||n.someProp("handleClick",i=>i(n,e,r))||(s?gy(n,t):my(n,t))}function ky(n,e,t,r){return ul(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",s=>s(n,e,r))}function by(n,e,t,r){return ul(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",s=>s(n,e,r))||xy(n,t,r)}function xy(n,e,t){if(t.button!=0)return!1;let r=Fd(n,e,!0),s=n.state.doc;return r?(Dr(n,r),r instanceof I&&s.eq(n.state.doc)&&(n.input.mouseDown=new wy(n,r)),!0):!1}function Fd(n,e,t){let r=n.state.doc;if(e==-1)return r.inlineContent?I.create(r,0,r.content.size):null;let s=r.resolve(e);for(let i=s.depth+1;i>0;i--){let o=i>s.depth?s.nodeAfter:s.node(i),l=s.before(i);if(o.inlineContent)return I.create(r,l+1,l+1+o.content.size);if(t&&R.isSelectable(o))return R.create(r,l)}return null}function dl(n){return xs(n)}const jd=Le?"metaKey":"ctrlKey";ve.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=dl(n),s=Date.now(),i="singleClick";s-n.input.lastClick.time<500&&py(t,n.input.lastClick)&&!t[jd]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:s,x:t.clientX,y:t.clientY,type:i,button:t.button},n.input.mouseDown&&n.input.mouseDown.done();let o=n.posAtCoords(Rr(t));o&&(i=="singleClick"?n.input.mouseDown=new Sy(n,o,t,!!r):(i=="doubleClick"?ky:by)(n,o.pos,o.inside,t)?t.preventDefault():st(n,"pointer"))};class Hd{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class Sy extends Hd{constructor(e,t,r,s){super(e),this.pos=t,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!r[jd],this.allowDefault=r.shiftKey;let i,o;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let u=e.state.doc.resolve(t.pos);i=u.parent,o=u.depth?u.before():0}const l=s?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.nodeDOM.nodeType==1?a.nodeDOM:null;let{selection:c}=e.state;r.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof R&&c.from<=o&&c.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ze&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),st(e,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||lt(this.view)})}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Rr(e))),this.updateAllowDefault(e),this.allowDefault||!t?st(this.view,"pointer"):yy(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||pe&&this.mightDrag&&!this.mightDrag.node.isAtom||oe&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Dr(this.view,P.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):st(this.view,"pointer")}move(e){this.updateAllowDefault(e),st(this.view,"pointer"),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class wy extends Hd{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),st(this.view,"pointer");let t=this.view.posAtCoords(Rr(e)),r=t&&Fd(this.view,t.inside,!1);if(!r)return;let{doc:s}=this.view.state,i=this.startSelection,[o,l]=r.from{n.input.lastTouch=Date.now(),dl(n),st(n,"pointer")};ve.touchmove=n=>{n.input.lastTouch=Date.now(),st(n,"pointer")};ve.contextmenu=n=>dl(n);function _d(n,e){return n.composing?!0:pe&&Math.abs(Date.now()-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const vy=rt?5e3:-1;Ee.compositionstart=Ee.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof I&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||oe&&yd&&Ey(n)))n.markCursor=n.state.storedMarks||t.marks(),xs(n,!0),n.markCursor=null;else if(xs(n,!e.selection.empty),ze&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let s=r.focusNode,i=r.focusOffset;s&&s.nodeType==1&&i!=0;){let o=i<0?s.lastChild:s.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=n.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else s=o,i=-1}}n.input.composing=!0}Vd(n,vy)};function Ey(n){let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(!e||e.nodeType!=1||t>=e.childNodes.length)return!1;let r=e.childNodes[t];return r.nodeType==1&&r.contentEditable=="false"}Ee.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now(),n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.badSafariComposition?n.domObserver.forceFlush():n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Vd(n,20))};function Vd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>xs(n),e))}function Wd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Date.now());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Cy(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=gg(e.focusNode,e.focusOffset),r=yg(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let s=r.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(t==i||r==i)return i;if(!s||!s.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let o=t.pmViewDesc;if(!(!o||!o.isText(t.nodeValue)))return r}}return t||r}function xs(n,e=!1){if(!(rt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Wd(n),e||n.docView&&n.docView.dirty){let t=ol(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Ty(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const yr=Ne&&St<15||xn&&Sg<604;ve.copy=Ee.cut=(n,e)=>{let t=e,r=n.state.selection,s=t.type=="cut";if(r.empty)return;let i=yr?null:t.clipboardData,o=r.content(),{dom:l,text:a}=al(n,o);i?(t.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",a)):Ty(n,l),s&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function My(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Ay(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?kr(n,r.value,null,s,e):kr(n,r.textContent,r.innerHTML,s,e)},50)}function kr(n,e,t,r,s){let i=Id(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,s,i||N.empty)))return!0;if(!i)return!1;let o=My(i),l=o?n.state.tr.replaceSelectionWith(o,r):n.state.tr.replaceSelection(i);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ee.paste=(n,e)=>{let t=e;if(n.composing&&!rt)return;let r=yr?null:t.clipboardData,s=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&kr(n,qd(r),r.getData("text/html"),s,t)?t.preventDefault():Ay(n,t)};class Ud{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const Ny=Le?"altKey":"ctrlKey";function Kd(n,e){let t;return n.someProp("dragCopies",r=>{t=t||r(e)}),t!=null?!t:!e[Ny]}ve.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let s=n.state.selection,i=s.empty?null:n.posAtCoords(Rr(t)),o;if(!(i&&i.pos>=s.from&&i.pos<=(s instanceof R?s.to-1:s.to))){if(r&&r.mightDrag)o=R.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(o=R.create(n.state.doc,d.posBefore))}}let l=(o||n.state.selection).content(),{dom:a,text:c,slice:u}=al(n,l);(!t.dataTransfer.files.length||!oe||gd>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(yr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",yr||t.dataTransfer.setData("text/plain",c),n.dragging=new Ud(u,Kd(n,t),o)};ve.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ee.dragover=Ee.dragenter=(n,e)=>e.preventDefault();Ee.drop=(n,e)=>{try{Oy(n,e,n.dragging)}finally{n.dragging=null}};function Oy(n,e,t){if(!e.dataTransfer)return;let r=n.posAtCoords(Rr(e));if(!r)return;let s=n.state.doc.resolve(r.pos),i=t&&t.slice;i?n.someProp("transformPasted",f=>{i=f(i,n,!1)}):i=Id(n,qd(e.dataTransfer),yr?null:e.dataTransfer.getData("text/html"),!1,s);let o=!!(t&&Kd(n,e));if(n.someProp("handleDrop",f=>f(n,e,i||N.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?Vu(n.state.doc,s.pos,i):s.pos;l==null&&(l=s.pos);let a=n.state.tr;if(o){let{node:f}=t;f?f.replace(a):a.deleteSelection()}let c=a.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=a.doc;if(u?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(d))return;let h=a.doc.resolve(c);if(u&&R.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new R(h));else{let f=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((p,m,g,y)=>f=y),a.setSelection(ll(n,h,a.doc.resolve(f)))}n.focus(),n.dispatch(a.setMeta("uiEvent","drop"))}ve.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&<(n)},20))};ve.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};ve.beforeinput=(n,e)=>{if(oe&&rt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Rt(8,"Backspace")))))return;let{$cursor:s}=n.state.selection;s&&s.pos>0&&n.dispatch(n.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let n in Ee)ve[n]=Ee[n];function br(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ss{constructor(e,t){this.toDOM=e,this.spec=t||jt,this.side=this.spec.side||0}map(e,t,r,s){let{pos:i,deleted:o}=e.mapResult(t.from+s,this.side<0?-1:1);return o?null:new Se(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ss&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&br(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class vt{constructor(e,t){this.attrs=e,this.spec=t||jt}map(e,t,r,s){let i=e.map(t.from+s,this.spec.inclusiveStart?-1:1)-r,o=e.map(t.to+s,this.spec.inclusiveEnd?1:-1)-r;return i>=o?null:new Se(i,o,this)}valid(e,t){return t.from=e&&(!i||i(l.spec))&&r.push(l.copy(l.from+s,l.to+s))}for(let o=0;oe){let l=this.children[o]+1;this.children[o+2].findInner(e-l,t-l,r,s+l,i)}}map(e,t,r){return this==he||e.maps.length==0?this:this.mapInner(e,t,0,0,r||jt)}mapInner(e,t,r,s,i){let o;for(let l=0;l{let c=a+r,u;if(u=Gd(t,l,c)){for(s||(s=this.children.slice());il&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let i=e+1,o=i+t.content.size;for(let l=0;li&&a.type instanceof vt){let c=Math.max(i,a.from)-i,u=Math.min(o,a.to)-i;cs.map(e,t,jt));return bt.from(r)}forChild(e,t){if(t.isLeaf)return K.empty;let r=[];for(let s=0;st instanceof K)?e:e.reduce((t,r)=>t.concat(r instanceof K?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(f-h);for(let y=0;yx+u-d)continue;let C=l[y]+u-d;f>=C?l[y+1]=h<=C?-2:-1:h>=u&&g&&(l[y]+=g,l[y+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let h=t.map(n[c+1]+i,-1),f=h-s,{index:p,offset:m}=r.content.findIndex(d),g=r.maybeChild(p);if(g&&m==d&&m+g.nodeSize==f){let y=l[c+2].mapInner(t,g,u+1,n[c]+i+1,o);y!=he?(l[c]=d,l[c+1]=f,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Dy(l,n,e,t,s,i,o),u=ws(c,r,0,o);e=u.local;for(let d=0;dt&&o.to{let c=Gd(n,l,a+t);if(c){i=!0;let u=ws(c,l,t+a+1,r);u!=he&&s.push(a,a+l.nodeSize,u)}});let o=Jd(i?Yd(n):n,-t).sort(Ht);for(let l=0;l0;)e++;n.splice(e,0,t)}function Di(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=he&&e.push(r)}),n.cursorWrapper&&e.push(K.create(n.state.doc,[n.cursorWrapper.deco])),bt.from(e)}const Iy={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ly=Ne&&St<=11;class Py{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class zy{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Py,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;ss.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():pe&&e.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ly&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Iy)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ka(this.view)){if(this.suppressingSelectionUpdates)return lt(this.view);if(Ne&&St<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ut(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let i=e.focusNode;i;i=bn(i))t.add(i);for(let i=e.anchorNode;i;i=bn(i))if(t.has(i)){r=i;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ka(e)&&!this.ignoreSelectionChange(r),i=-1,o=-1,l=!1,a=[];if(e.editable)for(let u=0;uu.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46||oe&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(u=>u.type=="childList"&&u.removedNodes.length))){for(let u of a)if(u.nodeName=="BR"&&u.parentNode){let d=u.nextSibling;for(;d&&d.nodeType==1;){if(d.contentEditable=="false"){u.parentNode.removeChild(u);break}d=d.firstChild}}}else if(ze&&a.length){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let[d,h]=u;d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let h of u){let f=h.parentNode;f&&f.nodeName=="LI"&&(!d||Fy(e,d)!=f)&&h.remove()}}}let c=null;i<0&&s&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||s)&&(i>-1&&(e.docView.markDirty(i,o),By(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,jy(e,a)),this.handleDOMChange(i,o,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||lt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;us;g--){let y=r.childNodes[g-1],x=y.pmViewDesc;if(y.nodeName=="BR"&&!x){i=g;break}if(!x||x.size)break}let d=n.state.doc,h=n.someProp("domParser")||tr.fromSchema(n.state.schema),f=d.resolve(o),p=null,m=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:s,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:_y,context:f});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+o,head:y+o}}return{doc:m,sel:p,from:o,to:l}}function _y(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(pe&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||pe&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Vy=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wy(n,e,t,r,s){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let M=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,L=ol(n,M);if(L&&!n.state.selection.eq(L)){if(oe&&rt&&n.input.lastKeyCode===13&&Date.now()-100U(n,Rt(13,"Enter"))))return;let z=n.state.tr.setSelection(L);M=="pointer"?z.setMeta("pointer",!0):M=="key"&&z.scrollIntoView(),i&&z.setMeta("composition",i),n.dispatch(z)}return}let o=n.state.doc.resolve(e),l=o.sharedDepth(t);e=o.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Hy(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),h,f;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||rt)&&s.some(M=>M.nodeType==1&&!Vy.test(M.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",M=>M(n,Rt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof I&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let M=ic(n,n.state.doc,c.sel);if(M&&!M.eq(n.state.selection)){let L=n.state.tr.setSelection(M);i&&L.setMeta("composition",i),n.dispatch(L)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),Ne&&St<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)=="  "&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),x=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA;if((xn&&n.input.lastIOSEnter>Date.now()-225&&(!x||s.some(M=>M.nodeName=="DIV"||M.nodeName=="P"))||!x&&m.posM(n,Rt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&Uy(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",M=>M(n,Rt(8,"Backspace")))){rt&&oe&&n.domObserver.suppressSelectionUpdates();return}oe&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),rt&&!x&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(M){return M(n,Rt(13,"Enter"))})},20));let C=p.start,v=p.endA,b=M=>{let L=M||n.state.tr.replace(C,v,c.doc.slice(p.start-c.from,p.endB-c.from));if(c.sel){let z=ic(n,L.doc,c.sel);z&&!(oe&&n.composing&&z.empty&&(p.start!=p.endB||n.input.lastChromeDeletelt(n),20));let M=b(n.state.tr.delete(C,v)),L=u.resolve(p.start).marksAcross(u.resolve(p.endA));L&&M.ensureMarks(L),n.dispatch(M)}else if(p.endA==p.endB&&(A=qy(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start())))){let M=b(n.state.tr);A.type=="add"?M.addMark(C,v,A.mark):M.removeMark(C,v,A.mark),n.dispatch(M)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let M=m.parent.textBetween(m.parentOffset,g.parentOffset),L=()=>b(n.state.tr.insertText(M,C,v));n.someProp("handleTextInput",z=>z(n,C,v,M,L))||n.dispatch(L())}else n.dispatch(b());else n.dispatch(b())}function ic(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:ll(n,e.resolve(t.anchor),e.resolve(t.head))}function qy(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,s=t,i=r,o,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(s.length==0&&i.length==1)l=i[0],o="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||Ii(o,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,s++,e=!1;if(t){let i=n.node(r).maybeChild(n.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,s++}return s}function Ky(n,e,t,r,s){let i=n.findDiffStart(e,t),o=t+n.size,l=t+e.size;if(i==null)return null;let{a,b:c}=n.findDiffEnd(e,o,l);if(s=="end"){let u=Math.max(0,i-Math.min(a,c));r-=a+u-i}if(a=a?i-r:0;i-=u,c=i+(c-a),a=i}else if(c=c?i-r:0;i-=u,a=i+(a-c),c=i}return{start:i,endA:a,endB:c}}class Xd{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new cy,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(uc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ac(this),lc(this),this.nodeViews=cc(this),this.docView=Ha(this.state.doc,oc(this),Di(this),this.dom,this),this.domObserver=new zy(this,(r,s,i,o)=>Wy(this,r,s,i,o)),this.domObserver.start(),uy(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Co(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(uc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let s=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Wd(this),o=!0),this.state=e;let l=s.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let f=cc(this);Gy(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Co(this),this.editable=ac(this),lc(this);let a=Di(this),c=oc(this),u=s.plugins!=e.plugins&&!s.doc.eq(e.doc)?"reset":e.scrollToSelection>s.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(s.selection))&&(o=!0);let h=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Eg(this);if(o){this.domObserver.stop();let f=d&&(Ne||oe)&&!this.composing&&!s.selection.empty&&!e.selection.empty&&Jy(s.selection,e.selection);if(d){let m=oe?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Cy(this)),(i||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Ha(e.doc,c,a,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}let p=this.input.mouseDown;f||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Jg(this)&&p.delaySelUpdate())?lt(this,f):(Od(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,s),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&Cg(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof R){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Pa(this,t.getBoundingClientRect(),e)}else Pa(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&it.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Rg(this,e)}coordsAtPos(e,t=1){return wd(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let s=this.docView.posFromDOM(e,t,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(e,t){return zg(this,t||this.state,e)}pasteHTML(e,t){return kr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return kr(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return al(this,e)}destroy(){this.docView&&(dy(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Di(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,pg())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return fy(this,e)}domSelectionRange(){let e=this.domSelection();return e?pe&&this.root.nodeType===11&&bg(this.dom.ownerDocument)==this.dom&&$y(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Xd.prototype.dispatch=function(n){let e=this._props.dispatchTransaction;e?e.call(this,n):this.updateState(this.state.apply(n))};function oc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Se.node(0,n.state.doc.content.size,e)]}function lc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Se.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function ac(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Jy(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function cc(n){let e=Object.create(null);function t(r){for(let s in r)Object.prototype.hasOwnProperty.call(e,s)||(e[s]=r[s])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function Gy(n,e){let t=0,r=0;for(let s in n){if(n[s]!=e[s])return!0;t++}for(let s in e)r++;return t!=r}function uc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Et={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},vs={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var ue=0;ue<10;ue++)Et[48+ue]=Et[96+ue]=String(ue);for(var ue=1;ue<=24;ue++)Et[ue+111]="F"+ue;for(var ue=65;ue<=90;ue++)Et[ue]=String.fromCharCode(ue+32),vs[ue]=String.fromCharCode(ue);for(var Li in Et)vs.hasOwnProperty(Li)||(vs[Li]=Et[Li]);function Qy(n){var e=Yy&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Xy&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?vs:Et)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const Zy=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),ek=typeof navigator<"u"&&/Win/.test(navigator.platform);function tk(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,s,i,o;for(let l=0;l{for(var t in e)sk(n,t,{get:e[t],enumerable:!0})};function ui(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:s}=t,{storedMarks:i}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return r},get doc(){return s},get tr(){return r=t.selection,s=t.doc,i=t.storedMarks,t}}}var di=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:s}=t,i=this.buildProps(s);return Object.fromEntries(Object.entries(n).map(([o,l])=>[o,(...c)=>{const u=l(...c)(i);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(s),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:i}=r,o=[],l=!!n,a=n||s.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),o.every(d=>d===!0)),u={...Object.fromEntries(Object.entries(t).map(([d,h])=>[d,(...p)=>{const m=this.buildProps(a,e),g=h(...p)(m);return o.push(g),u}])),run:c};return u}createCan(n){const{rawCommands:e,state:t}=this,r=!1,s=n||t.tr,i=this.buildProps(s,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(s,r)}}buildProps(n,e=!0){const{rawCommands:t,editor:r,state:s}=this,{view:i}=r,o={tr:n,editor:r,view:i,state:ui({state:s,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(o)]))}};return o}},Zd={};pl(Zd,{blur:()=>ik,clearContent:()=>ok,clearNodes:()=>lk,command:()=>ak,createParagraphNear:()=>ck,cut:()=>uk,deleteCurrentNode:()=>dk,deleteNode:()=>hk,deleteRange:()=>fk,deleteSelection:()=>gk,enter:()=>yk,exitCode:()=>kk,extendMarkRange:()=>bk,first:()=>xk,focus:()=>wk,forEach:()=>vk,insertContent:()=>Ek,insertContentAt:()=>Mk,joinBackward:()=>Ok,joinDown:()=>Nk,joinForward:()=>Rk,joinItemBackward:()=>Dk,joinItemForward:()=>Ik,joinTextblockBackward:()=>Lk,joinTextblockForward:()=>Pk,joinUp:()=>Ak,keyboardShortcut:()=>Bk,lift:()=>$k,liftEmptyBlock:()=>Fk,liftListItem:()=>jk,newlineInCode:()=>Hk,resetAttributes:()=>_k,scrollIntoView:()=>Vk,selectAll:()=>Wk,selectNodeBackward:()=>qk,selectNodeForward:()=>Uk,selectParentNode:()=>Kk,selectTextblockEnd:()=>Jk,selectTextblockStart:()=>Gk,setContent:()=>Yk,setMark:()=>kb,setMeta:()=>bb,setNode:()=>xb,setNodeSelection:()=>Sb,setTextDirection:()=>wb,setTextSelection:()=>vb,sinkListItem:()=>Eb,splitBlock:()=>Cb,splitListItem:()=>Tb,toggleList:()=>Ab,toggleMark:()=>Nb,toggleNode:()=>Ob,toggleWrap:()=>Rb,undoInputRule:()=>Db,unsetAllMarks:()=>Ib,unsetMark:()=>Lb,unsetTextDirection:()=>Pb,updateAttributes:()=>zb,wrapIn:()=>Bb,wrapInList:()=>$b});var ik=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())==null||t.removeAllRanges())}),!0),ok=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),lk=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:s}=r;return t&&s.forEach(({$from:i,$to:o})=>{n.doc.nodesBetween(i.pos,o.pos,(l,a)=>{if(l.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(a)),h=c.resolve(u.map(a+l.nodeSize)),f=d.blockRange(h);if(!f)return;const p=An(f);if(l.type.isTextblock){const{defaultType:m}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,m)}(p||p===0)&&e.lift(f,p)})}),!0},ak=n=>e=>n(e),ck=()=>({state:n,dispatch:e})=>dd(n,e),uk=(n,e)=>({editor:t,tr:r})=>{const{state:s}=t,i=s.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const o=r.mapping.map(e);return r.insert(o,i.content),r.setSelection(new I(r.doc.resolve(Math.max(o-1,0)))),!0},dk=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const s=n.selection.$anchor;for(let i=s.depth;i>0;i-=1)if(s.node(i).type===r.type){if(e){const l=s.before(i),a=s.after(i);n.delete(l,a).scrollIntoView()}return!0}return!1};function re(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}var hk=n=>({tr:e,state:t,dispatch:r})=>{const s=re(n,t.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===s){if(r){const a=i.before(o),c=i.after(o);e.delete(a,c).scrollIntoView()}return!0}return!1},fk=n=>({tr:e,dispatch:t})=>{const{from:r,to:s}=n;return t&&e.delete(r,s),!0},pk=n=>n.content?/^text(\*|\+)/.test(n.content):!1,dc=(n,e,t)=>{if(!n.parent.isInline||t==="left"&&n.pos>n.start()||t==="right"&&n.pos{const r=dc(n,t,"left"),s=dc(e,t,"right");return{from:r,to:s}},gk=()=>({state:n,dispatch:e})=>{const{$from:t,$to:r}=n.selection;if(n.selection.empty)return!1;const{from:s,to:i}=mk(t,r,n.schema);return e&&(n.tr.deleteRange(s,i).scrollIntoView(),e(n.tr)),!0},yk=()=>({commands:n})=>n.keyboardShortcut("Enter"),kk=()=>({state:n,dispatch:e})=>Zm(n,e);function ml(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function Es(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(s=>t.strict?e[s]===n[s]:ml(e[s])?e[s].test(n[s]):e[s]===n[s]):!0}function eh(n,e,t={}){return n.find(r=>r.type===e&&Es(Object.fromEntries(Object.keys(t).map(s=>[s,r.attrs[s]])),t))}function hc(n,e,t={}){return!!eh(n,e,t)}function gl(n,e,t){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(c=>c.type===e))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(c=>c.type===e))return;if(!t){const c=r.node.marks.find(u=>u.type===e);c&&(t=c.attrs)}if(!eh([...r.node.marks],e,t))return;let i=r.index,o=n.start()+r.offset,l=i+1,a=o+r.node.nodeSize;for(;i>0&&hc([...n.parent.child(i-1).marks],e,t);)i-=1,o-=n.parent.child(i).nodeSize;for(;l({tr:t,state:r,dispatch:s})=>{const i=ct(n,r.schema),{doc:o,selection:l}=t,{$from:a,from:c,to:u}=l;if(s){const d=gl(a,i,e);if(d&&d.from<=c&&d.to>=u){const h=I.create(o,d.from,d.to);t.setSelection(h)}}return!0},xk=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:s,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(xr()||To())&&r.dom.focus(),Sk()&&!xr()&&!To()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};try{if(r.hasFocus()&&n===null||n===!1)return!0}catch{return!1}if(i&&n===null&&!yl(t.state.selection))return o(),!0;const l=th(s.doc,n)||t.state.selection,a=t.state.selection.eq(l);return i&&(a||s.setSelection(l),a&&s.storedMarks&&s.setStoredMarks(s.storedMarks),o()),!0},vk=(n,e)=>t=>n.every((r,s)=>e(r,{...t,index:s})),Ek=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),nh=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&nh(r)}return n};function $r(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return nh(t)}function Sr(n,e,t){if(n instanceof xt||n instanceof w)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,s=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return w.fromArray(n.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(n);return t.errorOnInvalidContent&&o.check(),o}catch(i){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),Sr("",e,t)}if(s){if(t.errorOnInvalidContent){let o=!1,l="";const a=new Du({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(o=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?tr.fromSchema(a).parseSlice($r(n),t.parseOptions):tr.fromSchema(a).parse($r(n),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=tr.fromSchema(e);return t.slice?i.parseSlice($r(n),t.parseOptions).content:i.parse($r(n),t.parseOptions)}return Sr("",e,t)}function Ck(n,e,t){const r=n.steps.length-1;if(r{o===0&&(o=u)}),n.setSelection(P.near(n.doc.resolve(o),t))}var Tk=n=>!("type"in n),Mk=(n,e,t)=>({tr:r,dispatch:s,editor:i})=>{var o;if(s){t={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l;const a=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Sr(e,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){a(g)}try{l=Sr(e,i.schema,{parseOptions:c,errorOnInvalidContent:(o=t.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(g){return a(g),!1}let{from:u,to:d}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},h=!0,f=!0;if((Tk(l)?l:[l]).forEach(g=>{g.check(),h=h?g.isText&&g.marks.length===0:!1,f=f?g.isBlock:!1}),u===d&&f){const{parent:g}=r.doc.resolve(u);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(u-=1,d+=1)}let m;if(h){if(Array.isArray(e))m=e.map(g=>g.text||"").join("");else if(e instanceof w){let g="";e.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof e=="object"&&e&&e.text?m=e.text:m=e;r.insertText(m,u,d)}else{m=l;const g=r.doc.resolve(u),y=g.node(),x=g.parentOffset===0,C=y.isText||y.isTextblock,v=y.content.size>0;x&&C&&v&&f&&(u=Math.max(0,u-1)),r.replaceWith(u,d,m)}t.updateSelection&&Ck(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:m}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:m})}return!0},Ak=()=>({state:n,dispatch:e})=>Ym(n,e),Nk=()=>({state:n,dispatch:e})=>Xm(n,e),Ok=()=>({state:n,dispatch:e})=>sd(n,e),Rk=()=>({state:n,dispatch:e})=>ad(n,e),Dk=()=>({state:n,dispatch:e,tr:t})=>{try{const r=oi(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Ik=()=>({state:n,dispatch:e,tr:t})=>{try{const r=oi(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},Lk=()=>({state:n,dispatch:e})=>Jm(n,e),Pk=()=>({state:n,dispatch:e})=>Gm(n,e);function rh(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function zk(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,s,i,o;for(let l=0;l({editor:e,view:t,tr:r,dispatch:s})=>{const i=zk(n).split(/-(?!$)/),o=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a==null||a.steps.forEach(c=>{const u=c.map(r.mapping);u&&s&&r.maybeStep(u)}),!0};function Ct(n,e,t={}){const{from:r,to:s,empty:i}=n.selection,o=e?re(e,n.schema):null,l=[];n.doc.nodesBetween(r,s,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(s,h+d.nodeSize);l.push({node:d,from:f,to:p})});const a=s-r,c=l.filter(d=>o?o.name===d.node.type.name:!0).filter(d=>Es(d.node.attrs,t,{strict:!1}));return i?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=a}var $k=(n,e={})=>({state:t,dispatch:r})=>{const s=re(n,t.schema);return Ct(t,s,e)?Qm(t,r):!1},Fk=()=>({state:n,dispatch:e})=>hd(n,e),jk=n=>({state:e,dispatch:t})=>{const r=re(n,e.schema);return ug(r)(e,t)},Hk=()=>({state:n,dispatch:e})=>ud(n,e);function hi(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function fc(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,s)=>(t.includes(s)||(r[s]=n[s]),r),{})}var _k=(n,e)=>({tr:t,state:r,dispatch:s})=>{let i=null,o=null;const l=hi(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=re(n,r.schema)),l==="mark"&&(o=ct(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{i&&i===u.type&&(a=!0,s&&t.setNodeMarkup(d,void 0,fc(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&(a=!0,s&&t.addMark(d,d+u.nodeSize,o.create(fc(h.attrs,e))))})})}),a},Vk=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Wk=()=>({tr:n,dispatch:e})=>{if(e){const t=new ot(n.doc);n.setSelection(t)}return!0},qk=()=>({state:n,dispatch:e})=>od(n,e),Uk=()=>({state:n,dispatch:e})=>cd(n,e),Kk=()=>({state:n,dispatch:e})=>ng(n,e),Jk=()=>({state:n,dispatch:e})=>ig(n,e),Gk=()=>({state:n,dispatch:e})=>sg(n,e);function Mo(n,e,t={},r={}){return Sr(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}var Yk=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:s,tr:i,dispatch:o,commands:l})=>{const{doc:a}=i;if(r.preserveWhitespace!=="full"){const c=Mo(n,s.schema,r,{errorOnInvalidContent:e??s.options.enableContentCheck});return o&&i.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return o&&i.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??s.options.enableContentCheck})};function sh(n,e){const t=ct(e,n.schema),{from:r,to:s,empty:i}=n.selection,o=[];i?(n.storedMarks&&o.push(...n.storedMarks),o.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,s,a=>{o.push(...a.marks)});const l=o.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function ih(n,e){const t=new Yu(n);return e.forEach(r=>{r.steps.forEach(s=>{t.step(s)})}),t}function Xk(n){for(let e=0;e{t(s)&&r.push({node:s,pos:i})}),r}function Zk(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function fi(n){return e=>Zk(e.$from,n)}function O(n,e,t){return n.config[e]===void 0&&n.parent?O(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?O(n.parent,e,t):null}):n.config[e]}function kl(n){return n.map(e=>{const t={name:e.name,options:e.options,storage:e.storage},r=O(e,"addExtensions",t);return r?[e,...kl(r())]:e}).flat(10)}function bl(n,e){const t=Xt.fromSchema(e).serializeFragment(n),s=document.implementation.createHTMLDocument().createElement("div");return s.appendChild(t),s.innerHTML}function oh(n){return typeof n=="function"}function H(n,e=void 0,...t){return oh(n)?e?n.bind(e)(...t):n(...t):n}function eb(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Sn(n){const e=n.filter(s=>s.type==="extension"),t=n.filter(s=>s.type==="node"),r=n.filter(s=>s.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function lh(n){const e=[],{nodeExtensions:t,markExtensions:r}=Sn(n),s=[...t,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=t.filter(c=>c.name!=="text").map(c=>c.name),l=r.map(c=>c.name),a=[...o,...l];return n.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage,extensions:s},d=O(c,"addGlobalAttributes",u);if(!d)return;d().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=a:f.types==="nodes"?p=o:f.types==="marks"?p=l:p=[],p.forEach(m=>{Object.entries(f.attributes).forEach(([g,y])=>{e.push({type:m,name:g,attribute:{...i,...y}})})})})}),s.forEach(c=>{const u={name:c.name,options:c.options,storage:c.storage},d=O(c,"addAttributes",u);if(!d)return;const h=d();Object.entries(h).forEach(([f,p])=>{const m={...i,...p};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:c.name,name:f,attribute:m})})}),e}function tb(n){const e=[];let t="",r=!1,s=!1,i=0;const o=n.length;for(let l=0;l0){i-=1,t+=a;continue}if(a===";"&&i===0){e.push(t),t="";continue}}t+=a}return t&&e.push(t),e}function pc(n){const e=[],t=tb(n||""),r=t.length;for(let s=0;s!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([s,i])=>{if(!r[s]){r[s]=i;return}if(s==="class"){const l=i?String(i).split(" "):[],a=r[s]?r[s].split(" "):[],c=l.filter(u=>!a.includes(u));r[s]=[...a,...c].join(" ")}else if(s==="style"){const l=new Map([...pc(r[s]),...pc(i)]);r[s]=Array.from(l.entries()).map(([a,c])=>`${a}: ${c}`).join("; ")}else r[s]=i}),r},{})}function wn(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>J(t,r),{})}function nb(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function mc(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const s=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(t):nb(t.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...r,...s}}}}function gc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&eb(t)?!1:t!=null))}function yc(n){var e,t;const r={};return!((e=n==null?void 0:n.attribute)!=null&&e.isRequired)&&"default"in((n==null?void 0:n.attribute)||{})&&(r.default=n.attribute.default),((t=n==null?void 0:n.attribute)==null?void 0:t.validate)!==void 0&&(r.validate=n.attribute.validate),[n.name,r]}function rb(n,e){var t;const r=lh(n),{nodeExtensions:s,markExtensions:i}=Sn(n),o=(t=s.find(c=>O(c,"topNode")))==null?void 0:t.name,l=Object.fromEntries(s.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=n.reduce((y,x)=>{const C=O(x,"extendNodeSchema",d);return{...y,...C?C(c):{}}},{}),f=gc({...h,content:H(O(c,"content",d)),marks:H(O(c,"marks",d)),group:H(O(c,"group",d)),inline:H(O(c,"inline",d)),atom:H(O(c,"atom",d)),selectable:H(O(c,"selectable",d)),draggable:H(O(c,"draggable",d)),code:H(O(c,"code",d)),whitespace:H(O(c,"whitespace",d)),linebreakReplacement:H(O(c,"linebreakReplacement",d)),defining:H(O(c,"defining",d)),isolating:H(O(c,"isolating",d)),attrs:Object.fromEntries(u.map(yc))}),p=H(O(c,"parseHTML",d));p&&(f.parseDOM=p.map(y=>mc(y,u)));const m=O(c,"renderHTML",d);m&&(f.toDOM=y=>m({node:y,HTMLAttributes:wn(y,u)}));const g=O(c,"renderText",d);return g&&(f.toText=g),[c.name,f]})),a=Object.fromEntries(i.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=n.reduce((g,y)=>{const x=O(y,"extendMarkSchema",d);return{...g,...x?x(c):{}}},{}),f=gc({...h,inclusive:H(O(c,"inclusive",d)),excludes:H(O(c,"excludes",d)),group:H(O(c,"group",d)),spanning:H(O(c,"spanning",d)),code:H(O(c,"code",d)),attrs:Object.fromEntries(u.map(yc))}),p=H(O(c,"parseHTML",d));p&&(f.parseDOM=p.map(g=>mc(g,u)));const m=O(c,"renderHTML",d);return m&&(f.toDOM=g=>m({mark:g,HTMLAttributes:wn(g,u)})),[c.name,f]}));return new Du({topNode:o,nodes:l,marks:a})}function sb(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function ir(n){return n.sort((t,r)=>{const s=O(t,"priority")||100,i=O(r,"priority")||100;return s>i?-1:sr.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function ch(n,e,t){const{from:r,to:s}=e,{blockSeparator:i=` -`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(r,s,(a,c,u,d)=>{var h;a.isBlock&&c>r&&(l+=i);const f=o==null?void 0:o[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(h=a==null?void 0:a.text)==null?void 0:h.slice(Math.max(r,c)-c,s-c))}),l}function Yk(n,e){const t={from:0,to:n.content.size};return ih(n,t,e)}function oh(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Xk(n,e){const t=te(e,n.schema),{from:r,to:s}=n.selection,i=[];n.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function lh(n,e){const t=li(typeof e=="string"?e:e.name,n.schema);return t==="node"?Xk(n,e):t==="mark"?eh(n,e):{}}function Qk(n,e=JSON.stringify){const t={};return n.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(t,s)?!1:t[s]=!0})}function Zk(n){const e=Qk(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,o)=>o!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function ah(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),d=e.invert().map(c,-1),h=e.invert().map(u);r.push({oldRange:{from:d,to:h},newRange:{from:c,to:u}})})}),Zk(r)}function gl(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(s=>{const i=t.resolve(n),o=hl(i,s.type);o&&r.push({mark:s,...o})}):t.nodesBetween(n,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var eb=(n,e,t,r=20)=>{const s=n.doc.resolve(t);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function Mn(n,e){return e.nodes[n]||e.marks[n]||null}function es(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const s=n.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var tb=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";t+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Eo(n,e,t={}){const{empty:r,ranges:s}=n.selection,i=e?it(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>bs(d.attrs,t,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;n.doc.nodesBetween(f,p,(m,g)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),x=Math.min(p,g+m.nodeSize),C=x-y;o+=C,l.push(...m.marks.map(v=>({mark:v,from:y,to:x})))})}),o===0)return!1;const a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>bs(d.mark.attrs,t,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(a>0?a+c:a)>=o}function nb(n,e,t={}){if(!e)return St(n,null,t)||Eo(n,null,t);const r=li(e,n.schema);return r==="node"?St(n,e,t):r==="mark"?Eo(n,e,t):!1}var rb=(n,e)=>{const{$from:t,$to:r,$anchor:s}=n.selection;if(e){const i=ai(l=>l.type.name===e)(n.selection);if(!i)return!1;const o=n.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function pc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Ii(n,e){const{nodeExtensions:t}=yn(e),r=t.find(o=>o.name===n);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=j(R(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function kr(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return!/\S/.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let s=!0;return n.content.forEach(i=>{s!==!1&&(kr(i,{ignoreWhitespace:t,checkChildren:e})||(s=!1))}),s}return!1}function ch(n){return n instanceof I}function ib({selection:n,pos:e,nodeSize:t,selectedOnTextSelection:r=!1}){const{from:s,to:i}=n;return!!(s<=e&&i>=e+t||r&&fl(n)&&s>e&&ic.type.excludes(t)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,h)=>{if(c)return!1;if(u.isInline){const f=!h||h.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=f&&p}return!c}),c})}var cb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{const{selection:i}=t,{empty:o,ranges:l}=i,a=it(n,r.schema);if(s)if(o){const c=eh(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(h,f)=>{const p=Math.max(f,u),m=Math.min(f+h.nodeSize,d);h.marks.find(y=>y.type===a)?h.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return ab(r,t,a)},ub=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),db=(n,e={})=>({state:t,dispatch:r,chain:s})=>{const i=te(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Aa(i,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Aa(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},hb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,s=Rt(n,0,r.content.size),i=I.create(r,s);e.setSelection(i)}return!0},fb=(n,e)=>({tr:t,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&t.doc.nodesBetween(o,l,(a,c)=>{a.isText||t.setNodeMarkup(c,void 0,{...a.attrs,dir:n})}),!0},pb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:s,to:i}=typeof n=="number"?{from:n,to:n}:n,o=P.atStart(r).from,l=P.atEnd(r).to,a=Rt(s,o,l),c=Rt(i,o,l),u=P.create(r,a,c);e.setSelection(u)}return!0},mb=n=>({state:e,dispatch:t})=>{const r=te(n,e.schema);return sg(r)(e,t)};function mc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(s=>e==null?void 0:e.includes(s.type.name));n.tr.ensureMarks(r)}}var gb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=es(c,l.node().type.name,l.node().attrs);if(i instanceof I&&i.node.isBlock)return!l.parentOffset||!tt(o,l.pos)?!1:(r&&(n&&mc(t,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,h=l.depth===0?void 0:jk(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=d&&h?[{type:h,attrs:u}]:void 0,p=tt(e.doc,e.mapping.map(l.pos),1,f);if(!f&&!p&&tt(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(p&&(i instanceof P&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,f),h&&!d&&!l.parentOffset&&l.parent.type!==h)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}n&&mc(t,s.extensionManager.splittableMarks),e.scrollIntoView()}return p},yb=(n,e={})=>({tr:t,state:r,dispatch:s,editor:i})=>{var o;const l=te(n,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const h=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let y=w.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let L=a.depth-x;L>=a.depth-3;L-=1)y=w.from(a.node(L).copy(y));const C=a.indexAfter(-1){if(T>-1)return!1;L.isTextblock&&L.content.size===0&&(T=O+1)}),T>-1&&t.setSelection(P.near(t.doc.resolve(T))),t.scrollIntoView()}return!0}const f=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,p={...es(h,d.type.name,d.attrs),...e},m={...es(h,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);const g=f?[{type:l,attrs:p},{type:f,attrs:m}]:[{type:l,attrs:p}];if(!tt(t.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:x}=r,{splittableMarks:C}=i.extensionManager,v=x||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!v||!s)return!0;const k=v.filter(M=>C.includes(M.type.name));t.ensureMarks(k)}return!0},Di=(n,e)=>{const t=ai(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&vt(n.doc,t.pos)&&n.join(t.pos),!0},Li=(n,e)=>{const t=ai(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&vt(n.doc,r)&&n.join(r),!0};function kb(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),s=e.resolve(t.nodeSize-1);return P.between(r,s)}var bb=(n,e,t,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:h}=s.extensionManager,f=te(n,o.schema),p=te(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,C=y.blockRange(x),v=g||m.$to.parentOffset&&m.$from.marks();if(!C)return!1;const k=ai(ne=>Ii(ne.type.name,d))(m),M=m.from===0&&m.to===o.doc.content.size,T=o.doc.content.content,L=T.length===1?T[0]:null,O=M&&L&&Ii(L.type.name,d)?{node:L,pos:0}:null,$=k??O,de=!!k&&C.depth>=1&&C.depth-k.depth<=1,se=!!O;if((de||se)&&$){if($.node.type===f)return M&&se?a().command(({tr:ne,dispatch:H})=>{const U=kb(ne);return U?(ne.setSelection(U),H&&H(ne),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(Ii($.node.type.name,d)&&f.validContent($.node.content))return a().command(()=>(i.setNodeMarkup($.pos,f),!0)).command(()=>Di(i,f)).command(()=>Li(i,f)).run()}return!t||!v||!l?a().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Di(i,f)).command(()=>Li(i,f)).run():a().command(()=>{const ne=u().wrapInList(f,r),H=v.filter(U=>h.includes(U.type.name));return i.ensureMarks(H),ne?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Di(i,f)).command(()=>Li(i,f)).run()},xb=(n,e={},t={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=t,o=it(n,r.schema);return Eo(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},Sb=(n,e,t={})=>({state:r,commands:s})=>{const i=te(n,r.schema),o=te(e,r.schema),l=St(r,i,t);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...t})},wb=(n,e={})=>({state:t,commands:r})=>{const s=te(n,t.schema);return St(t,s,e)?r.lift(s):r.wrapIn(s,e)},vb=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,n.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},Eb=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{ignoreClearable:s=!1}=n,{selection:i}=e,{empty:o,ranges:l}=i;if(o)return!0;const{nonClearableMarks:a}=r.extensionManager;if(t){const c=Object.values(r.schema.marks).filter(u=>s||!a.includes(u.name));l.forEach(u=>{for(const d of c)e.removeMark(u.$from.pos,u.$to.pos,d)})}return!0},Cb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=it(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!s)return!0;if(u&&o){let{from:h,to:f}=l;const p=(i=c.marks().find(g=>g.type===a))==null?void 0:i.attrs,m=hl(c,a,p);m&&(h=m.from,f=m.to),t.removeMark(h,f,a)}else d.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,a)});return t.removeStoredMark(a),!0},Tb=n=>({tr:e,state:t,dispatch:r})=>{const{selection:s}=t;let i,o;return typeof n=="number"?(i=n,o=n):n&&"from"in n&&"to"in n?(i=n.from,o=n.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},Mb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{let i=null,o=null;const l=li(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=te(n,r.schema)),l==="mark"&&(o=it(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let h,f,p,m;t.selection.empty?r.doc.nodesBetween(u,d,(g,y)=>{i&&i===g.type&&(a=!0,p=Math.max(y,u),m=Math.min(y+g.nodeSize,d),h=y,f=g)}):r.doc.nodesBetween(u,d,(g,y)=>{y=u&&y<=d&&(i&&i===g.type&&(a=!0,s&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(a=!0,s)){const C=Math.max(y,u),v=Math.min(y+g.nodeSize,d);t.addMark(C,v,o.create({...x.attrs,...e}))}}))}),f&&(h!==void 0&&s&&t.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&s&&t.addMark(p,m,o.create({...g.attrs,...e}))}))}),a},Ab=(n,e={})=>({state:t,dispatch:r})=>{const s=te(n,t.schema);return Xm(s,e)(t,r)},Nb=(n,e={})=>({state:t,dispatch:r})=>{const s=te(n,t.schema);return Qm(s,e)(t,r)},Ob=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},ci=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},Rb=(n,e)=>{if(dl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Pr(n){var e;const{editor:t,from:r,to:s,text:i,rules:o,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const d=tb(c)+i;return o.forEach(h=>{if(u)return;const f=Rb(d,h.find);if(!f)return;const p=a.state.tr,m=ii({state:a.state,transaction:p}),g={from:r-(f[0].length-i.length),to:s},{commands:y,chain:x,can:C}=new oi({editor:t,state:m});h.handler({state:m,range:g,match:f,commands:y,chain:x,can:C})===null||!p.steps.length||(h.undoable&&p.setMeta(l,{transform:p,from:r,to:s,text:i}),a.dispatch(p),u=!0)}),u}function Ib(n){const{editor:e,rules:t}=n,r=new G({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=ml(w.from(u),o.schema);const{from:d}=a,h=d+u.length;Pr({editor:e,from:d,to:h,text:u,rules:t,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Pr({editor:e,from:i,to:o,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Pr({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Pr({editor:e,from:o.pos,to:o.pos,text:` -`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function Db(n){return Object.prototype.toString.call(n).slice(8,-1)}function zr(n){return Db(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function hh(n,e){const t={...n};return zr(n)&&zr(e)&&Object.keys(e).forEach(r=>{zr(e[r])&&zr(n[r])?t[r]=hh(n[r],e[r]):t[r]=e[r]}),t}var yl=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...j(R(this,"addOptions",{name:this.name}))}}get storage(){return{...j(R(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>hh(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Jt=class fh extends yl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new fh(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Lb(n){return typeof n=="number"}var Pb=class{constructor(n){this.find=n.find,this.handler=n.handler}},zb=(n,e,t)=>{if(dl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=n,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function Bb(n){const{editor:e,state:t,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=n,{commands:a,chain:c,can:u}=new oi({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,s,(f,p)=>{var m,g,y,x,C;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const v=(C=(x=(y=f.content)==null?void 0:y.size)!=null?x:f.nodeSize)!=null?C:0,k=Math.max(r,p),M=Math.min(s,p+v);if(k>=M)return;const T=f.isText?f.text||"":f.textBetween(k-p,M-p,void 0,"");zb(T,i.find,o).forEach(O=>{if(O.index===void 0)return;const $=k+O.index+1,de=$+O[0].length,se={from:t.tr.mapping.map($),to:t.tr.mapping.map(de)},ne=i.handler({state:t,range:se,match:O,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});d.push(ne)})}),d.every(f=>f!==null)}var Br=null,$b=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function Fb(n){const{editor:e,rules:t}=n;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const m=u.tr,g=ii({state:u,transaction:m});if(!(!Bb({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return t.map(u=>new G({view(d){const h=p=>{var m;r=(m=d.dom.parentElement)!=null&&m.contains(p.target)?d.dom.parentElement:null,r&&(Br=e)},f=()=>{Br&&(Br=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(i=r===d.dom.parentElement,l=h,!i){const f=Br;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,s=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!s,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){let{text:k}=y;typeof k=="string"?k=k:k=ml(w.from(k),f.schema);const{from:M}=y,T=M+k.length,L=$b(k);return a({rule:u,state:f,from:M,to:{b:T},pasteEvt:L})}const C=h.doc.content.findDiffStart(f.doc.content),v=h.doc.content.findDiffEnd(f.doc.content);if(!(!Lb(C)||!v||C===v.b))return a({rule:u,state:f,from:C,to:v,pasteEvt:o})}}))}var ui=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=sh(n),this.schema=Jk(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Mn(e.name,this.schema)},r=R(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return tr([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:Mn(r.name,this.schema)},i=[],o=R(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&R(r,"exitable",s)&&(l.ArrowRight=()=>Jt.handleExit({editor:n,mark:r})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,p])=>[f,()=>p({editor:n})]));l={...l,...h}}const a=Jy(l);i.push(a);const c=R(r,"addInputRules",s);if(pc(r,n.options.enableInputRules)&&c){const h=c();if(h&&h.length){const f=Ib({editor:n,rules:h}),p=Array.isArray(f)?f:[f];i.push(...p)}}const u=R(r,"addPasteRules",s);if(pc(r,n.options.enablePasteRules)&&u){const h=u();if(h&&h.length){const f=Fb({editor:n,rules:h});i.push(...f)}}const d=R(r,"addProseMirrorPlugins",s);if(d){const h=d();i.push(...h)}return i})}get attributes(){return rh(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=yn(this.extensions);return Object.fromEntries(e.filter(t=>!!R(t,"addNodeView")).map(t=>{const r=this.attributes.filter(a=>a.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:te(t.name,this.schema)},i=R(t,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,d,h)=>{const f=kn(a,r);return o({node:a,view:c,getPos:u,decorations:d,innerDecorations:h,editor:n,extension:t,HTMLAttributes:f})};return[t.name,l]}))}dispatchTransaction(n){const{editor:e}=this;return tr([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Mn(s.name,this.schema)},o=R(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},n)}transformPastedHTML(n){const{editor:e}=this;return tr([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Mn(s.name,this.schema)},o=R(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},n||(r=>r))}get markViews(){const{editor:n}=this,{markExtensions:e}=yn(this.extensions);return Object.fromEntries(e.filter(t=>!!R(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:it(t.name,this.schema)},i=R(t,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=kn(l,r);return i()({mark:l,view:a,inline:c,editor:n,extension:t,HTMLAttributes:u,updateAttributes:d=>{Zb(l,n,d)}})};return[t.name,o]}))}destroy(){this.extensions.forEach(n=>{let e=n;for(;e.parent;){const t=e.parent;t.child===e&&(t.child=null),e=t}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t,r;const s={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Mn(e.name,this.schema)};e.type==="mark"&&(((t=j(R(e,"keepOnSplit",s)))==null||t)&&this.splittableMarks.push(e.name),(r=j(R(e,"clearable",s)))==null||r||this.nonClearableMarks.push(e.name));const i=R(e,"onBeforeCreate",s),o=R(e,"onCreate",s),l=R(e,"onUpdate",s),a=R(e,"onSelectionUpdate",s),c=R(e,"onTransaction",s),u=R(e,"onFocus",s),d=R(e,"onBlur",s),h=R(e,"onDestroy",s);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),l&&this.editor.on("update",l),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};ui.resolve=sh;ui.sort=tr;ui.flatten=pl;var Hb={};ul(Hb,{ClipboardTextSerializer:()=>mh,Commands:()=>gh,Delete:()=>yh,Drop:()=>kh,Editable:()=>bh,FocusEvents:()=>Sh,Keymap:()=>wh,Paste:()=>vh,Tabindex:()=>Eh,TextDirection:()=>Ch,focusEventsPluginKey:()=>xh});var Y=class ph extends yl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new ph(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},mh=Y.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new G({key:new re("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:s}=e,i=oh(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:i};return[...s.ranges].sort((c,u)=>c.$from.pos-u.$from.pos).map(({$from:c,$to:u})=>ih(r,{from:c.pos,to:u.pos},l)).join(o??` +`,textSerializers:o={}}=t||{};let l="";return n.nodesBetween(r,s,(a,c,u,d)=>{var h;a.isBlock&&c>r&&(l+=i);const f=o==null?void 0:o[a.type.name];if(f)return u&&(l+=f({node:a,pos:c,parent:u,index:d,range:e})),!1;a.isText&&(l+=(h=a==null?void 0:a.text)==null?void 0:h.slice(Math.max(r,c)-c,s-c))}),l}function ib(n,e){const t={from:0,to:n.content.size};return ch(n,t,e)}function uh(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function ob(n,e){const t=re(e,n.schema),{from:r,to:s}=n.selection,i=[];n.doc.nodesBetween(r,s,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===t.name);return o?{...o.attrs}:{}}function dh(n,e){const t=hi(typeof e=="string"?e:e.name,n.schema);return t==="node"?ob(n,e):t==="mark"?sh(n,e):{}}function lb(n,e=JSON.stringify){const t={};return n.filter(r=>{const s=e(r);return Object.prototype.hasOwnProperty.call(t,s)?!1:t[s]=!0})}function ab(n){const e=lb(n);return e.length===1?e:e.filter((t,r)=>!e.filter((i,o)=>o!==r).some(i=>t.oldRange.from>=i.oldRange.from&&t.oldRange.to<=i.oldRange.to&&t.newRange.from>=i.newRange.from&&t.newRange.to<=i.newRange.to))}function hh(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((s,i)=>{const o=[];if(s.ranges.length)s.forEach((l,a)=>{o.push({from:l,to:a})});else{const{from:l,to:a}=t[i];if(l===void 0||a===void 0)return;o.push({from:l,to:a})}o.forEach(({from:l,to:a})=>{const c=e.slice(i).map(l,-1),u=e.slice(i).map(a),d=e.invert().map(c,-1),h=e.invert().map(u);r.push({oldRange:{from:d,to:h},newRange:{from:c,to:u}})})}),ab(r)}function xl(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(s=>{const i=t.resolve(n),o=gl(i,s.type);o&&r.push({mark:s,...o})}):t.nodesBetween(n,e,(s,i)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(o=>({from:i,to:i+s.nodeSize,mark:o})))}),r}var cb=(n,e,t,r=20)=>{const s=n.doc.resolve(t);let i=r,o=null;for(;i>0&&o===null;){const l=s.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function Rn(n,e){return e.nodes[n]||e.marks[n]||null}function is(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const s=n.find(i=>i.type===e&&i.name===r);return s?s.attribute.keepOnSplit:!1}))}var ub=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(s,i,o,l)=>{var a,c;const u=((c=(a=s.type.spec).toText)==null?void 0:c.call(a,{node:s,pos:i,parent:o,index:l}))||s.textContent||"%leaf%";t+=s.isAtom&&!s.isText?u:u.slice(0,Math.max(0,r-i))}),t};function Ao(n,e,t={}){const{empty:r,ranges:s}=n.selection,i=e?ct(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Es(d.attrs,t,{strict:!1}));let o=0;const l=[];if(s.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;n.doc.nodesBetween(f,p,(m,g)=>{if(i&&m.inlineContent&&!m.type.allowsMarkType(i))return!1;if(!m.isText&&!m.marks.length)return;const y=Math.max(f,g),x=Math.min(p,g+m.nodeSize),C=x-y;o+=C,l.push(...m.marks.map(v=>({mark:v,from:y,to:x})))})}),o===0)return!1;const a=l.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Es(d.mark.attrs,t,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=l.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(a>0?a+c:a)>=o}function db(n,e,t={}){if(!e)return Ct(n,null,t)||Ao(n,null,t);const r=hi(e,n.schema);return r==="node"?Ct(n,e,t):r==="mark"?Ao(n,e,t):!1}var hb=(n,e)=>{const{$from:t,$to:r,$anchor:s}=n.selection;if(e){const i=fi(l=>l.type.name===e)(n.selection);if(!i)return!1;const o=n.doc.resolve(i.pos+1);return s.pos+1===o.end()}return!(r.parentOffset{const{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function kc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function zi(n,e){const{nodeExtensions:t}=Sn(e),r=t.find(o=>o.name===n);if(!r)return!1;const s={name:r.name,options:r.options,storage:r.storage},i=H(O(r,"group",s));return typeof i!="string"?!1:i.split(" ").includes("list")}function wr(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return!/\S/.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let s=!0;return n.content.forEach(i=>{s!==!1&&(wr(i,{ignoreWhitespace:t,checkChildren:e})||(s=!1))}),s}return!1}function fh(n){return n instanceof R}function pb({selection:n,pos:e,nodeSize:t,selectedOnTextSelection:r=!1}){const{from:s,to:i}=n;return!!(s<=e&&i>=e+t||r&&yl(n)&&s>e&&ic.type.excludes(t)))}const{ranges:o}=s;return o.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,d,h)=>{if(c)return!1;if(u.isInline){const f=!h||h.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=f&&p}return!c}),c})}var kb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{const{selection:i}=t,{empty:o,ranges:l}=i,a=ct(n,r.schema);if(s)if(o){const c=sh(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(h,f)=>{const p=Math.max(f,u),m=Math.min(f+h.nodeSize,d);h.marks.find(y=>y.type===a)?h.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return yb(r,t,a)},bb=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),xb=(n,e={})=>({state:t,dispatch:r,chain:s})=>{const i=re(n,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),i.isTextblock?s().command(({commands:l})=>Da(i,{...o,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Da(i,{...o,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Sb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,s=Pt(n,0,r.content.size),i=R.create(r,s);e.setSelection(i)}return!0},wb=(n,e)=>({tr:t,state:r,dispatch:s})=>{const{selection:i}=r;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),s&&t.doc.nodesBetween(o,l,(a,c)=>{a.isText||t.setNodeMarkup(c,void 0,{...a.attrs,dir:n})}),!0},vb=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:s,to:i}=typeof n=="number"?{from:n,to:n}:n,o=I.atStart(r).from,l=I.atEnd(r).to,a=Pt(s,o,l),c=Pt(i,o,l),u=I.create(r,a,c);e.setSelection(u)}return!0},Eb=n=>({state:e,dispatch:t})=>{const r=re(n,e.schema);return fg(r)(e,t)};function bc(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(s=>e==null?void 0:e.includes(s.type.name));n.tr.ensureMarks(r)}}var Cb=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:s})=>{const{selection:i,doc:o}=e,{$from:l,$to:a}=i,c=s.extensionManager.attributes,u=is(c,l.node().type.name,l.node().attrs);if(i instanceof R&&i.node.isBlock)return!l.parentOffset||!it(o,l.pos)?!1:(r&&(n&&bc(t,s.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const d=a.parentOffset===a.parent.content.size,h=l.depth===0?void 0:Xk(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=d&&h?[{type:h,attrs:u}]:void 0,p=it(e.doc,e.mapping.map(l.pos),1,f);if(!f&&!p&&it(e.doc,e.mapping.map(l.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(p&&(i instanceof I&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,f),h&&!d&&!l.parentOffset&&l.parent.type!==h)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(l.before()),h)}n&&bc(t,s.extensionManager.splittableMarks),e.scrollIntoView()}return p},Tb=(n,e={})=>({tr:t,state:r,dispatch:s,editor:i})=>{var o;const l=re(n,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;const d=a.node(-1);if(d.type!==l)return!1;const h=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(s){let y=w.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let L=a.depth-x;L>=a.depth-3;L-=1)y=w.from(a.node(L).copy(y));const C=a.indexAfter(-1){if(M>-1)return!1;L.isTextblock&&L.content.size===0&&(M=z+1)}),M>-1&&t.setSelection(I.near(t.doc.resolve(M))),t.scrollIntoView()}return!0}const f=c.pos===a.end()?d.contentMatchAt(0).defaultType:null,p={...is(h,d.type.name,d.attrs),...e},m={...is(h,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);const g=f?[{type:l,attrs:p},{type:f,attrs:m}]:[{type:l,attrs:p}];if(!it(t.doc,a.pos,2))return!1;if(s){const{selection:y,storedMarks:x}=r,{splittableMarks:C}=i.extensionManager,v=x||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!v||!s)return!0;const b=v.filter(A=>C.includes(A.type.name));t.ensureMarks(b)}return!0},Bi=(n,e)=>{const t=fi(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&Mt(n.doc,t.pos)&&n.join(t.pos),!0},$i=(n,e)=>{const t=fi(o=>o.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const s=n.doc.nodeAt(r);return t.node.type===(s==null?void 0:s.type)&&Mt(n.doc,r)&&n.join(r),!0};function Mb(n){const e=n.doc,t=e.firstChild;if(!t)return null;const r=e.resolve(1),s=e.resolve(t.nodeSize-1);return I.between(r,s)}var Ab=(n,e,t,r={})=>({editor:s,tr:i,state:o,dispatch:l,chain:a,commands:c,can:u})=>{const{extensions:d,splittableMarks:h}=s.extensionManager,f=re(n,o.schema),p=re(e,o.schema),{selection:m,storedMarks:g}=o,{$from:y,$to:x}=m,C=y.blockRange(x),v=g||m.$to.parentOffset&&m.$from.marks();if(!C)return!1;const b=fi(te=>zi(te.type.name,d))(m),A=m.from===0&&m.to===o.doc.content.size,M=o.doc.content.content,L=M.length===1?M[0]:null,z=A&&L&&zi(L.type.name,d)?{node:L,pos:0}:null,U=b??z,Te=!!b&&C.depth>=1&&C.depth-b.depth<=1,Me=!!z;if((Te||Me)&&U){if(U.node.type===f)return A&&Me?a().command(({tr:te,dispatch:$})=>{const W=Mb(te);return W?(te.setSelection(W),$&&$(te),!0):!1}).liftListItem(p).run():c.liftListItem(p);if(zi(U.node.type.name,d)&&f.validContent(U.node.content))return a().command(()=>(i.setNodeMarkup(U.pos,f),!0)).command(()=>Bi(i,f)).command(()=>$i(i,f)).run()}return!t||!v||!l?a().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Bi(i,f)).command(()=>$i(i,f)).run():a().command(()=>{const te=u().wrapInList(f,r),$=v.filter(W=>h.includes(W.type.name));return i.ensureMarks($),te?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Bi(i,f)).command(()=>$i(i,f)).run()},Nb=(n,e={},t={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:i=!1}=t,o=ct(n,r.schema);return Ao(r,o,e)?s.unsetMark(o,{extendEmptyMarkRange:i}):s.setMark(o,e)},Ob=(n,e,t={})=>({state:r,commands:s})=>{const i=re(n,r.schema),o=re(e,r.schema),l=Ct(r,i,t);let a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?s.setNode(o,a):s.setNode(i,{...a,...t})},Rb=(n,e={})=>({state:t,commands:r})=>{const s=re(n,t.schema);return Ct(t,s,e)?r.lift(s):r.wrapIn(s,e)},Db=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r=0;a-=1)o.step(l.steps[a].invert(l.docs[a]));if(i.text){const a=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,n.schema.text(i.text,a))}else o.delete(i.from,i.to)}return!0}}return!1},Ib=(n={})=>({tr:e,dispatch:t,editor:r})=>{const{ignoreClearable:s=!1}=n,{selection:i}=e,{empty:o,ranges:l}=i;if(o)return!0;const{nonClearableMarks:a}=r.extensionManager;if(t){const c=Object.values(r.schema.marks).filter(u=>s||!a.includes(u.name));l.forEach(u=>{for(const d of c)e.removeMark(u.$from.pos,u.$to.pos,d)})}return!0},Lb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=t,a=ct(n,r.schema),{$from:c,empty:u,ranges:d}=l;if(!s)return!0;if(u&&o){let{from:h,to:f}=l;const p=(i=c.marks().find(g=>g.type===a))==null?void 0:i.attrs,m=gl(c,a,p);m&&(h=m.from,f=m.to),t.removeMark(h,f,a)}else d.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,a)});return t.removeStoredMark(a),!0},Pb=n=>({tr:e,state:t,dispatch:r})=>{const{selection:s}=t;let i,o;return typeof n=="number"?(i=n,o=n):n&&"from"in n&&"to"in n?(i=n.from,o=n.to):(i=s.from,o=s.to),r&&e.doc.nodesBetween(i,o,(l,a)=>{if(l.isText)return;const c={...l.attrs};delete c.dir,e.setNodeMarkup(a,void 0,c)}),!0},zb=(n,e={})=>({tr:t,state:r,dispatch:s})=>{let i=null,o=null;const l=hi(typeof n=="string"?n:n.name,r.schema);if(!l)return!1;l==="node"&&(i=re(n,r.schema)),l==="mark"&&(o=ct(n,r.schema));let a=!1;return t.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let h,f,p,m;t.selection.empty?r.doc.nodesBetween(u,d,(g,y)=>{i&&i===g.type&&(a=!0,p=Math.max(y,u),m=Math.min(y+g.nodeSize,d),h=y,f=g)}):r.doc.nodesBetween(u,d,(g,y)=>{y=u&&y<=d&&(i&&i===g.type&&(a=!0,s&&t.setNodeMarkup(y,void 0,{...g.attrs,...e})),o&&g.marks.length&&g.marks.forEach(x=>{if(o===x.type&&(a=!0,s)){const C=Math.max(y,u),v=Math.min(y+g.nodeSize,d);t.addMark(C,v,o.create({...x.attrs,...e}))}}))}),f&&(h!==void 0&&s&&t.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(g=>{o===g.type&&s&&t.addMark(p,m,o.create({...g.attrs,...e}))}))}),a},Bb=(n,e={})=>({state:t,dispatch:r})=>{const s=re(n,t.schema);return og(s,e)(t,r)},$b=(n,e={})=>({state:t,dispatch:r})=>{const s=re(n,t.schema);return lg(s,e)(t,r)},Fb=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){const t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){const t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){const t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}},pi=class{constructor(n){var e;this.find=n.find,this.handler=n.handler,this.undoable=(e=n.undoable)!=null?e:!0}},jb=(n,e)=>{if(ml(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Fr(n){var e;const{editor:t,from:r,to:s,text:i,rules:o,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const d=ub(c)+i;return o.forEach(h=>{if(u)return;const f=jb(d,h.find);if(!f)return;const p=a.state.tr,m=ui({state:a.state,transaction:p}),g={from:r-(f[0].length-i.length),to:s},{commands:y,chain:x,can:C}=new di({editor:t,state:m});h.handler({state:m,range:g,match:f,commands:y,chain:x,can:C})===null||!p.steps.length||(h.undoable&&p.setMeta(l,{transform:p,from:r,to:s,text:i}),a.dispatch(p),u=!0)}),u}function Hb(n){const{editor:e,rules:t}=n,r=new G({state:{init(){return null},apply(s,i,o){const l=s.getMeta(r);if(l)return l;const a=s.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=bl(w.from(u),o.schema);const{from:d}=a,h=d+u.length;Fr({editor:e,from:d,to:h,text:u,rules:t,plugin:r})}),s.selectionSet||s.docChanged?null:i}},props:{handleTextInput(s,i,o,l){return Fr({editor:e,from:i,to:o,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:i}=s.state.selection;i&&Fr({editor:e,from:i.pos,to:i.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(s,i){if(i.key!=="Enter")return!1;const{$cursor:o}=s.state.selection;return o?Fr({editor:e,from:o.pos,to:o.pos,text:` +`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function _b(n){return Object.prototype.toString.call(n).slice(8,-1)}function jr(n){return _b(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function gh(n,e){const t={...n};return jr(n)&&jr(e)&&Object.keys(e).forEach(r=>{jr(e[r])&&jr(n[r])?t[r]=gh(n[r],e[r]):t[r]=e[r]}),t}var Sl=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...H(O(this,"addOptions",{name:this.name}))}}get storage(){return{...H(O(this,"addStorage",{name:this.name,options:this.options}))}}configure(n={}){const e=this.extend({...this.config,addOptions:()=>gh(this.options,n)});return e.name=this.name,e.parent=this.parent,this.child=null,e}extend(n={}){const e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},Qt=class yh extends Sl{constructor(){super(...arguments),this.type="mark"}static create(e={}){const t=typeof e=="function"?e():e;return new yh(t)}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,s=e.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===t.name))return!1;const a=o.find(c=>(c==null?void 0:c.type.name)===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",s.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}};function Vb(n){return typeof n=="number"}var Wb=class{constructor(n){this.find=n.find,this.handler=n.handler}},qb=(n,e,t)=>{if(ml(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(s=>{const i=[s.text];return i.index=s.index,i.input=n,i.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(s.replaceWith)),i}):[]};function Ub(n){const{editor:e,state:t,from:r,to:s,rule:i,pasteEvent:o,dropEvent:l}=n,{commands:a,chain:c,can:u}=new di({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,s,(f,p)=>{var m,g,y,x,C;if((g=(m=f.type)==null?void 0:m.spec)!=null&&g.code||!(f.isText||f.isTextblock||f.isInline))return;const v=(C=(x=(y=f.content)==null?void 0:y.size)!=null?x:f.nodeSize)!=null?C:0,b=Math.max(r,p),A=Math.min(s,p+v);if(b>=A)return;const M=f.isText?f.text||"":f.textBetween(b-p,A-p,void 0,"");qb(M,i.find,o).forEach(z=>{if(z.index===void 0)return;const U=b+z.index+1,Te=U+z[0].length,Me={from:t.tr.mapping.map(U),to:t.tr.mapping.map(Te)},te=i.handler({state:t,range:Me,match:z,commands:a,chain:c,can:u,pasteEvent:o,dropEvent:l});d.push(te)})}),d.every(f=>f!==null)}var Hr=null,Kb=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function Jb(n){const{editor:e,rules:t}=n;let r=null,s=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const a=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const m=u.tr,g=ui({state:u,transaction:m});if(!(!Ub({editor:e,state:g,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return t.map(u=>new G({view(d){const h=p=>{var m;r=(m=d.dom.parentElement)!=null&&m.contains(p.target)?d.dom.parentElement:null,r&&(Hr=e)},f=()=>{Hr&&(Hr=null)};return window.addEventListener("dragstart",h),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",h),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(d,h)=>{if(i=r===d.dom.parentElement,l=h,!i){const f=Hr;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(d,h)=>{var f;const p=(f=h.clipboardData)==null?void 0:f.getData("text/html");return o=h,s=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],m=p.getMeta("uiEvent")==="paste"&&!s,g=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),x=!!y;if(!m&&!g&&!x)return;if(x){let{text:b}=y;typeof b=="string"?b=b:b=bl(w.from(b),f.schema);const{from:A}=y,M=A+b.length,L=Kb(b);return a({rule:u,state:f,from:A,to:{b:M},pasteEvt:L})}const C=h.doc.content.findDiffStart(f.doc.content),v=h.doc.content.findDiffEnd(f.doc.content);if(!(!Vb(C)||!v||C===v.b))return a({rule:u,state:f,from:C,to:v,pasteEvt:o})}}))}var mi=class{constructor(n,e){this.splittableMarks=[],this.nonClearableMarks=[],this.editor=e,this.baseExtensions=n,this.extensions=ah(n),this.schema=rb(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{const t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Rn(e.name,this.schema)},r=O(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){const{editor:n}=this;return ir([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:n,type:Rn(r.name,this.schema)},i=[],o=O(r,"addKeyboardShortcuts",s);let l={};if(r.type==="mark"&&O(r,"exitable",s)&&(l.ArrowRight=()=>Qt.handleExit({editor:n,mark:r})),o){const h=Object.fromEntries(Object.entries(o()).map(([f,p])=>[f,()=>p({editor:n})]));l={...l,...h}}const a=rk(l);i.push(a);const c=O(r,"addInputRules",s);if(kc(r,n.options.enableInputRules)&&c){const h=c();if(h&&h.length){const f=Hb({editor:n,rules:h}),p=Array.isArray(f)?f:[f];i.push(...p)}}const u=O(r,"addPasteRules",s);if(kc(r,n.options.enablePasteRules)&&u){const h=u();if(h&&h.length){const f=Jb({editor:n,rules:h});i.push(...f)}}const d=O(r,"addProseMirrorPlugins",s);if(d){const h=d();i.push(...h)}return i})}get attributes(){return lh(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:e}=Sn(this.extensions);return Object.fromEntries(e.filter(t=>!!O(t,"addNodeView")).map(t=>{const r=this.attributes.filter(a=>a.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:re(t.name,this.schema)},i=O(t,"addNodeView",s);if(!i)return[];const o=i();if(!o)return[];const l=(a,c,u,d,h)=>{const f=wn(a,r);return o({node:a,view:c,getPos:u,decorations:d,innerDecorations:h,editor:n,extension:t,HTMLAttributes:f})};return[t.name,l]}))}dispatchTransaction(n){const{editor:e}=this;return ir([...this.extensions].reverse()).reduceRight((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Rn(s.name,this.schema)},o=O(s,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:r})}:r},n)}transformPastedHTML(n){const{editor:e}=this;return ir([...this.extensions]).reduce((r,s)=>{const i={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:e,type:Rn(s.name,this.schema)},o=O(s,"transformPastedHTML",i);return o?(l,a)=>{const c=r(l,a);return o.call(i,c)}:r},n||(r=>r))}get markViews(){const{editor:n}=this,{markExtensions:e}=Sn(this.extensions);return Object.fromEntries(e.filter(t=>!!O(t,"addMarkView")).map(t=>{const r=this.attributes.filter(l=>l.type===t.name),s={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:ct(t.name,this.schema)},i=O(t,"addMarkView",s);if(!i)return[];const o=(l,a,c)=>{const u=wn(l,r);return i()({mark:l,view:a,inline:c,editor:n,extension:t,HTMLAttributes:u,updateAttributes:d=>{a0(l,n,d)}})};return[t.name,o]}))}destroy(){this.extensions.forEach(n=>{let e=n;for(;e.parent;){const t=e.parent;t.child===e&&(t.child=null),e=t}}),this.extensions=[],this.baseExtensions=[],this.schema=null,this.editor=null}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t,r;const s={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Rn(e.name,this.schema)};e.type==="mark"&&(((t=H(O(e,"keepOnSplit",s)))==null||t)&&this.splittableMarks.push(e.name),(r=H(O(e,"clearable",s)))==null||r||this.nonClearableMarks.push(e.name));const i=O(e,"onBeforeCreate",s),o=O(e,"onCreate",s),l=O(e,"onUpdate",s),a=O(e,"onSelectionUpdate",s),c=O(e,"onTransaction",s),u=O(e,"onFocus",s),d=O(e,"onBlur",s),h=O(e,"onDestroy",s);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),l&&this.editor.on("update",l),a&&this.editor.on("selectionUpdate",a),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}};mi.resolve=ah;mi.sort=ir;mi.flatten=kl;var Gb={};pl(Gb,{ClipboardTextSerializer:()=>bh,Commands:()=>xh,Delete:()=>Sh,Drop:()=>wh,Editable:()=>vh,FocusEvents:()=>Ch,Keymap:()=>Th,Paste:()=>Mh,Tabindex:()=>Ah,TextDirection:()=>Nh,focusEventsPluginKey:()=>Eh});var Y=class kh extends Sl{constructor(){super(...arguments),this.type="extension"}static create(e={}){const t=typeof e=="function"?e():e;return new kh(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},bh=Y.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new G({key:new se("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:s}=e,i=uh(t),{blockSeparator:o}=this.options,l={...o!==void 0?{blockSeparator:o}:{},textSerializers:i};return[...s.ranges].sort((c,u)=>c.$from.pos-u.$from.pos).map(({$from:c,$to:u})=>ch(r,{from:c.pos,to:u.pos},l)).join(o??` -`)}}})]}}),gh=Y.create({name:"commands",addCommands(){return{...Gd}}}),yh=Y.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,n))!=null?c:n.getMeta("y-sync$"))return;const u=th(n.before,[n,...e]);ah(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((f,p)=>{var m,g;if(f instanceof vn){const y=h.slice(p).map(f.from,-1),x=h.slice(p).map(f.to),C=h.invert().map(y,-1),v=h.invert().map(x),k=y>0?(m=u.doc.nodeAt(y-1))==null?void 0:m.marks.some(T=>T.eq(f.mark)):!1,M=(g=u.doc.nodeAt(x))==null?void 0:g.marks.some(T=>T.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:C,to:v},newRange:{from:y,to:x},partial:!!(M||k),editor:this.editor,transaction:n,combinedTransform:u})}})};(s=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),kh=Y.create({name:"drop",addProseMirrorPlugins(){return[new G({key:new re("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),bh=Y.create({name:"editable",addProseMirrorPlugins(){return[new G({key:new re("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xh=new re("focusEvents"),Sh=Y.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new G({key:xh,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),wh=Y.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?l.doc.resolve(h-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:z.atStart(c).from===h;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return gr()||Zd()?i:s},addProseMirrorPlugins(){return[new G({key:new re("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(m=>m.getMeta("composition")))return;const r=n.some(m=>m.docChanged)&&!e.doc.eq(t.doc),s=n.some(m=>m.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=z.atStart(e.doc).from,c=z.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!kr(t.doc))return;const h=t.tr,f=ii({state:t,transaction:h}),{commands:p}=new oi({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),vh=Y.create({name:"paste",addProseMirrorPlugins(){return[new G({key:new re("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Eh=Y.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new G({key:new re("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!=null?n:"0"}}}})]}}),Ch=Y.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=yn(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new G({key:new re("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),_b=class _n{constructor(e,t,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new _n(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new _n(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new _n(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const s=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new _n(a,this.editor,s,s||o?t:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(t).length>0){const i=s.node.attrs,o=Object.keys(t);for(let l=0;l{r&&s.length>0||(o.node.type.name===e&&i.every(a=>t[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,t,r))))}),s}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},jb=`.ProseMirror { +`)}}})]}}),xh=Y.create({name:"commands",addCommands(){return{...Zd}}}),Sh=Y.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,s;const i=()=>{var o,l,a,c;if((c=(a=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,n))!=null?c:n.getMeta("y-sync$"))return;const u=ih(n.before,[n,...e]);hh(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,m)=>{const g=m+p.nodeSize-2,y=f.oldRange.from<=m&&g<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:f.oldRange,newRange:f.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:u})})});const h=u.mapping;u.steps.forEach((f,p)=>{var m,g;if(f instanceof Mn){const y=h.slice(p).map(f.from,-1),x=h.slice(p).map(f.to),C=h.invert().map(y,-1),v=h.invert().map(x),b=y>0?(m=u.doc.nodeAt(y-1))==null?void 0:m.marks.some(M=>M.eq(f.mark)):!1,A=(g=u.doc.nodeAt(x))==null?void 0:g.marks.some(M=>M.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:C,to:v},newRange:{from:y,to:x},partial:!!(A||b),editor:this.editor,transaction:n,combinedTransform:u})}})};(s=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||s?setTimeout(i,0):i()}}),wh=Y.create({name:"drop",addProseMirrorPlugins(){return[new G({key:new se("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),vh=Y.create({name:"editable",addProseMirrorPlugins(){return[new G({key:new se("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Eh=new se("focusEvents"),Ch=Y.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new G({key:Eh,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Th=Y.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:a,doc:c}=l,{empty:u,$anchor:d}=a,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?l.doc.resolve(h-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,y=m&&p.parent.childCount===1?g===d.pos:P.atStart(c).from===h;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},i={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xr()||rh()?i:s},addProseMirrorPlugins(){return[new G({key:new se("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(m=>m.getMeta("composition")))return;const r=n.some(m=>m.docChanged)&&!e.doc.eq(t.doc),s=n.some(m=>m.getMeta("preventClearDocument"));if(!r||s)return;const{empty:i,from:o,to:l}=e.selection,a=P.atStart(e.doc).from,c=P.atEnd(e.doc).to;if(i||!(o===a&&l===c)||!wr(t.doc))return;const h=t.tr,f=ui({state:t,transaction:h}),{commands:p}=new di({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),Mh=Y.create({name:"paste",addProseMirrorPlugins(){return[new G({key:new se("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Ah=Y.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new G({key:new se("tabindex"),props:{attributes:()=>{var n;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(n=this.options.value)!=null?n:"0"}}}})]}}),Nh=Y.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Sn(this.extensions);return[{types:n.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const t=e.getAttribute("dir");return t&&(t==="ltr"||t==="rtl"||t==="auto")?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new G({key:new se("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),Yb=class qn{constructor(e,t,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=s}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new qn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new qn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new qn(e,this.editor)}get children(){const e=[];return this.node.content.forEach((t,r)=>{const s=t.isBlock&&!t.isTextblock,i=t.isAtom&&!t.isText,o=t.isInline,l=this.pos+r+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(l);if(!s&&!o&&a.depth<=this.depth)return;const c=new qn(a,this.editor,s,s||o?t:null);s&&(c.actualDepth=this.depth+1),e.push(c)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===e)if(Object.keys(t).length>0){const i=s.node.attrs,o=Object.keys(t);for(let l=0;l{r&&s.length>0||(o.node.type.name===e&&i.every(a=>t[a]===o.node.attrs[a])&&s.push(o),!(r&&s.length>0)&&(s=s.concat(o.querySelectorAll(e,t,r))))}),s}setAttribute(e){const{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Xb=`.ProseMirror { position: relative; } @@ -90,26 +90,26 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;function Th(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),s.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(s),s}var Vb=class extends Ob{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ob,createMappablePosition:lb},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=Xd(e,this.options.autofocus);this.editorState=dn.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Th(jb,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=nh(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;t=t.filter(o=>!o.key.startsWith(i))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e,t,r;const i=[...this.options.enableCoreExtensions?[bh,mh.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),gh,Sh,wh,Eh.configure({value:(r=(t=this.options.coreExtensionOptions)==null?void 0:t.tabindex)==null?void 0:r.value}),kh,vh,yh,Ch.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new ui(i,this)}createCommandManager(){this.commandManager=new oi({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=vo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=vo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=t?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new Kd(n,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),s=t.includes(n),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),a=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return lh(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return nb(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ml(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=` +}`;function Oh(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const s=document.createElement("style");return e&&s.setAttribute("nonce",e),s.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),s.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(s),s}var Qb=class extends Fb{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:mb,createMappablePosition:gb},this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:s,moved:i})=>this.options.onDrop(r,s,i)),this.on("paste",({event:r,slice:s})=>this.options.onPaste(r,s)),this.on("delete",this.options.onDelete);const e=this.createDoc(),t=th(e,this.options.autofocus);this.editorState=mn.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n!=null&&n.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Oh(Xb,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){const t=oh(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;const e=this.state.plugins;let t=e;if([].concat(n).forEach(s=>{const i=typeof s=="string"?`${s}$`:s.key;t=t.filter(o=>!o.key.startsWith(i))}),e.length===t.length)return;const r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e,t,r;const i=[...this.options.enableCoreExtensions?[vh,bh.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),xh,Ch,Th,Ah.configure({value:(r=(t=this.options.coreExtensionOptions)==null?void 0:t.tabindex)==null?void 0:r.value}),wh,Mh,Sh,Nh.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new mi(i,this)}createCommandManager(){this.commandManager=new di({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Mo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=Mo(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){const{editorProps:e,enableExtensionDispatchTransaction:t}=this.options,r=e.dispatchTransaction||this.dispatchTransaction.bind(this),s=t?this.extensionManager.dispatchTransaction(r):r,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new Xd(n,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:s,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const a=this.view.dom;a.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}const{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),s=t.includes(n),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!s)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});const o=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),a=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),a&&this.emit("blur",{editor:this,event:a.event,transaction:o}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return dh(this.state,n)}isActive(n,e){const t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return db(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return bl(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:e=` -`,textSerializers:t={}}=n||{};return Yk(this.state.doc,{blockSeparator:e,textSerializers:{...oh(this.schema),...t}})}get isEmpty(){return kr(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n),t=n>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new _b(e,this,!1,t)}get $doc(){return this.$pos(0)}};function bn(n){return new ci({find:n.find,handler:({state:e,range:t,match:r})=>{const s=j(n.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),u=c+o.length;if(gl(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===n.type&&m!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&i.delete(t.from+a,c);const h=t.from+a+o.length;i.addMark(t.from+a,h,n.type.create(s||{})),i.removeStoredMark(n.type)}},undoable:n.undoable})}function Mh(n){return new ci({find:n.find,handler:({state:e,range:t,match:r})=>{const s=j(n.getAttributes,void 0,r)||{},{tr:i}=e,o=t.from;let l=t.to;const a=n.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=n.type.isInline?o:o-1;i.insert(c,n.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:n.undoable})}function Co(n){return new ci({find:n.find,handler:({state:e,range:t,match:r})=>{const s=e.doc.resolve(t.from),i=j(n.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)},undoable:n.undoable})}function xn(n){return new ci({find:n.find,handler:({state:e,range:t,match:r,chain:s})=>{const i=j(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),c=a&&Yo(a,n.type,i);if(!c)return null;if(o.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=n.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));o.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,i).run()}const u=o.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&vt(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&o.join(t.from-1)},undoable:n.undoable})}var Wb=n=>"touches"in n,qb=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,r,s,i,o;this.node=n.node,this.editor=n.editor,this.element=n.element,this.element.draggable=!1,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(e=n.options)!=null&&e.min&&(this.minSize={...this.minSize,...n.options.min}),(t=n.options)!=null&&t.max&&(this.maxSize=n.options.max),(r=n==null?void 0:n.options)!=null&&r.directions&&(this.directions=n.options.directions),(s=n.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(i=n.options)!=null&&i.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),(o=n.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!=null?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,e,t){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,e,t):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const e=document.createElement("div");return e.dataset.resizeHandle=n,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(n,e){const t=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");t&&(n.style.top="0"),r&&(n.style.bottom="0"),s&&(n.style.left="0"),i&&(n.style.right="0"),(e==="top"||e==="bottom")&&(n.style.left="0",n.style.right="0"),(e==="left"||e==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{let e;this.createCustomHandle?e=this.createCustomHandle(n):e=this.createHandle(n),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${n}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(n)),this.createCustomHandle||this.positionHandle(e,n),e.addEventListener("mousedown",t=>this.handleResizeStart(t,n)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,n)),this.handleMap.set(n,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,e=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,e){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Wb(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,n,e),i=this.applyConstraints(r,s,t);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(n,e,t){let r=this.startWidth,s=this.startHeight;const i=n.includes("right"),o=n.includes("left"),l=n.includes("bottom"),a=n.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+t:a&&(s=this.startHeight-t),(n==="right"||n==="left")&&(r=this.startWidth+(i?e:-e)),(n==="top"||n==="bottom")&&(s=this.startHeight+(l?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,n):{width:r,height:s}}applyConstraints(n,e,t){var r,s,i,o;if(!t){let c=Math.max(this.minSize.width,n),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=n,a=e;return lthis.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(n,e,t){const r=t==="left"||t==="right",s=t==="top"||t==="bottom";return r?{width:n,height:n/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:n,height:n/this.aspectRatio}}};function Ub(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof I){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}var Kb={};ul(Kb,{createAtomBlockMarkdownSpec:()=>Jb,createBlockMarkdownSpec:()=>Gb,createInlineMarkdownSpec:()=>Qb,parseAttributes:()=>kl,parseIndentedBlocks:()=>To,renderNestedMarkdownContent:()=>xl,serializeAttributes:()=>bl});function kl(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,c=>(t.push(c),`__QUOTED_${t.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var d;const h=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),f=t[h];f&&(e[c]=f.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function bl(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function Jb(n){const{nodeName:e,name:t,parseAttributes:r=kl,serializeAttributes:s=bl,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=n,a=t||e,c=u=>{if(!l)return u;const d={};return l.forEach(h=>{h in u&&(d[h]=u[h])}),d};return{parseMarkdown:(u,d)=>{const h={...i,...u.attributes};return d.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(u){var d;const h=new RegExp(`^:::${a}(?:\\s|$)`,"m"),f=(d=u.match(h))==null?void 0:d.index;return f!==void 0?f:-1},tokenize(u,d,h){const f=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!o.find(x=>!(x in g)))return{type:e,raw:p[0],attributes:g}}},renderMarkdown:u=>{const d=c(u.attrs||{}),h=s(d),f=h?` {${h}}`:"";return`:::${a}${f} :::`}}}function Gb(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=kl,serializeAttributes:i=bl,defaultAttributes:o={},content:l="block",allowedAttributes:a}=n,c=t||e,u=d=>{if(!a)return d;const h={};return a.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{let f;if(r){const m=r(d);f=typeof m=="string"?[{type:"text",text:m}]:m}else l==="block"?f=h.parseChildren(d.tokens||[]):f=h.parseInline(d.tokens||[]);const p={...o,...d.attributes};return h.createNode(e,p,f)},markdownTokenizer:{name:e,level:"block",start(d){var h;const f=new RegExp(`^:::${c}`,"m"),p=(h=d.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(d,h,f){var p;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=d.match(m);if(!g)return;const[y,x=""]=g,C=s(x);let v=1;const k=y.length;let M="";const T=/^:::([\w-]*)(\s.*)?/gm,L=d.slice(k);for(T.lastIndex=0;;){const O=T.exec(L);if(O===null)break;const $=O.index,de=O[1];if(!((p=O[2])!=null&&p.endsWith(":::"))){if(de)v+=1;else if(v-=1,v===0){const se=L.slice(0,$);M=se.trim();const ne=d.slice(0,k+$+O[0].length);let H=[];if(M)if(l==="block")for(H=f.blockTokens(se),H.forEach(U=>{U.text&&(!U.tokens||U.tokens.length===0)&&(U.tokens=f.inlineTokens(U.text))});H.length>0;){const U=H[H.length-1];if(U.type==="paragraph"&&(!U.text||U.text.trim()===""))H.pop();else break}else H=f.inlineTokens(M);return{type:e,raw:ne,attributes:C,content:M,tokens:H}}}}}},renderMarkdown:(d,h)=>{const f=u(d.attrs||{}),p=i(f),m=p?` {${p}}`:"",g=h.renderChildren(d.content||[],` +`,textSerializers:t={}}=n||{};return ib(this.state.doc,{blockSeparator:e,textSerializers:{...uh(this.schema),...t}})}get isEmpty(){return wr(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){const e=this.state.doc.resolve(n),t=n>0&&e.nodeAfter&&!e.nodeAfter.isText?e.nodeAfter:null;return new Yb(e,this,!1,t)}get $doc(){return this.$pos(0)}};function vn(n){return new pi({find:n.find,handler:({state:e,range:t,match:r})=>{const s=H(n.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:i}=e,o=r[r.length-1],l=r[0];if(o){const a=l.search(/\S/),c=t.from+l.indexOf(o),u=c+o.length;if(xl(t.from,t.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===n.type&&m!==f.mark.type)).filter(f=>f.to>c).length)return null;ut.from&&i.delete(t.from+a,c);const h=t.from+a+o.length;i.addMark(t.from+a,h,n.type.create(s||{})),i.removeStoredMark(n.type)}},undoable:n.undoable})}function Rh(n){return new pi({find:n.find,handler:({state:e,range:t,match:r})=>{const s=H(n.getAttributes,void 0,r)||{},{tr:i}=e,o=t.from;let l=t.to;const a=n.type.create(s);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>l?u=l:l=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,o+r[0].length-1),i.replaceWith(u,l,a)}else if(r[0]){const c=n.type.isInline?o:o-1;i.insert(c,n.type.create(s)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:n.undoable})}function No(n){return new pi({find:n.find,handler:({state:e,range:t,match:r})=>{const s=e.doc.resolve(t.from),i=H(n.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,i)},undoable:n.undoable})}function En(n){return new pi({find:n.find,handler:({state:e,range:t,match:r,chain:s})=>{const i=H(n.getAttributes,void 0,r)||{},o=e.tr.delete(t.from,t.to),a=o.doc.resolve(t.from).blockRange(),c=a&&el(a,n.type,i);if(!c)return null;if(o.wrap(a,c),n.keepMarks&&n.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=n.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const m=p.filter(g=>f.includes(g.type.name));o.ensureMarks(m)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(d,i).run()}const u=o.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Mt(o.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&o.join(t.from-1)},undoable:n.undoable})}var Zb=n=>"touches"in n,e0=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(a,c)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const a=l.touches[0];if(!a)return;const c=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(c,u)},this.handleMouseUp=()=>{if(!this.isResizing)return;const l=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(l,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,t,r,s,i,o;this.node=n.node,this.editor=n.editor,this.element=n.element,this.element.draggable=!1,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(e=n.options)!=null&&e.min&&(this.minSize={...this.minSize,...n.options.min}),(t=n.options)!=null&&t.max&&(this.maxSize=n.options.max),(r=n==null?void 0:n.options)!=null&&r.directions&&(this.directions=n.options.directions),(s=n.options)!=null&&s.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(i=n.options)!=null&&i.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),(o=n.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=n.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var n;return(n=this.contentElement)!=null?n:null}handleEditorUpdate(){const n=this.editor.isEditable;n!==this.lastEditableState&&(this.lastEditableState=n,n?n&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(n,e,t){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,e,t):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const e=document.createElement("div");return e.dataset.resizeHandle=n,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(n,e){const t=e.includes("top"),r=e.includes("bottom"),s=e.includes("left"),i=e.includes("right");t&&(n.style.top="0"),r&&(n.style.bottom="0"),s&&(n.style.left="0"),i&&(n.style.right="0"),(e==="top"||e==="bottom")&&(n.style.left="0",n.style.right="0"),(e==="left"||e==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{let e;this.createCustomHandle?e=this.createCustomHandle(n):e=this.createHandle(n),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${n}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(n)),this.createCustomHandle||this.positionHandle(e,n),e.addEventListener("mousedown",t=>this.handleResizeStart(t,n)),e.addEventListener("touchstart",t=>this.handleResizeStart(t,n)),this.handleMap.set(n,e),this.wrapper.appendChild(e)})}removeHandles(){this.handleMap.forEach(n=>n.remove()),this.handleMap.clear()}applyInitialSize(){const n=this.node.attrs.width,e=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,e){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=e,Zb(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,e){if(!this.activeHandle)return;const t=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:s}=this.calculateNewDimensions(this.activeHandle,n,e),i=this.applyConstraints(r,s,t);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(n,e,t){let r=this.startWidth,s=this.startHeight;const i=n.includes("right"),o=n.includes("left"),l=n.includes("bottom"),a=n.includes("top");return i?r=this.startWidth+e:o&&(r=this.startWidth-e),l?s=this.startHeight+t:a&&(s=this.startHeight-t),(n==="right"||n==="left")&&(r=this.startWidth+(i?e:-e)),(n==="top"||n==="bottom")&&(s=this.startHeight+(l?t:-t)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,s,n):{width:r,height:s}}applyConstraints(n,e,t){var r,s,i,o;if(!t){let c=Math.max(this.minSize.width,n),u=Math.max(this.minSize.height,e);return(r=this.maxSize)!=null&&r.width&&(c=Math.min(this.maxSize.width,c)),(s=this.maxSize)!=null&&s.height&&(u=Math.min(this.maxSize.height,u)),{width:c,height:u}}let l=n,a=e;return lthis.maxSize.width&&(l=this.maxSize.width,a=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&a>this.maxSize.height&&(a=this.maxSize.height,l=a*this.aspectRatio),{width:l,height:a}}applyAspectRatio(n,e,t){const r=t==="left"||t==="right",s=t==="top"||t==="bottom";return r?{width:n,height:n/this.aspectRatio}:s?{width:e*this.aspectRatio,height:e}:{width:n,height:n/this.aspectRatio}}};function t0(n,e){const{selection:t}=n,{$from:r}=t;if(t instanceof R){const i=r.index();return r.parent.canReplaceWith(i,i+1,e)}let s=r.depth;for(;s>=0;){const i=r.index(s);if(r.node(s).contentMatchAt(i).matchType(e))return!0;s-=1}return!1}var n0={};pl(n0,{createAtomBlockMarkdownSpec:()=>r0,createBlockMarkdownSpec:()=>s0,createInlineMarkdownSpec:()=>l0,parseAttributes:()=>wl,parseIndentedBlocks:()=>Oo,renderNestedMarkdownContent:()=>El,serializeAttributes:()=>vl});function wl(n){if(!(n!=null&&n.trim()))return{};const e={},t=[],r=n.replace(/["']([^"']*)["']/g,c=>(t.push(c),`__QUOTED_${t.length-1}__`)),s=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(s){const c=s.map(u=>u.trim().slice(1));e.class=c.join(" ")}const i=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,c,u])=>{var d;const h=parseInt(((d=u.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),f=t[h];f&&(e[c]=f.slice(1,-1))});const a=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function vl(n){if(!n||Object.keys(n).length===0)return"";const e=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(r=>e.push(`.${r}`)),n.id&&e.push(`#${n.id}`),Object.entries(n).forEach(([t,r])=>{t==="class"||t==="id"||(r===!0?e.push(t):r!==!1&&r!=null&&e.push(`${t}="${String(r)}"`))}),e.join(" ")}function r0(n){const{nodeName:e,name:t,parseAttributes:r=wl,serializeAttributes:s=vl,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=n,a=t||e,c=u=>{if(!l)return u;const d={};return l.forEach(h=>{h in u&&(d[h]=u[h])}),d};return{parseMarkdown:(u,d)=>{const h={...i,...u.attributes};return d.createNode(e,h,[])},markdownTokenizer:{name:e,level:"block",start(u){var d;const h=new RegExp(`^:::${a}(?:\\s|$)`,"m"),f=(d=u.match(h))==null?void 0:d.index;return f!==void 0?f:-1},tokenize(u,d,h){const f=new RegExp(`^:::${a}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(f);if(!p)return;const m=p[1]||"",g=r(m);if(!o.find(x=>!(x in g)))return{type:e,raw:p[0],attributes:g}}},renderMarkdown:u=>{const d=c(u.attrs||{}),h=s(d),f=h?` {${h}}`:"";return`:::${a}${f} :::`}}}function s0(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=wl,serializeAttributes:i=vl,defaultAttributes:o={},content:l="block",allowedAttributes:a}=n,c=t||e,u=d=>{if(!a)return d;const h={};return a.forEach(f=>{f in d&&(h[f]=d[f])}),h};return{parseMarkdown:(d,h)=>{let f;if(r){const m=r(d);f=typeof m=="string"?[{type:"text",text:m}]:m}else l==="block"?f=h.parseChildren(d.tokens||[]):f=h.parseInline(d.tokens||[]);const p={...o,...d.attributes};return h.createNode(e,p,f)},markdownTokenizer:{name:e,level:"block",start(d){var h;const f=new RegExp(`^:::${c}`,"m"),p=(h=d.match(f))==null?void 0:h.index;return p!==void 0?p:-1},tokenize(d,h,f){var p;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=d.match(m);if(!g)return;const[y,x=""]=g,C=s(x);let v=1;const b=y.length;let A="";const M=/^:::([\w-]*)(\s.*)?/gm,L=d.slice(b);for(M.lastIndex=0;;){const z=M.exec(L);if(z===null)break;const U=z.index,Te=z[1];if(!((p=z[2])!=null&&p.endsWith(":::"))){if(Te)v+=1;else if(v-=1,v===0){const Me=L.slice(0,U);A=Me.trim();const te=d.slice(0,b+U+z[0].length);let $=[];if(A)if(l==="block")for($=f.blockTokens(Me),$.forEach(W=>{W.text&&(!W.tokens||W.tokens.length===0)&&(W.tokens=f.inlineTokens(W.text))});$.length>0;){const W=$[$.length-1];if(W.type==="paragraph"&&(!W.text||W.text.trim()===""))$.pop();else break}else $=f.inlineTokens(A);return{type:e,raw:te,attributes:C,content:A,tokens:$}}}}}},renderMarkdown:(d,h)=>{const f=u(d.attrs||{}),p=i(f),m=p?` {${p}}`:"",g=h.renderChildren(d.content||[],` `);return`:::${c}${m} ${g} -:::`}}}function Yb(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=t.exec(n)}return e}function Xb(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function Qb(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=Yb,serializeAttributes:i=Xb,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=n,c=t||e,u=h=>{if(!a)return h;const f={};return a.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in h){const y=h[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const p={...o,...h.attributes};if(l)return f.createNode(e,p);const m=r?r(h):h.content||"";return m?f.createNode(e,p,[f.createTextNode(m)]):f.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(h){const f=l?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),p=h.match(f),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(h,f,p){const m=l?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),g=h.match(m);if(!g)return;let y="",x="";if(l){const[,v]=g;x=v}else{const[,v,k]=g;x=v,y=k||""}const C=s(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:C}}},renderMarkdown:h=>{let f="";r?f=r(h):h.content&&h.content.length>0&&(f=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=u(h.attrs||{}),m=i(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${f}[/${c}]`}}}function To(n,e,t){var r,s,i,o;const l=n.split(` +:::`}}}function i0(n){if(!n.trim())return{};const e={},t=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=t.exec(n);for(;r!==null;){const[,s,i,o]=r;e[s]=i||o,r=t.exec(n)}return e}function o0(n){return Object.entries(n).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(" ")}function l0(n){const{nodeName:e,name:t,getContent:r,parseAttributes:s=i0,serializeAttributes:i=o0,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:a}=n,c=t||e,u=h=>{if(!a)return h;const f={};return a.forEach(p=>{const m=typeof p=="string"?p:p.name,g=typeof p=="string"?void 0:p.skipIfDefault;if(m in h){const y=h[m];if(g!==void 0&&y===g)return;f[m]=y}}),f},d=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(h,f)=>{const p={...o,...h.attributes};if(l)return f.createNode(e,p);const m=r?r(h):h.content||"";return m?f.createNode(e,p,[f.createTextNode(m)]):f.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(h){const f=l?new RegExp(`\\[${d}\\s*[^\\]]*\\]`):new RegExp(`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),p=h.match(f),m=p==null?void 0:p.index;return m!==void 0?m:-1},tokenize(h,f,p){const m=l?new RegExp(`^\\[${d}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),g=h.match(m);if(!g)return;let y="",x="";if(l){const[,v]=g;x=v}else{const[,v,b]=g;x=v,y=b||""}const C=s(x.trim());return{type:e,raw:g[0],content:y.trim(),attributes:C}}},renderMarkdown:h=>{let f="";r?f=r(h):h.content&&h.content.length>0&&(f=h.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const p=u(h.attrs||{}),m=i(p),g=m?` ${m}`:"";return l?`[${c}${g}]`:`[${c}${g}]${f}[/${c}]`}}}function Oo(n,e,t){var r,s,i,o;const l=n.split(` `),a=[];let c="",u=0;const d=e.baseIndentSize||2;for(;u0)break;if(h.trim()===""){u+=1,c=`${c}${h} `;continue}else return}const p=e.extractItemData(f),{indentLevel:m,mainContent:g}=p;c=`${c}${h} -`;const y=[g];for(u+=1;u$.trim()!=="");if(T===-1)break;if((((s=(r=l[u+1+T].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>m){y.push(k),c=`${c}${k} -`,u+=1;continue}else break}if((((o=(i=k.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>m)y.push(k),c=`${c}${k} -`,u+=1;else break}let x;const C=y.slice(1);if(C.length>0){const k=C.map(M=>M.slice(m+d)).join(` -`);k.trim()&&(e.customNestedParser?x=e.customNestedParser(k):x=t.blockTokens(k))}const v=e.createToken(p,x);a.push(v)}if(a.length!==0)return{items:a,raw:c}}function xl(n,e,t,r){if(!n||!Array.isArray(n.content))return"";const s=typeof t=="function"?t(r):t,[i,...o]=n.content,l=e.renderChildren([i]);let a=`${s}${l}`;return o&&o.length>0&&o.forEach((c,u)=>{var d,h;const f=(h=(d=e.renderChild)==null?void 0:d.call(e,c,u+1))!=null?h:e.renderChildren([c]);if(f!=null){const p=f.split(` +`;const y=[g];for(u+=1;uU.trim()!=="");if(M===-1)break;if((((s=(r=l[u+1+M].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:s.length)||0)>m){y.push(b),c=`${c}${b} +`,u+=1;continue}else break}if((((o=(i=b.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>m)y.push(b),c=`${c}${b} +`,u+=1;else break}let x;const C=y.slice(1);if(C.length>0){const b=C.map(A=>A.slice(m+d)).join(` +`);b.trim()&&(e.customNestedParser?x=e.customNestedParser(b):x=t.blockTokens(b))}const v=e.createToken(p,x);a.push(v)}if(a.length!==0)return{items:a,raw:c}}function El(n,e,t,r){if(!n||!Array.isArray(n.content))return"";const s=typeof t=="function"?t(r):t,[i,...o]=n.content,l=e.renderChildren([i]);let a=`${s}${l}`;return o&&o.length>0&&o.forEach((c,u)=>{var d,h;const f=(h=(d=e.renderChild)==null?void 0:d.call(e,c,u+1))!=null?h:e.renderChildren([c]);if(f!=null){const p=f.split(` `).map(m=>m?e.indent(m):e.indent("")).join(` `);a+=c.type==="paragraph"?` ${p}`:` -${p}`}}),a}function Zb(n,e,t={}){const{state:r}=e,{doc:s,tr:i}=r,o=n;s.descendants((l,a)=>{const c=i.mapping.map(a),u=i.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=n.type.create({...n.attrs,...t});i.removeMark(c,u,n.type),i.addMark(c,u,f)}}),i.docChanged&&e.view.dispatch(i)}var Ce=class Ah extends yl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Ah(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},e0=class{constructor(n,e,t){this.isDragging=!1,this.component=n,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(n){var e,t,r,s,i,o,l;const{view:a}=this.editor,c=n.target,u=c.nodeType===3?(e=c.parentElement)==null?void 0:e.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(c)||!u)return;let d=0,h=0;if(this.dom!==u){const x=this.dom.getBoundingClientRect(),C=u.getBoundingClientRect(),v=(s=n.offsetX)!=null?s:(r=n.nativeEvent)==null?void 0:r.offsetX,k=(o=n.offsetY)!=null?o:(i=n.nativeEvent)==null?void 0:i.offsetY;d=C.x-x.x+v,h=C.y-x.y+k}const f=this.dom.cloneNode(!0);try{const x=this.dom.getBoundingClientRect();f.style.width=`${Math.round(x.width)}px`,f.style.height=`${Math.round(x.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(f),document.body.appendChild(p),(l=n.dataTransfer)==null||l.setDragImage(f,d,h)}finally{p&&setTimeout(()=>{try{p==null||p.remove()}catch{}},0)}const m=this.getPos();if(typeof m!="number")return;const g=I.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(n){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:n});const t=n.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const s=n.type.startsWith("drag"),i=n.type==="dragover"||n.type==="dragenter",o=n.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!o&&!s)return!0;const{isEditable:a}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=I.isSelectable(this.node),h=n.type==="copy",f=n.type==="paste",p=n.type==="cut",m=n.type==="mousedown";if(!u&&d&&s&&n.target===this.dom&&n.preventDefault(),u&&s&&!c&&n.target===this.dom)return n.preventDefault(),!1;if(u&&a&&!c&&m){const g=t.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||i||o||h||f||p||m&&d)}ignoreMutation(n){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:n}):this.node.isLeaf||this.node.isAtom?!0:n.type==="selection"||this.dom.contains(n.target)&&n.type==="childList"&&(gr()||wo())&&this.editor.isFocused&&[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===n.target&&n.type==="attributes"?!0:!this.contentDOM.contains(n.target)}updateAttributes(n){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...n}),!0)})}deleteNode(){const n=this.getPos();if(typeof n!="number")return;const e=n+this.node.nodeSize;this.editor.commands.deleteRange({from:n,to:e})}};function Wt(n){return new Pb({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:s})=>{const i=j(n.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),h=d+l.length;if(gl(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;ht.from&&o.delete(t.from+u,d),c=t.from+u+l.length,o.addMark(t.from+u,c,n.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:t0,getOwnPropertySymbols:n0}=Object,{hasOwnProperty:r0}=Object.prototype;function Pi(n,e){return function(r,s,i){return n(r,s,i)&&e(r,s,i)}}function $r(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:i}=s,o=i.get(t),l=i.get(r);if(o&&l)return o===r&&l===t;i.set(t,r),i.set(r,t);const a=n(t,r,s);return i.delete(t),i.delete(r),a}}function s0(n){return n!=null?n[Symbol.toStringTag]:void 0}function gc(n){return t0(n).concat(n0(n))}const i0=Object.hasOwn||((n,e)=>r0.call(n,e));function Gt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const o0="__v",l0="__o",a0="_owner",{getOwnPropertyDescriptor:yc,keys:kc}=Object;function c0(n,e){return n.byteLength===e.byteLength&&xs(new Uint8Array(n),new Uint8Array(e))}function u0(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function d0(n,e){return n.byteLength===e.byteLength&&xs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function h0(n,e){return Gt(n.getTime(),e.getTime())}function f0(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function p0(n,e){return n===e}function bc(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.entries();let o,l,a=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const h=o.value,f=l.value;if(t.equals(h[0],f[0],a,d,n,e,t)&&t.equals(h[1],f[1],h[0],f[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const m0=Gt;function g0(n,e,t){const r=kc(n);let s=r.length;if(kc(e).length!==s)return!1;for(;s-- >0;)if(!Nh(n,e,t,r[s]))return!1;return!0}function An(n,e,t){const r=gc(n);let s=r.length;if(gc(e).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!Nh(n,e,t,i)||(o=yc(n,i),l=yc(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function y0(n,e){return Gt(n.valueOf(),e.valueOf())}function k0(n,e){return n.source===e.source&&n.flags===e.flags}function xc(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.values();let o,l;for(;(o=i.next())&&!o.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(o.value,l.value,o.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function xs(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function b0(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Nh(n,e,t,r){return(r===a0||r===l0||r===o0)&&(n.$$typeof||e.$$typeof)?!0:i0(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const x0="[object ArrayBuffer]",S0="[object Arguments]",w0="[object Boolean]",v0="[object DataView]",E0="[object Date]",C0="[object Error]",T0="[object Map]",M0="[object Number]",A0="[object Object]",N0="[object RegExp]",O0="[object Set]",R0="[object String]",I0={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},D0="[object URL]",L0=Object.prototype.toString;function P0({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:p}){return function(g,y,x){if(g===y)return!0;if(g==null||y==null)return!1;const C=typeof g;if(C!==typeof y)return!1;if(C!=="object")return C==="number"?l(g,y,x):C==="function"?i(g,y,x):!1;const v=g.constructor;if(v!==y.constructor)return!1;if(v===Object)return a(g,y,x);if(Array.isArray(g))return e(g,y,x);if(v===Date)return r(g,y,x);if(v===RegExp)return u(g,y,x);if(v===Map)return o(g,y,x);if(v===Set)return d(g,y,x);const k=L0.call(g);if(k===E0)return r(g,y,x);if(k===N0)return u(g,y,x);if(k===T0)return o(g,y,x);if(k===O0)return d(g,y,x);if(k===A0)return typeof g.then!="function"&&typeof y.then!="function"&&a(g,y,x);if(k===D0)return f(g,y,x);if(k===C0)return s(g,y,x);if(k===S0)return a(g,y,x);if(I0[k])return h(g,y,x);if(k===x0)return n(g,y,x);if(k===v0)return t(g,y,x);if(k===w0||k===M0||k===R0)return c(g,y,x);if(p){let M=p[k];if(!M){const T=s0(g);T&&(M=p[T])}if(M)return M(g,y,x)}return!1}}function z0({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:c0,areArraysEqual:t?An:u0,areDataViewsEqual:d0,areDatesEqual:h0,areErrorsEqual:f0,areFunctionsEqual:p0,areMapsEqual:t?Pi(bc,An):bc,areNumbersEqual:m0,areObjectsEqual:t?An:g0,arePrimitiveWrappersEqual:y0,areRegExpsEqual:k0,areSetsEqual:t?Pi(xc,An):xc,areTypedArraysEqual:t?Pi(xs,An):xs,areUrlsEqual:b0,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=$r(r.areArraysEqual),i=$r(r.areMapsEqual),o=$r(r.areObjectsEqual),l=$r(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function B0(n){return function(e,t,r,s,i,o,l){return n(e,t,l)}}function $0({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,i)}}const F0=Ct();Ct({strict:!0});Ct({circular:!0});Ct({circular:!0,strict:!0});Ct({createInternalComparator:()=>Gt});Ct({strict:!0,createInternalComparator:()=>Gt});Ct({circular:!0,createInternalComparator:()=>Gt});Ct({circular:!0,createInternalComparator:()=>Gt,strict:!0});function Ct(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,i=z0(n),o=P0(i),l=t?t(o):B0(o);return $0({circular:e,comparator:o,createState:r,equals:l,strict:s})}var Oh={exports:{}},Rh={};/** +${p}`}}),a}function a0(n,e,t={}){const{state:r}=e,{doc:s,tr:i}=r,o=n;s.descendants((l,a)=>{const c=i.mapping.map(a),u=i.mapping.map(a)+l.nodeSize;let d=null;if(l.marks.forEach(f=>{if(f!==o)return!1;d=f}),!d)return;let h=!1;if(Object.keys(t).forEach(f=>{t[f]!==d.attrs[f]&&(h=!0)}),h){const f=n.type.create({...n.attrs,...t});i.removeMark(c,u,n.type),i.addMark(c,u,f)}}),i.docChanged&&e.view.dispatch(i)}var Ce=class Dh extends Sl{constructor(){super(...arguments),this.type="node"}static create(e={}){const t=typeof e=="function"?e():e;return new Dh(t)}configure(e){return super.configure(e)}extend(e){const t=typeof e=="function"?e():e;return super.extend(t)}},c0=class{constructor(n,e,t){this.isDragging=!1,this.component=n,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(n){var e,t,r,s,i,o,l;const{view:a}=this.editor,c=n.target,u=c.nodeType===3?(e=c.parentElement)==null?void 0:e.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||(t=this.contentDOM)!=null&&t.contains(c)||!u)return;let d=0,h=0;if(this.dom!==u){const x=this.dom.getBoundingClientRect(),C=u.getBoundingClientRect(),v=(s=n.offsetX)!=null?s:(r=n.nativeEvent)==null?void 0:r.offsetX,b=(o=n.offsetY)!=null?o:(i=n.nativeEvent)==null?void 0:i.offsetY;d=C.x-x.x+v,h=C.y-x.y+b}const f=this.dom.cloneNode(!0);try{const x=this.dom.getBoundingClientRect();f.style.width=`${Math.round(x.width)}px`,f.style.height=`${Math.round(x.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(f),document.body.appendChild(p),(l=n.dataTransfer)==null||l.setDragImage(f,d,h)}finally{p&&setTimeout(()=>{try{p==null||p.remove()}catch{}},0)}const m=this.getPos();if(typeof m!="number")return;const g=R.create(a.state.doc,m),y=a.state.tr.setSelection(g);a.dispatch(y)}stopEvent(n){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:n});const t=n.target;if(!(this.dom.contains(t)&&!((e=this.contentDOM)!=null&&e.contains(t))))return!1;const s=n.type.startsWith("drag"),i=n.type==="dragover"||n.type==="dragenter",o=n.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(t.tagName)||t.isContentEditable)&&!o&&!s)return!0;const{isEditable:a}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=R.isSelectable(this.node),h=n.type==="copy",f=n.type==="paste",p=n.type==="cut",m=n.type==="mousedown";if(!u&&d&&s&&n.target===this.dom&&n.preventDefault(),u&&s&&!c&&n.target===this.dom)return n.preventDefault(),!1;if(u&&a&&!c&&m){const g=t.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||i||o||h||f||p||m&&d)}ignoreMutation(n){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:n}):this.node.isLeaf||this.node.isAtom?!0:n.type==="selection"||this.dom.contains(n.target)&&n.type==="childList"&&(xr()||To())&&this.editor.isFocused&&[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===n.target&&n.type==="attributes"?!0:!this.contentDOM.contains(n.target)}updateAttributes(n){this.editor.commands.command(({tr:e})=>{const t=this.getPos();return typeof t!="number"?!1:(e.setNodeMarkup(t,void 0,{...this.node.attrs,...n}),!0)})}deleteNode(){const n=this.getPos();if(typeof n!="number")return;const e=n+this.node.nodeSize;this.editor.commands.deleteRange({from:n,to:e})}};function Jt(n){return new Wb({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:s})=>{const i=H(n.getAttributes,void 0,r,s);if(i===!1||i===null)return null;const{tr:o}=e,l=r[r.length-1],a=r[0];let c=t.to;if(l){const u=a.search(/\S/),d=t.from+a.indexOf(l),h=d+l.length;if(xl(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===n.type&&y!==m.mark.type)).filter(m=>m.to>d).length)return null;ht.from&&o.delete(t.from+u,d),c=t.from+u+l.length,o.addMark(t.from+u,c,n.type.create(i||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(n.type)}}})}const{getOwnPropertyNames:u0,getOwnPropertySymbols:d0}=Object,{hasOwnProperty:h0}=Object.prototype;function Fi(n,e){return function(r,s,i){return n(r,s,i)&&e(r,s,i)}}function _r(n){return function(t,r,s){if(!t||!r||typeof t!="object"||typeof r!="object")return n(t,r,s);const{cache:i}=s,o=i.get(t),l=i.get(r);if(o&&l)return o===r&&l===t;i.set(t,r),i.set(r,t);const a=n(t,r,s);return i.delete(t),i.delete(r),a}}function f0(n){return n!=null?n[Symbol.toStringTag]:void 0}function xc(n){return u0(n).concat(d0(n))}const p0=Object.hasOwn||((n,e)=>h0.call(n,e));function Zt(n,e){return n===e||!n&&!e&&n!==n&&e!==e}const m0="__v",g0="__o",y0="_owner",{getOwnPropertyDescriptor:Sc,keys:wc}=Object;function k0(n,e){return n.byteLength===e.byteLength&&Cs(new Uint8Array(n),new Uint8Array(e))}function b0(n,e,t){let r=n.length;if(e.length!==r)return!1;for(;r-- >0;)if(!t.equals(n[r],e[r],r,r,n,e,t))return!1;return!0}function x0(n,e){return n.byteLength===e.byteLength&&Cs(new Uint8Array(n.buffer,n.byteOffset,n.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function S0(n,e){return Zt(n.getTime(),e.getTime())}function w0(n,e){return n.name===e.name&&n.message===e.message&&n.cause===e.cause&&n.stack===e.stack}function v0(n,e){return n===e}function vc(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.entries();let o,l,a=0;for(;(o=i.next())&&!o.done;){const c=e.entries();let u=!1,d=0;for(;(l=c.next())&&!l.done;){if(s[d]){d++;continue}const h=o.value,f=l.value;if(t.equals(h[0],f[0],a,d,n,e,t)&&t.equals(h[1],f[1],h[0],f[0],n,e,t)){u=s[d]=!0;break}d++}if(!u)return!1;a++}return!0}const E0=Zt;function C0(n,e,t){const r=wc(n);let s=r.length;if(wc(e).length!==s)return!1;for(;s-- >0;)if(!Ih(n,e,t,r[s]))return!1;return!0}function Dn(n,e,t){const r=xc(n);let s=r.length;if(xc(e).length!==s)return!1;let i,o,l;for(;s-- >0;)if(i=r[s],!Ih(n,e,t,i)||(o=Sc(n,i),l=Sc(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function T0(n,e){return Zt(n.valueOf(),e.valueOf())}function M0(n,e){return n.source===e.source&&n.flags===e.flags}function Ec(n,e,t){const r=n.size;if(r!==e.size)return!1;if(!r)return!0;const s=new Array(r),i=n.values();let o,l;for(;(o=i.next())&&!o.done;){const a=e.values();let c=!1,u=0;for(;(l=a.next())&&!l.done;){if(!s[u]&&t.equals(o.value,l.value,o.value,l.value,n,e,t)){c=s[u]=!0;break}u++}if(!c)return!1}return!0}function Cs(n,e){let t=n.byteLength;if(e.byteLength!==t||n.byteOffset!==e.byteOffset)return!1;for(;t-- >0;)if(n[t]!==e[t])return!1;return!0}function A0(n,e){return n.hostname===e.hostname&&n.pathname===e.pathname&&n.protocol===e.protocol&&n.port===e.port&&n.hash===e.hash&&n.username===e.username&&n.password===e.password}function Ih(n,e,t,r){return(r===y0||r===g0||r===m0)&&(n.$$typeof||e.$$typeof)?!0:p0(e,r)&&t.equals(n[r],e[r],r,r,n,e,t)}const N0="[object ArrayBuffer]",O0="[object Arguments]",R0="[object Boolean]",D0="[object DataView]",I0="[object Date]",L0="[object Error]",P0="[object Map]",z0="[object Number]",B0="[object Object]",$0="[object RegExp]",F0="[object Set]",j0="[object String]",H0={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},_0="[object URL]",V0=Object.prototype.toString;function W0({areArrayBuffersEqual:n,areArraysEqual:e,areDataViewsEqual:t,areDatesEqual:r,areErrorsEqual:s,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:a,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:f,unknownTagComparators:p}){return function(g,y,x){if(g===y)return!0;if(g==null||y==null)return!1;const C=typeof g;if(C!==typeof y)return!1;if(C!=="object")return C==="number"?l(g,y,x):C==="function"?i(g,y,x):!1;const v=g.constructor;if(v!==y.constructor)return!1;if(v===Object)return a(g,y,x);if(Array.isArray(g))return e(g,y,x);if(v===Date)return r(g,y,x);if(v===RegExp)return u(g,y,x);if(v===Map)return o(g,y,x);if(v===Set)return d(g,y,x);const b=V0.call(g);if(b===I0)return r(g,y,x);if(b===$0)return u(g,y,x);if(b===P0)return o(g,y,x);if(b===F0)return d(g,y,x);if(b===B0)return typeof g.then!="function"&&typeof y.then!="function"&&a(g,y,x);if(b===_0)return f(g,y,x);if(b===L0)return s(g,y,x);if(b===O0)return a(g,y,x);if(H0[b])return h(g,y,x);if(b===N0)return n(g,y,x);if(b===D0)return t(g,y,x);if(b===R0||b===z0||b===j0)return c(g,y,x);if(p){let A=p[b];if(!A){const M=f0(g);M&&(A=p[M])}if(A)return A(g,y,x)}return!1}}function q0({circular:n,createCustomConfig:e,strict:t}){let r={areArrayBuffersEqual:k0,areArraysEqual:t?Dn:b0,areDataViewsEqual:x0,areDatesEqual:S0,areErrorsEqual:w0,areFunctionsEqual:v0,areMapsEqual:t?Fi(vc,Dn):vc,areNumbersEqual:E0,areObjectsEqual:t?Dn:C0,arePrimitiveWrappersEqual:T0,areRegExpsEqual:M0,areSetsEqual:t?Fi(Ec,Dn):Ec,areTypedArraysEqual:t?Fi(Cs,Dn):Cs,areUrlsEqual:A0,unknownTagComparators:void 0};if(e&&(r=Object.assign({},r,e(r))),n){const s=_r(r.areArraysEqual),i=_r(r.areMapsEqual),o=_r(r.areObjectsEqual),l=_r(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:s,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return r}function U0(n){return function(e,t,r,s,i,o,l){return n(e,t,l)}}function K0({circular:n,comparator:e,createState:t,equals:r,strict:s}){if(t)return function(l,a){const{cache:c=n?new WeakMap:void 0,meta:u}=t();return e(l,a,{cache:c,equals:r,meta:u,strict:s})};if(n)return function(l,a){return e(l,a,{cache:new WeakMap,equals:r,meta:void 0,strict:s})};const i={cache:void 0,equals:r,meta:void 0,strict:s};return function(l,a){return e(l,a,i)}}const J0=Nt();Nt({strict:!0});Nt({circular:!0});Nt({circular:!0,strict:!0});Nt({createInternalComparator:()=>Zt});Nt({strict:!0,createInternalComparator:()=>Zt});Nt({circular:!0,createInternalComparator:()=>Zt});Nt({circular:!0,createInternalComparator:()=>Zt,strict:!0});function Nt(n={}){const{circular:e=!1,createInternalComparator:t,createState:r,strict:s=!1}=n,i=q0(n),o=W0(i),l=t?t(o):U0(o);return K0({circular:e,comparator:o,createState:r,equals:l,strict:s})}var Lh={exports:{}},Ph={};/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -117,67 +117,67 @@ ${p}`}}),a}function Zb(n,e,t={}){const{state:r}=e,{doc:s,tr:i}=r,o=n;s.descendan * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var di=N,H0=qo;function _0(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var j0=typeof Object.is=="function"?Object.is:_0,V0=H0.useSyncExternalStore,W0=di.useRef,q0=di.useEffect,U0=di.useMemo,K0=di.useDebugValue;Rh.useSyncExternalStoreWithSelector=function(n,e,t,r,s){var i=W0(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=U0(function(){function a(f){if(!c){if(c=!0,u=f,f=r(f),s!==void 0&&o.hasValue){var p=o.value;if(s(p,f))return d=p}return d=f}if(p=d,j0(u,f))return p;var m=r(f);return s!==void 0&&s(p,m)?(u=f,p):(u=f,d=m)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return a(e())},h===null?void 0:function(){return a(h())}]},[e,t,r,s]);var l=V0(n,i[0],i[1]);return q0(function(){o.hasValue=!0,o.value=l},[l]),K0(l),l};Oh.exports=Rh;var J0=Oh.exports,G0=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},Y0=({contentComponent:n})=>{const e=qo.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return b.jsx(b.Fragment,{children:Object.values(e)})};function X0(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:dp.createPortal(r.reactElement,r.element,t)},n.forEach(s=>s())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(s=>s())}}}var Q0=class extends Ft.Component{constructor(n){super(n),this.editorContentRef=Ft.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const e=this.props.editor;if(e&&!e.isDestroyed&&((n=e.view.dom)!=null&&n.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=X0(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var n;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:G0(e,this.editorContentRef),...t}),(n==null?void 0:n.contentComponent)&&b.jsx(Y0,{contentComponent:n.contentComponent})]})}},Z0=N.forwardRef((n,e)=>{const t=Ft.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return Ft.createElement(Q0,{key:t,innerRef:e,...n})}),Ih=Ft.memo(Z0),ex=typeof window<"u"?N.useLayoutEffect:N.useEffect,tx=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function nx(n){var e;const[t]=N.useState(()=>new tx(n.editor)),r=J0.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:F0);return ex(()=>t.watch(n.editor),[n.editor,t]),N.useDebugValue(r),r}var rx=!1,Dh=typeof window>"u",sx=Dh||!!(typeof window<"u"&&window.next),ix=class Lh{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=e??!0;return Dh?(t&&rx&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):sx&&e===void 0&&(t=!1),t?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Vb(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=t.extensions)==null?void 0:o[i])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?Lh.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function ox(n={},e=[]){const t=N.useRef(n);t.current=n;const[r]=N.useState(()=>new ix(t)),s=qo.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return N.useDebugValue(s),N.useEffect(r.onRender(e)),nx({editor:s,selector:({transactionNumber:i})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&i===0?0:i+1}),s}var Ph=N.createContext({editor:null});Ph.Consumer;var zh=N.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Bh=()=>N.useContext(zh);function lx({as:n="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:r}=Bh();return b.jsx(n,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:r})}var ax=Ft.forwardRef((n,e)=>{const{onDragStart:t}=Bh(),r=n.as||"div";return b.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function Sc(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function wc(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.forward_ref)"||n.$$typeof.description==="react.forward_ref"))}function cx(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.memo)"||n.$$typeof.description==="react.memo"))}function ux(n){if(Sc(n)||wc(n))return!0;if(cx(n)){const e=n.type;if(e)return Sc(e)||wc(e)}return!1}function dx(){try{if(N.version)return parseInt(N.version.split(".")[0],10)>=19}catch{}return!1}var hx=class{constructor(n,{editor:e,props:t={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=n,this.editor=e,this.props=t,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?up.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var n;if(this.destroyed)return;const e=this.component,t=this.props,r=this.editor,s=dx(),i=ux(e),o={...t};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=b.jsx(e,{...o}),(n=r==null?void 0:r.contentComponent)==null||n.setRenderer(this.id,this)}updateProps(n={}){if(this.destroyed)return;let e=!1;const t=Object.keys(n);for(let r=0;r{this.element.setAttribute(e,n[e])})}};Ft.createContext({markViewContentRef:()=>{}});var fx=class extends e0{constructor(n,e,t){if(super(n,e,t),this.selectionRafId=null,this.handlePositionUpdate=()=>{const r=this.getPos();typeof r!="number"||r===this.currentPos||(this.currentPos=r,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const n=this.editor,e=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(e,{get(t,r,s){var i;return r==="storage"?(i=n.storage[e.name])!=null?i:{}:Reflect.get(t,r,s)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode(),ref:N.createRef()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const s={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&(c.hasAttribute("data-node-view-wrapper")&&c.removeAttribute("data-node-view-wrapper"),c.appendChild(this.contentDOMElement))}},i=this.component,o=N.memo(c=>b.jsx(zh.Provider,{value:s,children:N.createElement(i,c)}));o.displayName="ReactNodeView";let l=this.node.isInline?"span":"div";this.options.as&&(l=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new hx(o,{editor:this.editor,props:e,as:l,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var n;if(this.renderer.element.firstElementChild&&!((n=this.renderer.element.firstElementChild)!=null&&n.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const n=this.currentPos;if(typeof n!="number")return;if(ib({selection:this.editor.state.selection,pos:n,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(n,e,t){const r=l=>{this.renderer.updateProps(l),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(n.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const l=this.node,a=this.decorations,c=this.innerDecorations;return this.node=n,this.decorations=e,this.innerDecorations=t,this.currentPos=this.getPos(),this.options.update({oldNode:l,oldDecorations:a,newNode:n,newDecorations:e,oldInnerDecorations:c,innerDecorations:t,updateProps:()=>r({node:n,decorations:e,innerDecorations:t,extension:this.extensionWithSyncedStorage})})}if(!(n!==this.node))return this.node=n,this.decorations=e,this.innerDecorations=t,!0;const i=this.getPos();this.node=n,this.decorations=e,this.innerDecorations=t,this.currentPos=i;const o={node:n,decorations:e,innerDecorations:t,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(o.getPos=()=>this.getPos()),r(o),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let n={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=kn(this.node,e);n=this.options.attrs({node:this.node,HTMLAttributes:t})}else n=this.options.attrs;this.renderer.updateAttributes(n)}}};function px(n,e){return t=>t.editor.contentComponent?new fx(n,t,e):{}}var Sl=N.createContext({get editor(){throw new Error("useTiptap must be used within a provider")}});Sl.displayName="TiptapContext";var mx=()=>N.useContext(Sl);function $h({editor:n,instance:e,children:t}){const r=n??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=N.useMemo(()=>({editor:r}),[r]),i=N.useMemo(()=>({editor:r}),[r]);return b.jsx(Ph.Provider,{value:i,children:b.jsx(Sl.Provider,{value:s,children:t})})}$h.displayName="Tiptap";function Fh({...n}){const{editor:e}=mx();return b.jsx(Ih,{editor:e,...n})}Fh.displayName="Tiptap.Content";Object.assign($h,{Content:Fh});var Ss=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]};function Hh(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Hh(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function _h(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;ce&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new be(r,s)}cutByIndex(e,t){return e==t?be.empty:e==0&&t==this.content.length?this:new be(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new be(s,i)}addToStart(e){return new be([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new be(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Fr(t+1,i):Fr(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return be.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return be.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return be.empty;let t,r=0;for(let s=0;s0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return on.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new on(st.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new on(e,r,s)}};ee.empty=new ee(st.empty,0,0);function jh(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(jh(i.content,e-s-1,t-s-1)))}function Vh(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Vh(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}var Wh=65535,qh=Math.pow(2,16);function yx(n,e){return n+e*qh}function vc(n){return n&Wh}function kx(n){return(n-(n&Wh))/qh}var Uh=1,Kh=2,ts=4,Jh=8,Ec=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(this.delInfo&Jh)>0}get deletedBefore(){return(this.delInfo&(Uh|ts))>0}get deletedAfter(){return(this.delInfo&(Kh|ts))>0}get deletedAcross(){return(this.delInfo&ts)>0}},qt=class ln{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ln.empty)return ln.empty}recover(e){let t=0,r=vc(e);if(!this.inverted)for(let s=0;se)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:yx(l/3,e-a),m=e==a?Kh:e==d?Uh:ts;return(t<0?e!=a:e!=d)&&(m|=Jh),new Ec(f,m,p)}s+=u-c}return r?e+s:new Ec(e+s,0,null)}touches(e,t){let r=0,s=vc(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,i)}invert(){return new Yh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vn(t.from,t.to,e.markFromJSON(t.mark))}};ge.jsonID("addMark",Gh);var Yh=class Wn extends ge{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ee(wl(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,r)}invert(){return new Gh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Wn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Wn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Wn(t.from,t.to,e.markFromJSON(t.mark))}};ge.jsonID("removeMark",Yh);var Xh=class qn extends ge{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return we.fromReplace(e,this.pos,this.pos+1,new ee(st.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;sr.pos?null:new ns(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ns(t.from,t.to,t.gapFrom,t.gapTo,ee.fromJSON(e,t.slice),t.insert,!!t.structure)}};ge.jsonID("replaceAround",Zh);function Ao(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}var bx=class rs extends ge{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let s=t.type.create(r,null,t.marks);return we.fromReplace(e,this.pos,this.pos+1,new ee(st.from(s),0,t.isLeaf?0:1))}getMap(){return qt.empty}invert(e){return new rs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new rs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new rs(t.pos,t.attr,t.value)}};ge.jsonID("attr",bx);var xx=class No extends ge{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return we.ok(r)}getMap(){return qt.empty}invert(e){return new No(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new No(t.attr,t.value)}};ge.jsonID("docAttr",xx);var br=class extends Error{};br=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};br.prototype=Object.create(Error.prototype);br.prototype.constructor=br;br.prototype.name="TransformError";var $i=Object.create(null),ie=class{constructor(n,e,t){this.$anchor=n,this.$head=e,this.ranges=t||[new Sx(n.min(e),n.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let e=0;e=0;s--){let i=e<0?an(n.node(0),n.node(s),n.before(s+1),n.index(s),e,t):an(n.node(0),n.node(s),n.after(s+1),n.index(s)+1,e,t);if(i)return i}return null}static near(n,e=1){return this.findFrom(n,e)||this.findFrom(n,-e)||new nr(n.node(0))}static atStart(n){return an(n,n,0,0,1)||new nr(n)}static atEnd(n){return an(n,n,n.content.size,n.childCount,-1)||new nr(n)}static fromJSON(n,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let t=$i[e.type];if(!t)throw new RangeError(`No selection type ${e.type} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in $i)throw new RangeError("Duplicate use of selection JSON ID "+n);return $i[n]=e,e.prototype.jsonID=n,e}getBookmark(){return Sn.between(this.$anchor,this.$head).getBookmark()}};ie.prototype.visible=!0;var Sx=class{constructor(n,e){this.$from=n,this.$to=e}},Cc=!1;function Tc(n){!Cc&&!n.parent.inlineContent&&(Cc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var Sn=class Un extends ie{constructor(e,t=e){Tc(e),Tc(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ie.near(r);let s=e.resolve(t.map(this.anchor));return new Un(s.parent.inlineContent?s:r,r)}replace(e,t=ee.empty){if(super.replace(e,t),t==ee.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Un&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ef(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Un(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let s=e.resolve(t);return new this(s,r==t?s:e.resolve(r))}static between(e,t,r){let s=e.pos-t.pos;if((!r||s)&&(r=s>=0?1:-1),!t.parent.inlineContent){let i=ie.findFrom(t,r,!0)||ie.findFrom(t,-r,!0);if(i)t=i.$head;else return ie.near(t,r)}return e.parent.inlineContent||(s==0?e=t:(e=(ie.findFrom(e,-r,!0)||ie.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&wn.isSelectable(l))return wn.create(n,t-(s<0?l.nodeSize:0))}else{let a=an(n,l,t+s,s<0?l.childCount:0,s,i);if(a)return a}t+=l.nodeSize*s}return null}function Mc(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(ie.near(n.doc.resolve(o),t))}function Ac(n,e){return!e||!n?n:n.bind(e)}var Hr=class{constructor(n,e,t){this.name=n,this.init=Ac(e.init,t),this.apply=Ac(e.apply,t)}};new Hr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Hr("selection",{init(n,e){return n.selection||ie.atStart(e.doc)},apply(n){return n.selection}}),new Hr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Hr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});var Ex=(n,e)=>{var t;const{state:r,view:s}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:o}=i;if(o.parentOffset!==0)return!1;const l=o.depth-1,a=o.node(l),c=o.index(l);if(c===0)return!1;if(a.type===e)return n.commands.lift(e.name);const u=a.child(c-1);if(u.type!==e||!((t=u.lastChild)!=null&&t.isTextblock))return!1;const d=o.before(),f=d-1-1,{tr:p}=r;return p.delete(d,o.after()).insert(f,o.parent.content),p.setSelection(Sn.create(p.doc,f)),s.dispatch(p.scrollIntoView()),!0},Cx=/^\s*>\s$/,Tx=Ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return Ss("blockquote",{...J(this.options.HTMLAttributes,n),children:Ss("slot",{})})},parseMarkdown:(n,e)=>{var t;const r=(t=e.parseBlockChildren)!=null?t:e.parseChildren;return e.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(` + */var gi=T,G0=Go;function Y0(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}var X0=typeof Object.is=="function"?Object.is:Y0,Q0=G0.useSyncExternalStore,Z0=gi.useRef,ex=gi.useEffect,tx=gi.useMemo,nx=gi.useDebugValue;Ph.useSyncExternalStoreWithSelector=function(n,e,t,r,s){var i=Z0(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=tx(function(){function a(f){if(!c){if(c=!0,u=f,f=r(f),s!==void 0&&o.hasValue){var p=o.value;if(s(p,f))return d=p}return d=f}if(p=d,X0(u,f))return p;var m=r(f);return s!==void 0&&s(p,m)?(u=f,p):(u=f,d=m)}var c=!1,u,d,h=t===void 0?null:t;return[function(){return a(e())},h===null?void 0:function(){return a(h())}]},[e,t,r,s]);var l=Q0(n,i[0],i[1]);return ex(function(){o.hasValue=!0,o.value=l},[l]),nx(l),l};Lh.exports=Ph;var rx=Lh.exports,sx=(...n)=>e=>{n.forEach(t=>{typeof t=="function"?t(e):t&&(t.current=e)})},ix=({contentComponent:n})=>{const e=Go.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return k.jsx(k.Fragment,{children:Object.values(e)})};function ox(){const n=new Set;let e={};return{subscribe(t){return n.add(t),()=>{n.delete(t)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(t,r){e={...e,[t]:hp.createPortal(r.reactElement,r.element,t)},n.forEach(s=>s())},removeRenderer(t){const r={...e};delete r[t],e=r,n.forEach(s=>s())}}}var lx=class extends Vt.Component{constructor(n){super(n),this.editorContentRef=Vt.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var n;const e=this.props.editor;if(e&&!e.isDestroyed&&((n=e.view.dom)!=null&&n.parentNode)){if(e.contentComponent)return;const t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=ox(),e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var n;const e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!((n=e.view.dom)!=null&&n.parentNode))return;const t=document.createElement("div");t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){const{editor:n,innerRef:e,...t}=this.props;return k.jsxs(k.Fragment,{children:[k.jsx("div",{ref:sx(e,this.editorContentRef),...t}),(n==null?void 0:n.contentComponent)&&k.jsx(ix,{contentComponent:n.contentComponent})]})}},ax=T.forwardRef((n,e)=>{const t=Vt.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return Vt.createElement(lx,{key:t,innerRef:e,...n})}),zh=Vt.memo(ax),cx=typeof window<"u"?T.useLayoutEffect:T.useEffect,ux=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}};function dx(n){var e;const[t]=T.useState(()=>new ux(n.editor)),r=rx.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getServerSnapshot,n.selector,(e=n.equalityFn)!=null?e:J0);return cx(()=>t.watch(n.editor),[n.editor,t]),T.useDebugValue(r),r}var hx=!1,Bh=typeof window>"u",fx=Bh||!!(typeof window<"u"&&window.next),px=class $h{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(t=>t())}getInitialEditor(){const e=this.options.current.immediatelyRender;let t=e??!0;return Bh?(t&&hx&&console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"),t=!1):fx&&e===void 0&&(t=!1),t?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onBeforeCreate)==null?void 0:i.call(s,...r)},onBlur:(...r)=>{var s,i;return(i=(s=this.options.current).onBlur)==null?void 0:i.call(s,...r)},onCreate:(...r)=>{var s,i;return(i=(s=this.options.current).onCreate)==null?void 0:i.call(s,...r)},onDestroy:(...r)=>{var s,i;return(i=(s=this.options.current).onDestroy)==null?void 0:i.call(s,...r)},onFocus:(...r)=>{var s,i;return(i=(s=this.options.current).onFocus)==null?void 0:i.call(s,...r)},onSelectionUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onSelectionUpdate)==null?void 0:i.call(s,...r)},onTransaction:(...r)=>{var s,i;return(i=(s=this.options.current).onTransaction)==null?void 0:i.call(s,...r)},onUpdate:(...r)=>{var s,i;return(i=(s=this.options.current).onUpdate)==null?void 0:i.call(s,...r)},onContentError:(...r)=>{var s,i;return(i=(s=this.options.current).onContentError)==null?void 0:i.call(s,...r)},onDrop:(...r)=>{var s,i;return(i=(s=this.options.current).onDrop)==null?void 0:i.call(s,...r)},onPaste:(...r)=>{var s,i;return(i=(s=this.options.current).onPaste)==null?void 0:i.call(s,...r)},onDelete:(...r)=>{var s,i;return(i=(s=this.options.current).onDelete)==null?void 0:i.call(s,...r)}};return new Qb(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&t.extensions?e.extensions.length!==t.extensions.length?!1:e.extensions.every((s,i)=>{var o;return s===((o=t.extensions)==null?void 0:o[i])}):e[r]===t[r])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?$h.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((r,s)=>r===e[s]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function mx(n={},e=[]){const t=T.useRef(n);t.current=n;const[r]=T.useState(()=>new px(t)),s=Go.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return T.useDebugValue(s),T.useEffect(r.onRender(e)),dx({editor:s,selector:({transactionNumber:i})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&i===0?0:i+1}),s}var Fh=T.createContext({editor:null});Fh.Consumer;var jh=T.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Hh=()=>T.useContext(jh);function gx({as:n="div",...e}){const{nodeViewContentRef:t,nodeViewContentChildren:r}=Hh();return k.jsx(n,{...e,ref:t,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:r})}var yx=Vt.forwardRef((n,e)=>{const{onDragStart:t}=Hh(),r=n.as||"div";return k.jsx(r,{...n,ref:e,"data-node-view-wrapper":"",onDragStart:t,style:{whiteSpace:"normal",...n.style}})});function Cc(n){return!!(typeof n=="function"&&n.prototype&&n.prototype.isReactComponent)}function Tc(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.forward_ref)"||n.$$typeof.description==="react.forward_ref"))}function kx(n){return!!(typeof n=="object"&&n.$$typeof&&(n.$$typeof.toString()==="Symbol(react.memo)"||n.$$typeof.description==="react.memo"))}function bx(n){if(Cc(n)||Tc(n))return!0;if(kx(n)){const e=n.type;if(e)return Cc(e)||Tc(e)}return!1}function xx(){try{if(T.version)return parseInt(T.version.split(".")[0],10)>=19}catch{}return!1}var Sx=class{constructor(n,{editor:e,props:t={},as:r="div",className:s=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=n,this.editor=e,this.props=t,this.element=document.createElement(r),this.element.classList.add("react-renderer"),s&&this.element.classList.add(...s.split(" ")),this.editor.isEditorContentInitialized?dp.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var n;if(this.destroyed)return;const e=this.component,t=this.props,r=this.editor,s=xx(),i=bx(e),o={...t};o.ref&&!(s||i)&&delete o.ref,!o.ref&&(s||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=k.jsx(e,{...o}),(n=r==null?void 0:r.contentComponent)==null||n.setRenderer(this.id,this)}updateProps(n={}){if(this.destroyed)return;let e=!1;const t=Object.keys(n);for(let r=0;r{this.element.setAttribute(e,n[e])})}};Vt.createContext({markViewContentRef:()=>{}});var wx=class extends c0{constructor(n,e,t){if(super(n,e,t),this.selectionRafId=null,this.handlePositionUpdate=()=>{const r=this.getPos();typeof r!="number"||r===this.currentPos||(this.currentPos=r,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs=="function"&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const r=this.dom.querySelector("[data-node-view-content]");if(!r)return;r.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on("update",this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const n=this.editor,e=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(e,{get(t,r,s){var i;return r==="storage"?(i=n.storage[e.name])!=null?i:{}:Reflect.get(t,r,s)}})}return this.cachedExtensionWithSyncedStorage}mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode(),ref:T.createRef()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const s={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&(c.hasAttribute("data-node-view-wrapper")&&c.removeAttribute("data-node-view-wrapper"),c.appendChild(this.contentDOMElement))}},i=this.component,o=T.memo(c=>k.jsx(jh.Provider,{value:s,children:T.createElement(i,c)}));o.displayName="ReactNodeView";let l=this.node.isInline?"span":"div";this.options.as&&(l=this.options.as);const{className:a=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Sx(o,{editor:this.editor,props:e,as:l,className:`node-${this.node.type.name} ${a}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){var n;if(this.renderer.element.firstElementChild&&!((n=this.renderer.element.firstElementChild)!=null&&n.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const n=this.currentPos;if(typeof n!="number")return;if(pb({selection:this.editor.state.selection,pos:n,nodeSize:this.node.nodeSize,selectedOnTextSelection:this.options.selectedOnTextSelection})){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(n,e,t){const r=l=>{this.renderer.updateProps(l),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(n.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const l=this.node,a=this.decorations,c=this.innerDecorations;return this.node=n,this.decorations=e,this.innerDecorations=t,this.currentPos=this.getPos(),this.options.update({oldNode:l,oldDecorations:a,newNode:n,newDecorations:e,oldInnerDecorations:c,innerDecorations:t,updateProps:()=>r({node:n,decorations:e,innerDecorations:t,extension:this.extensionWithSyncedStorage})})}if(!(n!==this.node))return this.node=n,this.decorations=e,this.innerDecorations=t,!0;const i=this.getPos();this.node=n,this.decorations=e,this.innerDecorations=t,this.currentPos=i;const o={node:n,decorations:e,innerDecorations:t,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(o.getPos=()=>this.getPos()),r(o),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.options.trackNodeViewPosition&&this.editor.off("update",this.handlePositionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let n={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,t=wn(this.node,e);n=this.options.attrs({node:this.node,HTMLAttributes:t})}else n=this.options.attrs;this.renderer.updateAttributes(n)}}};function vx(n,e){return t=>t.editor.contentComponent?new wx(n,t,e):{}}var Cl=T.createContext({get editor(){throw new Error("useTiptap must be used within a provider")}});Cl.displayName="TiptapContext";var Ex=()=>T.useContext(Cl);function _h({editor:n,instance:e,children:t}){const r=n??e;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const s=T.useMemo(()=>({editor:r}),[r]),i=T.useMemo(()=>({editor:r}),[r]);return k.jsx(Fh.Provider,{value:i,children:k.jsx(Cl.Provider,{value:s,children:t})})}_h.displayName="Tiptap";function Vh({...n}){const{editor:e}=Ex();return k.jsx(zh,{editor:e,...n})}Vh.displayName="Tiptap.Content";Object.assign(_h,{Content:Vh});var Ts=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);const{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]};function Wh(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let s=n.child(r),i=e.child(r);if(s==i){t+=s.nodeSize;continue}if(!s.sameMarkup(i))return t;if(s.isText&&s.text!=i.text){for(let o=0;s.text[o]==i.text[o];o++)t++;return t}if(s.content.size||i.content.size){let o=Wh(s.content,i.content,t+1);if(o!=null)return o}t+=s.nodeSize}}function qh(n,e,t,r){for(let s=n.childCount,i=e.childCount;;){if(s==0||i==0)return s==i?null:{a:t,b:r};let o=n.child(--s),l=e.child(--i),a=o.nodeSize;if(o==l){t-=a,r-=a;continue}if(!o.sameMarkup(l))return{a:t,b:r};if(o.isText&&o.text!=l.text){let c=0,u=Math.min(o.text.length,l.text.length);for(;ce&&r(a,s+l,i||null,o)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,s+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,s){let i="",o=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?s?typeof s=="function"?s(l):s:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(o?o=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,s=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(r)&&(s[s.length-1]=t.withText(t.text+r.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),r.push(l),s+=l.nodeSize),o=a}return new be(r,s)}cutByIndex(e,t){return e==t?be.empty:e==0&&t==this.content.length?this:new be(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let s=this.content.slice(),i=this.size+t.nodeSize-r.nodeSize;return s[e]=t,new be(s,i)}addToStart(e){return new be([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new be(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let s=this.child(t),i=r+s.nodeSize;if(i>=e)return i==e?Vr(t+1,i):Vr(t,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return be.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return be.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return be.empty;let t,r=0;for(let s=0;s0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return un.empty;let r=t.openStart||0,s=t.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new un(at.fromJSON(e,t.content),r,s)}static maxOpen(e,t=!0){let r=0,s=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)s++;return new un(e,r,s)}};ne.empty=new ne(at.empty,0,0);function Uh(n,e,t){let{index:r,offset:s}=n.findIndex(e),i=n.maybeChild(r),{index:o,offset:l}=n.findIndex(t);if(s==e||i.isText){if(l!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,i.copy(Uh(i.content,e-s-1,t-s-1)))}function Kh(n,e,t,r,s,i){let{index:o,offset:l}=n.findIndex(e),a=n.maybeChild(o);if(l==e||a.isText)return i&&r<=0&&s<=0&&!i.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=Kh(a.content,e-l-1,t,o==0?r-1:0,o==n.childCount-1?s-1:0,a);return c&&n.replaceChild(o,a.copy(c))}var Jh=65535,Gh=Math.pow(2,16);function Tx(n,e){return n+e*Gh}function Mc(n){return n&Jh}function Mx(n){return(n-(n&Jh))/Gh}var Yh=1,Xh=2,ls=4,Qh=8,Ac=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}get deleted(){return(this.delInfo&Qh)>0}get deletedBefore(){return(this.delInfo&(Yh|ls))>0}get deletedAfter(){return(this.delInfo&(Xh|ls))>0}get deletedAcross(){return(this.delInfo&ls)>0}},Gt=class dn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&dn.empty)return dn.empty}recover(e){let t=0,r=Mc(e);if(!this.inverted)for(let s=0;se)break;let c=this.ranges[l+i],u=this.ranges[l+o],d=a+c;if(e<=d){let h=c?e==a?-1:e==d?1:t:t,f=a+s+(h<0?0:u);if(r)return f;let p=e==(t<0?a:d)?null:Tx(l/3,e-a),m=e==a?Xh:e==d?Yh:ls;return(t<0?e!=a:e!=d)&&(m|=Qh),new Ac(f,m,p)}s+=u-c}return r?e+s:new Ac(e+s,0,null)}touches(e,t){let r=0,s=Mc(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+i],u=a+c;if(e<=u&&l==s*3)return!0;r+=this.ranges[l+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,i=0;s!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),s),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,i)}invert(){return new ef(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Kn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Kn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Kn(t.from,t.to,e.markFromJSON(t.mark))}};ge.jsonID("addMark",Zh);var ef=class Jn extends ge{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ne(Tl(t.content,s=>s.mark(this.mark.removeFromSet(s.marks)),e),t.openStart,t.openEnd);return we.fromReplace(e,this.from,this.to,r)}invert(){return new Zh(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Jn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Jn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Jn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Jn(t.from,t.to,e.markFromJSON(t.mark))}};ge.jsonID("removeMark",ef);var tf=class Gn extends ge{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return we.fromReplace(e,this.pos,this.pos+1,new ne(at.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let s=0;sr.pos?null:new as(t.pos,r.pos,s,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new as(t.from,t.to,t.gapFrom,t.gapTo,ne.fromJSON(e,t.slice),t.insert,!!t.structure)}};ge.jsonID("replaceAround",rf);function Do(n,e,t){let r=n.resolve(e),s=t-e,i=r.depth;for(;s>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,s--;if(s>0){let o=r.node(i).maybeChild(r.indexAfter(i));for(;s>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,s--}}return!1}var Ax=class cs extends ge{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return we.fail("No node at attribute step's position");let r=Object.create(null);for(let i in t.attrs)r[i]=t.attrs[i];r[this.attr]=this.value;let s=t.type.create(r,null,t.marks);return we.fromReplace(e,this.pos,this.pos+1,new ne(at.from(s),0,t.isLeaf?0:1))}getMap(){return Gt.empty}invert(e){return new cs(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new cs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new cs(t.pos,t.attr,t.value)}};ge.jsonID("attr",Ax);var Nx=class Io extends ge{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let s in e.attrs)t[s]=e.attrs[s];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return we.ok(r)}getMap(){return Gt.empty}invert(e){return new Io(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Io(t.attr,t.value)}};ge.jsonID("docAttr",Nx);var vr=class extends Error{};vr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};vr.prototype=Object.create(Error.prototype);vr.prototype.constructor=vr;vr.prototype.name="TransformError";var _i=Object.create(null),ie=class{constructor(n,e,t){this.$anchor=n,this.$head=e,this.ranges=t||[new Ox(n.min(e),n.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let n=this.ranges;for(let e=0;e=0;s--){let i=e<0?hn(n.node(0),n.node(s),n.before(s+1),n.index(s),e,t):hn(n.node(0),n.node(s),n.after(s+1),n.index(s)+1,e,t);if(i)return i}return null}static near(n,e=1){return this.findFrom(n,e)||this.findFrom(n,-e)||new or(n.node(0))}static atStart(n){return hn(n,n,0,0,1)||new or(n)}static atEnd(n){return hn(n,n,n.content.size,n.childCount,-1)||new or(n)}static fromJSON(n,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let t=_i[e.type];if(!t)throw new RangeError(`No selection type ${e.type} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in _i)throw new RangeError("Duplicate use of selection JSON ID "+n);return _i[n]=e,e.prototype.jsonID=n,e}getBookmark(){return Cn.between(this.$anchor,this.$head).getBookmark()}};ie.prototype.visible=!0;var Ox=class{constructor(n,e){this.$from=n,this.$to=e}},Nc=!1;function Oc(n){!Nc&&!n.parent.inlineContent&&(Nc=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var Cn=class Yn extends ie{constructor(e,t=e){Oc(e),Oc(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ie.near(r);let s=e.resolve(t.map(this.anchor));return new Yn(s.parent.inlineContent?s:r,r)}replace(e,t=ne.empty){if(super.replace(e,t),t==ne.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Yn&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new sf(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Yn(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let s=e.resolve(t);return new this(s,r==t?s:e.resolve(r))}static between(e,t,r){let s=e.pos-t.pos;if((!r||s)&&(r=s>=0?1:-1),!t.parent.inlineContent){let i=ie.findFrom(t,r,!0)||ie.findFrom(t,-r,!0);if(i)t=i.$head;else return ie.near(t,r)}return e.parent.inlineContent||(s==0?e=t:(e=(ie.findFrom(e,-r,!0)||ie.findFrom(e,r,!0)).$anchor,e.pos0?0:1);s>0?o=0;o+=s){let l=e.child(o);if(l.isAtom){if(!i&&Tn.isSelectable(l))return Tn.create(n,t-(s<0?l.nodeSize:0))}else{let a=hn(n,l,t+s,s<0?l.childCount:0,s,i);if(a)return a}t+=l.nodeSize*s}return null}function Rc(n,e,t){let r=n.steps.length-1;if(r{o==null&&(o=u)}),n.setSelection(ie.near(n.doc.resolve(o),t))}function Dc(n,e){return!e||!n?n:n.bind(e)}var Wr=class{constructor(n,e,t){this.name=n,this.init=Dc(e.init,t),this.apply=Dc(e.apply,t)}};new Wr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Wr("selection",{init(n,e){return n.selection||ie.atStart(e.doc)},apply(n){return n.selection}}),new Wr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Wr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});var Ix=(n,e)=>{var t;const{state:r,view:s}=n,{selection:i}=r;if(!i.empty)return!1;const{$from:o}=i;if(o.parentOffset!==0)return!1;const l=o.depth-1,a=o.node(l),c=o.index(l);if(c===0)return!1;if(a.type===e)return n.commands.lift(e.name);const u=a.child(c-1);if(u.type!==e||!((t=u.lastChild)!=null&&t.isTextblock))return!1;const d=o.before(),f=d-1-1,{tr:p}=r;return p.delete(d,o.after()).insert(f,o.parent.content),p.setSelection(Cn.create(p.doc,f)),s.dispatch(p.scrollIntoView()),!0},Lx=/^\s*>\s$/,Px=Ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return Ts("blockquote",{...J(this.options.HTMLAttributes,n),children:Ts("slot",{})})},parseMarkdown:(n,e)=>{var t;const r=(t=e.parseBlockChildren)!=null?t:e.parseChildren;return e.createNode("blockquote",void 0,r(n.tokens||[]))},renderMarkdown:(n,e)=>{if(!n.content)return"";const t=">",r=[];return n.content.forEach((s,i)=>{var o,l;const u=((l=(o=e.renderChild)==null?void 0:o.call(e,s,i))!=null?l:e.renderChildren([s])).split(` `).map(d=>d.trim()===""?t:`${t} ${d}`);r.push(u.join(` `))}),r.join(` ${t} -`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Ex(this.editor,this.type)}},addInputRules(){return[xn({find:Cx,type:this.type})]}}),Mx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ax=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Nx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ox=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Rx=Jt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return Ss("strong",{...J(this.options.HTMLAttributes,n),children:Ss("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[bn({find:Mx,type:this.type}),bn({find:Nx,type:this.type})]},addPasteRules(){return[Wt({find:Ax,type:this.type}),Wt({find:Ox,type:this.type})]}}),Ix=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},Dx=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let r;for(;(r=e.exec(n))!==null;)r.index>0&&n[r.index-1]==="`"||t.push({index:r.index,text:r[0],replaceWith:r[1]});return t},Lx=Jt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[bn({find:Ix,type:this.type})]},addPasteRules(){return[Wt({find:Dx,type:this.type})]}}),Fi=4,Px=/^```([a-z]+)?[\s\n]$/,zx=/^~~~([a-z]+)?[\s\n]$/,Bx=Ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Fi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const i=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",J(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,r;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&((r=n.raw)==null?void 0:r.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const s=((t=n.attrs)==null?void 0:t.language)||"";return n.content?r=[`\`\`\`${s}`,e.renderChildren(n.content),"```"].join(` +`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>Ix(this.editor,this.type)}},addInputRules(){return[En({find:Lx,type:this.type})]}}),zx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Bx=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,$x=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Fx=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,jx=Qt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return Ts("strong",{...J(this.options.HTMLAttributes,n),children:Ts("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,e)=>e.applyMark("bold",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`**${e.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[vn({find:zx,type:this.type}),vn({find:$x,type:this.type})]},addPasteRules(){return[Jt({find:Bx,type:this.type}),Jt({find:Fx,type:this.type})]}}),Hx=n=>{const e=/`([^`]+)`(?!`)$/.exec(n);return!e||e.index>0&&n[e.index-1]==="`"?null:{index:e.index,text:e[0],replaceWith:e[1]}},_x=n=>{const e=/`([^`]+)`(?!`)/g,t=[];let r;for(;(r=e.exec(n))!==null;)r.index>0&&n[r.index-1]==="`"||t.push({index:r.index,text:r[0],replaceWith:r[1]});return t},Vx=Qt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,e)=>e.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,e)=>n.content?`\`${e.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[vn({find:Hx,type:this.type})]},addPasteRules(){return[Jt({find:_x,type:this.type})]}}),Vi=4,Wx=/^```([a-z]+)?[\s\n]$/,qx=/^~~~([a-z]+)?[\s\n]$/,Ux=Ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Vi,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options;if(!t)return null;const i=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",J(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,e)=>{var t,r;return((t=n.raw)==null?void 0:t.startsWith("```"))===!1&&((r=n.raw)==null?void 0:r.startsWith("~~~"))===!1&&n.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:n.lang||null},n.text?[e.createTextNode(n.text)]:[])},renderMarkdown:(n,e)=>{var t;let r="";const s=((t=n.attrs)==null?void 0:t.language)||"";return n.content?r=[`\`\`\`${s}`,e.renderChildren(n.content),"```"].join(` `):r=`\`\`\`${s} -\`\`\``,r},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Fi,{state:r}=n,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const l=" ".repeat(t);return o?n.commands.insertContent(l):n.commands.command(({tr:a})=>{const{from:c,to:u}=s,f=r.doc.textBetween(c,u,` +\`\`\``,r},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Vi,{state:r}=n,{selection:s}=r,{$from:i,empty:o}=s;if(i.parent.type!==this.type)return!1;const l=" ".repeat(t);return o?n.commands.insertContent(l):n.commands.command(({tr:a})=>{const{from:c,to:u}=s,f=r.doc.textBetween(c,u,` `,` `).split(` `).map(p=>l+p).join(` -`);return a.replaceWith(c,u,r.schema.text(f)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Fi,{state:r}=n,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?n.commands.command(({tr:l})=>{var a;const{pos:c}=i,u=i.start(),d=i.end(),f=r.doc.textBetween(u,d,` +`);return a.replaceWith(c,u,r.schema.text(f)),!0})},"Shift-Tab":({editor:n})=>{var e;if(!this.options.enableTabIndentation)return!1;const t=(e=this.options.tabSize)!=null?e:Vi,{state:r}=n,{selection:s}=r,{$from:i,empty:o}=s;return i.parent.type!==this.type?!1:o?n.commands.command(({tr:l})=>{var a;const{pos:c}=i,u=i.start(),d=i.end(),f=r.doc.textBetween(u,d,` `,` `).split(` -`);let p=0,m=0;const g=c-u;for(let M=0;M=g){p=M;break}m+=f[M].length+1}const x=((a=f[p].match(/^ */))==null?void 0:a[0])||"",C=Math.min(x.length,t);if(C===0)return!0;let v=u;for(let M=0;M{const{from:a,to:c}=s,h=r.doc.textBetween(a,c,` +`);let p=0,m=0;const g=c-u;for(let A=0;A=g){p=A;break}m+=f[A].length+1}const x=((a=f[p].match(/^ */))==null?void 0:a[0])||"",C=Math.min(x.length,t);if(C===0)return!0;let v=u;for(let A=0;A{const{from:a,to:c}=s,h=r.doc.textBetween(a,c,` `,` `).split(` `).map(f=>{var p;const m=((p=f.match(/^ */))==null?void 0:p[0])||"",g=Math.min(m.length,t);return f.slice(g)}).join(` `);return l.replaceWith(a,c,r.schema.text(h)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:s}=t;if(!s||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(` -`);return!i||!o?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:s,empty:i}=t;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:c})=>(c.setSelection(z.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[Co({find:Px,type:this.type,getAttributes:n=>({language:n[1]})}),Co({find:zx,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new G({key:new re("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!t||!i)return!1;const{tr:o,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` -`));return o.replaceSelectionWith(this.type.create({language:i},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(P.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),$x=Ce.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`);return!i||!o?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:s,empty:i}=t;if(!i||s.parent.type!==this.type||!(s.parentOffset===s.parent.nodeSize-2))return!1;const l=s.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:c})=>(c.setSelection(P.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[No({find:Wx,type:this.type,getAttributes:n=>({language:n[1]})}),No({find:qx,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new G({key:new se("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),s=r?JSON.parse(r):void 0,i=s==null?void 0:s.mode;if(!t||!i)return!1;const{tr:o,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` +`));return o.replaceSelectionWith(this.type.create({language:i},a)),o.selection.$from.parent.type!==this.type&&o.setSelection(I.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),n.dispatch(o),!0}}})]}}),Kx=Ce.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):""}),Fx=Ce.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",J(this.options.HTMLAttributes,n)]},renderText(){return` +`):""}),Jx=Ce.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",J(this.options.HTMLAttributes,n)]},renderText(){return` `},renderMarkdown:()=>` -`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:i}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(h=>l.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Hx=Ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,J(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,s="#".repeat(r);return n.content?`${s} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Co({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),_x=Ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",J(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!Ub(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,s=n();return ch(t)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(P.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(I.create(o.doc,a.pos)):o.setSelection(P.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(o.insert(c,d),o.setSelection(P.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Mh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),jx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Wx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,qx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ux=Jt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",J(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[bn({find:jx,type:this.type}),bn({find:Wx,type:this.type})]},addPasteRules(){return[Wt({find:Vx,type:this.type}),Wt({find:qx,type:this.type})]}});const Kx="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Jx="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Oo="numeric",Ro="ascii",Io="alpha",rr="asciinumeric",Jn="alphanumeric",Do="domain",rf="emoji",Gx="scheme",Yx="slashscheme",Hi="whitespace";function Xx(n,e){return n in e||(e[n]=[]),e[n]}function It(n,e,t){e[Oo]&&(e[rr]=!0,e[Jn]=!0),e[Ro]&&(e[rr]=!0,e[Io]=!0),e[rr]&&(e[Jn]=!0),e[Io]&&(e[Jn]=!0),e[Jn]&&(e[Do]=!0),e[rf]&&(e[Do]=!0);for(const r in e){const s=Xx(r,t);s.indexOf(n)<0&&s.push(n)}}function Qx(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Te(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Te.groups={};Te.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,s),X=(n,e,t,r,s)=>n.tr(e,t,r,s),Nc=(n,e,t,r,s)=>n.ts(e,t,r,s),S=(n,e,t,r,s)=>n.tt(e,t,r,s),Xe="WORD",Lo="UWORD",sf="ASCIINUMERICAL",of="ALPHANUMERICAL",xr="LOCALHOST",Po="TLD",zo="UTLD",is="SCHEME",cn="SLASH_SCHEME",El="NUM",Bo="WS",Cl="NL",sr="OPENBRACE",ir="CLOSEBRACE",ws="OPENBRACKET",vs="CLOSEBRACKET",Es="OPENPAREN",Cs="CLOSEPAREN",Ts="OPENANGLEBRACKET",Ms="CLOSEANGLEBRACKET",As="FULLWIDTHLEFTPAREN",Ns="FULLWIDTHRIGHTPAREN",Os="LEFTCORNERBRACKET",Rs="RIGHTCORNERBRACKET",Is="LEFTWHITECORNERBRACKET",Ds="RIGHTWHITECORNERBRACKET",Ls="FULLWIDTHLESSTHAN",Ps="FULLWIDTHGREATERTHAN",zs="AMPERSAND",Bs="APOSTROPHE",$s="ASTERISK",ft="AT",Fs="BACKSLASH",Hs="BACKTICK",_s="CARET",Dt="COLON",Tl="COMMA",js="DOLLAR",je="DOT",Vs="EQUALS",Ml="EXCLAMATION",Oe="HYPHEN",or="PERCENT",Ws="PIPE",qs="PLUS",Us="POUND",lr="QUERY",Al="QUOTE",lf="FULLWIDTHMIDDLEDOT",Nl="SEMI",Ve="SLASH",ar="TILDE",Ks="UNDERSCORE",af="EMOJI",Js="SYM";var cf=Object.freeze({__proto__:null,ALPHANUMERICAL:of,AMPERSAND:zs,APOSTROPHE:Bs,ASCIINUMERICAL:sf,ASTERISK:$s,AT:ft,BACKSLASH:Fs,BACKTICK:Hs,CARET:_s,CLOSEANGLEBRACKET:Ms,CLOSEBRACE:ir,CLOSEBRACKET:vs,CLOSEPAREN:Cs,COLON:Dt,COMMA:Tl,DOLLAR:js,DOT:je,EMOJI:af,EQUALS:Vs,EXCLAMATION:Ml,FULLWIDTHGREATERTHAN:Ps,FULLWIDTHLEFTPAREN:As,FULLWIDTHLESSTHAN:Ls,FULLWIDTHMIDDLEDOT:lf,FULLWIDTHRIGHTPAREN:Ns,HYPHEN:Oe,LEFTCORNERBRACKET:Os,LEFTWHITECORNERBRACKET:Is,LOCALHOST:xr,NL:Cl,NUM:El,OPENANGLEBRACKET:Ts,OPENBRACE:sr,OPENBRACKET:ws,OPENPAREN:Es,PERCENT:or,PIPE:Ws,PLUS:qs,POUND:Us,QUERY:lr,QUOTE:Al,RIGHTCORNERBRACKET:Rs,RIGHTWHITECORNERBRACKET:Ds,SCHEME:is,SEMI:Nl,SLASH:Ve,SLASH_SCHEME:cn,SYM:Js,TILDE:ar,TLD:Po,UNDERSCORE:Ks,UTLD:zo,UWORD:Lo,WORD:Xe,WS:Bo});const Je=/[a-z]/,Nn=new RegExp("\\p{L}","u"),_i=new RegExp("\\p{Emoji}","u"),Ge=/\d/,ji=/\s/,Oc="\r",Vi=` -`,Zx="️",eS="‍",Wi="";let _r=null,jr=null;function tS(n=[]){const e={};Te.groups=e;const t=new Te;_r==null&&(_r=Rc(Kx)),jr==null&&(jr=Rc(Jx)),S(t,"'",Bs),S(t,"{",sr),S(t,"}",ir),S(t,"[",ws),S(t,"]",vs),S(t,"(",Es),S(t,")",Cs),S(t,"<",Ts),S(t,">",Ms),S(t,"(",As),S(t,")",Ns),S(t,"「",Os),S(t,"」",Rs),S(t,"『",Is),S(t,"』",Ds),S(t,"<",Ls),S(t,">",Ps),S(t,"&",zs),S(t,"*",$s),S(t,"@",ft),S(t,"`",Hs),S(t,"^",_s),S(t,":",Dt),S(t,",",Tl),S(t,"$",js),S(t,".",je),S(t,"=",Vs),S(t,"!",Ml),S(t,"-",Oe),S(t,"%",or),S(t,"|",Ws),S(t,"+",qs),S(t,"#",Us),S(t,"?",lr),S(t,'"',Al),S(t,"/",Ve),S(t,";",Nl),S(t,"~",ar),S(t,"_",Ks),S(t,"\\",Fs),S(t,"・",lf);const r=X(t,Ge,El,{[Oo]:!0});X(r,Ge,r);const s=X(r,Je,sf,{[rr]:!0}),i=X(r,Nn,of,{[Jn]:!0}),o=X(t,Je,Xe,{[Ro]:!0});X(o,Ge,s),X(o,Je,o),X(s,Ge,s),X(s,Je,s);const l=X(t,Nn,Lo,{[Io]:!0});X(l,Je),X(l,Ge,i),X(l,Nn,l),X(i,Ge,i),X(i,Je),X(i,Nn,i);const a=S(t,Vi,Cl,{[Hi]:!0}),c=S(t,Oc,Bo,{[Hi]:!0}),u=X(t,ji,Bo,{[Hi]:!0});S(t,Wi,u),S(c,Vi,a),S(c,Wi,u),X(c,ji,u),S(u,Oc),S(u,Vi),X(u,ji,u),S(u,Wi,u);const d=X(t,_i,af,{[rf]:!0});S(d,"#"),X(d,_i,d),S(d,Zx,d);const h=S(d,eS);S(h,"#"),X(h,_i,d);const f=[[Je,o],[Ge,s]],p=[[Je,null],[Nn,l],[Ge,i]];for(let m=0;m<_r.length;m++)lt(t,_r[m],Po,Xe,f);for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?x[Do]=!0:Je.test(g)?Ge.test(g)?x[rr]=!0:x[Ro]=!0:x[Oo]=!0,Nc(t,g,g,x)}return Nc(t,"localhost",xr,{ascii:!0}),t.jd=new Te(Js),{start:t,tokens:Object.assign({groups:e},cf)}}function uf(n,e){const t=nS(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,s=[];let i=0,o=0;for(;o=0&&(d+=t[o].length,h++),c+=t[o].length,i+=t[o].length,o++;i-=d,o-=h,c-=d,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function nS(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(i=n.charCodeAt(r+1))<56320||i>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function lt(n,e,t,r,s){let i;const o=e.length;for(let l=0;l=0;)i++;if(i>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+i),10);o>0;o--)t.pop();r+=i}else t.push(n[r]),r++}return e}const Sr={defaultProtocol:"http",events:null,format:Ic,formatHref:Ic,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ol(n,e=null){let t=Object.assign({},Sr);n&&(t=Object.assign(t,n instanceof Ol?n.o:n));const r=t.ignoreTags,s=[];for(let i=0;it?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Sr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),s=n.get("tagName",t,e),i=this.toFormattedString(n),o={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:d}}};function hi(n,e){class t extends df{constructor(s,i){super(s,i),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const rS=hi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Dc=hi("text"),sS=hi("nl"),Vr=hi("url",{isLink:!0,toHref(n=Sr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==xr&&n[1].t===Dt}}),Ne=n=>new Te(n);function iS({groups:n}){const e=n.domain.concat([zs,$s,ft,Fs,Hs,_s,js,Vs,Oe,El,or,Ws,qs,Us,Ve,Js,ar,Ks]),t=[Bs,Dt,Tl,je,Ml,or,lr,Al,Nl,Ts,Ms,sr,ir,vs,ws,Es,Cs,As,Ns,Os,Rs,Is,Ds,Ls,Ps],r=[zs,Bs,$s,Fs,Hs,_s,js,Vs,Oe,sr,ir,or,Ws,qs,Us,lr,Ve,Js,ar,Ks],s=Ne(),i=S(s,ar);B(i,r,i),B(i,n.domain,i);const o=Ne(),l=Ne(),a=Ne();B(s,n.domain,o),B(s,n.scheme,l),B(s,n.slashscheme,a),B(o,r,i),B(o,n.domain,o);const c=S(o,ft);S(i,ft,c),S(l,ft,c),S(a,ft,c);const u=S(i,je);B(u,r,i),B(u,n.domain,i);const d=Ne();B(c,n.domain,d),B(d,n.domain,d);const h=S(d,je);B(h,n.domain,d);const f=Ne(rS);B(h,n.tld,f),B(h,n.utld,f),S(c,xr,f);const p=S(d,Oe);S(p,Oe,p),B(p,n.domain,d),B(f,n.domain,d),S(f,je,h),S(f,Oe,p);const m=S(o,Oe),g=S(o,je);S(m,Oe,m),B(m,n.domain,o),B(g,r,i),B(g,n.domain,o);const y=Ne(Vr);B(g,n.tld,y),B(g,n.utld,y),B(y,n.domain,o),B(y,r,i),S(y,je,g),S(y,Oe,m),S(y,ft,c);const x=S(y,Dt),C=Ne(Vr);B(x,n.numeric,C);const v=Ne(Vr),k=Ne();B(v,e,v),B(v,t,k),B(k,e,v),B(k,t,k),S(y,Ve,v),S(C,Ve,v);const M=S(l,Dt),T=S(a,Dt),L=S(T,Ve),O=S(L,Ve);B(l,n.domain,o),S(l,je,g),S(l,Oe,m),B(a,n.domain,o),S(a,je,g),S(a,Oe,m),B(M,n.domain,v),S(M,Ve,v),S(M,lr,v),B(O,n.domain,v),B(O,e,v),S(O,Ve,v);const $=[[sr,ir],[ws,vs],[Es,Cs],[Ts,Ms],[As,Ns],[Os,Rs],[Is,Ds],[Ls,Ps]];for(let de=0;de<$.length;de++){const[se,ne]=$[de],H=S(v,se);S(k,se,H);const U=Ne(Vr);B(H,e,U);const ot=Ne();B(H,t,ot),S(H,ne,v),B(U,e,U),B(U,t,ot),B(ot,e,U),B(ot,t,ot),S(U,ne,v),S(ot,ne,v)}return S(s,xr,y),S(s,Cl,sS),{start:s,tokens:cf}}function oS(n,e,t){let r=t.length,s=0,i=[],o=[];for(;s=0&&h++,s++,u++;if(h<0)s-=u,s0&&(i.push(qi(Dc,e,o)),o=[]),s-=h,u-=h;const f=d.t,p=t.slice(s-u,s);i.push(qi(f,e,p))}}return o.length>0&&i.push(qi(Dc,e,o)),i}function qi(n,e,t){const r=t[0].s,s=t[t.length-1].e,i=e.slice(r,s);return new n(i,t)}const lS=typeof console<"u"&&console&&console.warn||(()=>{}),aS="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function cS(){return Te.groups={},q.scanner=null,q.parser=null,q.tokenQueue=[],q.pluginQueue=[],q.customSchemes=[],q.initialized=!1,q}function Lc(n,e=!1){if(q.initialized&&lS(`linkifyjs: already initialized - will not register custom scheme "${n}" ${aS}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:s,storedMarks:i}=t;if(s.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,a=i||s.$to.parentOffset&&s.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&o){const d=a.filter(h=>l.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Gx=Ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,J(this.options.HTMLAttributes,e),0]},parseMarkdown:(n,e)=>e.createNode("heading",{level:n.depth||1},e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>{var t;const r=(t=n.attrs)!=null&&t.level?parseInt(n.attrs.level,10):1,s="#".repeat(r);return n.content?`${s} ${e.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>No({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Yx=Ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",J(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{if(!t0(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$to:r}=t,s=n();return fh(t)?s.insertContentAt(r.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:a}=o.selection,c=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?o.setSelection(I.create(o.doc,a.pos+1)):a.nodeAfter.isBlock?o.setSelection(R.create(o.doc,a.pos)):o.setSelection(I.create(o.doc,a.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||a.parent.type.contentMatch.defaultType,d=u==null?void 0:u.create();d&&(o.insert(c,d),o.setSelection(I.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Rh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Xx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Qx=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Zx=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,eS=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,tS=Qt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",J(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(n,e)=>e.applyMark("italic",e.parseInline(n.tokens||[])),markdownOptions:{htmlReopen:{open:"",close:""}},renderMarkdown:(n,e)=>`*${e.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vn({find:Xx,type:this.type}),vn({find:Zx,type:this.type})]},addPasteRules(){return[Jt({find:Qx,type:this.type}),Jt({find:eS,type:this.type})]}});const nS="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",rS="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",Lo="numeric",Po="ascii",zo="alpha",lr="asciinumeric",Qn="alphanumeric",Bo="domain",af="emoji",sS="scheme",iS="slashscheme",Wi="whitespace";function oS(n,e){return n in e||(e[n]=[]),e[n]}function zt(n,e,t){e[Lo]&&(e[lr]=!0,e[Qn]=!0),e[Po]&&(e[lr]=!0,e[zo]=!0),e[lr]&&(e[Qn]=!0),e[zo]&&(e[Qn]=!0),e[Qn]&&(e[Bo]=!0),e[af]&&(e[Bo]=!0);for(const r in e){const s=oS(r,t);s.indexOf(n)<0&&s.push(n)}}function lS(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Ae(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}Ae.groups={};Ae.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,s),Q=(n,e,t,r,s)=>n.tr(e,t,r,s),Ic=(n,e,t,r,s)=>n.ts(e,t,r,s),S=(n,e,t,r,s)=>n.tt(e,t,r,s),tt="WORD",$o="UWORD",cf="ASCIINUMERICAL",uf="ALPHANUMERICAL",Er="LOCALHOST",Fo="TLD",jo="UTLD",ds="SCHEME",fn="SLASH_SCHEME",Al="NUM",Ho="WS",Nl="NL",ar="OPENBRACE",cr="CLOSEBRACE",Ms="OPENBRACKET",As="CLOSEBRACKET",Ns="OPENPAREN",Os="CLOSEPAREN",Rs="OPENANGLEBRACKET",Ds="CLOSEANGLEBRACKET",Is="FULLWIDTHLEFTPAREN",Ls="FULLWIDTHRIGHTPAREN",Ps="LEFTCORNERBRACKET",zs="RIGHTCORNERBRACKET",Bs="LEFTWHITECORNERBRACKET",$s="RIGHTWHITECORNERBRACKET",Fs="FULLWIDTHLESSTHAN",js="FULLWIDTHGREATERTHAN",Hs="AMPERSAND",_s="APOSTROPHE",Vs="ASTERISK",yt="AT",Ws="BACKSLASH",qs="BACKTICK",Us="CARET",Bt="COLON",Ol="COMMA",Ks="DOLLAR",Ue="DOT",Js="EQUALS",Rl="EXCLAMATION",Ie="HYPHEN",ur="PERCENT",Gs="PIPE",Ys="PLUS",Xs="POUND",dr="QUERY",Dl="QUOTE",df="FULLWIDTHMIDDLEDOT",Il="SEMI",Ke="SLASH",hr="TILDE",Qs="UNDERSCORE",hf="EMOJI",Zs="SYM";var ff=Object.freeze({__proto__:null,ALPHANUMERICAL:uf,AMPERSAND:Hs,APOSTROPHE:_s,ASCIINUMERICAL:cf,ASTERISK:Vs,AT:yt,BACKSLASH:Ws,BACKTICK:qs,CARET:Us,CLOSEANGLEBRACKET:Ds,CLOSEBRACE:cr,CLOSEBRACKET:As,CLOSEPAREN:Os,COLON:Bt,COMMA:Ol,DOLLAR:Ks,DOT:Ue,EMOJI:hf,EQUALS:Js,EXCLAMATION:Rl,FULLWIDTHGREATERTHAN:js,FULLWIDTHLEFTPAREN:Is,FULLWIDTHLESSTHAN:Fs,FULLWIDTHMIDDLEDOT:df,FULLWIDTHRIGHTPAREN:Ls,HYPHEN:Ie,LEFTCORNERBRACKET:Ps,LEFTWHITECORNERBRACKET:Bs,LOCALHOST:Er,NL:Nl,NUM:Al,OPENANGLEBRACKET:Rs,OPENBRACE:ar,OPENBRACKET:Ms,OPENPAREN:Ns,PERCENT:ur,PIPE:Gs,PLUS:Ys,POUND:Xs,QUERY:dr,QUOTE:Dl,RIGHTCORNERBRACKET:zs,RIGHTWHITECORNERBRACKET:$s,SCHEME:ds,SEMI:Il,SLASH:Ke,SLASH_SCHEME:fn,SYM:Zs,TILDE:hr,TLD:Fo,UNDERSCORE:Qs,UTLD:jo,UWORD:$o,WORD:tt,WS:Ho});const Qe=/[a-z]/,In=new RegExp("\\p{L}","u"),qi=new RegExp("\\p{Emoji}","u"),Ze=/\d/,Ui=/\s/,Lc="\r",Ki=` +`,aS="️",cS="‍",Ji="";let qr=null,Ur=null;function uS(n=[]){const e={};Ae.groups=e;const t=new Ae;qr==null&&(qr=Pc(nS)),Ur==null&&(Ur=Pc(rS)),S(t,"'",_s),S(t,"{",ar),S(t,"}",cr),S(t,"[",Ms),S(t,"]",As),S(t,"(",Ns),S(t,")",Os),S(t,"<",Rs),S(t,">",Ds),S(t,"(",Is),S(t,")",Ls),S(t,"「",Ps),S(t,"」",zs),S(t,"『",Bs),S(t,"』",$s),S(t,"<",Fs),S(t,">",js),S(t,"&",Hs),S(t,"*",Vs),S(t,"@",yt),S(t,"`",qs),S(t,"^",Us),S(t,":",Bt),S(t,",",Ol),S(t,"$",Ks),S(t,".",Ue),S(t,"=",Js),S(t,"!",Rl),S(t,"-",Ie),S(t,"%",ur),S(t,"|",Gs),S(t,"+",Ys),S(t,"#",Xs),S(t,"?",dr),S(t,'"',Dl),S(t,"/",Ke),S(t,";",Il),S(t,"~",hr),S(t,"_",Qs),S(t,"\\",Ws),S(t,"・",df);const r=Q(t,Ze,Al,{[Lo]:!0});Q(r,Ze,r);const s=Q(r,Qe,cf,{[lr]:!0}),i=Q(r,In,uf,{[Qn]:!0}),o=Q(t,Qe,tt,{[Po]:!0});Q(o,Ze,s),Q(o,Qe,o),Q(s,Ze,s),Q(s,Qe,s);const l=Q(t,In,$o,{[zo]:!0});Q(l,Qe),Q(l,Ze,i),Q(l,In,l),Q(i,Ze,i),Q(i,Qe),Q(i,In,i);const a=S(t,Ki,Nl,{[Wi]:!0}),c=S(t,Lc,Ho,{[Wi]:!0}),u=Q(t,Ui,Ho,{[Wi]:!0});S(t,Ji,u),S(c,Ki,a),S(c,Ji,u),Q(c,Ui,u),S(u,Lc),S(u,Ki),Q(u,Ui,u),S(u,Ji,u);const d=Q(t,qi,hf,{[af]:!0});S(d,"#"),Q(d,qi,d),S(d,aS,d);const h=S(d,cS);S(h,"#"),Q(h,qi,d);const f=[[Qe,o],[Ze,s]],p=[[Qe,null],[In,l],[Ze,i]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?x[Bo]=!0:Qe.test(g)?Ze.test(g)?x[lr]=!0:x[Po]=!0:x[Lo]=!0,Ic(t,g,g,x)}return Ic(t,"localhost",Er,{ascii:!0}),t.jd=new Ae(Zs),{start:t,tokens:Object.assign({groups:e},ff)}}function pf(n,e){const t=dS(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,s=[];let i=0,o=0;for(;o=0&&(d+=t[o].length,h++),c+=t[o].length,i+=t[o].length,o++;i-=d,o-=h,c-=d,s.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return s}function dS(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(i=n.charCodeAt(r+1))<56320||i>57343?n[r]:n.slice(r,r+2);e.push(o),r+=o.length}return e}function dt(n,e,t,r,s){let i;const o=e.length;for(let l=0;l=0;)i++;if(i>0){e.push(t.join(""));for(let o=parseInt(n.substring(r,r+i),10);o>0;o--)t.pop();r+=i}else t.push(n[r]),r++}return e}const Cr={defaultProtocol:"http",events:null,format:zc,formatHref:zc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ll(n,e=null){let t=Object.assign({},Cr);n&&(t=Object.assign(t,n instanceof Ll?n.o:n));const r=t.ignoreTags,s=[];for(let i=0;it?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Cr.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),s=n.get("tagName",t,e),i=this.toFormattedString(n),o={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return o.href=r,l&&(o.class=l),a&&(o.target=a),c&&(o.rel=c),u&&Object.assign(o,u),{tagName:s,attributes:o,content:i,eventListeners:d}}};function yi(n,e){class t extends mf{constructor(s,i){super(s,i),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const hS=yi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Bc=yi("text"),fS=yi("nl"),Kr=yi("url",{isLink:!0,toHref(n=Cr.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Er&&n[1].t===Bt}}),De=n=>new Ae(n);function pS({groups:n}){const e=n.domain.concat([Hs,Vs,yt,Ws,qs,Us,Ks,Js,Ie,Al,ur,Gs,Ys,Xs,Ke,Zs,hr,Qs]),t=[_s,Bt,Ol,Ue,Rl,ur,dr,Dl,Il,Rs,Ds,ar,cr,As,Ms,Ns,Os,Is,Ls,Ps,zs,Bs,$s,Fs,js],r=[Hs,_s,Vs,Ws,qs,Us,Ks,Js,Ie,ar,cr,ur,Gs,Ys,Xs,dr,Ke,Zs,hr,Qs],s=De(),i=S(s,hr);B(i,r,i),B(i,n.domain,i);const o=De(),l=De(),a=De();B(s,n.domain,o),B(s,n.scheme,l),B(s,n.slashscheme,a),B(o,r,i),B(o,n.domain,o);const c=S(o,yt);S(i,yt,c),S(l,yt,c),S(a,yt,c);const u=S(i,Ue);B(u,r,i),B(u,n.domain,i);const d=De();B(c,n.domain,d),B(d,n.domain,d);const h=S(d,Ue);B(h,n.domain,d);const f=De(hS);B(h,n.tld,f),B(h,n.utld,f),S(c,Er,f);const p=S(d,Ie);S(p,Ie,p),B(p,n.domain,d),B(f,n.domain,d),S(f,Ue,h),S(f,Ie,p);const m=S(o,Ie),g=S(o,Ue);S(m,Ie,m),B(m,n.domain,o),B(g,r,i),B(g,n.domain,o);const y=De(Kr);B(g,n.tld,y),B(g,n.utld,y),B(y,n.domain,o),B(y,r,i),S(y,Ue,g),S(y,Ie,m),S(y,yt,c);const x=S(y,Bt),C=De(Kr);B(x,n.numeric,C);const v=De(Kr),b=De();B(v,e,v),B(v,t,b),B(b,e,v),B(b,t,b),S(y,Ke,v),S(C,Ke,v);const A=S(l,Bt),M=S(a,Bt),L=S(M,Ke),z=S(L,Ke);B(l,n.domain,o),S(l,Ue,g),S(l,Ie,m),B(a,n.domain,o),S(a,Ue,g),S(a,Ie,m),B(A,n.domain,v),S(A,Ke,v),S(A,dr,v),B(z,n.domain,v),B(z,e,v),S(z,Ke,v);const U=[[ar,cr],[Ms,As],[Ns,Os],[Rs,Ds],[Is,Ls],[Ps,zs],[Bs,$s],[Fs,js]];for(let Te=0;Te=0&&h++,s++,u++;if(h<0)s-=u,s0&&(i.push(Gi(Bc,e,o)),o=[]),s-=h,u-=h;const f=d.t,p=t.slice(s-u,s);i.push(Gi(f,e,p))}}return o.length>0&&i.push(Gi(Bc,e,o)),i}function Gi(n,e,t){const r=t[0].s,s=t[t.length-1].e,i=e.slice(r,s);return new n(i,t)}const gS=typeof console<"u"&&console&&console.warn||(()=>{}),yS="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",q={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function kS(){return Ae.groups={},q.scanner=null,q.parser=null,q.tokenQueue=[],q.pluginQueue=[],q.customSchemes=[],q.initialized=!1,q}function $c(n,e=!1){if(q.initialized&&gS(`linkifyjs: already initialized - will not register custom scheme "${n}" ${yS}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);q.customSchemes.push([n,e])}function uS(){q.scanner=tS(q.customSchemes);for(let n=0;n{const s=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,l=th(t.doc,[...e]);if(ah(l).forEach(({newRange:c})=>{const u=Vk(r.doc,c,f=>f.isTextblock);let d,h;if(u.length>1)d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const f=r.doc.textBetween(c.from,c.to," "," ");if(!hS.test(f))return;d=u[0],h=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&h){const f=h.split(dS).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const g=Rl(p).map(y=>y.toObject(n.defaultProtocol));if(!pS(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{gl(y.from,y.to,r.doc).some(x=>x.mark.type===n.type)||o.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function gS(n){return new G({key:new re("handleClickLink"),props:{handleClick:(e,t,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const a=r.target;if(!a)return!1;const c=n.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(n.enableClickSelection&&(l=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){const a=lh(e.state,n.type.name),c=(s=o.href)!=null?s:a.href,u=(i=o.target)!=null?i:a.target;c&&(window.open(c,u),l=!0)}return l}}})}function yS(n){return new G({key:new re("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:s}=n,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=hf(a,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.value)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function Tt(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&t.push(s)}),!n||n.replace(fS,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ff=Jt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){Lc(n);return}Lc(n.scheme,n.optionalSlashes)})},onDestroy(){cS()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Tt(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const s=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Tt(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Tt(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",J(this.options.HTMLAttributes,n),0]:["a",J(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,r,s,i;const o=(r=(t=n.attrs)==null?void 0:t.href)!=null?r:"",l=(i=(s=n.attrs)==null?void 0:s.title)!=null?i:"",a=e.renderChildren(n);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Tt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!Tt(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Wt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,s=hf(n).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!Tt(o,t),protocols:t,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(mS({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!Tt(s,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(gS({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(yS({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),kS=ff,bS=Object.defineProperty,xS=(n,e)=>{for(var t in e)bS(n,t,{get:e[t],enumerable:!0})},SS="listItem",Pc="textStyle",zc=/^\s*([-+*])\s$/,pf=Ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(SS,this.editor.getAttributes(Pc)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=xn({find:zc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=xn({find:zc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Pc),editor:this.editor})),[n]}}),wS=(n,e,t)=>{const{selection:r}=n;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let f=s.depth;f>0;f-=1)if(s.node(f).type.name===e){i=f;break}if(i<0)return null;const o=s.node(i),l=s.index(i);if(l+1>=o.childCount)return null;const a=o.child(l+1);if(!t.includes(a.type.name))return null;const c=n.schema.nodes[e];let u=!1;if(a.forEach(f=>{f.type===c&&f.childCount>1&&(u=!0)}),!u)return null;const d=n.doc.resolve(s.after()).nodeAfter;if(!d||!t.includes(d.type.name))return null;const h=[];return d.forEach(f=>{h.push(f)}),h.length===0?null:{listItemDepth:i,nestedList:d,nestedListPos:s.after(),insertPos:s.after(i),items:h}},vS=(n,e,t,r)=>{const s=wS(n,t,r);if(!s)return!1;const{selection:i}=n,{nestedList:o,nestedListPos:l,insertPos:a,items:c}=s,u=n.tr;u.delete(l,l+o.nodeSize);const d=u.mapping.map(a);return u.insert(d,w.from(c)),u.setSelection(i.map(u.doc,u.mapping)),e&&e(u),!0},ES=(n,e,t)=>vS(n.state,n.view.dispatch,e,t),mf=(n,e)=>Y.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>ES(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}});function CS(n){var e,t;const r=(e=n.tokens)==null?void 0:e[0];return!!(n.text&&((t=n.tokens)==null?void 0:t.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===n.text)}function TS(n,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(n)):e.parseInline([{type:"text",raw:n,text:n}])}var gf=Ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{var t;if(n.type!=="list_item")return[];const r=(t=e.parseBlockChildren)!=null?t:e.parseChildren;let s=[];if(n.tokens&&n.tokens.length>0){if(CS(n))return{type:"listItem",content:[{type:"paragraph",content:TS(n.text||"",e)}]};if(n.tokens.some(o=>o.type==="paragraph"))s=r(n.tokens);else{const o=n.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],n.tokens.length>1){const a=n.tokens.slice(1),c=r(a);s.push(...c)}}else s=r(n.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(n,e,t)=>xl(n,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},t),addExtensions(){return[mf(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),MS={};xS(MS,{findListItemPos:()=>fi,getNextListDepth:()=>Dl,handleBackspace:()=>$o,handleDelete:()=>Fo,hasListBefore:()=>yf,hasListItemAfter:()=>AS,hasListItemBefore:()=>NS,listItemHasSubList:()=>OS,nextListIsDeeper:()=>kf,nextListIsHigher:()=>bf});var fi=(n,e)=>{const{$from:t}=e.selection,r=te(n,e.schema);let s=null,i=t.depth,o=t.pos,l=null;for(;i>0&&l===null;)s=t.node(i),s.type===r?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},Dl=(n,e)=>{const t=fi(n,e);if(!t)return!1;const[,r]=eb(e,n,t.$pos.pos+4);return r},yf=(n,e,t)=>{const{$anchor:r}=n.selection,s=Math.max(0,r.pos-2),i=n.doc.resolve(s).node();return!(!i||!t.includes(i.type.name))},$o=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!St(n.state,e)&&yf(n.state,e,t)){const{$anchor:r}=n.state.selection,s=n.state.doc.resolve(r.before()-1),i=[];s.node().descendants((a,c)=>{a.type.name===e&&i.push({node:a,pos:c})});const o=i.at(-1);if(!o)return!1;const l=n.state.doc.resolve(s.start()+o.pos+1);return n.chain().cut({from:r.start()-1,to:r.end()+1},l.end()).joinForward().run()}return!St(n.state,e)||!sb(n.state)?!1:n.chain().liftListItem(e).run()},kf=(n,e)=>{const t=Dl(n,e),r=fi(n,e);return!r||!t?!1:t>r.depth},bf=(n,e)=>{const t=Dl(n,e),r=fi(n,e);return!r||!t?!1:t{if(!St(n.state,e)||!rb(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:s}=t;return!t.empty&&r.sameParent(s)?!1:kf(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():bf(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},AS=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((t=s.nodeAfter)==null?void 0:t.type.name)!==n)},NS=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((t=s.nodeBefore)==null?void 0:t.type.name)!==n)},OS=(n,e,t)=>{if(!t)return!1;const r=te(n,e.schema);let s=!1;return t.descendants(i=>{i.type===r&&(s=!0)}),s},xf=Y.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Fo(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Fo(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&$o(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&$o(n,t,r)&&(e=!0)}),e}}}}),Bc=/^(\s*)(\d+)\.\s+(.*)$/,RS=/^\s/;function IS(n){const e=n.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function DS(n){const e=[],t=[];let r=!1;return n.forEach(s=>{if(r){t.push(s);return}if(s.trim()===""){r=!0,t.push(s);return}if(e.length>0&&IS(s)){r=!0,t.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:t}}function LS(n){const e=[];let t=0,r=0;for(;t{const s=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!s||i)return;const{tr:o}=r,l=ih(t.doc,[...e]);if(hh(l).forEach(({newRange:c})=>{const u=Qk(r.doc,c,f=>f.isTextblock);let d,h;if(u.length>1)d=u[0],h=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ");else if(u.length){const f=r.doc.textBetween(c.from,c.to," "," ");if(!SS.test(f))return;d=u[0],h=r.doc.textBetween(d.pos,c.to,void 0," ")}if(d&&h){const f=h.split(xS).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],m=d.pos+h.lastIndexOf(p);if(!p)return!1;const g=Pl(p).map(y=>y.toObject(n.defaultProtocol));if(!vS(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{xl(y.from,y.to,r.doc).some(x=>x.mark.type===n.type)||o.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!o.steps.length)return o}})}function CS(n){return new G({key:new se("handleClickLink"),props:{handleClick:(e,t,r)=>{var s,i;if(r.button!==0||!e.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const a=r.target;if(!a)return!1;const c=n.editor.view.dom;o=a.closest("a"),o&&!c.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(n.enableClickSelection&&(l=n.editor.commands.extendMarkRange(n.type.name)),n.openOnClick){const a=dh(e.state,n.type.name),c=(s=o.href)!=null?s:a.href,u=(i=o.target)!=null?i:a.target;c&&(window.open(c,u),l=!0)}return l}}})}function TS(n){return new G({key:new se("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{shouldAutoLink:s}=n,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let a="";r.content.forEach(u=>{a+=u.textContent});const c=gf(a,{defaultProtocol:n.defaultProtocol}).find(u=>u.isLink&&u.value===a);return!a||!c||s!==void 0&&!s(c.value)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function Ot(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const s=typeof r=="string"?r:r.scheme;s&&t.push(s)}),!n||n.replace(wS,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var yf=Qt.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){$c(n);return}$c(n.scheme,n.optionalSlashes)})},onDestroy(){kS()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Ot(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(n),t=/^[a-z][a-z0-9+.-]*:/i.test(n);if(e||t&&!n.includes("@"))return!0;const s=(n.includes("@")?n.split("@").pop():n).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(s)||!/\./.test(s))}}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ot(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Ot(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",J(this.options.HTMLAttributes,n),0]:["a",J(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,e)=>e.applyMark("link",e.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,e)=>{var t,r,s,i;const o=(r=(t=n.attrs)==null?void 0:t.href)!=null?r:"",l=(i=(s=n.attrs)==null?void 0:s.title)!=null?i:"",a=e.renderChildren(n);return l?`[${a}](${o} "${l}")`:`[${a}](${o})`},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ot(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n||{};return t&&!this.options.isAllowedUri(t,{defaultValidate:r=>!!Ot(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Jt({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,s=gf(n).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!Ot(o,t),protocols:t,defaultProtocol:r}));s.length&&s.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(ES({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:s=>!!Ot(s,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),n.push(CS({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(TS({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),MS=yf,AS=Object.defineProperty,NS=(n,e)=>{for(var t in e)AS(n,t,{get:e[t],enumerable:!0})},OS="listItem",Fc="textStyle",jc=/^\s*([-+*])\s$/,kf=Ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?e.parseChildren(n.items):[]},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OS,this.editor.getAttributes(Fc)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=En({find:jc,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=En({find:jc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Fc),editor:this.editor})),[n]}}),RS=(n,e,t)=>{const{selection:r}=n;if(!r.empty)return null;const{$from:s}=r;if(!s.parent.isTextblock||s.parentOffset!==s.parent.content.size)return null;let i=-1;for(let f=s.depth;f>0;f-=1)if(s.node(f).type.name===e){i=f;break}if(i<0)return null;const o=s.node(i),l=s.index(i);if(l+1>=o.childCount)return null;const a=o.child(l+1);if(!t.includes(a.type.name))return null;const c=n.schema.nodes[e];let u=!1;if(a.forEach(f=>{f.type===c&&f.childCount>1&&(u=!0)}),!u)return null;const d=n.doc.resolve(s.after()).nodeAfter;if(!d||!t.includes(d.type.name))return null;const h=[];return d.forEach(f=>{h.push(f)}),h.length===0?null:{listItemDepth:i,nestedList:d,nestedListPos:s.after(),insertPos:s.after(i),items:h}},DS=(n,e,t,r)=>{const s=RS(n,t,r);if(!s)return!1;const{selection:i}=n,{nestedList:o,nestedListPos:l,insertPos:a,items:c}=s,u=n.tr;u.delete(l,l+o.nodeSize);const d=u.mapping.map(a);return u.insert(d,w.from(c)),u.setSelection(i.map(u.doc,u.mapping)),e&&e(u),!0},IS=(n,e,t)=>DS(n.state,n.view.dispatch,e,t),bf=(n,e)=>Y.create({name:`${n}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){const t=()=>IS(this.editor,n,e);return{Delete:t,"Mod-Delete":t}}});function LS(n){var e,t;const r=(e=n.tokens)==null?void 0:e[0];return!!(n.text&&((t=n.tokens)==null?void 0:t.length)===1&&(r==null?void 0:r.type)==="list"&&r.ordered&&r.raw===n.text)}function PS(n,e){return e.tokenizeInline?e.parseInline(e.tokenizeInline(n)):e.parseInline([{type:"text",raw:n,text:n}])}var xf=Ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,e)=>{var t;if(n.type!=="list_item")return[];const r=(t=e.parseBlockChildren)!=null?t:e.parseChildren;let s=[];if(n.tokens&&n.tokens.length>0){if(LS(n))return{type:"listItem",content:[{type:"paragraph",content:PS(n.text||"",e)}]};if(n.tokens.some(o=>o.type==="paragraph"))s=r(n.tokens);else{const o=n.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(o.tokens)}],n.tokens.length>1){const a=n.tokens.slice(1),c=r(a);s.push(...c)}}else s=r(n.tokens)}}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(n,e,t)=>El(n,e,r=>{var s,i;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((i=(s=r.meta)==null?void 0:s.parentAttrs)==null?void 0:i.start)||1)+r.index}. `:"- "},t),addExtensions(){return[bf(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zS={};NS(zS,{findListItemPos:()=>ki,getNextListDepth:()=>Bl,handleBackspace:()=>_o,handleDelete:()=>Vo,hasListBefore:()=>Sf,hasListItemAfter:()=>BS,hasListItemBefore:()=>$S,listItemHasSubList:()=>FS,nextListIsDeeper:()=>wf,nextListIsHigher:()=>vf});var ki=(n,e)=>{const{$from:t}=e.selection,r=re(n,e.schema);let s=null,i=t.depth,o=t.pos,l=null;for(;i>0&&l===null;)s=t.node(i),s.type===r?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},Bl=(n,e)=>{const t=ki(n,e);if(!t)return!1;const[,r]=cb(e,n,t.$pos.pos+4);return r},Sf=(n,e,t)=>{const{$anchor:r}=n.selection,s=Math.max(0,r.pos-2),i=n.doc.resolve(s).node();return!(!i||!t.includes(i.type.name))},_o=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Ct(n.state,e)&&Sf(n.state,e,t)){const{$anchor:r}=n.state.selection,s=n.state.doc.resolve(r.before()-1),i=[];s.node().descendants((a,c)=>{a.type.name===e&&i.push({node:a,pos:c})});const o=i.at(-1);if(!o)return!1;const l=n.state.doc.resolve(s.start()+o.pos+1);return n.chain().cut({from:r.start()-1,to:r.end()+1},l.end()).joinForward().run()}return!Ct(n.state,e)||!fb(n.state)?!1:n.chain().liftListItem(e).run()},wf=(n,e)=>{const t=Bl(n,e),r=ki(n,e);return!r||!t?!1:t>r.depth},vf=(n,e)=>{const t=Bl(n,e),r=ki(n,e);return!r||!t?!1:t{if(!Ct(n.state,e)||!hb(n.state,e))return!1;const{selection:t}=n.state,{$from:r,$to:s}=t;return!t.empty&&r.sameParent(s)?!1:wf(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():vf(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},BS=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-r.parentOffset-2);return!(s.index()===s.parent.childCount-1||((t=s.nodeAfter)==null?void 0:t.type.name)!==n)},$S=(n,e)=>{var t;const{$anchor:r}=e.selection,s=e.doc.resolve(r.pos-2);return!(s.index()===0||((t=s.nodeBefore)==null?void 0:t.type.name)!==n)},FS=(n,e,t)=>{if(!t)return!1;const r=re(n,e.schema);let s=!1;return t.descendants(i=>{i.type===r&&(s=!0)}),s},Ef=Y.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Vo(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Vo(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&_o(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&_o(n,t,r)&&(e=!0)}),e}}}}),Hc=/^(\s*)(\d+)\.\s+(.*)$/,jS=/^\s/;function HS(n){const e=n.trimStart();return/^[-+*]\s+/.test(e)||/^\d+\.\s+/.test(e)||/^>\s?/.test(e)||/^```/.test(e)||/^~~~/.test(e)}function _S(n){const e=[],t=[];let r=!1;return n.forEach(s=>{if(r){t.push(s);return}if(s.trim()===""){r=!0,t.push(s);return}if(e.length>0&&HS(s)){r=!0,t.push(s);return}e.push(s)}),{paragraphLines:e,blockLines:t}}function VS(n){const e=[];let t=0,r=0;for(;te;)h.push(n[d]),d+=1;if(h.length>0){const f=Math.min(...h.map(m=>m.indent)),p=Sf(h,f,t);c.push({type:"list",ordered:!0,start:h[0].number,items:p,raw:h.map(m=>m.raw).join(` -`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=d}else s+=1}return r}function PS(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var zS="listItem",$c="textStyle",Fc=/^(\d+)\.\s$/,wf=Ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",J(this.options.HTMLAttributes,t),0]:["ol",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.items?PS(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:r}:{type:"orderedList",content:r}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`).trim();if(u){const f=t.blockTokens(u);c.push(...f)}let d=s+1;const h=[];for(;de;)h.push(n[d]),d+=1;if(h.length>0){const f=Math.min(...h.map(m=>m.indent)),p=Cf(h,f,t);c.push({type:"list",ordered:!0,start:h[0].number,items:p,raw:h.map(m=>m.raw).join(` +`)})}r.push({type:"list_item",raw:i.raw,tokens:c}),s=d}else s+=1}return r}function WS(n,e){return n.map(t=>{if(t.type!=="list_item")return e.parseChildren([t])[0];const r=[];return t.tokens&&t.tokens.length>0&&t.tokens.forEach(s=>{if(s.type==="paragraph"||s.type==="list"||s.type==="blockquote"||s.type==="code")r.push(...e.parseChildren([s]));else if(s.type==="text"&&s.tokens){const i=e.parseChildren([s]);r.push({type:"paragraph",content:i})}else{const i=e.parseChildren([s]);i.length>0&&r.push(...i)}}),{type:"listItem",content:r}})}var qS="listItem",_c="textStyle",Vc=/^(\d+)\.\s$/,Tf=Ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",J(this.options.HTMLAttributes,t),0]:["ol",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,e)=>{if(n.type!=="list"||!n.ordered)return[];const t=n.start||1,r=n.items?WS(n.items,e):[];return t!==1?{type:"orderedList",attrs:{start:t},content:r}:{type:"orderedList",content:r}},renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` `):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const e=n.match(/^(\s*)(\d+)\.\s+/),t=e==null?void 0:e.index;return t!==void 0?t:-1},tokenize:(n,e,t)=>{var r;const s=n.split(` -`),[i,o]=LS(s);if(i.length===0)return;const l=Sf(i,0,t);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:l,raw:s.slice(0,o).join(` -`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zS,this.editor.getAttributes($c)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=xn({find:Fc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=xn({find:Fc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes($c)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),BS=/^\s*(\[([( |x])?\])\s$/,$S=Ce.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",J(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const s=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return xl(n,e,s)},addExtensions(){return this.options.nested?[mf(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=d=>{var h,f;l.ariaLabel=((f=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:f.call(h,d,l.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(n),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:h}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=t();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,h)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{s.setAttribute(d,h)}),s.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,i.append(l,o),s.append(i,a),Object.entries(e).forEach(([d,h])=>{s.setAttribute(d,h)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:a,update:d=>{if(d.type!==this.type)return!1;s.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,c(d);const h=r.extensionManager.attributes,f=kn(d,h),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return u.forEach(g=>{p.has(g)||(g in m?s.setAttribute(g,m[g]):s.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?s.setAttribute(g,m[g]):s.removeAttribute(g):s.setAttribute(g,y)}),u=p,!0}}}},addInputRules(){return[xn({find:BS,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),FS=Ce.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` -`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=i=>{const o=To(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);return o?[{type:"taskList",raw:o.raw,items:o.items}]:t.blockTokens(i)},s=To(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:t.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},t);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Y.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(pf.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(gf.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(xf.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(wf.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push($S.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(FS.configure(this.options.taskList)),n}});var Wr=" ",Ui=" ",HS=Ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",J(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Wr||t[0].text===Wr||t[0].raw===Ui||t[0].text===Ui)&&r.length===1&&r[0].type==="text"&&(r[0].text===Wr||r[0].text===Ui)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{var r,s;if(!n)return"";const i=Array.isArray(n.content)?n.content:[];if(i.length===0){const o=Array.isArray((r=t==null?void 0:t.previousNode)==null?void 0:r.content)?t.previousNode.content:[];return((s=t==null?void 0:t.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Wr:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_S=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,jS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,VS=Jt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[bn({find:_S,type:this.type})]},addPasteRules(){return[Wt({find:jS,type:this.type})]}}),WS=Ce.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),vf=Jt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",J(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),qS=vf;function US(n={}){return new G({view(e){return new KS(e,n)}})}class KS{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=d?p.bottom:p.top;d&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),h=d.width/a.offsetWidth,f=d.height/a.offsetHeight;c=d.left-a.scrollLeft*h,u=d.top-a.scrollTop*f}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!i){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Fu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Q extends z{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Q.valid(r)?new Q(r):z.near(r)}content(){return A.empty}eq(e){return e instanceof Q&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Q(e.resolve(t.pos))}getBookmark(){return new Ll(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!JS(e)||!GS(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Q.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){i=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=t;let a=e.doc.resolve(s);if(Q.valid(a))return a}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!I.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*t),r=!1;continue e}break}i=o,s+=t;let l=e.doc.resolve(s);if(Q.valid(l))return l}return null}}}Q.prototype.visible=!1;Q.findFrom=Q.findGapCursorFrom;z.jsonID("gapcursor",Q);class Ll{constructor(e){this.pos=e}map(e){return new Ll(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Q.valid(t)?new Q(t):z.near(t)}}function Ef(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function JS(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||Ef(s.type))return!0;if(s.inlineContent)return!1}}return!0}function GS(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||Ef(s.type))return!0;if(s.inlineContent)return!1}}return!0}function YS(){return new G({props:{decorations:ew,createSelectionBetween(n,e,t){return e.pos==t.pos&&Q.valid(t)?new Q(t):null},handleClick:QS,handleKeyDown:XS,handleDOMEvents:{beforeinput:ZS}}})}const XS=Jd({ArrowLeft:qr("horiz",-1),ArrowRight:qr("horiz",1),ArrowUp:qr("vert",-1),ArrowDown:qr("vert",1)});function qr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof P){if(!i.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Q.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Q(c))),!0):!1}}function QS(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Q.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&I.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Q(r))),!0)}function ZS(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Q))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=w.empty;for(let o=r.length-1;o>=0;o--)s=w.from(r[o].createAndFill(null,s));let i=n.state.tr.replace(t.pos,t.pos,new A(s,0,0));return i.setSelection(P.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function ew(n){if(!(n.selection instanceof Q))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",K.create(n.doc,[Se.widget(n.selection.head,e,{key:"gapcursor"})])}var Gs=200,le=function(){};le.prototype.append=function(e){return e.length?(e=le.from(e),!this.length&&e||e.length=t?le.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};le.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};le.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};le.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},t,r),s};le.from=function(e){return e instanceof le?e:e&&e.length?new Cf(e):le.empty};var Cf=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=Gs)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=Gs)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(le);le.empty=new Cf([]);var tw=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(le);const nw=500;class $e{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;t&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){s||(s=this.remapping(r,h+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new We(d.map));let f=d.step.map(s.slice(i)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new We(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(i)):d.selection,a=new $e(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;usw&&(l=rw(l,c),o-=c),new $e(l.append(i),o)}remapping(e,t){let r=new hr;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new $e(this.items.append(e.map(t=>new We(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},s);let a=t;this.items.forEach(h=>{let f=i.getMirror(--a);if(f==null)return;o=Math.min(o,f);let p=i.maps[f];if(h.step){let m=e.steps[f].invert(e.docs[f]),g=h.selection&&h.selection.map(i.slice(a+1,f));g&&l++,r.push(new We(p,m,g))}else r.push(new We(p))},s);let c=[];for(let h=t;hnw&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&i++;let d=new We(c.invert(),a,u),h,f=s.length-1;(h=s.length&&s[f].merge(d))?s[f]=h:s.push(d)}}else o.map&&r--},this.items.length,0),new $e(le.from(s.reverse()),i)}}$e.empty=new $e(le.empty,0);function rw(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class We{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new We(t.getMap().invert(),t,this.selection)}}}class pt{constructor(e,t,r,s,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const sw=20;function iw(n,e,t,r){let s=t.getMeta($t),i;if(s)return s.historyState;t.getMeta(aw)&&(n=new pt(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta($t))return o.getMeta($t).redo?new pt(n.done.addTransform(t,void 0,r,ls(e)),n.undone,Hc(t.mapping.maps),n.prevTime,n.prevComposition):new pt(n.done,n.undone.addTransform(t,void 0,r,ls(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!ow(t,n.prevRanges)),c=o?Ki(n.prevRanges,t.mapping):Hc(t.mapping.maps);return new pt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,ls(e)),$e.empty,c,t.time,l??n.prevComposition)}else return(i=t.getMeta("rebased"))?new pt(n.done.rebased(t,i),n.undone.rebased(t,i),Ki(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new pt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Ki(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function ow(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i=e[i]&&(t=!0)}),t}function Hc(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,i,o)=>e.push(i,o));return e}function Ki(n,e){if(!n)return null;let t=[];for(let r=0;r{let s=$t.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=lw(s,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const Mf=Tf(!1,!0),Af=Tf(!0,!0);Y.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new G({key:new re("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var uw=Y.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[US(this.options)]}});Y.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new G({key:new re("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!t||!r)return K.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(Se.node(c,c+a.nodeSize,{class:this.options.className}))}),K.create(n,i)}}})]}});var dw=Y.create({name:"gapCursor",addProseMirrorPlugins(){return[YS()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=j(R(n,"allowGapCursor",t)))!=null?e:null}}}),Nf="placeholder",wr=new re("tiptap__placeholder"),jc=200;function Vc(n){const{editor:e,placeholder:t,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),Se.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:i,pos:s,hasAnchor:l}):t})}function Wc(n,e){return typeof n=="function"?n(e):n}function hw({editor:n,options:e,dataAttribute:t,doc:r,selection:s}){var i,o;if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const h=r.resolve(a),f=h.depth>0?h.node(1):h.nodeAfter,p=h.depth>0?h.before(1):a;if(f&&f.type.isTextblock&&kr(f)){const m=a>=p&&a<=p+f.nodeSize;c.push(Vc({editor:n,isEmptyDoc:u,dataAttribute:t,hasAnchor:m,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Wc(e.emptyNodeClass,{editor:n,node:f,pos:p,hasAnchor:m})},node:f,pos:p}))}}else{const h=wr.getState(n.state),f=(i=h==null?void 0:h.topPos)!=null?i:0,p=(o=h==null?void 0:h.bottomPos)!=null?o:r.content.size;r.nodesBetween(f,p,(m,g)=>{const y=a>=g&&a<=g+m.nodeSize,x=!m.isLeaf&&kr(m);return m.type.isTextblock&&(y||!e.showOnlyCurrent)&&x&&c.push(Vc({editor:n,isEmptyDoc:u,dataAttribute:t,hasAnchor:y,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Wc(e.emptyNodeClass,{editor:n,node:m,pos:g,hasAnchor:y})},node:m,pos:g})),e.includeChildren})}return K.create(r,c)}function fw(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function pw(n){const e=getComputedStyle(n),t=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(t)}function mw(n){let e=n;for(;e;){if(pw(e))return e;const t=e.parentElement;if(!t){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=t}return window}function gw(n){return n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect()}function yw({doc:n,view:e,scrollContainer:t}){const r=e.dom.getBoundingClientRect(),s=t?gw(t):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-jc,o=Math.min(r.bottom,s.bottom)+jc;if(i>=o)return{top:0,bottom:n.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:n.content.size}}var kw={init(){return{topPos:null,bottomPos:null}},apply(n,e){const t=n.getMeta(wr);return t!=null&&t.positions?{topPos:t.positions.top,bottomPos:t.positions.bottom}:n.docChanged?{topPos:e.topPos!==null?n.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?n.mapping.map(e.bottomPos):null}:e}};function bw(n){const e=mw(n.dom),t=()=>{const l=yw({view:n,doc:n.state.doc,scrollContainer:e}),a=wr.getState(n.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=n.state.tr.setMeta(wr,{positions:l});n.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,t()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),t(),{update(l,a){n.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function xw({editor:n,options:e}){const t=e.dataAttribute?`data-${fw(e.dataAttribute)}`:`data-${Nf}`;return new G({key:wr,state:kw,view:bw,props:{decorations:({doc:r,selection:s})=>hw({editor:n,options:e,dataAttribute:t,doc:r,selection:s})}})}var Sw=Y.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:Nf,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[xw({editor:this.editor,options:this.options})]}}),ww=`.ProseMirror:not(.ProseMirror-focused) *::selection { +`),[i,o]=VS(s);if(i.length===0)return;const l=Cf(i,0,t);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=i[0])==null?void 0:r.number)||1,items:l,raw:s.slice(0,o).join(` +`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qS,this.editor.getAttributes(_c)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=En({find:Vc,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=En({find:Vc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_c)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),US=/^\s*(\[([( |x])?\])\s$/,KS=Ce.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",J(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,e)=>{const t=[];if(n.tokens&&n.tokens.length>0?t.push(e.createNode("paragraph",{},e.parseInline(n.tokens))):n.text?t.push(e.createNode("paragraph",{},[e.createNode("text",{text:n.text})])):t.push(e.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const r=e.parseChildren(n.nestedTokens);t.push(...r)}return e.createNode("taskItem",{checked:n.checked||!1},t)},renderMarkdown:(n,e)=>{var t;const s=`- [${(t=n.attrs)!=null&&t.checked?"x":" "}] `;return El(n,e,s)},addExtensions(){return this.options.nested?[bf(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{const s=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=d=>{var h,f;l.ariaLabel=((f=(h=this.options.a11y)==null?void 0:h.checkboxLabel)==null?void 0:f.call(h,d,l.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};c(n),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",d=>d.preventDefault()),l.addEventListener("change",d=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:h}=d.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=t();if(typeof p!="number")return!1;const m=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...m==null?void 0:m.attrs,checked:h}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,h)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,h])=>{s.setAttribute(d,h)}),s.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,i.append(l,o),s.append(i,a),Object.entries(e).forEach(([d,h])=>{s.setAttribute(d,h)});let u=new Set(Object.keys(e));return{dom:s,contentDOM:a,update:d=>{if(d.type!==this.type)return!1;s.dataset.checked=d.attrs.checked,l.checked=d.attrs.checked,c(d);const h=r.extensionManager.attributes,f=wn(d,h),p=new Set(Object.keys(f)),m=this.options.HTMLAttributes;return u.forEach(g=>{p.has(g)||(g in m?s.setAttribute(g,m[g]):s.removeAttribute(g))}),Object.entries(f).forEach(([g,y])=>{y==null?g in m?s.setAttribute(g,m[g]):s.removeAttribute(g):s.setAttribute(g,y)}),u=p,!0}}}},addInputRules(){return[En({find:US,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),JS=Ce.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",J(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,e)=>e.createNode("taskList",{},e.parseChildren(n.items||[])),renderMarkdown:(n,e)=>n.content?e.renderChildren(n.content,` +`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var e;const t=(e=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return t!==void 0?t:-1},tokenize(n,e,t){const r=i=>{const o=Oo(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,a)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:t.inlineTokens(l.mainContent),nestedTokens:a}),customNestedParser:r},t);return o?[{type:"taskList",raw:o.raw,items:o.items}]:t.blockTokens(i)},s=Oo(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:t.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:r},t);if(s)return{type:"taskList",raw:s.raw,items:s.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Y.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(kf.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(xf.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(Ef.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Tf.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(KS.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(JS.configure(this.options.taskList)),n}});var Jr=" ",Yi=" ",GS=Ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",J(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,e)=>{const t=n.tokens||[];if(t.length===1&&t[0].type==="image")return e.parseChildren([t[0]]);const r=e.parseInline(t);return t.length===1&&t[0].type==="text"&&(t[0].raw===Jr||t[0].text===Jr||t[0].raw===Yi||t[0].text===Yi)&&r.length===1&&r[0].type==="text"&&(r[0].text===Jr||r[0].text===Yi)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,r)},renderMarkdown:(n,e,t)=>{var r,s;if(!n)return"";const i=Array.isArray(n.content)?n.content:[];if(i.length===0){const o=Array.isArray((r=t==null?void 0:t.previousNode)==null?void 0:r.content)?t.previousNode.content:[];return((s=t==null?void 0:t.previousNode)==null?void 0:s.type)==="paragraph"&&o.length===0?Jr:""}return e.renderChildren(i)},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),YS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,XS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,QS=Qt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",J(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,e)=>e.applyMark("strike",e.parseInline(n.tokens||[])),renderMarkdown:(n,e)=>`~~${e.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[vn({find:YS,type:this.type})]},addPasteRules(){return[Jt({find:XS,type:this.type})]}}),ZS=Ce.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Mf=Qt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",J(this.options.HTMLAttributes,n),0]},parseMarkdown(n,e){return e.applyMark(this.name||"underline",e.parseInline(n.tokens||[]))},renderMarkdown(n,e){return`++${e.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,e,t){const s=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!s)return;const i=s[2].trim();return{type:"underline",raw:s[0],text:i,tokens:t.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ew=Mf;function tw(n={}){return new G({view(e){return new nw(e,n)}})}class nw{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(s=>{let i=o=>{this[s](o)};return e.dom.addEventListener(s,i),{name:s,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,s=this.editorView.dom,i=s.getBoundingClientRect(),o=i.width/s.offsetWidth,l=i.height/s.offsetHeight;if(t){let d=e.nodeBefore,h=e.nodeAfter;if(d||h){let f=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(f){let p=f.getBoundingClientRect(),m=d?p.bottom:p.top;d&&h&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let d=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;r={left:d.left-h,right:d.left+h,top:d.top,bottom:d.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let d=a.getBoundingClientRect(),h=d.width/a.offsetWidth,f=d.height/a.offsetHeight;c=d.left-a.scrollLeft*h,u=d.top-a.scrollTop*f}this.element.style.left=(r.left-c)/o+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),s=r&&r.type.spec.disableDropCursor,i=typeof s=="function"?s(this.editorView,t,e):s;if(t&&!i){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Vu(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Z extends P{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Z.valid(r)?new Z(r):P.near(r)}content(){return N.empty}eq(e){return e instanceof Z&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Z(e.resolve(t.pos))}getBookmark(){return new $l(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!rw(e)||!sw(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let s=t.contentMatchAt(e.index()).defaultType;return s&&s.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Z.valid(e))return e;let s=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(t>0?e.indexAfter(o)0){i=l.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;s+=t;let a=e.doc.resolve(s);if(Z.valid(a))return a}for(;;){let o=t>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!R.isSelectable(i)){e=e.doc.resolve(s+i.nodeSize*t),r=!1;continue e}break}i=o,s+=t;let l=e.doc.resolve(s);if(Z.valid(l))return l}return null}}}Z.prototype.visible=!1;Z.findFrom=Z.findGapCursorFrom;P.jsonID("gapcursor",Z);class $l{constructor(e){this.pos=e}map(e){return new $l(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Z.valid(t)?new Z(t):P.near(t)}}function Af(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function rw(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t-1);;s=s.lastChild){if(s.childCount==0&&!s.inlineContent||Af(s.type))return!0;if(s.inlineContent)return!1}}return!0}function sw(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let s=r.child(t);;s=s.firstChild){if(s.childCount==0&&!s.inlineContent||Af(s.type))return!0;if(s.inlineContent)return!1}}return!0}function iw(){return new G({props:{decorations:cw,createSelectionBetween(n,e,t){return e.pos==t.pos&&Z.valid(t)?new Z(t):null},handleClick:lw,handleKeyDown:ow,handleDOMEvents:{beforeinput:aw}}})}const ow=Qd({ArrowLeft:Gr("horiz",-1),ArrowRight:Gr("horiz",1),ArrowUp:Gr("vert",-1),ArrowDown:Gr("vert",1)});function Gr(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,s,i){let o=r.selection,l=e>0?o.$to:o.$from,a=o.empty;if(o instanceof I){if(!i.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=Z.findGapCursorFrom(l,e,a);return c?(s&&s(r.tr.setSelection(new Z(c))),!0):!1}}function lw(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Z.valid(r))return!1;let s=n.posAtCoords({left:t.clientX,top:t.clientY});return s&&s.inside>-1&&R.isSelectable(n.state.doc.nodeAt(s.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Z(r))),!0)}function aw(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Z))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let s=w.empty;for(let o=r.length-1;o>=0;o--)s=w.from(r[o].createAndFill(null,s));let i=n.state.tr.replace(t.pos,t.pos,new N(s,0,0));return i.setSelection(I.near(i.doc.resolve(t.pos+1))),n.dispatch(i),!1}function cw(n){if(!(n.selection instanceof Z))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",K.create(n.doc,[Se.widget(n.selection.head,e,{key:"gapcursor"})])}var ei=200,le=function(){};le.prototype.append=function(e){return e.length?(e=le.from(e),!this.length&&e||e.length=t?le.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};le.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};le.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};le.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(i,o){return s.push(e(i,o))},t,r),s};le.from=function(e){return e instanceof le?e:e&&e.length?new Nf(e):le.empty};var Nf=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(s,i){return s==0&&i==this.length?this:new e(this.values.slice(s,i))},e.prototype.getInner=function(s){return this.values[s]},e.prototype.forEachInner=function(s,i,o,l){for(var a=i;a=o;a--)if(s(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(s){if(this.length+s.length<=ei)return new e(this.values.concat(s.flatten()))},e.prototype.leafPrepend=function(s){if(this.length+s.length<=ei)return new e(s.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(le);le.empty=new Nf([]);var uw=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(s-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,s,i,o){var l=this.left.length;if(s>l&&this.right.forEachInvertedInner(r,s-l,Math.max(i,l)-l,o+l)===!1||i=i?this.right.slice(r-i,s-i):this.left.slice(r,i).append(this.right.slice(0,s-i))},e.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new e(this.left,s)},e.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new e(s,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(le);const dw=500;class He{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,i;t&&(s=this.remapping(r,this.items.length),i=s.maps.length);let o=e.tr,l,a,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){s||(s=this.remapping(r,h+1),i=s.maps.length),i--,u.push(d);return}if(s){u.push(new Je(d.map));let f=d.step.map(s.slice(i)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],c.push(new Je(p,void 0,void 0,c.length+u.length))),i--,p&&s.appendMap(p,i)}else o.maybeStep(d.step);if(d.selection)return l=s?d.selection.map(s.slice(i)):d.selection,a=new He(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:o,selection:l}}addTransform(e,t,r,s){let i=[],o=this.eventCount,l=this.items,a=!s&&l.length?l.get(l.length-1):null;for(let u=0;ufw&&(l=hw(l,c),o-=c),new He(l.append(i),o)}remapping(e,t){let r=new gr;return this.items.forEach((s,i)=>{let o=s.mirrorOffset!=null&&i-s.mirrorOffset>=e?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,o)},e,t),r}addMaps(e){return this.eventCount==0?this:new He(this.items.append(e.map(t=>new Je(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],s=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},s);let a=t;this.items.forEach(h=>{let f=i.getMirror(--a);if(f==null)return;o=Math.min(o,f);let p=i.maps[f];if(h.step){let m=e.steps[f].invert(e.docs[f]),g=h.selection&&h.selection.map(i.slice(a+1,f));g&&l++,r.push(new Je(p,m,g))}else r.push(new Je(p))},s);let c=[];for(let h=t;hdw&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,s=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)s.push(o),o.selection&&i++;else if(o.step){let a=o.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=o.selection&&o.selection.map(t.slice(r));u&&i++;let d=new Je(c.invert(),a,u),h,f=s.length-1;(h=s.length&&s[f].merge(d))?s[f]=h:s.push(d)}}else o.map&&r--},this.items.length,0),new He(le.from(s.reverse()),i)}}He.empty=new He(le.empty,0);function hw(n,e){let t;return n.forEach((r,s)=>{if(r.selection&&e--==0)return t=s,!1}),n.slice(t)}class Je{constructor(e,t,r,s){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=s}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Je(t.getMap().invert(),t,this.selection)}}}class kt{constructor(e,t,r,s,i){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=s,this.prevComposition=i}}const fw=20;function pw(n,e,t,r){let s=t.getMeta(_t),i;if(s)return s.historyState;t.getMeta(yw)&&(n=new kt(n.done,n.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(o&&o.getMeta(_t))return o.getMeta(_t).redo?new kt(n.done.addTransform(t,void 0,r,hs(e)),n.undone,Wc(t.mapping.maps),n.prevTime,n.prevComposition):new kt(n.done,n.undone.addTransform(t,void 0,r,hs(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!o&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!mw(t,n.prevRanges)),c=o?Xi(n.prevRanges,t.mapping):Wc(t.mapping.maps);return new kt(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,hs(e)),He.empty,c,t.time,l??n.prevComposition)}else return(i=t.getMeta("rebased"))?new kt(n.done.rebased(t,i),n.undone.rebased(t,i),Xi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new kt(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Xi(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function mw(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,s)=>{for(let i=0;i=e[i]&&(t=!0)}),t}function Wc(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,s,i,o)=>e.push(i,o));return e}function Xi(n,e){if(!n)return null;let t=[];for(let r=0;r{let s=_t.getState(t);if(!s||(n?s.undone:s.done).eventCount==0)return!1;if(r){let i=gw(s,t,n);i&&r(e?i.scrollIntoView():i)}return!0}}const Rf=Of(!1,!0),Df=Of(!0,!0);Y.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc;if(((n==null?void 0:n.mode)||this.options.mode)==="textSize"){const r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{const e=(n==null?void 0:n.node)||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new G({key:new se("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;const s=this.options.limit,i=this.options.autoTrim;if(s==null||s===0||i===!1){n=!0;return}const o=this.storage.characters({node:r.doc});if(o>s){const l=o-s,a=0,c=l;console.warn(`[CharacterCount] Initial content exceeded limit of ${s} characters. Content was automatically trimmed.`);const u=r.tr.deleteRange(a,c);return n=!0,u}n=!0},filterTransaction:(e,t)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const s=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=r||s>r&&i>r&&i<=s)return!0;if(s>r&&i>r&&i>s||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,a=i-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}});var bw=Y.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[tw(this.options)]}});Y.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new G({key:new se("focus"),props:{decorations:({doc:n,selection:e})=>{const{isEditable:t,isFocused:r}=this.editor,{anchor:s}=e,i=[];if(!t||!r)return K.create(n,[]);let o=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(s>=c&&s<=c+a.nodeSize-1))return!1;o+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(s>=c&&s<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(Se.node(c,c+a.nodeSize,{class:this.options.className}))}),K.create(n,i)}}})]}});var xw=Y.create({name:"gapCursor",addProseMirrorPlugins(){return[iw()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=H(O(n,"allowGapCursor",t)))!=null?e:null}}}),If="placeholder",Tr=new se("tiptap__placeholder"),Uc=200;function Kc(n){const{editor:e,placeholder:t,dataAttribute:r,pos:s,node:i,isEmptyDoc:o,hasAnchor:l,classes:{emptyNode:a,emptyEditor:c}}=n,u=[a];return o&&u.push(c),Se.node(s,s+i.nodeSize,{class:u.join(" "),[r]:typeof t=="function"?t({editor:e,node:i,pos:s,hasAnchor:l}):t})}function Jc(n,e){return typeof n=="function"?n(e):n}function Sw({editor:n,options:e,dataAttribute:t,doc:r,selection:s}){var i,o;if(!(n.isEditable||!e.showOnlyWhenEditable))return null;const{anchor:a}=s,c=[],u=n.isEmpty;if(e.showOnlyCurrent&&!e.includeChildren){const h=r.resolve(a),f=h.depth>0?h.node(1):h.nodeAfter,p=h.depth>0?h.before(1):a;if(f&&f.type.isTextblock&&wr(f)){const m=a>=p&&a<=p+f.nodeSize;c.push(Kc({editor:n,isEmptyDoc:u,dataAttribute:t,hasAnchor:m,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Jc(e.emptyNodeClass,{editor:n,node:f,pos:p,hasAnchor:m})},node:f,pos:p}))}}else{const h=Tr.getState(n.state),f=(i=h==null?void 0:h.topPos)!=null?i:0,p=(o=h==null?void 0:h.bottomPos)!=null?o:r.content.size;r.nodesBetween(f,p,(m,g)=>{const y=a>=g&&a<=g+m.nodeSize,x=!m.isLeaf&&wr(m);return m.type.isTextblock&&(y||!e.showOnlyCurrent)&&x&&c.push(Kc({editor:n,isEmptyDoc:u,dataAttribute:t,hasAnchor:y,placeholder:e.placeholder,classes:{emptyEditor:e.emptyEditorClass,emptyNode:Jc(e.emptyNodeClass,{editor:n,node:m,pos:g,hasAnchor:y})},node:m,pos:g})),e.includeChildren})}return K.create(r,c)}function ww(n){return n.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function vw(n){const e=getComputedStyle(n),t=`${e.overflow} ${e.overflowY} ${e.overflowX}`;return/auto|scroll|overlay/.test(t)}function Ew(n){let e=n;for(;e;){if(vw(e))return e;const t=e.parentElement;if(!t){const r=e.getRootNode();if(r instanceof ShadowRoot){e=r.host;continue}return window}e=t}return window}function Cw(n){return n===window?{top:0,bottom:window.innerHeight}:n.getBoundingClientRect()}function Tw({doc:n,view:e,scrollContainer:t}){const r=e.dom.getBoundingClientRect(),s=t?Cw(t):{top:0,bottom:window.innerHeight},i=Math.max(r.top,s.top)-Uc,o=Math.min(r.bottom,s.bottom)+Uc;if(i>=o)return{top:0,bottom:n.content.size};const a=getComputedStyle(e.dom).direction==="rtl"?Math.max(r.right-2,r.left+2):r.left+2,c=e.posAtCoords({left:a,top:i+2}),u=e.posAtCoords({left:a,top:o-2});return{top:c?c.pos:0,bottom:u?u.pos:n.content.size}}var Mw={init(){return{topPos:null,bottomPos:null}},apply(n,e){const t=n.getMeta(Tr);return t!=null&&t.positions?{topPos:t.positions.top,bottomPos:t.positions.bottom}:n.docChanged?{topPos:e.topPos!==null?n.mapping.map(e.topPos):null,bottomPos:e.bottomPos!==null?n.mapping.map(e.bottomPos):null}:e}};function Aw(n){const e=Ew(n.dom),t=()=>{const l=Tw({view:n,doc:n.state.doc,scrollContainer:e}),a=Tr.getState(n.state);if((a==null?void 0:a.topPos)===l.top&&(a==null?void 0:a.bottomPos)===l.bottom)return;const c=n.state.tr.setMeta(Tr,{positions:l});n.dispatch(c)};let r=null,s=0;const i=150,o=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null;const l=performance.now();l-s>=i?(s=l,t()):o()}))};return e.addEventListener("scroll",o,{passive:!0}),t(),{update(l,a){n.state.doc.content.size!==a.doc.content.size&&o()},destroy:()=>{r!==null&&cancelAnimationFrame(r),e.removeEventListener("scroll",o)}}}function Nw({editor:n,options:e}){const t=e.dataAttribute?`data-${ww(e.dataAttribute)}`:`data-${If}`;return new G({key:Tr,state:Mw,view:Aw,props:{decorations:({doc:r,selection:s})=>Sw({editor:n,options:e,dataAttribute:t,doc:r,selection:s})}})}var Ow=Y.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:If,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Nw({editor:this.editor,options:this.options})]}}),Rw=`.ProseMirror:not(.ProseMirror-focused) *::selection { background: transparent; } .ProseMirror:not(.ProseMirror-focused) *::-moz-selection { background: transparent; -}`;Y.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return n.options.injectCSS&&typeof document<"u"&&Th(ww,n.options.injectNonce,"selection"),[new G({key:new re("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||ch(t.selection)||n.view.dragging?null:K.create(t.doc,[Se.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var vw="skipTrailingNode";function qc({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var Ew=Y.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new re(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(t).includes(s.name));return[new G({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,h=c.nodes[t];if(!s.some(f=>f.getMeta(vw))&&u)return a.insert(d,h.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!qc({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!qc({node:o,types:r})}}})]}}),Cw=Y.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Mf(n,e),redo:()=>({state:n,dispatch:e})=>Af(n,e)}},addProseMirrorPlugins(){return[cw(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Tw=Y.create({name:"starterKit",addExtensions(){var n,e,t,r;const s=[];return this.options.bold!==!1&&s.push(Rx.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Tx.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(pf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Lx.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(Bx.configure(this.options.codeBlock)),this.options.document!==!1&&s.push($x.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(uw.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(dw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(Fx.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(Hx.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(Cw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(_x.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(Ux.configure(this.options.italic)),this.options.listItem!==!1&&s.push(gf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(xf.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&s.push(ff.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(wf.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(HS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(VS.configure(this.options.strike)),this.options.text!==!1&&s.push(WS.configure(this.options.text)),this.options.underline!==!1&&s.push(vf.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&s.push(Ew.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),Mw=Tw,Aw=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Nw=Ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",J(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,r,s,i,o;const l=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",a=(s=(r=n.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=n.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${a}](${l} "${c}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");a.draggable=!1;const c=J(this.options.HTMLAttributes,o);Object.entries(c).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,f);break}}),c.src!==null&&(a.src=c.src);const u=new qb({element:a,editor:l,node:s,getPos:i,onResize:(h,f)=>{a.style.width=`${h}px`,a.style.height=`${f}px`},onCommit:(h,f)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,p)=>h.type===s.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",a.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},u}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Mh({find:Aw,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),Ow=Nw,Rw=Sw;function Iw(n){for(var e=1;e0&&n[e-1]===` -`;)e--;return n.substring(0,e)}function If(n){return Rf(Of(n))}var Dw=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Pl(n){return zl(n,Dw)}var Df=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Lf(n){return zl(n,Df)}function Lw(n){return zf(n,Df)}var Pf=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Pw(n){return zl(n,Pf)}function zw(n){return zf(n,Pf)}function zl(n,e){return e.indexOf(n.nodeName)>=0}function zf(n,e){return n.getElementsByTagName&&e.some(function(t){return n.getElementsByTagName(t).length})}var Bw=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Bf(n){return Bw.reduce(function(e,t){return e.replace(t[0],t[1])},n)}var ye={};ye.paragraph={filter:"p",replacement:function(n){return` +}`;Y.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:e}=this;return n.options.injectCSS&&typeof document<"u"&&Oh(Rw,n.options.injectNonce,"selection"),[new G({key:new se("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||fh(t.selection)||n.view.dragging?null:K.create(t.doc,[Se.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});var Dw="skipTrailingNode";function Gc({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||(e==null?void 0:e.type)===n}var Iw=Y.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const e=new se(this.name),t=this.options.node||((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,s])=>s).filter(s=>(this.options.notAfter||[]).concat(t).includes(s.name));return[new G({key:e,appendTransaction:(s,i,o)=>{const{doc:l,tr:a,schema:c}=o,u=e.getState(o),d=l.content.size,h=c.nodes[t];if(!s.some(f=>f.getMeta(Dw))&&u)return a.insert(d,h.create())},state:{init:(s,i)=>{const o=i.tr.doc.lastChild;return!Gc({node:o,types:r})},apply:(s,i)=>{if(!s.docChanged||s.getMeta("__uniqueIDTransaction"))return i;const o=s.doc.lastChild;return!Gc({node:o,types:r})}}})]}}),Lw=Y.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Rf(n,e),redo:()=>({state:n,dispatch:e})=>Df(n,e)}},addProseMirrorPlugins(){return[kw(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),Pw=Y.create({name:"starterKit",addExtensions(){var n,e,t,r;const s=[];return this.options.bold!==!1&&s.push(jx.configure(this.options.bold)),this.options.blockquote!==!1&&s.push(Px.configure(this.options.blockquote)),this.options.bulletList!==!1&&s.push(kf.configure(this.options.bulletList)),this.options.code!==!1&&s.push(Vx.configure(this.options.code)),this.options.codeBlock!==!1&&s.push(Ux.configure(this.options.codeBlock)),this.options.document!==!1&&s.push(Kx.configure(this.options.document)),this.options.dropcursor!==!1&&s.push(bw.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&s.push(xw.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&s.push(Jx.configure(this.options.hardBreak)),this.options.heading!==!1&&s.push(Gx.configure(this.options.heading)),this.options.undoRedo!==!1&&s.push(Lw.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&s.push(Yx.configure(this.options.horizontalRule)),this.options.italic!==!1&&s.push(tS.configure(this.options.italic)),this.options.listItem!==!1&&s.push(xf.configure(this.options.listItem)),this.options.listKeymap!==!1&&s.push(Ef.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&s.push(yf.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&s.push(Tf.configure(this.options.orderedList)),this.options.paragraph!==!1&&s.push(GS.configure(this.options.paragraph)),this.options.strike!==!1&&s.push(QS.configure(this.options.strike)),this.options.text!==!1&&s.push(ZS.configure(this.options.text)),this.options.underline!==!1&&s.push(Mf.configure((t=this.options)==null?void 0:t.underline)),this.options.trailingNode!==!1&&s.push(Iw.configure((r=this.options)==null?void 0:r.trailingNode)),s}}),zw=Pw,Bw=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,$w=Ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",J(this.options.HTMLAttributes,n)]},parseMarkdown:(n,e)=>e.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var e,t,r,s,i,o;const l=(t=(e=n.attrs)==null?void 0:e.src)!=null?t:"",a=(s=(r=n.attrs)==null?void 0:r.alt)!=null?s:"",c=(o=(i=n.attrs)==null?void 0:i.title)!=null?o:"";return c?`![${a}](${l} "${c}")`:`![${a}](${l})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:n,minWidth:e,minHeight:t,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:s,getPos:i,HTMLAttributes:o,editor:l})=>{const a=document.createElement("img");a.draggable=!1;const c=J(this.options.HTMLAttributes,o);Object.entries(c).forEach(([h,f])=>{if(f!=null)switch(h){case"width":case"height":break;default:a.setAttribute(h,f);break}}),c.src!==null&&(a.src=c.src);const u=new e0({element:a,editor:l,node:s,getPos:i,onResize:(h,f)=>{a.style.width=`${h}px`,a.style.height=`${f}px`},onCommit:(h,f)=>{const p=i();p!==void 0&&this.editor.chain().setNodeSelection(p).updateAttributes(this.name,{width:h,height:f}).run()},onUpdate:(h,f,p)=>h.type===s.type,options:{directions:n,min:{width:e,height:t},preserveAspectRatio:r===!0}}),d=u.dom;return d.style.visibility="hidden",d.style.pointerEvents="none",a.onload=()=>{d.style.visibility="",d.style.pointerEvents=""},u}},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[Rh({find:Bw,type:this.type,getAttributes:n=>{const[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),Fw=$w,jw=Ow;function Hw(n){for(var e=1;e0&&n[e-1]===` +`;)e--;return n.substring(0,e)}function zf(n){return Pf(Lf(n))}var _w=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Fl(n){return jl(n,_w)}var Bf=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function $f(n){return jl(n,Bf)}function Vw(n){return jf(n,Bf)}var Ff=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Ww(n){return jl(n,Ff)}function qw(n){return jf(n,Ff)}function jl(n,e){return e.indexOf(n.nodeName)>=0}function jf(n,e){return n.getElementsByTagName&&e.some(function(t){return n.getElementsByTagName(t).length})}var Uw=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Hf(n){return Uw.reduce(function(e,t){return e.replace(t[0],t[1])},n)}var ye={};ye.paragraph={filter:"p",replacement:function(n){return` `+n+` `}};ye.lineBreak={filter:"br",replacement:function(n,e,t){return t.br+` -`}};ye.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(n,e,t){var r=Number(e.nodeName.charAt(1));if(t.headingStyle==="setext"&&r<3){var s=Ho(r===1?"=":"-",n.length);return` +`}};ye.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(n,e,t){var r=Number(e.nodeName.charAt(1));if(t.headingStyle==="setext"&&r<3){var s=Wo(r===1?"=":"-",n.length);return` `+n+` `+s+` `}else return` -`+Ho("#",r)+" "+n+` +`+Wo("#",r)+" "+n+` -`}};ye.blockquote={filter:"blockquote",replacement:function(n){return n=If(n).replace(/^/gm,"> "),` +`}};ye.blockquote={filter:"blockquote",replacement:function(n){return n=zf(n).replace(/^/gm,"> "),` `+n+` @@ -186,7 +186,7 @@ ${t} `+n+` -`}};ye.listItem={filter:"li",replacement:function(n,e,t){var r=t.bulletListMarker+" ",s=e.parentNode;if(s.nodeName==="OL"){var i=s.getAttribute("start"),o=Array.prototype.indexOf.call(s.children,e);r=(i?Number(i)+o:o+1)+". "}var l=/\n$/.test(n);return n=If(n)+(l?` +`}};ye.listItem={filter:"li",replacement:function(n,e,t){var r=t.bulletListMarker+" ",s=e.parentNode;if(s.nodeName==="OL"){var i=s.getAttribute("start"),o=Array.prototype.indexOf.call(s.children,e);r=(i?Number(i)+o:o+1)+". "}var l=/\n$/.test(n);return n=zf(n)+(l?` `:""),n=n.replace(/\n/gm,` `+" ".repeat(r.length)),r+n+(e.nextSibling?` `:"")}};ye.indentedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="indented"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){return` @@ -194,7 +194,7 @@ ${t} `+e.firstChild.textContent.replace(/\n/g,` `)+` -`}};ye.fencedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="fenced"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){for(var r=e.firstChild.getAttribute("class")||"",s=(r.match(/language-(\S+)/)||[null,""])[1],i=e.firstChild.textContent,o=t.fence.charAt(0),l=3,a=new RegExp("^"+o+"{3,}","gm"),c;c=a.exec(i);)c[0].length>=l&&(l=c[0].length+1);var u=Ho(o,l);return` +`}};ye.fencedCodeBlock={filter:function(n,e){return e.codeBlockStyle==="fenced"&&n.nodeName==="PRE"&&n.firstChild&&n.firstChild.nodeName==="CODE"},replacement:function(n,e,t){for(var r=e.firstChild.getAttribute("class")||"",s=(r.match(/language-(\S+)/)||[null,""])[1],i=e.firstChild.textContent,o=t.fence.charAt(0),l=3,a=new RegExp("^"+o+"{3,}","gm"),c;c=a.exec(i);)c[0].length>=l&&(l=c[0].length+1);var u=Wo(o,l);return` `+u+s+` `+i.replace(/\n$/,"")+` @@ -204,13 +204,13 @@ ${t} `+t.hr+` -`}};ye.inlineLink={filter:function(n,e){return e.linkStyle==="inlined"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e){var t=Bl(e.getAttribute("href")),r=$l(Ys(e.getAttribute("title"))),s=r?' "'+r+'"':"";return"["+n+"]("+t+s+")"}};ye.referenceLink={filter:function(n,e){return e.linkStyle==="referenced"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e,t){var r=Bl(e.getAttribute("href")),s=Ys(e.getAttribute("title"));s&&(s=' "'+$l(s)+'"');var i,o;switch(t.linkReferenceStyle){case"collapsed":i="["+n+"][]",o="["+n+"]: "+r+s;break;case"shortcut":i="["+n+"]",o="["+n+"]: "+r+s;break;default:var l=this.references.length+1;i="["+n+"]["+l+"]",o="["+l+"]: "+r+s}return this.references.push(o),i},references:[],append:function(n){var e="";return this.references.length&&(e=` +`}};ye.inlineLink={filter:function(n,e){return e.linkStyle==="inlined"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e){var t=Hl(e.getAttribute("href")),r=_l(ti(e.getAttribute("title"))),s=r?' "'+r+'"':"";return"["+n+"]("+t+s+")"}};ye.referenceLink={filter:function(n,e){return e.linkStyle==="referenced"&&n.nodeName==="A"&&n.getAttribute("href")},replacement:function(n,e,t){var r=Hl(e.getAttribute("href")),s=ti(e.getAttribute("title"));s&&(s=' "'+_l(s)+'"');var i,o;switch(t.linkReferenceStyle){case"collapsed":i="["+n+"][]",o="["+n+"]: "+r+s;break;case"shortcut":i="["+n+"]",o="["+n+"]: "+r+s;break;default:var l=this.references.length+1;i="["+n+"]["+l+"]",o="["+l+"]: "+r+s}return this.references.push(o),i},references:[],append:function(n){var e="";return this.references.length&&(e=` `+this.references.join(` `)+` -`,this.references=[]),e}};ye.emphasis={filter:["em","i"],replacement:function(n,e,t){return n.trim()?t.emDelimiter+n+t.emDelimiter:""}};ye.strong={filter:["strong","b"],replacement:function(n,e,t){return n.trim()?t.strongDelimiter+n+t.strongDelimiter:""}};ye.code={filter:function(n){var e=n.previousSibling||n.nextSibling,t=n.parentNode.nodeName==="PRE"&&!e;return n.nodeName==="CODE"&&!t},replacement:function(n){if(!n)return"";n=n.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(n)?" ":"",t="`",r=n.match(/`+/gm)||[];r.indexOf(t)!==-1;)t=t+"`";return t+e+n+e+t}};ye.image={filter:"img",replacement:function(n,e){var t=Bf(Ys(e.getAttribute("alt"))),r=Bl(e.getAttribute("src")||""),s=Ys(e.getAttribute("title")),i=s?' "'+$l(s)+'"':"";return r?"!["+t+"]("+r+i+")":""}};function Ys(n){return n?n.replace(/(\n+\s*)+/g,` -`):""}function Bl(n){var e=n.replace(/([<>()])/g,"\\$1");return e.indexOf(" ")>=0?"<"+e+">":e}function $l(n){return n.replace(/"/g,'\\"')}function $f(n){this.options=n,this._keep=[],this._remove=[],this.blankRule={replacement:n.blankReplacement},this.keepReplacement=n.keepReplacement,this.defaultRule={replacement:n.defaultReplacement},this.array=[];for(var e in n.rules)this.array.push(n.rules[e])}$f.prototype={add:function(n,e){this.array.unshift(e)},keep:function(n){this._keep.unshift({filter:n,replacement:this.keepReplacement})},remove:function(n){this._remove.unshift({filter:n,replacement:function(){return""}})},forNode:function(n){if(n.isBlank)return this.blankRule;var e;return(e=Gi(this.array,n,this.options))||(e=Gi(this._keep,n,this.options))||(e=Gi(this._remove,n,this.options))?e:this.defaultRule},forEach:function(n){for(var e=0;e-1)return!0}else if(typeof r=="function"){if(r.call(n,e,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Fw(n){var e=n.element,t=n.isBlock,r=n.isVoid,s=n.isPre||function(d){return d.nodeName==="PRE"};if(!(!e.firstChild||s(e))){for(var i=null,o=!1,l=null,a=Uc(l,e,s);a!==e;){if(a.nodeType===3||a.nodeType===4){var c=a.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!o&&c[0]===" "&&(c=c.substr(1)),!c){a=Yi(a);continue}a.data=c,i=a}else if(a.nodeType===1)t(a)||a.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,o=!1):r(a)||s(a)?(i=null,o=!0):i&&(o=!1);else{a=Yi(a);continue}var u=Uc(l,a,s);l=a,a=u}i&&(i.data=i.data.replace(/ $/,""),i.data||Yi(i))}}function Yi(n){var e=n.nextSibling||n.parentNode;return n.parentNode.removeChild(n),e}function Uc(n,e,t){return n&&n.parentNode===e||t(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var Fl=typeof window<"u"?window:{};function Hw(){var n=Fl.DOMParser,e=!1;try{new n().parseFromString("","text/html")&&(e=!0)}catch{}return e}function _w(){var n=function(){};return jw()?n.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:n.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},n}function jw(){var n=!1;try{document.implementation.createHTMLDocument("").open()}catch{Fl.ActiveXObject&&(n=!0)}return n}var Vw=Hw()?Fl.DOMParser:_w();function Ww(n,e){var t;if(typeof n=="string"){var r=qw().parseFromString(''+n+"","text/html");t=r.getElementById("turndown-root")}else t=n.cloneNode(!0);return Fw({element:t,isBlock:Pl,isVoid:Lf,isPre:e.preformattedCode?Uw:null}),t}var Xi;function qw(){return Xi=Xi||new Vw,Xi}function Uw(n){return n.nodeName==="PRE"||n.nodeName==="CODE"}function Kw(n,e){return n.isBlock=Pl(n),n.isCode=n.nodeName==="CODE"||n.parentNode.isCode,n.isBlank=Jw(n),n.flankingWhitespace=Gw(n,e),n}function Jw(n){return!Lf(n)&&!Pw(n)&&/^\s*$/i.test(n.textContent)&&!Lw(n)&&!zw(n)}function Gw(n,e){if(n.isBlock||e.preformattedCode&&n.isCode)return{leading:"",trailing:""};var t=Yw(n.textContent);return t.leadingAscii&&Kc("left",n,e)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&Kc("right",n,e)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function Yw(n){var e=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function Kc(n,e,t){var r,s,i;return n==="left"?(r=e.previousSibling,s=/ $/):(r=e.nextSibling,s=/^ /),r&&(r.nodeType===3?i=s.test(r.nodeValue):t.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!Pl(r)&&(i=s.test(r.textContent))),i}var Xw=Array.prototype.reduce;function vr(n){if(!(this instanceof vr))return new vr(n);var e={rules:ye,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(t,r){return r.isBlock?` +`,this.references=[]),e}};ye.emphasis={filter:["em","i"],replacement:function(n,e,t){return n.trim()?t.emDelimiter+n+t.emDelimiter:""}};ye.strong={filter:["strong","b"],replacement:function(n,e,t){return n.trim()?t.strongDelimiter+n+t.strongDelimiter:""}};ye.code={filter:function(n){var e=n.previousSibling||n.nextSibling,t=n.parentNode.nodeName==="PRE"&&!e;return n.nodeName==="CODE"&&!t},replacement:function(n){if(!n)return"";n=n.replace(/\r?\n|\r/g," ");for(var e=/^`|^ .*?[^ ].* $|`$/.test(n)?" ":"",t="`",r=n.match(/`+/gm)||[];r.indexOf(t)!==-1;)t=t+"`";return t+e+n+e+t}};ye.image={filter:"img",replacement:function(n,e){var t=Hf(ti(e.getAttribute("alt"))),r=Hl(e.getAttribute("src")||""),s=ti(e.getAttribute("title")),i=s?' "'+_l(s)+'"':"";return r?"!["+t+"]("+r+i+")":""}};function ti(n){return n?n.replace(/(\n+\s*)+/g,` +`):""}function Hl(n){var e=n.replace(/([<>()])/g,"\\$1");return e.indexOf(" ")>=0?"<"+e+">":e}function _l(n){return n.replace(/"/g,'\\"')}function _f(n){this.options=n,this._keep=[],this._remove=[],this.blankRule={replacement:n.blankReplacement},this.keepReplacement=n.keepReplacement,this.defaultRule={replacement:n.defaultReplacement},this.array=[];for(var e in n.rules)this.array.push(n.rules[e])}_f.prototype={add:function(n,e){this.array.unshift(e)},keep:function(n){this._keep.unshift({filter:n,replacement:this.keepReplacement})},remove:function(n){this._remove.unshift({filter:n,replacement:function(){return""}})},forNode:function(n){if(n.isBlank)return this.blankRule;var e;return(e=Zi(this.array,n,this.options))||(e=Zi(this._keep,n,this.options))||(e=Zi(this._remove,n,this.options))?e:this.defaultRule},forEach:function(n){for(var e=0;e-1)return!0}else if(typeof r=="function"){if(r.call(n,e,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Jw(n){var e=n.element,t=n.isBlock,r=n.isVoid,s=n.isPre||function(d){return d.nodeName==="PRE"};if(!(!e.firstChild||s(e))){for(var i=null,o=!1,l=null,a=Yc(l,e,s);a!==e;){if(a.nodeType===3||a.nodeType===4){var c=a.data.replace(/[ \r\n\t]+/g," ");if((!i||/ $/.test(i.data))&&!o&&c[0]===" "&&(c=c.substr(1)),!c){a=eo(a);continue}a.data=c,i=a}else if(a.nodeType===1)t(a)||a.nodeName==="BR"?(i&&(i.data=i.data.replace(/ $/,"")),i=null,o=!1):r(a)||s(a)?(i=null,o=!0):i&&(o=!1);else{a=eo(a);continue}var u=Yc(l,a,s);l=a,a=u}i&&(i.data=i.data.replace(/ $/,""),i.data||eo(i))}}function eo(n){var e=n.nextSibling||n.parentNode;return n.parentNode.removeChild(n),e}function Yc(n,e,t){return n&&n.parentNode===e||t(e)?e.nextSibling||e.parentNode:e.firstChild||e.nextSibling||e.parentNode}var Vl=typeof window<"u"?window:{};function Gw(){var n=Vl.DOMParser,e=!1;try{new n().parseFromString("","text/html")&&(e=!0)}catch{}return e}function Yw(){var n=function(){};return Xw()?n.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:n.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},n}function Xw(){var n=!1;try{document.implementation.createHTMLDocument("").open()}catch{Vl.ActiveXObject&&(n=!0)}return n}var Qw=Gw()?Vl.DOMParser:Yw();function Zw(n,e){var t;if(typeof n=="string"){var r=e1().parseFromString(''+n+"","text/html");t=r.getElementById("turndown-root")}else t=n.cloneNode(!0);return Jw({element:t,isBlock:Fl,isVoid:$f,isPre:e.preformattedCode?t1:null}),t}var to;function e1(){return to=to||new Qw,to}function t1(n){return n.nodeName==="PRE"||n.nodeName==="CODE"}function n1(n,e){return n.isBlock=Fl(n),n.isCode=n.nodeName==="CODE"||n.parentNode.isCode,n.isBlank=r1(n),n.flankingWhitespace=s1(n,e),n}function r1(n){return!$f(n)&&!Ww(n)&&/^\s*$/i.test(n.textContent)&&!Vw(n)&&!qw(n)}function s1(n,e){if(n.isBlock||e.preformattedCode&&n.isCode)return{leading:"",trailing:""};var t=i1(n.textContent);return t.leadingAscii&&Xc("left",n,e)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&Xc("right",n,e)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function i1(n){var e=n.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:e[1],leadingAscii:e[2],leadingNonAscii:e[3],trailing:e[4],trailingNonAscii:e[5],trailingAscii:e[6]}}function Xc(n,e,t){var r,s,i;return n==="left"?(r=e.previousSibling,s=/ $/):(r=e.nextSibling,s=/^ /),r&&(r.nodeType===3?i=s.test(r.nodeValue):t.preformattedCode&&r.nodeName==="CODE"?i=!1:r.nodeType===1&&!Fl(r)&&(i=s.test(r.textContent))),i}var o1=Array.prototype.reduce;function Mr(n){if(!(this instanceof Mr))return new Mr(n);var e={rules:ye,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(t,r){return r.isBlock?` `:""},keepReplacement:function(t,r){return r.isBlock?` @@ -220,16 +220,16 @@ ${t} `+t+` -`:t}};this.options=Iw({},e,n),this.rules=new $f(this.options)}vr.prototype={turndown:function(n){if(!e1(n))throw new TypeError(n+" is not a string, or an element/document/fragment node.");if(n==="")return"";var e=Ff.call(this,new Ww(n,this.options));return Qw.call(this,e)},use:function(n){if(Array.isArray(n))for(var e=0;enull};function Zt(n){let e=[];return t=>{let r=Math.max(0,Math.min(3,t-1)),s=e[r];return s||(s=n(r),e[r]=s),s}}function F(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(fe.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var t1=((n="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Zt(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Zt(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Zt(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Zt(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Zt(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Zt(n=>new RegExp(`^ {0,${n}}>`))},n1=/^(?:[ \t]*(?:\n|$))+/,r1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,s1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Nr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,i1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,_l=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,jf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Vf=F(jf).replace(/bull/g,_l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),o1=F(jf).replace(/bull/g,_l).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),jl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,l1=/^[^\n]+/,Vl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,a1=F(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Vl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),c1=F(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,_l).getRegex(),pi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wl=/|$))/,u1=F("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wl).replace("tag",pi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Wf=F(jl).replace("hr",Nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex(),d1=F(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Wf).getRegex(),ql={blockquote:d1,code:r1,def:a1,fences:s1,heading:i1,hr:Nr,html:u1,lheading:Vf,list:c1,newline:n1,paragraph:Wf,table:At,text:l1},Jc=F("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex(),h1={...ql,lheading:o1,table:Jc,paragraph:F(jl).replace("hr",Nr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Jc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex()},f1={...ql,html:F(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:At,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:F(jl).replace("hr",Nr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",Vf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},p1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,m1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qf=/^( {2,}|\\)\n(?!\s*$)/,g1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",t1?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Kf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,S1=F(Kf,"u").replace(/punct/g,Cn).getRegex(),w1=F(Kf,"u").replace(/punct/g,Uf).getRegex(),Jf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",v1=F(Jf,"gu").replace(/notPunctSpace/g,Ul).replace(/punctSpace/g,mi).replace(/punct/g,Cn).getRegex(),E1=F(Jf,"gu").replace(/notPunctSpace/g,b1).replace(/punctSpace/g,k1).replace(/punct/g,Uf).getRegex(),C1=F("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ul).replace(/punctSpace/g,mi).replace(/punct/g,Cn).getRegex(),T1=F(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Cn).getRegex(),M1="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",A1=F(M1,"gu").replace(/notPunctSpace/g,Ul).replace(/punctSpace/g,mi).replace(/punct/g,Cn).getRegex(),N1=F(/\\(punct)/,"gu").replace(/punct/g,Cn).getRegex(),O1=F(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),R1=F(Wl).replace("(?:-->|$)","-->").getRegex(),I1=F("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",R1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Xs=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,D1=F(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Xs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Gf=F(/^!?\[(label)\]\[(ref)\]/).replace("label",Xs).replace("ref",Vl).getRegex(),Yf=F(/^!?\[(ref)\](?:\[\])?/).replace("ref",Vl).getRegex(),L1=F("reflink|nolink(?!\\()","g").replace("reflink",Gf).replace("nolink",Yf).getRegex(),Gc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Kl={_backpedal:At,anyPunctuation:N1,autolink:O1,blockSkip:x1,br:qf,code:m1,del:At,delLDelim:At,delRDelim:At,emStrongLDelim:S1,emStrongRDelimAst:v1,emStrongRDelimUnd:C1,escape:p1,link:D1,nolink:Yf,punctuation:y1,reflink:Gf,reflinkSearch:L1,tag:I1,text:g1,url:At},P1={...Kl,link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",Xs).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Xs).getRegex()},_o={...Kl,emStrongRDelimAst:E1,emStrongLDelim:w1,delLDelim:T1,delRDelim:A1,url:F(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Gc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:F(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},Yc=n=>B1[n];function _e(n,e){if(e){if(fe.escapeTest.test(n))return n.replace(fe.escapeReplace,Yc)}else if(fe.escapeTestNoEncode.test(n))return n.replace(fe.escapeReplaceNoEncode,Yc);return n}function Xc(n){try{n=encodeURI(n).replace(fe.percentDecode,"%")}catch{return null}return n}function Qc(n,e){var i;let t=n.replace(fe.findPipe,(o,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),r=t.split(fe.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.lengthnull};function rn(n){let e=[];return t=>{let r=Math.max(0,Math.min(3,t-1)),s=e[r];return s||(s=n(r),e[r]=s),s}}function F(n,e=""){let t=typeof n=="string"?n:n.source,r={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(fe.caret,"$1"),t=t.replace(s,o),r},getRegex:()=>new RegExp(t,e)};return r}var u1=((n="")=>{try{return!!new RegExp("(?<=1)(?/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:rn(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:rn(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:rn(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:rn(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:rn(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:rn(n=>new RegExp(`^ {0,${n}}>`))},d1=/^(?:[ \t]*(?:\n|$))+/,h1=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,f1=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ir=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p1=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ql=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Uf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Kf=F(Uf).replace(/bull/g,ql).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),m1=F(Uf).replace(/bull/g,ql).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ul=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,g1=/^[^\n]+/,Kl=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,y1=F(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Kl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),k1=F(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,ql).getRegex(),bi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Jl=/|$))/,b1=F("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Jl).replace("tag",bi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Jf=F(Ul).replace("hr",Ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bi).getRegex(),x1=F(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Jf).getRegex(),Gl={blockquote:x1,code:h1,def:y1,fences:f1,heading:p1,hr:Ir,html:b1,lheading:Kf,list:k1,newline:d1,paragraph:Jf,table:Dt,text:g1},Qc=F("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bi).getRegex(),S1={...Gl,lheading:m1,table:Qc,paragraph:F(Ul).replace("hr",Ir).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qc).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",bi).getRegex()},w1={...Gl,html:F(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Jl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Dt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:F(Ul).replace("hr",Ir).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",Kf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},v1=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,E1=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gf=/^( {2,}|\\)\n(?!\s*$)/,C1=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\`+)[^`]+\k(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",u1?"(?`+)[^`]+\k(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Xf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,O1=F(Xf,"u").replace(/punct/g,Nn).getRegex(),R1=F(Xf,"u").replace(/punct/g,Yf).getRegex(),Qf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",D1=F(Qf,"gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,xi).replace(/punct/g,Nn).getRegex(),I1=F(Qf,"gu").replace(/notPunctSpace/g,A1).replace(/punctSpace/g,M1).replace(/punct/g,Yf).getRegex(),L1=F("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,xi).replace(/punct/g,Nn).getRegex(),P1=F(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Nn).getRegex(),z1="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",B1=F(z1,"gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,xi).replace(/punct/g,Nn).getRegex(),$1=F(/\\(punct)/,"gu").replace(/punct/g,Nn).getRegex(),F1=F(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),j1=F(Jl).replace("(?:-->|$)","-->").getRegex(),H1=F("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",j1).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ni=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,_1=F(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ni).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zf=F(/^!?\[(label)\]\[(ref)\]/).replace("label",ni).replace("ref",Kl).getRegex(),ep=F(/^!?\[(ref)\](?:\[\])?/).replace("ref",Kl).getRegex(),V1=F("reflink|nolink(?!\\()","g").replace("reflink",Zf).replace("nolink",ep).getRegex(),Zc=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Xl={_backpedal:Dt,anyPunctuation:$1,autolink:F1,blockSkip:N1,br:Gf,code:E1,del:Dt,delLDelim:Dt,delRDelim:Dt,emStrongLDelim:O1,emStrongRDelimAst:D1,emStrongRDelimUnd:L1,escape:v1,link:_1,nolink:ep,punctuation:T1,reflink:Zf,reflinkSearch:V1,tag:H1,text:C1,url:Dt},W1={...Xl,link:F(/^!?\[(label)\]\((.*?)\)/).replace("label",ni).getRegex(),reflink:F(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ni).getRegex()},qo={...Xl,emStrongRDelimAst:I1,emStrongLDelim:R1,delLDelim:P1,delRDelim:B1,url:F(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Zc).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:F(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},eu=n=>U1[n];function qe(n,e){if(e){if(fe.escapeTest.test(n))return n.replace(fe.escapeReplace,eu)}else if(fe.escapeTestNoEncode.test(n))return n.replace(fe.escapeReplaceNoEncode,eu);return n}function tu(n){try{n=encodeURI(n).replace(fe.percentDecode,"%")}catch{return null}return n}function nu(n,e){var i;let t=n.replace(fe.findPipe,(o,l,a)=>{let c=!1,u=l;for(;--u>=0&&a[u]==="\\";)c=!c;return c?"|":" |"}),r=t.split(fe.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length=0&&fe.blankLine.test(e[t]);)t--;return e.length-t<=2?n:e.slice(0,t+1).join(` -`)}function $1(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r0?-2:-1}function F1(n,e=0){let t=e,r="";for(let s of n)if(s===" "){let i=4-t%4;r+=" ".repeat(i),t+=i}else r+=s,t++;return r}function eu(n,e,t,r,s){let i=e.href,o=e.title||null,l=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function H1(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(` +`)}function K1(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r0?-2:-1}function J1(n,e=0){let t=e,r="";for(let s of n)if(s===" "){let i=4-t%4;r+=" ".repeat(i),t+=i}else r+=s,t++;return r}function su(n,e,t,r,s){let i=e.href,o=e.title||null,l=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,a}function G1(n,e,t){let r=n.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(` `).map(i=>{let o=i.match(t.other.beginningSpace);if(o===null)return i;let[l]=o;return l.length>=s.length?i.slice(s.length):i}).join(` -`)}var Qs=class{constructor(n){V(this,"options");V(this,"rules");V(this,"lexer");this.options=n||Yt}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:Zc(e[0]),r=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:r}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=H1(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=at(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:at(e[0],` -`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:at(e[0],` -`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=at(e[0],` +`)}var ri=class{constructor(n){_(this,"options");_(this,"rules");_(this,"lexer");this.options=n||en}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=this.options.pedantic?e[0]:ru(e[0]),r=t.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t,codeBlockStyle:"indented",text:r}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],r=G1(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=ht(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:ht(e[0],` +`),depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:ht(e[0],` +`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=ht(e[0],` `).split(` `),r="",s="",i=[];for(;t.length>0;){let o=!1,l=[],a;for(a=0;a1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let i=this.rules.other.listItemRegex(t),o=!1;for(;n;){let a=!1,c="",u="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let d=F1(e[2].split(` +`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let i=this.rules.other.listItemRegex(t),o=!1;for(;n;){let a=!1,c="",u="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let d=J1(e[2].split(` `,1)[0],e[1].length),h=n.split(` `,1)[0],f=!d.trim(),p=0;if(this.options.pedantic?(p=2,u=d.trimStart()):f?p=e[1].length+1:(p=d.search(this.rules.other.nonSpaceChar),p=p>4?1:p,u=d.slice(p),p+=e[1].length),f&&this.rules.other.blankLine.test(h)&&(c+=h+` -`,n=n.substring(h.length+1),a=!0),!a){let m=this.rules.other.nextBulletRegex(p),g=this.rules.other.hrRegex(p),y=this.rules.other.fencesBeginRegex(p),x=this.rules.other.headingBeginRegex(p),C=this.rules.other.htmlBeginRegex(p),v=this.rules.other.blockquoteBeginRegex(p);for(;n;){let k=n.split(` -`,1)[0],M;if(h=k,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),M=h):M=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||x.test(h)||C.test(h)||v.test(h)||m.test(h)||g.test(h))break;if(M.search(this.rules.other.nonSpaceChar)>=p||!h.trim())u+=` -`+M.slice(p);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||x.test(d)||g.test(d))break;u+=` -`+h}f=!h.trim(),c+=k+` -`,n=n.substring(k.length+1),d=M.slice(p)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),s.raw+=c}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]);let c=a.tokens[0];if(a.task&&((c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="paragraph")){a.text=a.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let u=this.rules.other.listTaskCheckbox.exec(a.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};a.checked=d.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=d.raw+a.tokens[0].raw,a.tokens[0].text=d.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(d)):a.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):a.tokens.unshift(d)}}else a.task&&(a.task=!1);if(!s.loose){let u=a.tokens.filter(h=>h.type==="space"),d=u.length>0&&u.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=d}}if(s.loose)for(let a of s.items){a.loose=!0;for(let c of a.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(n){let e=this.rules.block.html.exec(n);if(e){let t=Zc(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:at(e[0],` -`),href:r,title:s}}}table(n){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Qc(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` -`):[],i={type:"table",raw:at(e[0],` -`),header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:at(e[0],` +`,n=n.substring(h.length+1),a=!0),!a){let m=this.rules.other.nextBulletRegex(p),g=this.rules.other.hrRegex(p),y=this.rules.other.fencesBeginRegex(p),x=this.rules.other.headingBeginRegex(p),C=this.rules.other.htmlBeginRegex(p),v=this.rules.other.blockquoteBeginRegex(p);for(;n;){let b=n.split(` +`,1)[0],A;if(h=b,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),y.test(h)||x.test(h)||C.test(h)||v.test(h)||m.test(h)||g.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=p||!h.trim())u+=` +`+A.slice(p);else{if(f||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||y.test(d)||x.test(d)||g.test(d))break;u+=` +`+h}f=!h.trim(),c+=b+` +`,n=n.substring(b.length+1),d=A.slice(p)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(o=!0)),s.items.push({type:"list_item",raw:c,task:!!this.options.gfm&&this.rules.other.listIsTask.test(u),loose:!1,text:u,tokens:[]}),s.raw+=c}let l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let a of s.items){this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]);let c=a.tokens[0];if(a.task&&((c==null?void 0:c.type)==="text"||(c==null?void 0:c.type)==="paragraph")){a.text=a.text.replace(this.rules.other.listReplaceTask,""),c.raw=c.raw.replace(this.rules.other.listReplaceTask,""),c.text=c.text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}let u=this.rules.other.listTaskCheckbox.exec(a.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};a.checked=d.checked,s.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=d.raw+a.tokens[0].raw,a.tokens[0].text=d.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(d)):a.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):a.tokens.unshift(d)}}else a.task&&(a.task=!1);if(!s.loose){let u=a.tokens.filter(h=>h.type==="space"),d=u.length>0&&u.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=d}}if(s.loose)for(let a of s.items){a.loose=!0;for(let c of a.tokens)c.type==="text"&&(c.type="paragraph")}return s}}html(n){let e=this.rules.block.html.exec(n);if(e){let t=ru(e[0]);return{type:"html",block:!0,raw:t,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:t}}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:ht(e[0],` +`),href:r,title:s}}}table(n){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=nu(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(` +`):[],i={type:"table",raw:ht(e[0],` +`),header:[],align:[],rows:[]};if(t.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:ht(e[0],` `),depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===` -`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=at(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=$1(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),eu(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return eu(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,o,l=s,a=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+s);(r=c.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let u=[...r[0]][0].length,d=n.slice(0,s+r.index+u+o);if(Math.min(s,o)%2){let f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let c=[...r[0]][0].length,u=n.slice(0,s+r.index+c+o),d=u.slice(s,-s);return{type:"del",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},ze=class jo{constructor(e){V(this,"tokens");V(this,"options");V(this,"state");V(this,"inlineQueue");V(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Yt,this.options.tokenizer=this.options.tokenizer||new Qs,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:fe,block:Ur.normal,inline:On.normal};this.options.pedantic?(t.block=Ur.pedantic,t.inline=On.pedantic):this.options.gfm&&(t.block=Ur.gfm,this.options.breaks?t.inline=On.breaks:t.inline=On.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ur,inline:On}}static lex(e,t){return new jo(t).lex(e)}static lexInline(e,t){return new jo(t).inlineTokens(e)}lex(e){e=e.replace(fe.carriageReturn,` +`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=ht(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=K1(e[2],"()");if(i===-2)return;if(i>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),su(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return su(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,o,l=s,a=0,c=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+s);(r=c.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){a+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+a);let u=[...r[0]][0].length,d=n.slice(0,s+r.index+u+o);if(Math.min(s,o)%2){let f=d.slice(1,-1);return{type:"em",raw:d,text:f,tokens:this.lexer.inlineTokens(f)}}let h=d.slice(2,-2);return{type:"strong",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,i,o,l=s,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+s);(r=a.exec(e))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(o=[...i].length,o!==s))continue;if(r[3]||r[4]){l+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l);let c=[...r[0]][0].length,u=n.slice(0,s+r.index+c+o),d=u.slice(s,-s);return{type:"del",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},Fe=class Uo{constructor(e){_(this,"tokens");_(this,"options");_(this,"state");_(this,"inlineQueue");_(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||en,this.options.tokenizer=this.options.tokenizer||new ri,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:fe,block:Yr.normal,inline:Ln.normal};this.options.pedantic?(t.block=Yr.pedantic,t.inline=Ln.pedantic):this.options.gfm&&(t.block=Yr.gfm,this.options.breaks?t.inline=Ln.breaks:t.inline=Ln.gfm),this.tokenizer.rules=t}static get rules(){return{block:Yr,inline:Ln}}static lex(e,t){return new Uo(t).lex(e)}static lexInline(e,t){return new Uo(t).inlineTokens(e)}lex(e){e=e.replace(fe.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let t=0;t(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let u=t.at(-1);a.raw.length===1&&u!==void 0?u.raw+=` `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` @@ -266,9 +266,9 @@ ${u}`:u;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a),r=c.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(` `)?"":` `)+a.raw,u.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,d,h,f;this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)p.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let o=!1,l="",a=1/0;for(;e;){if(e.length(p=g.call({lexer:this},e,t))?(e=e.substring(p.raw.length),t.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let g=t.at(-1);p.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=p.raw,g.text+=p.text):t.push(p);continue}if(p=this.tokenizer.emStrong(e,r,l)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.del(e,r,l)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),t.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),t.push(p);continue}let m=e;if((f=this.options.extensions)!=null&&f.startInline){let g=1/0,y=e.slice(1),x;this.options.extensions.startInline.forEach(C=>{x=C.call({lexer:this},y),typeof x=="number"&&x>=0&&(g=Math.min(g,x))}),g<1/0&&g>=0&&(m=e.substring(0,g+1))}if(p=this.tokenizer.inlineText(m)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(l=p.raw.slice(-1)),o=!0;let g=t.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=p.raw,g.text+=p.text):t.push(p);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},Zs=class{constructor(n){V(this,"options");V(this,"parser");this.options=n||Yt}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let r=(i=(e||"").match(fe.notSpaceStart))==null?void 0:i[0],s=n.replace(fe.endingNewline,"")+` -`;return r?'
'+(t?s:_e(s,!0))+`
-`:"
"+(t?s:_e(s,!0))+`
+`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var c,u,d,h,f;this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let p=Object.keys(this.tokens.links);if(p.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)p.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)i=s[2]?s[2].length:0,r=r.slice(0,s.index+i)+"["+"a".repeat(s[0].length-i-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let o=!1,l="",a=1/0;for(;e;){if(e.length(p=g.call({lexer:this},e,t))?(e=e.substring(p.raw.length),t.push(p),!0):!1))continue;if(p=this.tokenizer.escape(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.tag(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.link(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(p.raw.length);let g=t.at(-1);p.type==="text"&&(g==null?void 0:g.type)==="text"?(g.raw+=p.raw,g.text+=p.text):t.push(p);continue}if(p=this.tokenizer.emStrong(e,r,l)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.codespan(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.br(e)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.del(e,r,l)){e=e.substring(p.raw.length),t.push(p);continue}if(p=this.tokenizer.autolink(e)){e=e.substring(p.raw.length),t.push(p);continue}if(!this.state.inLink&&(p=this.tokenizer.url(e))){e=e.substring(p.raw.length),t.push(p);continue}let m=e;if((f=this.options.extensions)!=null&&f.startInline){let g=1/0,y=e.slice(1),x;this.options.extensions.startInline.forEach(C=>{x=C.call({lexer:this},y),typeof x=="number"&&x>=0&&(g=Math.min(g,x))}),g<1/0&&g>=0&&(m=e.substring(0,g+1))}if(p=this.tokenizer.inlineText(m)){e=e.substring(p.raw.length),p.raw.slice(-1)!=="_"&&(l=p.raw.slice(-1)),o=!0;let g=t.at(-1);(g==null?void 0:g.type)==="text"?(g.raw+=p.raw,g.text+=p.text):t.push(p);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t="Infinite loop on byte: "+e;if(this.options.silent)console.error(t);else throw new Error(t)}},si=class{constructor(n){_(this,"options");_(this,"parser");this.options=n||en}space(n){return""}code({text:n,lang:e,escaped:t}){var i;let r=(i=(e||"").match(fe.notSpaceStart))==null?void 0:i[0],s=n.replace(fe.endingNewline,"")+` +`;return r?'
'+(t?s:qe(s,!0))+`
+`:"
"+(t?s:qe(s,!0))+`
`}blockquote({tokens:n}){return`
${this.parser.parse(n)}
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`${this.parser.parseInline(n)} @@ -284,61 +284,61 @@ ${this.parser.parse(n)} `}tablerow({text:n}){return` ${n} `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+` -`}strong({tokens:n}){return`${this.parser.parseInline(n)}`}em({tokens:n}){return`${this.parser.parseInline(n)}`}codespan({text:n}){return`${_e(n,!0)}`}br(n){return"
"}del({tokens:n}){return`${this.parser.parseInline(n)}`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),s=Xc(n);if(s===null)return r;n=s;let i='
",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=Xc(n);if(s===null)return _e(t);n=s;let i=`${_e(t)}{let a=o[l].flat(1/0);t=t.concat(this.walkTokens(a,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new Zs(this.defaults);for(let i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=t.renderer[o],a=s[o];s[o]=(...c)=>{let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new Qs(this.defaults);for(let i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=t.tokenizer[o],a=s[o];s[o]=(...c)=>{let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new Gn;for(let i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=t.hooks[o],a=s[o];Gn.passThroughHooks.has(i)?s[o]=c=>{if(this.defaults.async&&Gn.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await l.call(s,c);return a.call(s,d)})();let u=l.call(s,c);return a.call(s,u)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(s,c);return d===!1&&(d=await a.apply(s,c)),d})();let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return ze.lex(n,e??this.defaults)}parser(n,e){return Be.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=n),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(n):n?ze.lex:ze.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(n):n?Be.parse:Be.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(n):n?ze.lex:ze.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(n):n?Be.parse:Be.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(n,e){return t=>{if(t.message+=` -Please report this to https://github.com/markedjs/marked.`,n){let r="

An error occurred:

"+_e(t.message+"",!0)+"
";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},Ut=new _1;function _(n,e){return Ut.parse(n,e)}_.options=_.setOptions=function(n){return Ut.setOptions(n),_.defaults=Ut.defaults,_f(_.defaults),_};_.getDefaults=Hl;_.defaults=Yt;_.use=function(...n){return Ut.use(...n),_.defaults=Ut.defaults,_f(_.defaults),_};_.walkTokens=function(n,e){return Ut.walkTokens(n,e)};_.parseInline=Ut.parseInline;_.Parser=Be;_.parser=Be.parse;_.Renderer=Zs;_.TextRenderer=Jl;_.Lexer=ze;_.lexer=ze.lex;_.Tokenizer=Qs;_.Hooks=Gn;_.parse=_;_.options;_.setOptions;_.use;_.walkTokens;_.parseInline;Be.parse;ze.lex;const j1=/([\s\S]*?)<\/members-only>/gi,Xf={headingStyle:"atx",codeBlockStyle:"fenced",emDelimiter:"*",bulletListMarker:"-"};function Qf(n){return n.replace(/^\n+/,"").replace(/\n+$/,"")}function tu(n){return n.replace(/\u00A0/g," ")}function Zf(n){if(!//i.test(n))return n;const e=new DOMParser().parseFromString(`
${n}
`,"text/html"),t=e.querySelector("[data-wrap]");return t?([...t.querySelectorAll("p")].forEach(r=>{const s=r.innerHTML;if(!//i.test(s))return;const i=s.split(//i),o=e.createDocumentFragment();i.forEach((l,a)=>{if(l===""&&a===i.length-1)return;const c=e.createElement("p");c.innerHTML=l,o.appendChild(c)}),r.replaceWith(o)}),t.innerHTML):n}function ep(n){n.addRule("image",{filter:"img",replacement:(e,t)=>{const r=t,s=r.getAttribute("alt")??"",i=r.getAttribute("src")??"";return i?`![${s}](${i})`:""}}),n.addRule("underline",{filter:["u"],replacement:e=>`${e}`}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:e=>`~~${e}~~`}),n.addRule("horizontalRule",{filter:"hr",replacement:()=>` +`}strong({tokens:n}){return`${this.parser.parseInline(n)}`}em({tokens:n}){return`${this.parser.parseInline(n)}`}codespan({text:n}){return`${qe(n,!0)}`}br(n){return"
"}del({tokens:n}){return`${this.parser.parseInline(n)}`}link({href:n,title:e,tokens:t}){let r=this.parser.parseInline(t),s=tu(n);if(s===null)return r;n=s;let i='
",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=tu(n);if(s===null)return qe(t);n=s;let i=`${qe(t)}{let a=o[l].flat(1/0);t=t.concat(this.walkTokens(a,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new si(this.defaults);for(let i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let o=i,l=t.renderer[o],a=s[o];s[o]=(...c)=>{let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new ri(this.defaults);for(let i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let o=i,l=t.tokenizer[o],a=s[o];s[o]=(...c)=>{let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new Zn;for(let i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let o=i,l=t.hooks[o],a=s[o];Zn.passThroughHooks.has(i)?s[o]=c=>{if(this.defaults.async&&Zn.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await l.call(s,c);return a.call(s,d)})();let u=l.call(s,c);return a.call(s,u)}:s[o]=(...c)=>{if(this.defaults.async)return(async()=>{let d=await l.apply(s,c);return d===!1&&(d=await a.apply(s,c)),d})();let u=l.apply(s,c);return u===!1&&(u=a.apply(s,c)),u}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Fe.lex(n,e??this.defaults)}parser(n,e){return je.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let r={...t},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=n),s.async)return(async()=>{let o=s.hooks?await s.hooks.preprocess(e):e,l=await(s.hooks?await s.hooks.provideLexer(n):n?Fe.lex:Fe.lexInline)(o,s),a=s.hooks?await s.hooks.processAllTokens(l):l;s.walkTokens&&await Promise.all(this.walkTokens(a,s.walkTokens));let c=await(s.hooks?await s.hooks.provideParser(n):n?je.parse:je.parseInline)(a,s);return s.hooks?await s.hooks.postprocess(c):c})().catch(i);try{s.hooks&&(e=s.hooks.preprocess(e));let o=(s.hooks?s.hooks.provideLexer(n):n?Fe.lex:Fe.lexInline)(e,s);s.hooks&&(o=s.hooks.processAllTokens(o)),s.walkTokens&&this.walkTokens(o,s.walkTokens);let l=(s.hooks?s.hooks.provideParser(n):n?je.parse:je.parseInline)(o,s);return s.hooks&&(l=s.hooks.postprocess(l)),l}catch(o){return i(o)}}}onError(n,e){return t=>{if(t.message+=` +Please report this to https://github.com/markedjs/marked.`,n){let r="

An error occurred:

"+qe(t.message+"",!0)+"
";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},Yt=new Y1;function j(n,e){return Yt.parse(n,e)}j.options=j.setOptions=function(n){return Yt.setOptions(n),j.defaults=Yt.defaults,qf(j.defaults),j};j.getDefaults=Wl;j.defaults=en;j.use=function(...n){return Yt.use(...n),j.defaults=Yt.defaults,qf(j.defaults),j};j.walkTokens=function(n,e){return Yt.walkTokens(n,e)};j.parseInline=Yt.parseInline;j.Parser=je;j.parser=je.parse;j.Renderer=si;j.TextRenderer=Ql;j.Lexer=Fe;j.lexer=Fe.lex;j.Tokenizer=ri;j.Hooks=Zn;j.parse=j;j.options;j.setOptions;j.use;j.walkTokens;j.parseInline;je.parse;Fe.lex;const X1=/([\s\S]*?)<\/members-only>/gi,tp={headingStyle:"atx",codeBlockStyle:"fenced",emDelimiter:"*",bulletListMarker:"-"};function np(n){return n.replace(/^\n+/,"").replace(/\n+$/,"")}function iu(n){return n.replace(/\u00A0/g," ")}function rp(n){if(!//i.test(n))return n;const e=new DOMParser().parseFromString(`
${n}
`,"text/html"),t=e.querySelector("[data-wrap]");return t?([...t.querySelectorAll("p")].forEach(r=>{const s=r.innerHTML;if(!//i.test(s))return;const i=s.split(//i),o=e.createDocumentFragment();i.forEach((l,a)=>{if(l===""&&a===i.length-1)return;const c=e.createElement("p");c.innerHTML=l,o.appendChild(c)}),r.replaceWith(o)}),t.innerHTML):n}function sp(n){n.addRule("image",{filter:"img",replacement:(e,t)=>{const r=t,s=r.getAttribute("alt")??"",i=r.getAttribute("src")??"";return i?`![${s}](${i})`:""}}),n.addRule("underline",{filter:["u"],replacement:e=>`${e}`}),n.addRule("strikethrough",{filter:["del","s","strike"],replacement:e=>`~~${e}~~`}),n.addRule("horizontalRule",{filter:"hr",replacement:()=>` --- -`}),n.addRule("anchor",{filter:e=>e.nodeName!=="A"?!1:!!e.getAttribute("href"),replacement:(e,t)=>{const r=t,s=r.getAttribute("href")??"",i=r.getAttribute("title");return i?`[${e}](${s} "${i}")`:`[${e}](${s})`}})}const tp=new vr(Xf);ep(tp);const Gl=new vr(Xf);ep(Gl);Gl.addRule("membersOnly",{filter:"members-only",replacement:(n,e)=>{const t=e,r=[];return t.childNodes.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){const o=(i.textContent??"").trim();o&&r.push(tu(o));return}i instanceof HTMLElement&&r.push(tu(tp.turndown(i.outerHTML).trim()))}),` +`}),n.addRule("anchor",{filter:e=>e.nodeName!=="A"?!1:!!e.getAttribute("href"),replacement:(e,t)=>{const r=t,s=r.getAttribute("href")??"",i=r.getAttribute("title");return i?`[${e}](${s} "${i}")`:`[${e}](${s})`}})}const ip=new Mr(tp);sp(ip);const Zl=new Mr(tp);sp(Zl);Zl.addRule("membersOnly",{filter:"members-only",replacement:(n,e)=>{const t=e,r=[];return t.childNodes.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){const o=(i.textContent??"").trim();o&&r.push(iu(o));return}i instanceof HTMLElement&&r.push(iu(ip.turndown(i.outerHTML).trim()))}),` -${Qf(r.join(` +${np(r.join(` `))} -`}});_.setOptions({gfm:!0,breaks:!0});_.use({tokenizer:{code(){}}});function np(n){return au.sanitize(n,lu)}function V1(n){return n.split(/(```[\s\S]*?```)/g).map((e,t)=>t%2===1?e:e.replace(/^( +)(?=\S)/gm,(r,s)=>" ".repeat(s.length))).join("")}function Qi(n){return n.trim()?_.parse(V1(n),{async:!1}):""}function W1(n){const e=new DOMParser().parseFromString(np(n),"text/html");return e.querySelectorAll(".post-members-only__badge, .post-members-only__exit-btn, .post-members-only__unwrap-btn").forEach(t=>{t.remove()}),e.querySelectorAll("members-only").forEach(t=>{const r=t.querySelector(".post-members-only__body"),s=r?r.innerHTML:t.innerHTML;t.innerHTML=Zf(s)}),e.body.innerHTML}function q1(n){return n.replace(/<\/members-only>(?=[^\s\n])/g,`
+`}});j.setOptions({gfm:!0,breaks:!0});j.use({tokenizer:{code(){}}});function op(n){return hu.sanitize(n,du)}function Q1(n){return n.split(/(```[\s\S]*?```)/g).map((e,t)=>t%2===1?e:e.replace(/^( +)(?=\S)/gm,(r,s)=>" ".repeat(s.length))).join("")}function no(n){return n.trim()?j.parse(Q1(n),{async:!1}):""}function Z1(n){const e=new DOMParser().parseFromString(op(n),"text/html");return e.querySelectorAll(".post-members-only__badge, .post-members-only__exit-btn, .post-members-only__unwrap-btn").forEach(t=>{t.remove()}),e.querySelectorAll("members-only").forEach(t=>{const r=t.querySelector(".post-members-only__body"),s=r?r.innerHTML:t.innerHTML;t.innerHTML=rp(s)}),e.body.innerHTML}function ev(n){return n.replace(/<\/members-only>(?=[^\s\n])/g,` `).replace(/\s*<\/members-only>/g,` -`)}function U1(n){return n.replace(/^(\s*[-+*])\s+(?=\S)/gm,"$1 ").replace(/^(\s*\d+\.)\s+(?=\S)/gm,"$1 ")}function K1(n){if(!n.trim())return"";const e=W1(n),t=Gl.turndown(e).replace(/\n{3,}/g,` +`)}function tv(n){return n.replace(/^(\s*[-+*])\s+(?=\S)/gm,"$1 ").replace(/^(\s*\d+\.)\s+(?=\S)/gm,"$1 ")}function nv(n){if(!n.trim())return"";const e=Z1(n),t=Zl.turndown(e).replace(/\n{3,}/g,` -`).trim();return U1(t)}function Kr(n){if(!n.trim())return"";const e=q1(n),t=new RegExp(j1.source,"gi");let r="",s=0,i=t.exec(e);for(;i;){const l=e.slice(s,i.index);l.trim()&&(r+=Qi(l));const a=Qf(i[1]),c=a.trim()?Zf(Qi(a)):"";r+=`${c}`,s=t.lastIndex,i=t.exec(e)}const o=e.slice(s);return o.trim()&&(r+=Qi(o)),np(r)}const un=" ";function J1(n,e,t){const r=n.lastIndexOf(` +`).trim();return tv(t)}function Xr(n){if(!n.trim())return"";const e=ev(n),t=new RegExp(X1.source,"gi");let r="",s=0,i=t.exec(e);for(;i;){const l=e.slice(s,i.index);l.trim()&&(r+=no(l));const a=np(i[1]),c=a.trim()?rp(no(a)):"";r+=`${c}`,s=t.lastIndex,i=t.exec(e)}const o=e.slice(s);return o.trim()&&(r+=no(o)),op(r)}const pn=" ";function rv(n,e,t){const r=n.lastIndexOf(` `,e-1)+1,s=n.indexOf(` -`,t),i=s===-1?n.length:s;return{lineStart:r,lineEnd:i}}function G1(n,e,t){const s=n.slice(e,t).split(` -`).map(i=>un+i).join(` -`);return n.slice(0,e)+s+n.slice(t)}function Y1(n,e,t,r,s){const o=n.slice(e,t).split(` +`,t),i=s===-1?n.length:s;return{lineStart:r,lineEnd:i}}function sv(n,e,t){const s=n.slice(e,t).split(` +`).map(i=>pn+i).join(` +`);return n.slice(0,e)+s+n.slice(t)}function iv(n,e,t,r,s){const o=n.slice(e,t).split(` `);let l=e,a=r,c=s;const u=o.map(d=>{const h=d.match(/^ {1,4}/),f=h?h[0].length:0;return f>0&&(r>l&&(a-=Math.min(f,r-l)),s>l&&(c-=Math.min(f,s-l))),l+=d.length+1,d.replace(/^ {1,4}/,"")}).join(` -`);return{next:n.slice(0,e)+u+n.slice(t),newStart:Math.max(e,a),newEnd:Math.max(e,c)}}function Fe(n,e,t,r=t,s){s(e),requestAnimationFrame(()=>{n.selectionStart=t,n.selectionEnd=r,n.focus()})}function nu(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,o=e.slice(0,s)+t+e.slice(i),l=s+t.length;Fe(n,o,l,l,r)}function X1(n,e){if(n.key!=="Tab")return;n.preventDefault();const t=n.currentTarget,{selectionStart:r,selectionEnd:s,value:i}=t,{lineStart:o,lineEnd:l}=J1(i,r,s),a=r!==s,c=i.slice(o,l),u=a&&c.split(` -`).length>1;if(n.shiftKey){if(u){const{next:m,newStart:g,newEnd:y}=Y1(i,o,l,r,s);Fe(t,m,g,y,e);return}const f=i.slice(o,r).match(/ {1,4}$/);if(f){const m=f[0].length,g=i.slice(0,r-m)+i.slice(r);Fe(t,g,r-m,s-m,e);return}const p=i.slice(o,r).match(/^ {1,4}/);if(p){const m=p[0].length,g=i.slice(0,o)+i.slice(o+m);Fe(t,g,r-m,s-m,e)}return}if(u){const h=G1(i,o,l),f=i.slice(o,l).split(` -`).length;Fe(t,h,r+un.length,s+un.length*f,e);return}const d=i.slice(0,r)+un+i.slice(s);Fe(t,d,r+un.length,r+un.length,e)}function Rn(n,e,t,r,s,i){const{selectionStart:o,selectionEnd:l}=n,c=e.slice(o,l)||s,u=t+c+r,d=e.slice(0,o)+u+e.slice(l),h=o+t.length,f=h+c.length;Fe(n,d,h,f,i)}function Zi(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,o=e.lastIndexOf(` +`);return{next:n.slice(0,e)+u+n.slice(t),newStart:Math.max(e,a),newEnd:Math.max(e,c)}}function _e(n,e,t,r=t,s){s(e),requestAnimationFrame(()=>{n.selectionStart=t,n.selectionEnd=r,n.focus()})}function ou(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,o=e.slice(0,s)+t+e.slice(i),l=s+t.length;_e(n,o,l,l,r)}function ov(n,e){if(n.key!=="Tab")return;n.preventDefault();const t=n.currentTarget,{selectionStart:r,selectionEnd:s,value:i}=t,{lineStart:o,lineEnd:l}=rv(i,r,s),a=r!==s,c=i.slice(o,l),u=a&&c.split(` +`).length>1;if(n.shiftKey){if(u){const{next:m,newStart:g,newEnd:y}=iv(i,o,l,r,s);_e(t,m,g,y,e);return}const f=i.slice(o,r).match(/ {1,4}$/);if(f){const m=f[0].length,g=i.slice(0,r-m)+i.slice(r);_e(t,g,r-m,s-m,e);return}const p=i.slice(o,r).match(/^ {1,4}/);if(p){const m=p[0].length,g=i.slice(0,o)+i.slice(o+m);_e(t,g,r-m,s-m,e)}return}if(u){const h=sv(i,o,l),f=i.slice(o,l).split(` +`).length;_e(t,h,r+pn.length,s+pn.length*f,e);return}const d=i.slice(0,r)+pn+i.slice(s);_e(t,d,r+pn.length,r+pn.length,e)}function Pn(n,e,t,r,s,i){const{selectionStart:o,selectionEnd:l}=n,c=e.slice(o,l)||s,u=t+c+r,d=e.slice(0,o)+u+e.slice(l),h=o+t.length,f=h+c.length;_e(n,d,h,f,i)}function ro(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,o=e.lastIndexOf(` `,s-1)+1,l=e.indexOf(` `,i),a=l===-1?e.length:l,u=e.slice(o,a).split(` `).map(h=>`${t}${h}`),d=e.slice(0,o)+u.join(` -`)+e.slice(a);Fe(n,d,s+t.length,i+t.length*u.length,r)}function Q1(n,e,t){const{selectionStart:r}=n,s=e.lastIndexOf(` +`)+e.slice(a);_e(n,d,s+t.length,i+t.length*u.length,r)}function lv(n,e,t){const{selectionStart:r}=n,s=e.lastIndexOf(` `,r-1)+1,i=e.indexOf(` -`,r),o=i===-1?e.length:i,l=e.slice(s,o),a=l.match(/^(#{2,6})\s+(.*)$/);let c;if(!a)c=`## ${l}`;else{const h=a[1].length,f=a[2];c=h>=6?f:`${"#".repeat(h+1)} ${f}`}const u=e.slice(0,s)+c+e.slice(o),d=c.length-l.length;Fe(n,u,r+Math.max(0,d),r+Math.max(0,d),t)}function Z1(n,e,t){const{selectionStart:r,selectionEnd:s}=n,o=e.slice(0,r)+` +`,r),o=i===-1?e.length:i,l=e.slice(s,o),a=l.match(/^(#{2,6})\s+(.*)$/);let c;if(!a)c=`## ${l}`;else{const h=a[1].length,f=a[2];c=h>=6?f:`${"#".repeat(h+1)} ${f}`}const u=e.slice(0,s)+c+e.slice(o),d=c.length-l.length;_e(n,u,r+Math.max(0,d),r+Math.max(0,d),t)}function av(n,e,t){const{selectionStart:r,selectionEnd:s}=n,o=e.slice(0,r)+` -`+e.slice(s),l=r+18;Fe(n,o,l,l,t)}function ev(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,l=`[${e.slice(s,i)||"链接文字"}](${t})`,a=e.slice(0,s)+l+e.slice(i);Fe(n,a,s+l.length,s+l.length,r)}function ru(n){var s,i;const e=n.trim();if(!e)return 0;const t=((s=e.match(/[\u4e00-\u9fff]/g))==null?void 0:s.length)??0,r=((i=e.match(/[a-zA-Z0-9]+/g))==null?void 0:i.length)??0;return t+r}function eo(n){for(let e=n.depth;e>0;e-=1)if(n.node(e).type.name==="membersOnly")return e;return-1}function tv({selected:n,editor:e}){const t=()=>{e.chain().focus().exitMembersOnly().run()},r=()=>{e.chain().focus().unwrapMembersOnly().run()};return b.jsxs(ax,{as:"members-only",className:`post-members-only post-members-only--visible editor-members-only${n?" editor-members-only--selected":""}`,children:[b.jsxs("div",{className:"post-members-only__badge",contentEditable:!1,children:[b.jsx("span",{className:"post-members-only__badge-icon","aria-hidden":"true",children:b.jsx(to,{size:12})}),b.jsx("span",{children:"登录可见"}),b.jsxs("button",{type:"button",className:"post-members-only__exit-btn",title:"Ctrl+Enter 退出到公开区域",onMouseDown:s=>s.preventDefault(),onClick:t,children:[b.jsx(bp,{size:11}),"退出"]}),b.jsx("span",{className:"post-members-only__shortcut-hint",children:"Ctrl+Enter 退出"}),b.jsx("button",{type:"button",className:"post-members-only__unwrap-btn",title:"取消登录可见包裹,保留正文",onMouseDown:s=>s.preventDefault(),onClick:r,children:"取消包裹"})]}),b.jsx(lx,{className:"post-members-only__body"})]})}const nv=Ce.create({name:"membersOnly",group:"block",content:"block+",defining:!0,isolating:!0,parseHTML(){return[{tag:"members-only"}]},renderHTML({HTMLAttributes:n}){return["members-only",J(n),0]},addNodeView(){return px(tv)},addKeyboardShortcuts(){return{Enter:({editor:n})=>{const{$from:e,empty:t}=n.state.selection;if(!t||eo(e)<0)return!1;const s=e.parent,i=e.parentOffset===s.content.size,o=s.textContent.trim().length===0;return!i||!o?!1:n.commands.exitMembersOnly()},"Mod-Enter":({editor:n})=>n.isActive("membersOnly")?n.commands.exitMembersOnly():!1}},addCommands(){return{insertMembersOnly:()=>({chain:n})=>n().insertContent({type:this.name,content:[{type:"paragraph"}]}).run(),wrapMembersOnly:()=>({tr:n,state:e,dispatch:t})=>{const{from:r,to:s,empty:i}=e.selection;if(i)return!1;const o=e.doc.slice(r,s);if(!o.content.size)return!1;const l=e.schema.nodes.membersOnly.create(null,o.content);return t&&n.replaceRangeWith(r,s,l),!0},exitMembersOnly:()=>({state:n,chain:e})=>{const{$from:t}=n.selection,r=eo(t);if(r<0)return!1;const s=t.before(r),i=t.node(r),o=s+i.nodeSize;return e().insertContentAt(o,{type:"paragraph"}).setTextSelection(o+1).run()},unwrapMembersOnly:()=>({tr:n,state:e,dispatch:t})=>{const{$from:r}=e.selection,s=eo(r);if(s<0)return!1;const i=r.before(s),o=r.node(s);return n.replaceWith(i,i+o.nodeSize,o.content),t&&t(n),!0}}}}),wt=" ";function rp(n){const{from:e,to:t}=n.state.selection,r=[];return n.state.doc.nodesBetween(e,t,(s,i)=>{if(s.isTextblock)return r.push({pos:i}),!1}),r}function rv(n){const{from:e,to:t,empty:r}=n.state.selection;if(r)return!1;const s=n.state.doc.textBetween(e,t,` +`+e.slice(s),l=r+18;_e(n,o,l,l,t)}function cv(n,e,t,r){const{selectionStart:s,selectionEnd:i}=n,l=`[${e.slice(s,i)||"链接文字"}](${t})`,a=e.slice(0,s)+l+e.slice(i);_e(n,a,s+l.length,s+l.length,r)}function lu(n){var s,i;const e=n.trim();if(!e)return 0;const t=((s=e.match(/[\u4e00-\u9fff]/g))==null?void 0:s.length)??0,r=((i=e.match(/[a-zA-Z0-9]+/g))==null?void 0:i.length)??0;return t+r}function so(n){for(let e=n.depth;e>0;e-=1)if(n.node(e).type.name==="membersOnly")return e;return-1}function uv({selected:n,editor:e}){const t=()=>{e.chain().focus().exitMembersOnly().run()},r=()=>{e.chain().focus().unwrapMembersOnly().run()};return k.jsxs(yx,{as:"members-only",className:`post-members-only post-members-only--visible editor-members-only${n?" editor-members-only--selected":""}`,children:[k.jsxs("div",{className:"post-members-only__badge",contentEditable:!1,children:[k.jsx("span",{className:"post-members-only__badge-icon","aria-hidden":"true",children:k.jsx(io,{size:12})}),k.jsx("span",{children:"登录可见"}),k.jsxs("button",{type:"button",className:"post-members-only__exit-btn",title:"Ctrl+Enter 退出到公开区域",onMouseDown:s=>s.preventDefault(),onClick:t,children:[k.jsx(xp,{size:11}),"退出"]}),k.jsx("span",{className:"post-members-only__shortcut-hint",children:"Ctrl+Enter 退出"}),k.jsx("button",{type:"button",className:"post-members-only__unwrap-btn",title:"取消登录可见包裹,保留正文",onMouseDown:s=>s.preventDefault(),onClick:r,children:"取消包裹"})]}),k.jsx(gx,{className:"post-members-only__body"})]})}const dv=Ce.create({name:"membersOnly",group:"block",content:"block+",defining:!0,isolating:!0,parseHTML(){return[{tag:"members-only"}]},renderHTML({HTMLAttributes:n}){return["members-only",J(n),0]},addNodeView(){return vx(uv)},addKeyboardShortcuts(){return{Enter:({editor:n})=>{const{$from:e,empty:t}=n.state.selection;if(!t||so(e)<0)return!1;const s=e.parent,i=e.parentOffset===s.content.size,o=s.textContent.trim().length===0;return!i||!o?!1:n.commands.exitMembersOnly()},"Mod-Enter":({editor:n})=>n.isActive("membersOnly")?n.commands.exitMembersOnly():!1}},addCommands(){return{insertMembersOnly:()=>({chain:n})=>n().insertContent({type:this.name,content:[{type:"paragraph"}]}).run(),wrapMembersOnly:()=>({tr:n,state:e,dispatch:t})=>{const{from:r,to:s,empty:i}=e.selection;if(i)return!1;const o=e.doc.slice(r,s);if(!o.content.size)return!1;const l=e.schema.nodes.membersOnly.create(null,o.content);return t&&n.replaceRangeWith(r,s,l),!0},exitMembersOnly:()=>({state:n,chain:e})=>{const{$from:t}=n.selection,r=so(t);if(r<0)return!1;const s=t.before(r),i=t.node(r),o=s+i.nodeSize;return e().insertContentAt(o,{type:"paragraph"}).setTextSelection(o+1).run()},unwrapMembersOnly:()=>({tr:n,state:e,dispatch:t})=>{const{$from:r}=e.selection,s=so(r);if(s<0)return!1;const i=r.before(s),o=r.node(s);return n.replaceWith(i,i+o.nodeSize,o.content),t&&t(n),!0}}}}),Tt=" ";function lp(n){const{from:e,to:t}=n.state.selection,r=[];return n.state.doc.nodesBetween(e,t,(s,i)=>{if(s.isTextblock)return r.push({pos:i}),!1}),r}function hv(n){const{from:e,to:t,empty:r}=n.state.selection;if(r)return!1;const s=n.state.doc.textBetween(e,t,` `,` `),i=[e];for(let a=0;a{o=o.insertText(wt,a+l),l+=wt.length}),n.view.dispatch(o),!0}function sv(n){const{from:e,to:t,empty:r}=n.state.selection;if(r)return!1;const s=n.state.doc,i=s.textBetween(e,t,` +`&&i.push(e+a+1);let o=n.state.tr,l=0;return i.forEach(a=>{o=o.insertText(Tt,a+l),l+=Tt.length}),n.view.dispatch(o),!0}function fv(n){const{from:e,to:t,empty:r}=n.state.selection;if(r)return!1;const s=n.state.doc,i=s.textBetween(e,t,` `,` `),o=[e];for(let u=0;u{const d=u+a,f=(s.textBetween(d,t+a).split(` -`)[0]??"").match(/^ {1,4}/);f&&(l=l.delete(d,d+f[0].length),a-=f[0].length,c=!0)}),c?(n.view.dispatch(l),!0):!1}function iv(n){const{empty:e}=n.state.selection;if(e)return!1;if(n.isActive("codeBlock"))return rv(n);if(n.isActive("listItem"))return n.chain().focus().sinkListItem("listItem").run();const t=rp(n);if(t.length===0)return!1;let r=n.state.tr,s=0;return t.forEach(({pos:i})=>{const o=i+1+s;r=r.insertText(wt,o),s+=wt.length}),n.view.dispatch(r),!0}function ov(n){const{empty:e}=n.state.selection;if(e)return!1;if(n.isActive("codeBlock"))return sv(n);if(n.isActive("listItem"))return n.chain().focus().liftListItem("listItem").run();const t=rp(n);if(t.length===0)return!1;let r=n.state.tr,s=0;return t.forEach(({pos:i})=>{const o=n.state.doc.nodeAt(i);if(!(o!=null&&o.isTextblock))return;const a=o.textContent.match(/^ {1,4}/);if(!a)return;const c=a[0].length,u=i+1+s;r=r.delete(u,u+c),s-=c}),r.steps.length===0?!1:(n.view.dispatch(r),!0)}function su(n){const{state:e}=n,{$from:t,empty:r}=e.selection;if(!r||!t.parent.isTextblock)return!1;const s=t.start(),i=e.doc.textBetween(s,t.pos);if(i.endsWith(wt))return n.chain().focus().deleteRange({from:t.pos-wt.length,to:t.pos}).run();const o=i.match(/^ {1,4}/);return o?n.chain().focus().deleteRange({from:s,to:s+o[0].length}).run():!1}const lv=Y.create({name:"tabIndent",addKeyboardShortcuts(){return{Tab:({editor:n})=>n.state.selection.empty?n.isActive("codeBlock")?n.chain().focus().insertContent(wt).run():n.isActive("listItem")?n.chain().focus().sinkListItem("listItem").run():n.chain().focus().insertContent(wt).run():iv(n),"Shift-Tab":({editor:n})=>n.state.selection.empty?n.isActive("codeBlock")?su(n):n.isActive("listItem")?n.chain().focus().liftListItem("listItem").run():su(n):ov(n)}}});function av({open:n,onOpenChange:e,initialUrl:t="",onConfirm:r,onRemove:s}){const[i,o]=N.useState(t);N.useEffect(()=>{n&&o(t||"https://")},[n,t]);const l=()=>{r(i.trim()),e(!1)};return b.jsx(Mp,{open:n,onOpenChange:e,children:b.jsxs(Ap,{className:"article-link-dialog",children:[b.jsxs(Np,{children:[b.jsx(Op,{children:"插入链接"}),b.jsx(Rp,{children:"输入完整 URL,留空并确认可移除已有链接。"})]}),b.jsx(Dp,{type:"url",value:i,placeholder:"https://",onChange:a=>o(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),l())},autoFocus:!0}),b.jsxs(Ip,{className:"article-link-dialog__footer",children:[s&&t?b.jsx(gi,{type:"button",variant:"outline",onClick:()=>{s(),e(!1)},children:"移除链接"}):null,b.jsx(gi,{type:"button",variant:"outline",onClick:()=>e(!1),children:"取消"}),b.jsx(gi,{type:"button",onClick:l,children:"确定"})]})]})})}function Wo({content:n,hint:e,side:t="bottom",align:r="center",children:s,className:i}){if(!N.isValidElement(s))return s;const o=e?`${n},${e}`:n,l=N.cloneElement(s,{"aria-label":o});return b.jsxs("span",{className:Yl("ui-tooltip",i),children:[l,b.jsxs("span",{role:"tooltip",className:Yl("ui-tooltip-bubble",`ui-tooltip-bubble--${t}`,`ui-tooltip-bubble--${r}`,e?"ui-tooltip-bubble--rich":"ui-tooltip-bubble--compact"),children:[b.jsx("span",{className:"ui-tooltip-bubble__title",children:n}),e?b.jsx("span",{className:"ui-tooltip-bubble__hint",children:e}):null]})]})}const cv="在此输入仅登录用户可见的内容…";function Ye(n){return au.sanitize(n,lu)}function iu(n){return n.state.doc.textContent.trim().length===0}function uv(n){for(let e=2;e<=6;e+=1)if(n.isActive("heading",{level:e})){e===6?n.chain().focus().setParagraph().run():n.chain().focus().toggleHeading({level:e+1}).run();return}n.chain().focus().toggleHeading({level:2}).run()}async function ou(){return new Promise(n=>{const e=document.createElement("input");e.type="file",e.accept="image/jpeg,image/png,image/gif,image/webp",e.onchange=async()=>{var r;const t=(r=e.files)==null?void 0:r[0];if(!t){n(null);return}try{const{url:s}=await en.uploadPostImage(t);n(s)}catch(s){He.error(s instanceof Error?s.message:"图片上传失败"),n(null)}},e.click()})}function dv(n){return n.map((e,t)=>b.jsxs("span",{className:e.className==="article-tool-btn--members"?"article-editor-tools-members":void 0,children:[e.className==="article-tool-btn--members"?b.jsx("span",{className:"article-editor-tools-sep","aria-hidden":"true"}):null,b.jsx(Wo,{content:e.title,hint:e.hint,align:e.align,side:"bottom",children:b.jsx("button",{type:"button",className:`article-tool-btn${e.active?" active":""}${e.className?` ${e.className}`:""}`,onMouseDown:r=>r.preventDefault(),onClick:e.action,children:e.icon})})]},t))}const hv=N.forwardRef(function({value:e,onChange:t,placeholder:r="在此撰写正文…"},s){const i=N.useRef(!1),o=N.useRef(e),[,l]=N.useState(0),[a,c]=N.useState("rich"),[u,d]=N.useState(!1),[h,f]=N.useState(""),[p,m]=N.useState(!1),[g,y]=N.useState(""),[x,C]=N.useState("rich"),v=N.useRef(null),k=ox({extensions:[Mw.configure({heading:{levels:[2,3,4,5,6]}}),qS,kS.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),Ow.configure({inline:!1,allowBase64:!1}),Rw.configure({placeholder:({node:E})=>{var D;return E.type.name==="paragraph"&&((D=E.parent)==null?void 0:D.type.name)==="membersOnly"?cv:r},includeChildren:!0}),nv,lv],content:Ye(e)||"",onUpdate:({editor:E})=>{const D=Ye(E.getHTML());i.current=!0,o.current=D,t(D),iu(E)&&!E.state.selection.empty&&E.commands.setTextSelection(1)},onSelectionUpdate:()=>{l(E=>E+1)},onTransaction:()=>{l(E=>E+1)},editorProps:{attributes:{class:"article-prosemirror post-detail-content",spellcheck:"false"},handleKeyDown:(E,D)=>(D.ctrlKey||D.metaKey)&&D.key.toLowerCase()==="a"&&!E.state.doc.textContent.trim()?(D.preventDefault(),E.dispatch(E.state.tr.setSelection(P.create(E.state.doc,1))),!0):!1}});N.useEffect(()=>{if(!k||a!=="rich")return;if(i.current){i.current=!1;return}const E=Ye(e);E!==o.current&&(o.current=E,k.commands.setContent(E||"",{emitUpdate:!1}))},[e,k,a]),N.useEffect(()=>{if(!u)return;const E=document.body.style.overflow;document.body.style.overflow="hidden";const D=Z=>{Z.key==="Escape"&&d(!1)};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",D)}},[u]),N.useImperativeHandle(s,()=>({getHTML:()=>a==="markdown"?Ye(Kr(h)):k?Ye(k.getHTML()):e,isEmpty:()=>a==="markdown"?h.trim().length===0:k?iu(k):!e.trim(),focus:()=>{var E;if(a==="markdown"){(E=v.current)==null||E.focus();return}k==null||k.commands.focus()}}),[k,e,a,h]);const M=N.useCallback(E=>{f(E);const D=Ye(Kr(E));i.current=!0,o.current=D,t(D)},[t]),T=N.useCallback(E=>{if(E==="rich"){if(!k)return;const D=k.getAttributes("link").href;y(D??"")}else y("");C(E),m(!0)},[k]),L=N.useCallback(E=>{if(x==="markdown"){const D=v.current;if(!D||!E)return;ev(D,h,E,M);return}if(k){if(!E){k.chain().focus().extendMarkRange("link").unsetLink().run();return}k.chain().focus().extendMarkRange("link").setLink({href:E}).run()}},[k,x,h,M]),O=N.useCallback(()=>{k&&k.chain().focus().extendMarkRange("link").unsetLink().run()},[k]),$=N.useCallback(async()=>{if(!k)return;const E=await ou();E&&k.chain().focus().setImage({src:E}).run()},[k]),de=N.useCallback(()=>{if(!k)return;if(k.isActive("membersOnly")){k.chain().focus().exitMembersOnly().run();return}const{from:E,to:D,empty:Z}=k.state.selection;if(!Z&&E!==D){k.chain().focus().wrapMembersOnly().run();return}k.chain().focus().insertMembersOnly().run()},[k]),se=N.useCallback(()=>{if(!k)return;const E=Ye(k.getHTML());o.current=E,f(K1(E)),c("markdown")},[k]),ne=N.useCallback(()=>{const E=Ye(Kr(h));o.current=E,i.current=!0,t(E),k&&k.commands.setContent(E||"",{emitUpdate:!1}),c("rich")},[k,h,t]),H=N.useCallback(E=>()=>{const D=v.current;D&&E(D,h,M)},[h,M]),U=N.useCallback(async()=>{const E=v.current;if(!E)return;const D=await ou();D&&nu(E,h,` +`)[0]??"").match(/^ {1,4}/);f&&(l=l.delete(d,d+f[0].length),a-=f[0].length,c=!0)}),c?(n.view.dispatch(l),!0):!1}function pv(n){const{empty:e}=n.state.selection;if(e)return!1;if(n.isActive("codeBlock"))return hv(n);if(n.isActive("listItem"))return n.chain().focus().sinkListItem("listItem").run();const t=lp(n);if(t.length===0)return!1;let r=n.state.tr,s=0;return t.forEach(({pos:i})=>{const o=i+1+s;r=r.insertText(Tt,o),s+=Tt.length}),n.view.dispatch(r),!0}function mv(n){const{empty:e}=n.state.selection;if(e)return!1;if(n.isActive("codeBlock"))return fv(n);if(n.isActive("listItem"))return n.chain().focus().liftListItem("listItem").run();const t=lp(n);if(t.length===0)return!1;let r=n.state.tr,s=0;return t.forEach(({pos:i})=>{const o=n.state.doc.nodeAt(i);if(!(o!=null&&o.isTextblock))return;const a=o.textContent.match(/^ {1,4}/);if(!a)return;const c=a[0].length,u=i+1+s;r=r.delete(u,u+c),s-=c}),r.steps.length===0?!1:(n.view.dispatch(r),!0)}function au(n){const{state:e}=n,{$from:t,empty:r}=e.selection;if(!r||!t.parent.isTextblock)return!1;const s=t.start(),i=e.doc.textBetween(s,t.pos);if(i.endsWith(Tt))return n.chain().focus().deleteRange({from:t.pos-Tt.length,to:t.pos}).run();const o=i.match(/^ {1,4}/);return o?n.chain().focus().deleteRange({from:s,to:s+o[0].length}).run():!1}const gv=Y.create({name:"tabIndent",addKeyboardShortcuts(){return{Tab:({editor:n})=>n.state.selection.empty?n.isActive("codeBlock")?n.chain().focus().insertContent(Tt).run():n.isActive("listItem")?n.chain().focus().sinkListItem("listItem").run():n.chain().focus().insertContent(Tt).run():pv(n),"Shift-Tab":({editor:n})=>n.state.selection.empty?n.isActive("codeBlock")?au(n):n.isActive("listItem")?n.chain().focus().liftListItem("listItem").run():au(n):mv(n)}}});function yv({open:n,onOpenChange:e,initialUrl:t="",onConfirm:r,onRemove:s}){const[i,o]=T.useState(t);T.useEffect(()=>{n&&o(t||"https://")},[n,t]);const l=()=>{r(i.trim()),e(!1)};return k.jsx(Ap,{open:n,onOpenChange:e,children:k.jsxs(Np,{className:"article-link-dialog",children:[k.jsxs(Op,{children:[k.jsx(Rp,{children:"插入链接"}),k.jsx(Dp,{children:"输入完整 URL,留空并确认可移除已有链接。"})]}),k.jsx(Lp,{type:"url",value:i,placeholder:"https://",onChange:a=>o(a.target.value),onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),l())},autoFocus:!0}),k.jsxs(Ip,{className:"article-link-dialog__footer",children:[s&&t?k.jsx(Zr,{type:"button",variant:"outline",onClick:()=>{s(),e(!1)},children:"移除链接"}):null,k.jsx(Zr,{type:"button",variant:"outline",onClick:()=>e(!1),children:"取消"}),k.jsx(Zr,{type:"button",onClick:l,children:"确定"})]})]})})}function Jo({content:n,hint:e,side:t="bottom",align:r="center",children:s,className:i}){if(!T.isValidElement(s))return s;const o=e?`${n},${e}`:n,l=T.cloneElement(s,{"aria-label":o});return k.jsxs("span",{className:ea("ui-tooltip",i),children:[l,k.jsxs("span",{role:"tooltip",className:ea("ui-tooltip-bubble",`ui-tooltip-bubble--${t}`,`ui-tooltip-bubble--${r}`,e?"ui-tooltip-bubble--rich":"ui-tooltip-bubble--compact"),children:[k.jsx("span",{className:"ui-tooltip-bubble__title",children:n}),e?k.jsx("span",{className:"ui-tooltip-bubble__hint",children:e}):null]})]})}const kv="在此输入仅登录用户可见的内容…";function et(n){return hu.sanitize(n,du)}function cu(n){return n.state.doc.textContent.trim().length===0}function bv(n){for(let e=2;e<=6;e+=1)if(n.isActive("heading",{level:e})){e===6?n.chain().focus().setParagraph().run():n.chain().focus().toggleHeading({level:e+1}).run();return}n.chain().focus().toggleHeading({level:2}).run()}async function uu(){return new Promise(n=>{const e=document.createElement("input");e.type="file",e.accept="image/jpeg,image/png,image/gif,image/webp",e.onchange=async()=>{var r;const t=(r=e.files)==null?void 0:r[0];if(!t){n(null);return}try{const{url:s}=await sn.uploadPostImage(t);n(s)}catch(s){We.error(s instanceof Error?s.message:"图片上传失败"),n(null)}},e.click()})}function xv(n){return n.map((e,t)=>k.jsxs("span",{className:e.className==="article-tool-btn--members"?"article-editor-tools-members":void 0,children:[e.className==="article-tool-btn--members"?k.jsx("span",{className:"article-editor-tools-sep","aria-hidden":"true"}):null,k.jsx(Jo,{content:e.title,hint:e.hint,align:e.align,side:"bottom",children:k.jsx("button",{type:"button",className:`article-tool-btn${e.active?" active":""}${e.className?` ${e.className}`:""}`,onMouseDown:r=>r.preventDefault(),onClick:e.action,children:e.icon})})]},t))}const Sv=T.forwardRef(function({value:e,onChange:t,placeholder:r="在此撰写正文…"},s){const i=T.useRef(!1),o=T.useRef(e),[,l]=T.useState(0),[a,c]=T.useState("rich"),[u,d]=T.useState(!1),[h,f]=T.useState(""),[p,m]=T.useState(!1),[g,y]=T.useState(""),[x,C]=T.useState("rich"),v=T.useRef(null),b=mx({extensions:[zw.configure({heading:{levels:[2,3,4,5,6]}}),ew,MS.configure({openOnClick:!1,autolink:!0,defaultProtocol:"https"}),Fw.configure({inline:!1,allowBase64:!1}),jw.configure({placeholder:({node:E})=>{var D;return E.type.name==="paragraph"&&((D=E.parent)==null?void 0:D.type.name)==="membersOnly"?kv:r},includeChildren:!0}),dv,gv],content:et(e)||"",onUpdate:({editor:E})=>{const D=et(E.getHTML());i.current=!0,o.current=D,t(D),cu(E)&&!E.state.selection.empty&&E.commands.setTextSelection(1)},onSelectionUpdate:()=>{l(E=>E+1)},onTransaction:()=>{l(E=>E+1)},editorProps:{attributes:{class:"article-prosemirror post-detail-content",spellcheck:"false"},handleKeyDown:(E,D)=>(D.ctrlKey||D.metaKey)&&D.key.toLowerCase()==="a"&&!E.state.doc.textContent.trim()?(D.preventDefault(),E.dispatch(E.state.tr.setSelection(I.create(E.state.doc,1))),!0):!1}});T.useEffect(()=>{if(!b||a!=="rich")return;if(i.current){i.current=!1;return}const E=et(e);E!==o.current&&(o.current=E,b.commands.setContent(E||"",{emitUpdate:!1}))},[e,b,a]),T.useEffect(()=>{if(!u)return;const E=document.body.style.overflow;document.body.style.overflow="hidden";const D=ee=>{ee.key==="Escape"&&d(!1)};return window.addEventListener("keydown",D),()=>{document.body.style.overflow=E,window.removeEventListener("keydown",D)}},[u]),T.useImperativeHandle(s,()=>({getHTML:()=>a==="markdown"?et(Xr(h)):b?et(b.getHTML()):e,isEmpty:()=>a==="markdown"?h.trim().length===0:b?cu(b):!e.trim(),focus:()=>{var E;if(a==="markdown"){(E=v.current)==null||E.focus();return}b==null||b.commands.focus()}}),[b,e,a,h]);const A=T.useCallback(E=>{f(E);const D=et(Xr(E));i.current=!0,o.current=D,t(D)},[t]),M=T.useCallback(E=>{if(E==="rich"){if(!b)return;const D=b.getAttributes("link").href;y(D??"")}else y("");C(E),m(!0)},[b]),L=T.useCallback(E=>{if(x==="markdown"){const D=v.current;if(!D||!E)return;cv(D,h,E,A);return}if(b){if(!E){b.chain().focus().extendMarkRange("link").unsetLink().run();return}b.chain().focus().extendMarkRange("link").setLink({href:E}).run()}},[b,x,h,A]),z=T.useCallback(()=>{b&&b.chain().focus().extendMarkRange("link").unsetLink().run()},[b]),U=T.useCallback(async()=>{if(!b)return;const E=await uu();E&&b.chain().focus().setImage({src:E}).run()},[b]),Te=T.useCallback(()=>{if(!b)return;if(b.isActive("membersOnly")){b.chain().focus().exitMembersOnly().run();return}const{from:E,to:D,empty:ee}=b.state.selection;if(!ee&&E!==D){b.chain().focus().wrapMembersOnly().run();return}b.chain().focus().insertMembersOnly().run()},[b]),Me=T.useCallback(()=>{if(!b)return;const E=et(b.getHTML());o.current=E,f(nv(E)),c("markdown")},[b]),te=T.useCallback(()=>{const E=et(Xr(h));o.current=E,i.current=!0,t(E),b&&b.commands.setContent(E||"",{emitUpdate:!1}),c("rich")},[b,h,t]),$=T.useCallback(E=>()=>{const D=v.current;D&&E(D,h,A)},[h,A]),W=T.useCallback(async()=>{const E=v.current;if(!E)return;const D=await uu();D&&ou(E,h,` ![图片](${D}) -`,M)},[h,M]),ot=N.useMemo(()=>yp(Ye(Kr(h)),!0),[h]),sp=N.useCallback(()=>k?[{icon:b.jsx("strong",{children:"H"}),title:"标题",hint:"H2 → H6 循环",active:k.isActive("heading"),action:()=>uv(k)},{icon:b.jsx(Ql,{size:15}),title:"加粗",active:k.isActive("bold"),action:()=>k.chain().focus().toggleBold().run()},{icon:b.jsx(Zl,{size:15}),title:"斜体",active:k.isActive("italic"),action:()=>k.chain().focus().toggleItalic().run()},{icon:b.jsx(ea,{size:15}),title:"下划线",active:k.isActive("underline"),action:()=>k.chain().focus().toggleUnderline().run()},{icon:b.jsx(ta,{size:15}),title:"删除线",active:k.isActive("strike"),action:()=>k.chain().focus().toggleStrike().run()},{icon:b.jsx(na,{size:15}),title:"分割线",action:()=>k.chain().focus().setHorizontalRule().run()},{icon:b.jsx(ra,{size:15}),title:"引用",active:k.isActive("blockquote"),action:()=>k.chain().focus().toggleBlockquote().run()},{icon:b.jsx(sa,{size:15}),title:"无序列表",active:k.isActive("bulletList"),action:()=>k.chain().focus().toggleBulletList().run()},{icon:b.jsx(ia,{size:15}),title:"有序列表",active:k.isActive("orderedList"),action:()=>k.chain().focus().toggleOrderedList().run()},{icon:b.jsx(oa,{size:15}),title:"代码块",active:k.isActive("codeBlock"),action:()=>k.chain().focus().toggleCodeBlock().run()},{icon:b.jsx(la,{size:15}),title:"链接",active:k.isActive("link"),action:()=>T("rich")},{icon:b.jsx(aa,{size:15}),title:"上传图片",action:$},{icon:b.jsx(to,{size:15}),title:"登录可见",hint:"独立输入区;Ctrl+Enter 退出",active:k.isActive("membersOnly"),className:"article-tool-btn--members",action:de}]:[],[k,T,$,de]),ip=N.useCallback(()=>[{icon:b.jsx("strong",{children:"H"}),title:"标题",hint:"H2 → H6 循环",action:H(Q1)},{icon:b.jsx(Ql,{size:15}),title:"加粗",action:H((E,D,Z)=>Rn(E,D,"**","**","加粗文字",Z))},{icon:b.jsx(Zl,{size:15}),title:"斜体",action:H((E,D,Z)=>Rn(E,D,"*","*","斜体文字",Z))},{icon:b.jsx(ea,{size:15}),title:"下划线",action:H((E,D,Z)=>Rn(E,D,"","","下划线文字",Z))},{icon:b.jsx(ta,{size:15}),title:"删除线",action:H((E,D,Z)=>Rn(E,D,"~~","~~","删除线文字",Z))},{icon:b.jsx(na,{size:15}),title:"分割线",action:H((E,D,Z)=>nu(E,D,` +`,A)},[h,A]),Re=T.useMemo(()=>kp(et(Xr(h)),!0),[h]),X=T.useCallback(()=>b?[{icon:k.jsx("strong",{children:"H"}),title:"标题",hint:"H2 → H6 循环",active:b.isActive("heading"),action:()=>bv(b)},{icon:k.jsx(na,{size:15}),title:"加粗",active:b.isActive("bold"),action:()=>b.chain().focus().toggleBold().run()},{icon:k.jsx(ra,{size:15}),title:"斜体",active:b.isActive("italic"),action:()=>b.chain().focus().toggleItalic().run()},{icon:k.jsx(sa,{size:15}),title:"下划线",active:b.isActive("underline"),action:()=>b.chain().focus().toggleUnderline().run()},{icon:k.jsx(ia,{size:15}),title:"删除线",active:b.isActive("strike"),action:()=>b.chain().focus().toggleStrike().run()},{icon:k.jsx(oa,{size:15}),title:"分割线",action:()=>b.chain().focus().setHorizontalRule().run()},{icon:k.jsx(la,{size:15}),title:"引用",active:b.isActive("blockquote"),action:()=>b.chain().focus().toggleBlockquote().run()},{icon:k.jsx(aa,{size:15}),title:"无序列表",active:b.isActive("bulletList"),action:()=>b.chain().focus().toggleBulletList().run()},{icon:k.jsx(ca,{size:15}),title:"有序列表",active:b.isActive("orderedList"),action:()=>b.chain().focus().toggleOrderedList().run()},{icon:k.jsx(ua,{size:15}),title:"代码块",active:b.isActive("codeBlock"),action:()=>b.chain().focus().toggleCodeBlock().run()},{icon:k.jsx(da,{size:15}),title:"链接",active:b.isActive("link"),action:()=>M("rich")},{icon:k.jsx(ha,{size:15}),title:"上传图片",action:U},{icon:k.jsx(io,{size:15}),title:"登录可见",hint:"独立输入区;Ctrl+Enter 退出",active:b.isActive("membersOnly"),className:"article-tool-btn--members",action:Te}]:[],[b,M,U,Te]),de=T.useCallback(()=>[{icon:k.jsx("strong",{children:"H"}),title:"标题",hint:"H2 → H6 循环",action:$(lv)},{icon:k.jsx(na,{size:15}),title:"加粗",action:$((E,D,ee)=>Pn(E,D,"**","**","加粗文字",ee))},{icon:k.jsx(ra,{size:15}),title:"斜体",action:$((E,D,ee)=>Pn(E,D,"*","*","斜体文字",ee))},{icon:k.jsx(sa,{size:15}),title:"下划线",action:$((E,D,ee)=>Pn(E,D,"","","下划线文字",ee))},{icon:k.jsx(ia,{size:15}),title:"删除线",action:$((E,D,ee)=>Pn(E,D,"~~","~~","删除线文字",ee))},{icon:k.jsx(oa,{size:15}),title:"分割线",action:$((E,D,ee)=>ou(E,D,` --- -`,Z))},{icon:b.jsx(ra,{size:15}),title:"引用",action:H((E,D,Z)=>Zi(E,D,"> ",Z))},{icon:b.jsx(sa,{size:15}),title:"无序列表",action:H((E,D,Z)=>Zi(E,D,"- ",Z))},{icon:b.jsx(ia,{size:15}),title:"有序列表",action:H((E,D,Z)=>Zi(E,D,"1. ",Z))},{icon:b.jsx(oa,{size:15}),title:"代码块",action:H((E,D,Z)=>Rn(E,D,"```\n","\n```","代码",Z))},{icon:b.jsx(la,{size:15}),title:"链接",action:()=>T("markdown")},{icon:b.jsx(aa,{size:15}),title:"上传图片",action:U},{icon:b.jsx(to,{size:15}),title:"登录可见",hint:"插入 区块",className:"article-tool-btn--members",action:H(Z1)}],[H,T,U]),op=a==="rich"?sp():ip(),lp=a==="markdown"?ru(h):k?ru(k.getText()):0;return b.jsxs("div",{className:`article-editor article-editor--${a}${u?" article-editor--fullscreen":""}`,children:[b.jsx("div",{className:"article-editor-bar",children:b.jsx("div",{className:"article-editor-tools",children:dv(op)})}),b.jsx("div",{className:"article-editor-body",children:a==="rich"?b.jsx("div",{className:"article-editor-pane article-editor-pane--rich",children:b.jsx("div",{className:"article-editor-scroll",children:b.jsx(Ih,{editor:k,className:"article-editor-content"})})}):b.jsxs("div",{className:"article-editor-markdown",children:[b.jsx("div",{className:"article-editor-pane article-editor-pane--source",children:b.jsx("div",{className:"article-editor-scroll",children:b.jsx("textarea",{ref:v,className:"article-editor-markdown-input",value:h,onChange:E=>M(E.target.value),onKeyDown:E=>X1(E,M),placeholder:"在此编写 Markdown 源码…",spellCheck:!1})})}),b.jsxs("div",{className:"article-editor-markdown-preview",children:[b.jsx("div",{className:"article-editor-markdown-preview-label",children:"预览"}),b.jsx("div",{className:"article-editor-markdown-preview-body post-detail-content",dangerouslySetInnerHTML:{__html:ot}})]})]})}),b.jsxs("div",{className:"article-editor-status",children:[b.jsxs("div",{className:"article-editor-status-meta",children:[b.jsxs("span",{children:[lp," 字"]}),b.jsx("span",{className:"article-editor-status-sep",children:"·"}),b.jsxs("span",{children:[a==="rich"?"富文本":"Markdown 源码"," · Tab 缩进 / Shift+Tab 回退",a==="rich"?" · 登录可见内 Ctrl+Enter 退出":""]})]}),b.jsxs("div",{className:"article-editor-status-actions",children:[b.jsx(Wo,{content:a==="rich"?"Markdown 源码":"富文本编辑",hint:a==="rich"?"切换为 Markdown 源码编写":"返回所见即所得编辑",align:"end",side:"top",children:b.jsxs("button",{type:"button",className:`article-editor-view-btn${a==="markdown"?" active":""}`,onMouseDown:E=>E.preventDefault(),onClick:a==="rich"?se:ne,children:[a==="rich"?b.jsx(xp,{size:15}):b.jsx(Sp,{size:15}),b.jsx("span",{children:a==="rich"?"源码":"富文本"})]})}),b.jsx(Wo,{content:u?"退出全屏":"全屏编辑",hint:u?"Esc 也可退出":"沉浸式编写长文",align:"end",side:"top",children:b.jsxs("button",{type:"button",className:"article-editor-view-btn",onMouseDown:E=>E.preventDefault(),onClick:()=>d(E=>!E),children:[u?b.jsx(wp,{size:15}):b.jsx(vp,{size:15}),b.jsx("span",{children:u?"退出全屏":"全屏"})]})})]})]}),b.jsx(av,{open:p,onOpenChange:m,initialUrl:g,onConfirm:L,onRemove:x==="rich"&&g?O:void 0})]})});function Av(){const n=hp(),{id:e}=fp(),t=e?Number(e):null,r=t!==null&&!Number.isNaN(t),[s]=pp(),i=s.get("board")||"",{user:o,loading:l}=mp(),{limits:a}=gp(),[c,u]=N.useState([]),[d,h]=N.useState(i),[f,p]=N.useState(""),[m,g]=N.useState(""),[y,x]=N.useState(""),[C,v]=N.useState(!1),[k,M]=N.useState(r);if(N.useEffect(()=>{if(!l){if(!o){n("/login");return}if(r){M(!0),Promise.all([en.boards(),en.post(t,{skipView:!0})]).then(([O,$])=>{const de=O.boards??[];u(de);const se=$.post;if(!(o.role==="admin"||se.user_id===o.id)){He.error("无权编辑此帖子"),n(`/post/${t}`);return}if(!$.can_edit){He.error($.edit_block_reason||"当前无法编辑此帖子"),n(`/post/${t}`);return}h(String(se.board_id)),p(se.title),g(se.tags??""),x(se.content??"")}).catch(O=>{He.error(O instanceof Error?O.message:"加载帖子失败"),n("/")}).finally(()=>M(!1));return}en.boards().then(O=>{const $=O.boards??[];u($),!i&&$.length>0&&h(String($[0].id))}).catch(()=>{})}},[o,l,n,i,r,t]),l)return b.jsx("div",{className:"compose-page compose-page--empty",children:b.jsx(Xl,{size:"lg"})});if(!o)return null;if(k)return b.jsx("div",{className:"compose-page compose-page--empty",children:b.jsx(Xl,{size:"lg"})});if(!r&&c.length===0)return b.jsx("div",{className:"compose-page compose-page--empty",children:b.jsxs("div",{className:"compose-empty-card",children:[b.jsx("div",{className:"compose-empty-icon",children:"✎"}),b.jsx("h2",{children:"暂无可发帖板块"}),b.jsx("p",{children:"需要管理员先创建板块后才能发布内容"}),o.role==="admin"?b.jsx("button",{type:"button",className:"compose-primary-btn",onClick:()=>n("/admin/boards"),children:"去创建板块"}):b.jsx("button",{type:"button",className:"compose-ghost-btn",onClick:()=>n("/"),children:"返回首页"})]})});const T=async()=>{const O=f.trim();if(!r&&!d){He.warning("请选择板块");return}if(!O){He.warning("请输入标题");return}if(kp(y)){He.warning("请输入正文内容");return}v(!0);try{const $={title:O,content:y.trim(),tags:m.trim()};if(r)await en.updatePost(t,$),He.success("帖子已更新"),n(`/post/${t}`);else{const de=await en.createPost({board_id:d,...$});He.success("发帖成功"),n(`/post/${de.post_id}`)}}catch($){He.error($ instanceof Error?$.message:r?"保存失败":"发帖失败")}finally{v(!1)}},L=c.find(O=>String(O.id)===d);return b.jsx("div",{className:"compose-page",children:b.jsxs("div",{className:"compose-canvas",children:[b.jsxs("header",{className:"compose-header",children:[b.jsxs("button",{type:"button",className:"compose-back",onClick:()=>n(r?`/post/${t}`:-1),children:[b.jsx(Ep,{size:16}),b.jsx("span",{children:"返回"})]}),b.jsx("div",{className:"compose-header-actions",children:b.jsxs("button",{type:"button",className:"compose-publish-btn",disabled:C,onClick:T,children:[b.jsx(Cp,{size:16}),C?r?"保存中…":"发布中…":r?"保存修改":"发布帖子"]})})]}),b.jsxs("div",{className:"compose-meta",children:[r?L&&b.jsx("div",{className:"compose-board-pills",children:b.jsx("span",{className:"compose-board-pill active",children:L.name})}):b.jsx("div",{className:"compose-board-pills",children:c.map(O=>b.jsx("button",{type:"button",className:`compose-board-pill${String(O.id)===d?" active":""}`,onClick:()=>h(String(O.id)),children:O.name},O.id))}),b.jsxs("div",{className:"compose-tags-field",children:[b.jsx(Tp,{className:"compose-tags-icon",size:16}),b.jsx("input",{type:"text",placeholder:"添加标签,逗号分隔",value:m,onChange:O=>g(O.target.value),maxLength:a.post_tags_max>0?a.post_tags_max:void 0})]})]}),b.jsxs("div",{className:"compose-writing",children:[b.jsx("input",{className:"compose-title",type:"text",placeholder:"输入文章标题…",value:f,onChange:O=>p(O.target.value),maxLength:a.post_title_max>0?a.post_title_max:void 0}),L&&b.jsxs("div",{className:"compose-subtitle",children:[r?"编辑于":"发布至"," ",b.jsx("strong",{children:L.name})]}),b.jsx(hv,{value:y,onChange:x,placeholder:"开始写作。所见即所得,选中文字后使用工具栏设置格式。"})]})]})})}export{Av as default}; +`,ee))},{icon:k.jsx(la,{size:15}),title:"引用",action:$((E,D,ee)=>ro(E,D,"> ",ee))},{icon:k.jsx(aa,{size:15}),title:"无序列表",action:$((E,D,ee)=>ro(E,D,"- ",ee))},{icon:k.jsx(ca,{size:15}),title:"有序列表",action:$((E,D,ee)=>ro(E,D,"1. ",ee))},{icon:k.jsx(ua,{size:15}),title:"代码块",action:$((E,D,ee)=>Pn(E,D,"```\n","\n```","代码",ee))},{icon:k.jsx(da,{size:15}),title:"链接",action:()=>M("markdown")},{icon:k.jsx(ha,{size:15}),title:"上传图片",action:W},{icon:k.jsx(io,{size:15}),title:"登录可见",hint:"插入 区块",className:"article-tool-btn--members",action:$(av)}],[$,M,W]),ut=a==="rich"?X():de(),Ve=a==="markdown"?lu(h):b?lu(b.getText()):0;return k.jsxs("div",{className:`article-editor article-editor--${a}${u?" article-editor--fullscreen":""}`,children:[k.jsx("div",{className:"article-editor-bar",children:k.jsx("div",{className:"article-editor-tools",children:xv(ut)})}),k.jsx("div",{className:"article-editor-body",children:a==="rich"?k.jsx("div",{className:"article-editor-pane article-editor-pane--rich",children:k.jsx("div",{className:"article-editor-scroll",children:k.jsx(zh,{editor:b,className:"article-editor-content"})})}):k.jsxs("div",{className:"article-editor-markdown",children:[k.jsx("div",{className:"article-editor-pane article-editor-pane--source",children:k.jsx("div",{className:"article-editor-scroll",children:k.jsx("textarea",{ref:v,className:"article-editor-markdown-input",value:h,onChange:E=>A(E.target.value),onKeyDown:E=>ov(E,A),placeholder:"在此编写 Markdown 源码…",spellCheck:!1})})}),k.jsxs("div",{className:"article-editor-markdown-preview",children:[k.jsx("div",{className:"article-editor-markdown-preview-label",children:"预览"}),k.jsx("div",{className:"article-editor-markdown-preview-body post-detail-content",dangerouslySetInnerHTML:{__html:Re}})]})]})}),k.jsxs("div",{className:"article-editor-status",children:[k.jsxs("div",{className:"article-editor-status-meta",children:[k.jsxs("span",{children:[Ve," 字"]}),k.jsx("span",{className:"article-editor-status-sep",children:"·"}),k.jsxs("span",{children:[a==="rich"?"富文本":"Markdown 源码"," · Tab 缩进 / Shift+Tab 回退",a==="rich"?" · 登录可见内 Ctrl+Enter 退出":""]})]}),k.jsxs("div",{className:"article-editor-status-actions",children:[k.jsx(Jo,{content:a==="rich"?"Markdown 源码":"富文本编辑",hint:a==="rich"?"切换为 Markdown 源码编写":"返回所见即所得编辑",align:"end",side:"top",children:k.jsxs("button",{type:"button",className:`article-editor-view-btn${a==="markdown"?" active":""}`,onMouseDown:E=>E.preventDefault(),onClick:a==="rich"?Me:te,children:[a==="rich"?k.jsx(Sp,{size:15}):k.jsx(wp,{size:15}),k.jsx("span",{children:a==="rich"?"源码":"富文本"})]})}),k.jsx(Jo,{content:u?"退出全屏":"全屏编辑",hint:u?"Esc 也可退出":"沉浸式编写长文",align:"end",side:"top",children:k.jsxs("button",{type:"button",className:"article-editor-view-btn",onMouseDown:E=>E.preventDefault(),onClick:()=>d(E=>!E),children:[u?k.jsx(vp,{size:15}):k.jsx(Ep,{size:15}),k.jsx("span",{children:u?"退出全屏":"全屏"})]})})]})]}),k.jsx(yv,{open:p,onOpenChange:m,initialUrl:g,onConfirm:L,onRemove:x==="rich"&&g?z:void 0})]})});function wv({open:n,onStay:e,onLeave:t,isEdit:r=!1}){return k.jsx(Pp,{open:n,children:k.jsxs(zp,{onEscapeKeyDown:e,children:[k.jsxs(Bp,{children:[k.jsx($p,{children:"放弃未保存的修改?"}),k.jsx(Fp,{children:r?"你对这篇文章的修改尚未保存,离开后将无法恢复。":"你正在撰写的内容尚未发布,离开后将无法恢复。"})]}),k.jsxs(jp,{children:[k.jsx(Hp,{onClick:e,children:"继续编辑"}),k.jsx(Zr,{type:"button",variant:"destructive",onClick:t,children:"放弃并离开"})]})]})})}function Fv(){const n=fp(),{id:e}=pp(),t=e?Number(e):null,r=t!==null&&!Number.isNaN(t),[s]=mp(),i=s.get("board")||"",{user:o,loading:l}=gp(),{limits:a}=yp(),[c,u]=T.useState([]),[d,h]=T.useState(i),[f,p]=T.useState(""),[m,g]=T.useState(""),[y,x]=T.useState(""),[C,v]=T.useState(!1),[b,A]=T.useState(r),[M,L]=T.useState(null);T.useEffect(()=>{if(!l){if(!o){n("/login");return}if(r){A(!0),Promise.all([sn.boards(),sn.post(t,{skipView:!0})]).then(([X,de])=>{const ut=X.boards??[];u(ut);const Ve=de.post;if(!(o.role==="admin"||Ve.user_id===o.id)){We.error("无权编辑此帖子"),n(`/post/${t}`);return}if(!de.can_edit){We.error(de.edit_block_reason||"当前无法编辑此帖子"),n(`/post/${t}`);return}const D=String(Ve.board_id);h(D),p(Ve.title),g(Ve.tags??""),x(Ve.content??""),L({title:Ve.title,tags:Ve.tags??"",content:Ve.content??"",boardId:D})}).catch(X=>{We.error(X instanceof Error?X.message:"加载帖子失败"),n("/")}).finally(()=>A(!1));return}sn.boards().then(X=>{const de=X.boards??[];u(de);const ut=i||(de.length>0?String(de[0].id):"");!i&&de.length>0&&h(ut),L({title:"",tags:"",content:"",boardId:ut})}).catch(()=>{})}},[o,l,n,i,r,t]);const z=T.useMemo(()=>M?f!==M.title||m!==M.tags||y!==M.content||!r&&d!==M.boardId:!1,[M,f,m,y,d,r]),{dialogOpen:U,stayOnPage:Te,discardAndLeave:Me,requestLeave:te,markSaved:$}=_p({isDirty:z});if(l)return k.jsx("div",{className:"compose-page compose-page--empty",children:k.jsx(ta,{size:"lg"})});if(!o)return null;if(b)return k.jsx("div",{className:"compose-page compose-page--empty",children:k.jsx(ta,{size:"lg"})});if(!r&&c.length===0)return k.jsx("div",{className:"compose-page compose-page--empty",children:k.jsxs("div",{className:"compose-empty-card",children:[k.jsx("div",{className:"compose-empty-icon",children:"✎"}),k.jsx("h2",{children:"暂无可发帖板块"}),k.jsx("p",{children:"需要管理员先创建板块后才能发布内容"}),o.role==="admin"?k.jsx("button",{type:"button",className:"compose-primary-btn",onClick:()=>n("/admin/boards"),children:"去创建板块"}):k.jsx("button",{type:"button",className:"compose-ghost-btn",onClick:()=>n("/"),children:"返回首页"})]})});const W=async()=>{const X=f.trim();if(!r&&!d){We.warning("请选择板块");return}if(!X){We.warning("请输入标题");return}if(bp(y)){We.warning("请输入正文内容");return}v(!0);try{const de={title:X,content:y.trim(),tags:m.trim()};if(r)await sn.updatePost(t,de),We.success("帖子已更新"),$(),n(`/post/${t}`);else{const ut=await sn.createPost({board_id:d,...de});We.success("发帖成功"),$(),n(`/post/${ut.post_id}`)}}catch(de){We.error(de instanceof Error?de.message:r?"保存失败":"发帖失败")}finally{v(!1)}},Re=c.find(X=>String(X.id)===d);return k.jsxs("div",{className:"compose-page",children:[k.jsxs("div",{className:"compose-canvas",children:[k.jsxs("header",{className:"compose-header",children:[k.jsxs("button",{type:"button",className:"compose-back",onClick:()=>te(()=>n(r?`/post/${t}`:-1)),children:[k.jsx(Cp,{size:16}),k.jsx("span",{children:"返回"})]}),k.jsx("div",{className:"compose-header-actions",children:k.jsxs("button",{type:"button",className:"compose-publish-btn",disabled:C,onClick:W,children:[k.jsx(Tp,{size:16}),C?r?"保存中…":"发布中…":r?"保存修改":"发布帖子"]})})]}),k.jsxs("div",{className:"compose-meta",children:[r?Re&&k.jsx("div",{className:"compose-board-pills",children:k.jsx("span",{className:"compose-board-pill active",children:Re.name})}):k.jsx("div",{className:"compose-board-pills",children:c.map(X=>k.jsx("button",{type:"button",className:`compose-board-pill${String(X.id)===d?" active":""}`,onClick:()=>h(String(X.id)),children:X.name},X.id))}),k.jsxs("div",{className:"compose-tags-field",children:[k.jsx(Mp,{className:"compose-tags-icon",size:16}),k.jsx("input",{type:"text",placeholder:"添加标签,逗号分隔",value:m,onChange:X=>g(X.target.value),maxLength:a.post_tags_max>0?a.post_tags_max:void 0})]})]}),k.jsxs("div",{className:"compose-writing",children:[k.jsx("input",{className:"compose-title",type:"text",placeholder:"输入文章标题…",value:f,onChange:X=>p(X.target.value),maxLength:a.post_title_max>0?a.post_title_max:void 0}),Re&&k.jsxs("div",{className:"compose-subtitle",children:[r?"编辑于":"发布至"," ",k.jsx("strong",{children:Re.name})]}),k.jsx(Sv,{value:y,onChange:x,placeholder:"开始写作。所见即所得,选中文字后使用工具栏设置格式。"})]})]}),k.jsx(wv,{open:U,onStay:Te,onLeave:Me,isEdit:r})]})}export{Fv as default}; diff --git a/embed_static/static/spa/assets/FavoritesPage-BrE1xy6C.js b/embed_static/static/spa/assets/FavoritesPage-rLr3pZbU.js similarity index 81% rename from embed_static/static/spa/assets/FavoritesPage-BrE1xy6C.js rename to embed_static/static/spa/assets/FavoritesPage-rLr3pZbU.js index 8e6e2a2..4372353 100644 --- a/embed_static/static/spa/assets/FavoritesPage-BrE1xy6C.js +++ b/embed_static/static/spa/assets/FavoritesPage-rLr3pZbU.js @@ -1 +1 @@ -import{e as j,r as n,j as s}from"./react-vendor-1fwFMt02.js";import{h as f,a as g,n as N,S as v,B as m}from"./index-CucHNnyZ.js";import{f as y}from"./content-BrFHUpp8.js";import{A as k}from"./ui-vendor-Gb6mai95.js";function S(){const a=j(),{user:t,loading:i}=f(),[r,h]=n.useState([]),[x,u]=n.useState(!0);return n.useEffect(()=>{if(!i){if(!t){a("/login");return}g.favorites().then(e=>h(Array.isArray(e.favorites)?e.favorites:[])).catch(e=>N.error(e.message)).finally(()=>u(!1))}},[t,i,a]),i||x?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(v,{size:"lg"})}):t?s.jsx("div",{className:"page-wrap",children:s.jsxs("div",{className:"page-inner-wide",children:[s.jsxs(m,{variant:"ghost",className:"mb-3",onClick:()=>a("/"),children:[s.jsx(k,{}),"返回"]}),s.jsx("h1",{className:"page-title",children:"我的收藏"}),s.jsxs("p",{className:"page-desc",children:["共 ",r.length," 篇收藏帖子"]}),r.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("p",{children:"还没有收藏任何帖子"}),s.jsx(m,{onClick:()=>a("/"),children:"去逛逛"})]}):s.jsx("div",{className:"content-surface",children:r.map(e=>{var o,l,c,d,p;return s.jsx("div",{className:"post-row",onClick:()=>a(`/post/${e.post_id}`),children:s.jsxs("div",{className:"post-body",children:[s.jsx("div",{className:"post-title",children:((o=e.post)==null?void 0:o.title)||"帖子已删除"}),s.jsxs("div",{className:"post-meta",children:[((c=(l=e.post)==null?void 0:l.board)==null?void 0:c.name)&&s.jsx("span",{children:e.post.board.name}),((p=(d=e.post)==null?void 0:d.user)==null?void 0:p.nickname)&&s.jsx("span",{children:e.post.user.nickname}),s.jsxs("span",{children:["收藏于 ",y(e.created_at)]})]})]})},e.id)})})]})}):null}export{S as default}; +import{e as j,r as n,j as s}from"./react-vendor-BdyZmpPe.js";import{h as f,b as g,n as N,S as v,B as m}from"./index-Cp7Ff9NP.js";import{f as y}from"./content-BrFHUpp8.js";import{Q as b}from"./ui-vendor-B26O8baZ.js";function S(){const a=j(),{user:t,loading:i}=f(),[r,h]=n.useState([]),[x,u]=n.useState(!0);return n.useEffect(()=>{if(!i){if(!t){a("/login");return}g.favorites().then(e=>h(Array.isArray(e.favorites)?e.favorites:[])).catch(e=>N.error(e.message)).finally(()=>u(!1))}},[t,i,a]),i||x?s.jsx("div",{className:"flex justify-center py-16",children:s.jsx(v,{size:"lg"})}):t?s.jsx("div",{className:"page-wrap",children:s.jsxs("div",{className:"page-inner-wide",children:[s.jsxs(m,{variant:"ghost",className:"mb-3",onClick:()=>a("/"),children:[s.jsx(b,{}),"返回"]}),s.jsx("h1",{className:"page-title",children:"我的收藏"}),s.jsxs("p",{className:"page-desc",children:["共 ",r.length," 篇收藏帖子"]}),r.length===0?s.jsxs("div",{className:"empty-state",children:[s.jsx("p",{children:"还没有收藏任何帖子"}),s.jsx(m,{onClick:()=>a("/"),children:"去逛逛"})]}):s.jsx("div",{className:"content-surface",children:r.map(e=>{var o,l,c,d,p;return s.jsx("div",{className:"post-row",onClick:()=>a(`/post/${e.post_id}`),children:s.jsxs("div",{className:"post-body",children:[s.jsx("div",{className:"post-title",children:((o=e.post)==null?void 0:o.title)||"帖子已删除"}),s.jsxs("div",{className:"post-meta",children:[((c=(l=e.post)==null?void 0:l.board)==null?void 0:c.name)&&s.jsx("span",{children:e.post.board.name}),((p=(d=e.post)==null?void 0:d.user)==null?void 0:p.nickname)&&s.jsx("span",{children:e.post.user.nickname}),s.jsxs("span",{children:["收藏于 ",y(e.created_at)]})]})]})},e.id)})})]})}):null}export{S as default}; diff --git a/embed_static/static/spa/assets/HomePage-B75SKkZF.js b/embed_static/static/spa/assets/HomePage-B75SKkZF.js new file mode 100644 index 0000000..77316df --- /dev/null +++ b/embed_static/static/spa/assets/HomePage-B75SKkZF.js @@ -0,0 +1 @@ +import{j as e,r as t,e as K,g as Q,i as Z,x as C}from"./react-vendor-BdyZmpPe.js";import{c as ee,B as se,u as te,p as ae,g as M,a as re,b as A,n as ne,s as oe,F as V,d as le,e as ce,f as ie}from"./index-Cp7Ff9NP.js";import{u as de}from"./virtual-vendor-rtLkLCpN.js";import{P as ue,B as fe}from"./PinnedIcon-Dc0ZpCCq.js";import{f as U}from"./content-BrFHUpp8.js";import{M as me,$ as he,U as xe,X as pe,a0 as je}from"./ui-vendor-B26O8baZ.js";function ve({post:s,sort:i="latest",onClick:d}){var g,l,c,a;const o=((l=(g=s.user)==null?void 0:g.nickname)==null?void 0:l[0])||"?",v=i==="reply"?s.last_reply_at?`${U(s.last_reply_at)} 回复`:"暂无回复":U(s.created_at),N=s.comment_count??0,m=s.like_count??0;return e.jsxs("div",{className:"post-row",onClick:d,children:[e.jsx("div",{className:"post-avatar",children:(c=s.user)!=null&&c.avatar?e.jsx("img",{src:s.user.avatar,alt:""}):o}),e.jsxs("div",{className:"post-body",children:[e.jsxs("div",{className:"post-title",children:[s.pinned&&e.jsx(ue,{className:"mr-1.5"}),s.title]}),e.jsxs("div",{className:"post-meta",children:[s.board&&e.jsx(fe,{board:s.board}),e.jsx("span",{children:((a=s.user)==null?void 0:a.nickname)||"匿名"}),e.jsx("span",{children:v})]})]}),e.jsxs("div",{className:"post-stats",children:[e.jsxs("span",{className:`post-stat${N===0?" post-stat--zero":""}`,children:[e.jsx(me,{"aria-hidden":!0}),N]}),e.jsxs("span",{className:`post-stat${m===0?" post-stat--zero":""}`,children:[e.jsx(he,{"aria-hidden":!0}),m]})]})]})}function w({className:s,...i}){return e.jsx("div",{className:ee("skeleton",s),...i})}function O({count:s=8}){return e.jsx("div",{className:"post-list-skeleton","aria-busy":"true","aria-label":"加载中",children:Array.from({length:s},(i,d)=>e.jsxs("div",{className:"post-row post-row--skeleton",children:[e.jsx(w,{className:"skeleton--avatar"}),e.jsxs("div",{className:"post-body",children:[e.jsx(w,{className:"skeleton--title",style:{width:`${55+d%4*10}%`}}),e.jsxs("div",{className:"skeleton-meta-row",children:[e.jsx(w,{className:"skeleton--badge"}),e.jsx(w,{className:"skeleton--meta"}),e.jsx(w,{className:"skeleton--meta skeleton--meta-short"})]})]}),e.jsxs("div",{className:"post-stats",children:[e.jsx(w,{className:"skeleton--stat"}),e.jsx(w,{className:"skeleton--stat"})]})]},d))})}function Ne({posts:s,sort:i="latest",loading:d,hasMore:o,canAutoLoad:v,postTotal:N,onLoadMore:m,onSelect:g,restoreScrollTop:l,resetScrollKey:c=0,onScrollTopChange:a,onScrollRestored:r}){const h=t.useRef(null),b=t.useRef(!1),x=de({count:s.length,getScrollElement:()=>h.current,estimateSize:()=>72,overscan:8}),F=o&&!v&&!d,y=!o&&s.length>0&&!d,P=d&&s.length===0,_=d&&s.length>0;return t.useLayoutEffect(()=>{if(c<=0)return;const u=h.current;u&&(u.scrollTop=0,x.scrollToOffset(0)),b.current=!0,a==null||a(0)},[c,x,a]),t.useLayoutEffect(()=>{l==null||b.current||s.length===0||(x.scrollToOffset(l),b.current=!0,r==null||r())},[l,s.length,x,r]),t.useEffect(()=>{b.current=!1},[l]),t.useEffect(()=>{const u=h.current;if(!u)return;const p=()=>{a==null||a(u.scrollTop),u.scrollTop+u.clientHeight>=u.scrollHeight-120&&v&&o&&!d&&m()};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)},[v,o,d,m,a]),e.jsx("div",{className:"post-list-scroll",ref:h,children:P?e.jsx(O,{}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"content-surface",style:{height:x.getTotalSize(),position:"relative"},children:x.getVirtualItems().map(u=>{const p=s[u.index];return e.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${u.start}px)`},children:e.jsx(ve,{post:p,sort:i,onClick:()=>g(p.id)})},p.id)})}),_&&e.jsx(O,{count:2}),F&&e.jsxs("div",{className:"feed-list-footer feed-list-footer--history",children:[e.jsxs("p",{className:"feed-list-footer__hint",children:["已显示 ",s.length," / ",N," 条"]}),e.jsx(se,{type:"button",variant:"outline",size:"sm",onClick:m,children:"加载更多历史"})]}),y&&e.jsx("div",{className:"feed-list-footer feed-list-footer--end",children:"— 已加载全部 —"})]})})}function ge({boardId:s,keyword:i,boards:d,stats:o,postTotal:v}){const N=K(),m=d.find(c=>c.id===s),g=i?`搜索:${i}`:s&&m?m.name:"全部帖子",l=s&&m&&m.description||"";return e.jsxs("div",{className:`feed-head${i?" feed-head--solo":""}`,children:[e.jsxs("div",{className:"feed-head__title",children:[e.jsx("h2",{title:l||void 0,children:g}),!i&&o&&e.jsxs("div",{className:"feed-head__stats",children:[e.jsxs("span",{className:"feed-stat-chip",children:[e.jsx(xe,{"aria-hidden":!0}),"会员 ",e.jsx("strong",{children:o.users})]}),e.jsxs("span",{className:"feed-stat-chip",children:[e.jsx(pe,{"aria-hidden":!0}),"帖子 ",e.jsx("strong",{children:o.posts})]}),e.jsxs("span",{className:"feed-stat-chip",children:[e.jsx(je,{"aria-hidden":!0}),"板块 ",e.jsx("strong",{children:o.boards})]})]})]}),i&&e.jsx("button",{type:"button",className:"feed-head__clear",onClick:()=>N("/"),children:"清除搜索"}),i&&e.jsxs("span",{className:"feed-toolbar__count",children:["共 ",v," 条"]})]})}function Le(){const s=K(),i=Q(),[d]=Z(),o=C(),{limits:v}=te(),N=v.page_size_default,m=v.feed_max_pages,g=v.feed_max_items,l=Number(d.get("board"))||(o==null?void 0:o.boardId)||0,c=d.get("keyword")||"",a=ae(d.get("sort")),r=M(l,c,a),[h,b]=t.useState(()=>(r==null?void 0:r.posts)??[]),[x,F]=t.useState(()=>(r==null?void 0:r.postTotal)??0),[y,P]=t.useState(()=>(r==null?void 0:r.page)??1),[_,u]=t.useState(()=>(r==null?void 0:r.hasMore)??!0),[p,T]=t.useState(()=>!r),[D,z]=t.useState(()=>(r==null?void 0:r.scrollTop)??null),[G,W]=t.useState(0),R=t.useRef((r==null?void 0:r.scrollTop)??0),S=t.useRef(null),$=t.useRef(!1),X=t.useMemo(()=>_&&y{var n;z(null),R.current=0,W(f=>f+1),(n=S.current)==null||n.scrollTo(0)},[]),k=t.useCallback(()=>{$.current=!0,re(),B()},[B]),E=t.useCallback(async(n,f=!1)=>{T(!0);try{const j=await A.posts({page:n,size:N,board_id:l||"",keyword:c,sort:a==="latest"?"":a}),L=Array.isArray(j.posts)?j.posts:[];b(H=>f?L:[...H,...L]),F(j.total??0),u(!!j.has_more),P(n)}catch(j){ne.error(j instanceof Error?j.message:"加载失败"),f&&b([])}finally{T(!1)}},[l,c,a,N]),I=t.useCallback(async()=>{try{const n=await A.posts({page:1,size:N,board_id:l||"",keyword:c,sort:a==="latest"?"":a}),f=Array.isArray(n.posts)?n.posts:[],j=new Set(f.map(L=>L.id));b(L=>[...f,...L.filter(H=>!j.has(H.id))]),F(n.total??0),u(!!n.has_more)}catch{}},[l,c,a,N]),Y=t.useCallback(()=>{p||!_||E(y+1)},[p,_,y,E]);t.useEffect(()=>{var j;if((j=i.state)==null?void 0:j.refreshFeed){k(),E(1,!0);return}const f=M(l,c,a);if(f){b(f.posts),F(f.postTotal),P(f.page),u(f.hasMore),z(f.scrollTop),R.current=f.scrollTop,T(!1),I();return}z(null),R.current=0,E(1,!0)},[l,c,a,i.key,i.state,E,I,k]),t.useEffect(()=>()=>{$.current||h.length===0||oe(l,c,a,{posts:h,postTotal:x,page:y,hasMore:_,scrollTop:R.current})},[l,c,a,h,x,y,_]),t.useEffect(()=>{!p&&h.length>0&&($.current=!1)},[p,h.length]),t.useEffect(()=>{const n=()=>{k()};return window.addEventListener(V,n),()=>window.removeEventListener(V,n)},[k]),t.useEffect(()=>{const n=()=>{k(),E(1,!0)};return window.addEventListener("posts-refresh",n),()=>window.removeEventListener("posts-refresh",n)},[k,E]);const q=n=>{if(n===a){k(),E(1,!0);return}ce(s,ie(l,n))},J=!c;return e.jsx("div",{className:"page-wrap",ref:S,children:e.jsxs("div",{className:"feed-panel",children:[e.jsxs("div",{className:"feed-top",children:[e.jsx(ge,{boardId:l,keyword:c,boards:(o==null?void 0:o.boards)??[],stats:(o==null?void 0:o.stats)??null,postTotal:x}),J&&e.jsx(le,{value:a,onChange:q,postTotal:x})]}),e.jsx(Ne,{posts:h,sort:a,loading:p,hasMore:_,canAutoLoad:X,postTotal:x,onLoadMore:Y,onSelect:n=>s(`/post/${n}`),restoreScrollTop:D,resetScrollKey:G,onScrollTopChange:n=>{R.current=n},onScrollRestored:()=>z(null)})]})})}export{Le as default}; diff --git a/embed_static/static/spa/assets/HomePage-DC4iWqJT.js b/embed_static/static/spa/assets/HomePage-DC4iWqJT.js deleted file mode 100644 index 4a2ca2d..0000000 --- a/embed_static/static/spa/assets/HomePage-DC4iWqJT.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e,r as t,e as O,g as J,i as Q,v as X}from"./react-vendor-1fwFMt02.js";import{S as Z,B as C,u as ee,p as se,g as V,c as te,a as $,n as re,s as ae,F as A,b as ne,d as oe,e as ce}from"./index-CucHNnyZ.js";import{u as le}from"./virtual-vendor-DDSEW9eW.js";import{B as ie}from"./badge-CS5odIe6.js";import{P as de}from"./PinnedIcon-_RgLYKvd.js";import{f as M}from"./content-BrFHUpp8.js";import"./ui-vendor-Gb6mai95.js";function ue({post:s,sort:u="latest",onClick:h}){var g,f,_,c;const o=((f=(g=s.user)==null?void 0:g.nickname)==null?void 0:f[0])||"?",v=u==="reply"?s.last_reply_at?`${M(s.last_reply_at)} 回复`:"暂无回复":M(s.created_at);return e.jsxs("div",{className:"post-row",onClick:h,children:[e.jsx("div",{className:"post-avatar",children:(_=s.user)!=null&&_.avatar?e.jsx("img",{src:s.user.avatar,alt:""}):o}),e.jsxs("div",{className:"post-body",children:[e.jsxs("div",{className:"post-title",children:[s.pinned&&e.jsx(de,{className:"mr-1.5"}),s.title]}),e.jsxs("div",{className:"post-meta",children:[s.board&&e.jsx(ie,{variant:"green",children:s.board.name}),e.jsx("span",{children:((c=s.user)==null?void 0:c.nickname)||"匿名"}),e.jsx("span",{children:v})]})]}),e.jsxs("div",{className:"post-stats",children:[e.jsxs("span",{children:["💬 ",s.comment_count??0]}),e.jsxs("span",{children:["👍 ",s.like_count??0]})]})]})}function fe({posts:s,sort:u="latest",loading:h,hasMore:o,canAutoLoad:v,postTotal:g,onLoadMore:f,onSelect:_,restoreScrollTop:c,resetScrollKey:l=0,onScrollTopChange:n,onScrollRestored:r}){const p=t.useRef(null),b=t.useRef(!1),x=le({count:s.length,getScrollElement:()=>p.current,estimateSize:()=>72,overscan:8}),R=o&&!v&&!h,E=!o&&s.length>0&&!h;return t.useLayoutEffect(()=>{if(l<=0)return;const i=p.current;i&&(i.scrollTop=0,x.scrollToOffset(0)),b.current=!0,n==null||n(0)},[l,x,n]),t.useLayoutEffect(()=>{c==null||b.current||s.length===0||(x.scrollToOffset(c),b.current=!0,r==null||r())},[c,s.length,x,r]),t.useEffect(()=>{b.current=!1},[c]),t.useEffect(()=>{const i=p.current;if(!i)return;const m=()=>{n==null||n(i.scrollTop),i.scrollTop+i.clientHeight>=i.scrollHeight-120&&v&&o&&!h&&f()};return i.addEventListener("scroll",m),()=>i.removeEventListener("scroll",m)},[v,o,h,f,n]),e.jsxs("div",{className:"post-list-scroll",ref:p,children:[e.jsx("div",{className:"content-surface",style:{height:x.getTotalSize(),position:"relative"},children:x.getVirtualItems().map(i=>{const m=s[i.index];return e.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${i.start}px)`},children:e.jsx(ue,{post:m,sort:u,onClick:()=>_(m.id)})},m.id)})}),h&&e.jsx("div",{className:"feed-list-footer",children:e.jsx(Z,{})}),R&&e.jsxs("div",{className:"feed-list-footer feed-list-footer--history",children:[e.jsxs("p",{className:"feed-list-footer__hint",children:["已显示 ",s.length," / ",g," 条"]}),e.jsx(C,{type:"button",variant:"outline",size:"sm",onClick:f,children:"加载更多历史"})]}),E&&e.jsx("div",{className:"feed-list-footer feed-list-footer--end",children:"— 已加载全部 —"})]})}function me({boardId:s,keyword:u,boards:h,stats:o,postTotal:v}){const g=O(),f=h.find(l=>l.id===s),_=u?`搜索:${u}`:s&&f?f.name:"全部帖子",c=s&&f&&f.description||"";return e.jsxs("div",{className:`feed-head${u?" feed-head--solo":""}`,children:[e.jsxs("div",{className:"feed-head__title",children:[e.jsx("h2",{title:c||void 0,children:_}),!u&&o&&e.jsxs("span",{className:"feed-head__meta",children:["会员 ",e.jsx("strong",{children:o.users}),e.jsx("span",{className:"feed-head__dot","aria-hidden":!0,children:"·"}),"帖子 ",e.jsx("strong",{children:o.posts}),e.jsx("span",{className:"feed-head__dot","aria-hidden":!0,children:"·"}),"板块 ",e.jsx("strong",{children:o.boards})]})]}),u&&e.jsx("button",{type:"button",className:"feed-head__clear",onClick:()=>g("/"),children:"清除搜索"}),u&&e.jsxs("span",{className:"feed-toolbar__count",children:["共 ",v," 条"]})]})}function be(){const s=O(),u=J(),[h]=Q(),o=X(),{limits:v}=ee(),g=v.page_size_default,f=v.feed_max_pages,_=v.feed_max_items,c=Number(h.get("board"))||(o==null?void 0:o.boardId)||0,l=h.get("keyword")||"",n=se(h.get("sort")),r=V(c,l,n),[p,b]=t.useState(()=>(r==null?void 0:r.posts)??[]),[x,R]=t.useState(()=>(r==null?void 0:r.postTotal)??0),[E,i]=t.useState(()=>(r==null?void 0:r.page)??1),[m,k]=t.useState(()=>(r==null?void 0:r.hasMore)??!0),[F,z]=t.useState(()=>!r),[K,P]=t.useState(()=>(r==null?void 0:r.scrollTop)??null),[D,U]=t.useState(0),L=t.useRef((r==null?void 0:r.scrollTop)??0),S=t.useRef(null),T=t.useRef(!1),W=t.useMemo(()=>m&&E{var a;P(null),L.current=0,U(d=>d+1),(a=S.current)==null||a.scrollTo(0)},[]),y=t.useCallback(()=>{T.current=!0,te(),B()},[B]),N=t.useCallback(async(a,d=!1)=>{z(!0);try{const j=await $.posts({page:a,size:g,board_id:c||"",keyword:l,sort:n==="latest"?"":n}),w=Array.isArray(j.posts)?j.posts:[];b(H=>d?w:[...H,...w]),R(j.total??0),k(!!j.has_more),i(a)}catch(j){re.error(j instanceof Error?j.message:"加载失败"),d&&b([])}finally{z(!1)}},[c,l,n,g]),I=t.useCallback(async()=>{try{const a=await $.posts({page:1,size:g,board_id:c||"",keyword:l,sort:n==="latest"?"":n}),d=Array.isArray(a.posts)?a.posts:[],j=new Set(d.map(w=>w.id));b(w=>[...d,...w.filter(H=>!j.has(H.id))]),R(a.total??0),k(!!a.has_more)}catch{}},[c,l,n,g]),Y=t.useCallback(()=>{F||!m||N(E+1)},[F,m,E,N]);t.useEffect(()=>{var j;if((j=u.state)==null?void 0:j.refreshFeed){y(),N(1,!0);return}const d=V(c,l,n);if(d){b(d.posts),R(d.postTotal),i(d.page),k(d.hasMore),P(d.scrollTop),L.current=d.scrollTop,z(!1),I();return}P(null),L.current=0,N(1,!0)},[c,l,n,u.key,u.state,N,I,y]),t.useEffect(()=>()=>{T.current||p.length===0||ae(c,l,n,{posts:p,postTotal:x,page:E,hasMore:m,scrollTop:L.current})},[c,l,n,p,x,E,m]),t.useEffect(()=>{!F&&p.length>0&&(T.current=!1)},[F,p.length]),t.useEffect(()=>{const a=()=>{y()};return window.addEventListener(A,a),()=>window.removeEventListener(A,a)},[y]),t.useEffect(()=>{const a=()=>{y(),N(1,!0)};return window.addEventListener("posts-refresh",a),()=>window.removeEventListener("posts-refresh",a)},[y,N]);const q=a=>{if(a===n){y(),N(1,!0);return}oe(s,ce(c,a))},G=!l;return e.jsxs("div",{className:"page-wrap",ref:S,children:[e.jsxs("div",{className:"feed-top",children:[e.jsx(me,{boardId:c,keyword:l,boards:(o==null?void 0:o.boards)??[],stats:(o==null?void 0:o.stats)??null,postTotal:x}),G&&e.jsx(ne,{value:n,onChange:q,postTotal:x})]}),e.jsx(fe,{posts:p,sort:n,loading:F,hasMore:m,canAutoLoad:W,postTotal:x,onLoadMore:Y,onSelect:a=>s(`/post/${a}`),restoreScrollTop:K,resetScrollKey:D,onScrollTopChange:a=>{L.current=a},onScrollRestored:()=>P(null)})]})}export{be as default}; diff --git a/embed_static/static/spa/assets/LoginPage-sbkZASpH.js b/embed_static/static/spa/assets/LoginPage-jlZcJP-F.js similarity index 85% rename from embed_static/static/spa/assets/LoginPage-sbkZASpH.js rename to embed_static/static/spa/assets/LoginPage-jlZcJP-F.js index 9e2168e..bfba60e 100644 --- a/embed_static/static/spa/assets/LoginPage-sbkZASpH.js +++ b/embed_static/static/spa/assets/LoginPage-jlZcJP-F.js @@ -1 +1 @@ -import{e as f,r as g,j as s,L as b}from"./react-vendor-1fwFMt02.js";import{u as w,a as F,F as y,b as t,c as n,d as l,e as c,f as i,o as N,s as m}from"./form-cra7lKcv.js";import{h as v,B as L,a as S,n as d}from"./index-CucHNnyZ.js";import{I as u}from"./input-DOedlbiC.js";import"./ui-vendor-Gb6mai95.js";const C=N({username:m().min(1,"请输入用户名"),password:m().min(1,"请输入密码")});function z(){const x=f(),{refresh:p}=v(),[h,a]=g.useState(!1),r=w({resolver:F(C),defaultValues:{username:"",password:""}}),j=async e=>{a(!0);try{await S.login(e.username,e.password),await p(),d.success("登录成功"),x("/",{replace:!0})}catch(o){d.error(o instanceof Error?o.message:"登录失败")}finally{a(!1)}};return s.jsx("div",{className:"auth-page",children:s.jsxs("div",{className:"auth-box",children:[s.jsx("div",{className:"logo-mark",children:"姜"}),s.jsx("h1",{children:"登录姜十三论坛"}),s.jsx("p",{className:"subtitle",children:"拾三一隅,自在交流"}),s.jsx(y,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(j),className:"space-y-4",children:[s.jsx(t,{control:r.control,name:"username",render:({field:e})=>s.jsxs(n,{children:[s.jsx(l,{children:"用户名"}),s.jsx(c,{children:s.jsx(u,{placeholder:"用户名",autoComplete:"username",...e})}),s.jsx(i,{})]})}),s.jsx(t,{control:r.control,name:"password",render:({field:e})=>s.jsxs(n,{children:[s.jsx(l,{children:"密码"}),s.jsx(c,{children:s.jsx(u,{type:"password",placeholder:"密码",autoComplete:"current-password",...e})}),s.jsx(i,{})]})}),s.jsx(L,{type:"submit",className:"w-full",loading:h,children:"登录"})]})}),s.jsxs("p",{style:{textAlign:"center",marginTop:16,fontSize:13,color:"var(--color-text-3)"},children:["没有账号?",s.jsx(b,{to:"/register",children:"注册"})]})]})})}export{z as default}; +import{e as f,r as g,j as s,L as b}from"./react-vendor-BdyZmpPe.js";import{u as w,a as F,F as y,b as t,c as n,d as l,e as c,f as i,o as N,s as m}from"./form-DggfNWHU.js";import{h as v,B as L,b as S,n as d}from"./index-Cp7Ff9NP.js";import{I as u}from"./input-y6vZyHhN.js";import"./ui-vendor-B26O8baZ.js";const C=N({username:m().min(1,"请输入用户名"),password:m().min(1,"请输入密码")});function z(){const x=f(),{refresh:p}=v(),[h,a]=g.useState(!1),r=w({resolver:F(C),defaultValues:{username:"",password:""}}),j=async e=>{a(!0);try{await S.login(e.username,e.password),await p(),d.success("登录成功"),x("/",{replace:!0})}catch(o){d.error(o instanceof Error?o.message:"登录失败")}finally{a(!1)}};return s.jsx("div",{className:"auth-page",children:s.jsxs("div",{className:"auth-box",children:[s.jsx("div",{className:"logo-mark",children:"姜"}),s.jsx("h1",{children:"登录姜十三论坛"}),s.jsx("p",{className:"subtitle",children:"拾三一隅,自在交流"}),s.jsx(y,{...r,children:s.jsxs("form",{onSubmit:r.handleSubmit(j),className:"space-y-4",children:[s.jsx(t,{control:r.control,name:"username",render:({field:e})=>s.jsxs(n,{children:[s.jsx(l,{children:"用户名"}),s.jsx(c,{children:s.jsx(u,{placeholder:"用户名",autoComplete:"username",...e})}),s.jsx(i,{})]})}),s.jsx(t,{control:r.control,name:"password",render:({field:e})=>s.jsxs(n,{children:[s.jsx(l,{children:"密码"}),s.jsx(c,{children:s.jsx(u,{type:"password",placeholder:"密码",autoComplete:"current-password",...e})}),s.jsx(i,{})]})}),s.jsx(L,{type:"submit",className:"w-full",loading:h,children:"登录"})]})}),s.jsxs("p",{style:{textAlign:"center",marginTop:16,fontSize:13,color:"var(--color-text-3)"},children:["没有账号?",s.jsx(b,{to:"/register",children:"注册"})]})]})})}export{z as default}; diff --git a/embed_static/static/spa/assets/PinnedIcon-Dc0ZpCCq.js b/embed_static/static/spa/assets/PinnedIcon-Dc0ZpCCq.js new file mode 100644 index 0000000..5784f23 --- /dev/null +++ b/embed_static/static/spa/assets/PinnedIcon-Dc0ZpCCq.js @@ -0,0 +1 @@ +import{j as r}from"./react-vendor-BdyZmpPe.js";import{i as s,c as e}from"./index-Cp7Ff9NP.js";import{ac as i}from"./ui-vendor-B26O8baZ.js";function d({board:a,className:n}){const o=s(a);return r.jsx("span",{className:e("board-badge",`board-badge--${o}`,n),children:a.name})}function l({className:a,size:n=16}){return r.jsx(i,{className:e("post-pinned-icon",a),size:n,fill:"currentColor","aria-label":"置顶",role:"img"})}export{d as B,l as P}; diff --git a/embed_static/static/spa/assets/PinnedIcon-_RgLYKvd.js b/embed_static/static/spa/assets/PinnedIcon-_RgLYKvd.js deleted file mode 100644 index c682cfe..0000000 --- a/embed_static/static/spa/assets/PinnedIcon-_RgLYKvd.js +++ /dev/null @@ -1 +0,0 @@ -import{j as n}from"./react-vendor-1fwFMt02.js";import{f as i}from"./index-CucHNnyZ.js";import{N as s}from"./ui-vendor-Gb6mai95.js";function m({className:o,size:r=16}){return n.jsx(s,{className:i("post-pinned-icon",o),size:r,fill:"currentColor","aria-label":"置顶",role:"img"})}export{m as P}; diff --git a/embed_static/static/spa/assets/PostDetailPage-BjTvWYTM.js b/embed_static/static/spa/assets/PostDetailPage-BjTvWYTM.js deleted file mode 100644 index b8a8c00..0000000 --- a/embed_static/static/spa/assets/PostDetailPage-BjTvWYTM.js +++ /dev/null @@ -1,14 +0,0 @@ -import{j as t,r as m,e as je,w as qe}from"./react-vendor-1fwFMt02.js";import{P as He}from"./PinnedIcon-_RgLYKvd.js";import{f as le,a as z,n as E,S as Ne,h as Ue,B as T,c as Je}from"./index-CucHNnyZ.js";import{B as re}from"./badge-CS5odIe6.js";import{h as Ve,a as Y,i as Xe}from"./content-BrFHUpp8.js";import{i as Ze,X as be,s as Qe,v as we,w as Ke,x as et,y as Ce,G as tt,r as st,z as nt,B as it,D as at,A as ot,E as ce,J as lt,j as rt,K as ct,N as dt}from"./ui-vendor-Gb6mai95.js";import{r as ut,P as mt}from"./postContent-ClrHK1rL.js";import{p as ft}from"./purify-vendor-Cx4rtWv4.js";function ht({content:n,onMentionClick:e}){return t.jsx("div",{className:"floor-body",dangerouslySetInnerHTML:{__html:Ve(n)}})}function q(n){var e;return(e=n.user)!=null&&e.nickname?n.user.nickname:n.guest_nick?n.guest_nick:"游客"}function vt(n){return q(n)[0]||"?"}function xt(n){return!n.user_id||n.user_id===0}function gt(n){const e=new Map,s=[];for(const i of n)e.set(i.id,{comment:i,children:[]});for(const i of n){const o=e.get(i.id);i.reply_to&&e.has(i.reply_to)?e.get(i.reply_to).children.push(o):s.push(o)}return s}function pt(n){const e=new Date(n),s=new Date,i=o=>String(o).padStart(2,"0");return e.getFullYear()===s.getFullYear()?`${i(e.getMonth()+1)}月${i(e.getDate())}日`:`${e.getFullYear()}年${e.getMonth()+1}月${e.getDate()}日`}function ke({node:n,nested:e,highlightFloor:s,replyToId:i,onReply:o,onCancelReply:a,renderReplyBox:l}){var v,b;const r=n.comment,d=q(r),f=xt(r),h=s===r.floor,w=!!r.content_hidden,C=i===r.id;return t.jsxs("div",{id:`floor-${r.floor}`,className:`waline-comment ${e?"nested":""} ${h?"highlight":""}`,children:[t.jsx("div",{className:`waline-comment-avatar ${f&&!((v=r.user)!=null&&v.avatar)?"guest":""}`,children:(b=r.user)!=null&&b.avatar?t.jsx("img",{src:r.user.avatar,alt:""}):vt(r)}),t.jsxs("div",{className:"waline-comment-main",children:[t.jsx("div",{className:"waline-comment-head",children:r.guest_url?t.jsx("a",{href:r.guest_url,target:"_blank",rel:"noopener noreferrer",className:"waline-comment-author",children:d}):t.jsx("span",{className:"waline-comment-author",children:d})}),w?t.jsx("div",{className:"waline-comment-private-mask",children:"该评论为私密评论,仅文章作者与评论发起者可见!"}):t.jsxs("div",{className:"waline-comment-bubble",children:[r.reply_target&&t.jsxs("span",{className:"waline-reply-at",children:["@",q(r.reply_target)]}),t.jsx(ht,{content:r.content})]}),t.jsxs("div",{className:"waline-comment-meta",children:[t.jsxs("span",{className:"waline-comment-date",children:[t.jsx(Ze,{size:14}),pt(r.created_at)]}),C?t.jsxs("button",{type:"button",className:"waline-comment-reply-btn cancel",onClick:a,children:[t.jsx(be,{size:14}),"取消"]}):t.jsxs("button",{type:"button",className:"waline-comment-reply-btn",onClick:()=>o(r),children:[t.jsx(Qe,{size:14}),"回复"]})]}),C&&l&&t.jsx("div",{id:`reply-box-${r.id}`,className:"comment-box-wrap inline",children:l(r)}),n.children.length>0&&t.jsx("div",{className:"waline-replies",children:n.children.map(S=>t.jsx(ke,{node:S,nested:!0,highlightFloor:s,replyToId:i,onReply:o,onCancelReply:a,renderReplyBox:l},S.comment.id))})]})]})}function jt({comments:n,highlightFloor:e,replyToId:s,onReply:i,onCancelReply:o,renderReplyBox:a}){const l=gt(n);return t.jsx("div",{className:"comment-thread-list",children:l.map(r=>t.jsx(ke,{node:r,highlightFloor:e,replyToId:s,onReply:i,onCancelReply:o,renderReplyBox:a},r.comment.id))})}const ye=m.forwardRef(({className:n,...e},s)=>t.jsx(we,{className:le("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--j13-green)] data-[state=unchecked]:bg-input",n),...e,ref:s,children:t.jsx(Ke,{className:le("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ye.displayName=we.displayName;const Nt=["😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","🥰","😗","😙","😚","🙂","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","🥱","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","🙁","😖","😞","😟","😤","😢","😭","😦","😧","😨","😩","🤯","😬","😰","😱","🥵","🥶","😳","🤪","😵","🥴","😠","😡","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🥳","🥺","🤠","🤡","🤥","🤫","🤭","🧐","🤓","😈","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👋","🤚","🖐","✋","🖖","👌","🤏","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🤝","🙏","💪","🦾","🦿","🦵","🦶","❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✨","⭐","🌟","💫","🔥","💥","💯","✅","❌","❓","❗","💢","💤","💦","🎉","🎊","🎁","🏆","🥇","🥈"];function bt({onSelect:n}){return t.jsx("div",{className:"emoji-picker",children:Nt.map(e=>t.jsx("button",{type:"button",className:"emoji-picker-item",onClick:()=>n(e),children:e},e))})}const Se="j13_guest_nick",Ee="j13_guest_email",_e="j13_guest_url",Pe="j13_my_comment_ids";function wt(){return{nick:localStorage.getItem(Se)||"",email:localStorage.getItem(Ee)||"",url:localStorage.getItem(_e)||""}}function Ct(n){localStorage.setItem(Se,n.nick),localStorage.setItem(Ee,n.email),localStorage.setItem(_e,n.url)}function Ie(){try{const n=localStorage.getItem(Pe);if(!n)return[];const e=JSON.parse(n);return Array.isArray(e)?e.filter(s=>typeof s=="number"):[]}catch{return[]}}function kt(n){const e=Ie();e.includes(n)||(e.push(n),localStorage.setItem(Pe,JSON.stringify(e.slice(-200))))}function de({user:n,replyTo:e,inline:s,submitting:i,submitCount:o=0,onSubmit:a,onCancelReply:l}){var A;const r=wt(),[d,f]=m.useState(""),[h,w]=m.useState(r.nick),[C,v]=m.useState(r.email),[b,S]=m.useState(r.url),[p,k]=m.useState(!1),[x,u]=m.useState(!1),j=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{var g;s&&e&&((g=j.current)==null||g.focus({preventScroll:!0}))},[e==null?void 0:e.id,s]),m.useEffect(()=>{f(""),u(!1),k(!1)},[o]),m.useEffect(()=>{if(!x)return;const g=_=>{y.current&&!y.current.contains(_.target)&&u(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[x]);const P=g=>{const _=j.current;if(_){const D=_.selectionStart??d.length,F=_.selectionEnd??d.length,O=d.slice(0,D)+g+d.slice(F);f(O),requestAnimationFrame(()=>{_.focus();const B=D+g.length;_.setSelectionRange(B,B)})}else f(D=>D+g)},I=()=>{const g=d.trim();g&&(!n&&!h.trim()||(n||Ct({nick:h.trim(),email:C.trim(),url:b.trim()}),a({content:g,guestNick:n?void 0:h.trim(),guestEmail:n?void 0:C.trim(),guestUrl:n?void 0:b.trim(),isPrivate:p})))},L=g=>{g.key==="Enter"&&(g.ctrlKey||g.metaKey)&&(g.preventDefault(),I())},R=((A=n==null?void 0:n.nickname)==null?void 0:A[0])||(h==null?void 0:h[0])||"?";return t.jsxs("div",{className:"comment-box",ref:y,children:[t.jsx("div",{className:"comment-box-avatar",children:n!=null&&n.avatar?t.jsx("img",{src:n.avatar,alt:"",className:"comment-box-avatar-img"}):t.jsx("div",{className:`comment-box-avatar-placeholder ${n?"":"guest"}`,children:n?R:t.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",children:t.jsx("path",{d:"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"})})})}),t.jsxs("div",{className:"comment-box-main",children:[e&&!s&&t.jsxs("div",{className:"comment-box-reply-hint",children:[t.jsxs("span",{children:["回复 #",e.floor," ",q(e)]}),l&&t.jsx("button",{type:"button",className:"comment-box-reply-cancel",onClick:l,children:"取消"})]}),t.jsxs("div",{className:`comment-box-input-wrap ${p?"private-mode":""}`,children:[t.jsx("textarea",{ref:j,className:"comment-box-textarea",placeholder:p?"正在隐私评论中...":"说点什么吧",value:d,onChange:g=>f(g.target.value),onKeyDown:L,rows:3}),t.jsx("button",{type:"button",className:"comment-box-send",disabled:i||!d.trim()||!n&&!h.trim(),onClick:I,title:"发送",children:t.jsx(et,{size:16})})]}),!n&&t.jsxs("div",{className:"comment-box-guest-fields",children:[t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["昵称",t.jsx("em",{className:"comment-box-guest-required",children:"必填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"怎么称呼你",autoComplete:"nickname",value:h,onChange:g=>w(g.target.value)})]}),t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["邮箱",t.jsx("em",{className:"comment-box-guest-optional",children:"选填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"name@example.com",type:"email",autoComplete:"email",value:C,onChange:g=>v(g.target.value)})]}),t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["网址",t.jsx("em",{className:"comment-box-guest-optional",children:"选填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"https://example.com",type:"url",autoComplete:"url",value:b,onChange:g=>S(g.target.value)})]}),t.jsx("p",{className:"comment-box-guest-hint",children:"邮箱不会公开展示,仅用于站内记录。"})]}),t.jsxs("div",{className:"comment-box-toolbar",children:[t.jsx("button",{type:"button",className:`comment-box-owo ${x?"active":""}`,onClick:()=>u(g=>!g),children:"OwO"}),t.jsxs("label",{className:"comment-box-private",children:[t.jsx(ye,{checked:p,onCheckedChange:k}),t.jsx("span",{children:"隐私评论"})]})]}),x&&t.jsx(bt,{onSelect:P})]})]})}function J({html:n,isLoggedIn:e,className:s="post-detail-content"}){const i=je(),o=m.useMemo(()=>ut(n,e),[n,e]),a=m.useCallback(l=>{const r=l.target;if(r.closest("[data-members-login]")){l.preventDefault(),i("/login");return}r.closest("[data-members-register]")&&(l.preventDefault(),i("/register"))},[i]);return t.jsx("div",{className:s,onClick:a,dangerouslySetInnerHTML:{__html:o}})}class Le{diff(e,s,i={}){let o;typeof i=="function"?(o=i,i={}):"callback"in i&&(o=i.callback);const a=this.castInput(e,i),l=this.castInput(s,i),r=this.removeEmpty(this.tokenize(a,i)),d=this.removeEmpty(this.tokenize(l,i));return this.diffWithOptionsObj(r,d,i,o)}diffWithOptionsObj(e,s,i,o){var a;const l=x=>{if(x=this.postProcess(x,i),o){setTimeout(function(){o(x)},0);return}else return x},r=s.length,d=e.length;let f=1,h=r+d;i.maxEditLength!=null&&(h=Math.min(h,i.maxEditLength));const w=(a=i.timeout)!==null&&a!==void 0?a:1/0,C=Date.now()+w,v=[{oldPos:-1,lastComponent:void 0}];let b=this.extractCommon(v[0],s,e,0,i);if(v[0].oldPos+1>=d&&b+1>=r)return l(this.buildValues(v[0].lastComponent,s,e));let S=-1/0,p=1/0;const k=()=>{for(let x=Math.max(S,-f);x<=Math.min(p,f);x+=2){let u;const j=v[x-1],y=v[x+1];j&&(v[x-1]=void 0);let P=!1;if(y){const L=y.oldPos-x;P=y&&0<=L&&L=d&&b+1>=r)return l(this.buildValues(u.lastComponent,s,e))||!0;v[x]=u,u.oldPos+1>=d&&(p=Math.min(p,x-1)),b+1>=r&&(S=Math.max(S,x+1))}f++};if(o)(function x(){setTimeout(function(){if(f>h||Date.now()>C)return o(void 0);k()||x()},0)})();else for(;f<=h&&Date.now()<=C;){const x=k();if(x)return x}}addToPath(e,s,i,o,a){const l=e.lastComponent;return l&&!a.oneChangePerToken&&l.added===s&&l.removed===i?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:s,removed:i,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:s,removed:i,previousComponent:l}}}extractCommon(e,s,i,o,a){const l=s.length,r=i.length;let d=e.oldPos,f=d-o,h=0;for(;f+1C.length?b:C}),h.value=this.join(w)}else h.value=this.join(s.slice(d,d+h.count));d+=h.count,h.added||(f+=h.count)}}return o}}function ue(n,e){let s;for(s=0;se.length&&(s=n.length-e.length);let i=e.length;n.length0&&e[l]!=e[a];)a=o[a];e[l]==e[a]&&a++}a=0;for(let l=s;l0&&n[l]!=e[a];)a=o[a];n[l]==e[a]&&a++}return a}function Te(n,e){const s=[];for(const i of Array.from(e.segment(n))){const o=i.segment;s.length&&/\s/.test(s[s.length-1])&&/\s/.test(o)?s[s.length-1]+=o:s.push(o)}return s}function Z(n,e){if(e)return $(n,e)[1];let s;for(s=n.length-1;s>=0&&n[s].match(/\s/);s--);return n.substring(s+1)}function W(n,e){if(e)return $(n,e)[0];const s=n.match(/^\s*/);return s?s[0]:""}function $(n,e){if(!e)return[W(n),Z(n)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');const s=Te(n,e),i=s[0],o=s[s.length-1],a=/\s/.test(i)?i:"",l=/\s/.test(o)?o:"";return[a,l]}const he="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",St=new RegExp(`[${he}]+|\\s+|[^${he}]`,"ug");class Et extends Le{equals(e,s,i){return i.ignoreCase&&(e=e.toLowerCase(),s=s.toLowerCase()),e.trim()===s.trim()}tokenize(e,s={}){let i;if(s.intlSegmenter){const l=s.intlSegmenter;if(l.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Te(e,l)}else i=e.match(St)||[];const o=[];let a=null;return i.forEach(l=>{/\s/.test(l)?a==null?o.push(l):o.push(o.pop()+l):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+l):o.push(a+l):o.push(l),a=l}),o}join(e){return e.map((s,i)=>i==0?s:s.replace(/^\s+/,"")).join("")}postProcess(e,s){if(!e||s.oneChangePerToken)return e;let i=null,o=null,a=null;return e.forEach(l=>{l.added?o=l:l.removed?a=l:((o||a)&&ve(i,a,o,l,s.intlSegmenter),i=l,o=null,a=null)}),(o||a)&&ve(i,a,o,null,s.intlSegmenter),e}}const _t=new Et;function Pt(n,e,s){return _t.diff(n,e,s)}function ve(n,e,s,i,o){if(e&&s){const[a,l]=$(e.value,o),[r,d]=$(s.value,o);if(n){const f=ue(a,r);n.value=X(n.value,r,f),e.value=M(e.value,f),s.value=M(s.value,f)}if(i){const f=me(l,d);i.value=V(i.value,d,f),e.value=G(e.value,f),s.value=G(s.value,f)}}else if(s){if(n){const a=W(s.value,o);s.value=s.value.substring(a.length)}if(i){const a=W(i.value,o);i.value=i.value.substring(a.length)}}else if(n&&i){const a=W(i.value,o),[l,r]=$(e.value,o),d=ue(a,l);e.value=M(e.value,d);const f=me(M(a,d),r);e.value=G(e.value,f),i.value=V(i.value,a,f),n.value=X(n.value,a,a.slice(0,a.length-f.length))}else if(i){const a=W(i.value,o),l=Z(e.value,o),r=fe(l,a);e.value=G(e.value,r)}else if(n){const a=Z(n.value,o),l=W(e.value,o),r=fe(a,l);e.value=M(e.value,r)}}class It extends Le{constructor(){super(...arguments),this.tokenize=zt}equals(e,s,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` -`))&&(e=e.trim()),(!i.newlineIsToken||!s.includes(` -`))&&(s=s.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` -`)&&(e=e.slice(0,-1)),s.endsWith(` -`)&&(s=s.slice(0,-1))),super.equals(e,s,i)}}const Lt=new It;function Tt(n,e,s){return Lt.diff(n,e,s)}function zt(n,e){e.stripTrailingCr&&(n=n.replace(/\r\n/g,` -`));const s=[],i=n.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let o=0;oi.replaceWith(` -`)),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, blockquote, pre, members-only").forEach(i=>{i.prepend(e.createTextNode(` -`)),i.append(e.createTextNode(` -`))}),(e.body.textContent??"").replace(/\r\n/g,` -`).replace(/\n{3,}/g,` - -`).trim()}function Dt(n,e){const s=n.title.trim()!==e.title.trim(),i=xe(n.tags)!==xe(e.tags),o=H(n.content)!==H(e.content);return{titleChanged:s,tagsChanged:i,contentChanged:o,hasChanges:s||i||o}}function xe(n){return n.split(/[,,]/).map(e=>e.trim()).filter(Boolean).join(",")}function Wt(n,e){return Tt(n||"",e||"")}function Mt(n,e){return Pt(n||"",e||"")}function $t(n){let e=0,s=0;for(const i of n){const o=i.value.split(` -`).filter(a=>a.length>0);i.added?e+=o.length:i.removed&&(s+=o.length)}return{added:e,removed:s}}function ge({before:n,after:e}){const s=Mt(n,e);return n===e?t.jsx("span",{className:"revision-diff-unchanged",children:n||"(空)"}):t.jsx("span",{className:"revision-diff-inline",children:s.map((i,o)=>i.added?t.jsx("ins",{children:i.value},o):i.removed?t.jsx("del",{children:i.value},o):t.jsx("span",{children:i.value},o))})}function Rt({before:n,after:e}){const s=Wt(n,e),{added:i,removed:o}=$t(s);return n===e?t.jsx("p",{className:"revision-diff-unchanged",children:"正文无变化"}):t.jsxs("div",{className:"revision-diff-lines",children:[t.jsxs("div",{className:"revision-diff-stats",children:[o>0&&t.jsxs("span",{className:"revision-diff-stat revision-diff-stat--del",children:["删除 ",o," 行"]}),i>0&&t.jsxs("span",{className:"revision-diff-stat revision-diff-stat--add",children:["新增 ",i," 行"]})]}),t.jsx("pre",{className:"revision-diff-pre",children:s.map((a,l)=>{const r=a.value.split(` -`);return r.map((d,f)=>{if(f===r.length-1&&d==="")return null;const h=a.added?"revision-diff-line revision-diff-line--add":a.removed?"revision-diff-line revision-diff-line--del":"revision-diff-line revision-diff-line--same",w=a.added?"+":a.removed?"−":" ";return t.jsxs("div",{className:h,children:[t.jsx("span",{className:"revision-diff-gutter","aria-hidden":"true",children:w}),t.jsx("span",{className:"revision-diff-text",children:d||" "})]},`${l}-${f}`)})})})]})}function pe({summary:n}){return n.hasChanges?t.jsxs(t.Fragment,{children:[n.titleChanged&&t.jsx("span",{className:"revision-badge",children:"标题"}),n.contentChanged&&t.jsx("span",{className:"revision-badge",children:"正文"}),n.tagsChanged&&t.jsx("span",{className:"revision-badge",children:"标签"})]}):t.jsx("span",{className:"revision-badge revision-badge--none",children:"无变更"})}function At({postId:n,currentPost:e,open:s,onClose:i,isLoggedIn:o}){var x;const[a,l]=m.useState([]),[r,d]=m.useState(null),[f,h]=m.useState(!1),[w,C]=m.useState("diff"),[v,b]=m.useState(!1);m.useEffect(()=>{if(!s){d(null),C("diff"),b(!1);return}h(!0),z.postRevisions(n).then(u=>{const j=u.revisions??[];l(j),j.length>0&&d(j[0].id)}).catch(u=>E.error(u instanceof Error?u.message:"加载历史失败")).finally(()=>h(!1))},[s,n]),m.useEffect(()=>{if(!s)return;const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);const S=m.useMemo(()=>a.map((u,j)=>{const y=j===0?e:{title:a[j-1].title,content:a[j-1].content,tags:a[j-1].tags},P={title:u.title,content:u.content,tags:u.tags};return{rev:u,after:y,summary:Dt(P,y),index:a.length-j}}),[a,e]),p=S.find(u=>u.rev.id===r)??null;if(!s)return null;const k=p?{title:p.rev.title,content:p.rev.content,tags:p.rev.tags}:null;return t.jsx("div",{className:`post-revision-overlay${v?" post-revision-overlay--fullscreen":""}`,onClick:i,children:t.jsxs("div",{className:`post-revision-panel${v?" post-revision-panel--fullscreen":""}`,onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"编辑历史",children:[t.jsxs("header",{className:"post-revision-head",children:[t.jsxs("div",{className:"post-revision-head-left",children:[t.jsx(Ce,{size:18}),t.jsx("h3",{children:"编辑历史"}),p&&t.jsxs("span",{className:"post-revision-head-sub",children:["第 ",p.index," 次编辑"]})]}),t.jsxs("div",{className:"post-revision-head-actions",children:[t.jsx("div",{className:"post-revision-view-tabs",role:"tablist",children:[["diff",tt,"变更对比"],["before",st,"编辑前"],["after",nt,"编辑后"]].map(([u,j,y])=>t.jsxs("button",{type:"button",role:"tab","aria-selected":w===u,className:`post-revision-tab${w===u?" active":""}`,onClick:()=>C(u),children:[t.jsx(j,{size:14}),t.jsx("span",{className:"post-revision-tab-label",children:y})]},u))}),t.jsx("button",{type:"button",className:"post-revision-icon-btn",onClick:()=>b(u=>!u),title:v?"退出全屏":"全屏显示","aria-label":v?"退出全屏":"全屏显示",children:v?t.jsx(it,{size:18}):t.jsx(at,{size:18})}),t.jsx("button",{type:"button",className:"post-revision-icon-btn",onClick:i,"aria-label":"关闭",children:t.jsx(be,{size:18})})]})]}),f?t.jsx("div",{className:"post-revision-loading",children:t.jsx(Ne,{size:"lg"})}):S.length===0?t.jsx("p",{className:"post-revision-empty",children:"暂无编辑记录"}):t.jsxs("div",{className:"post-revision-body",children:[t.jsxs("aside",{className:"post-revision-sidebar",children:[t.jsx("div",{className:"post-revision-sidebar-label",children:"时间线"}),t.jsx("ul",{className:"post-revision-list",children:S.map(u=>{var j;return t.jsx("li",{children:t.jsxs("button",{type:"button",className:`post-revision-item${r===u.rev.id?" active":""}`,onClick:()=>d(u.rev.id),children:[t.jsxs("div",{className:"post-revision-item-head",children:[t.jsxs("span",{className:"post-revision-item-num",children:["#",u.index]}),t.jsx(pe,{summary:u.summary})]}),t.jsx("span",{className:"post-revision-item-title",children:u.rev.title}),t.jsxs("span",{className:"post-revision-item-meta",children:[((j=u.rev.editor)==null?void 0:j.nickname)??"未知"," · ",Y(u.rev.created_at)]})]})},u.rev.id)})}),t.jsxs("div",{className:"post-revision-current",children:[t.jsx("span",{className:"post-revision-current-label",children:"当前版本"}),t.jsx("span",{className:"post-revision-current-title",children:e.title})]})]}),t.jsx("main",{className:"post-revision-main",children:p&&k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"post-revision-main-head",children:[t.jsxs("div",{children:[t.jsx("span",{className:"post-revision-main-editor",children:((x=p.rev.editor)==null?void 0:x.nickname)??"未知"}),t.jsx("span",{className:"post-revision-main-time",children:Y(p.rev.created_at)})]}),t.jsx(pe,{summary:p.summary})]}),t.jsxs("div",{className:"post-revision-scroll",children:[w==="diff"&&t.jsxs("div",{className:"revision-diff-view",children:[t.jsxs("section",{className:"revision-diff-section",children:[t.jsx("h4",{children:"标题"}),t.jsx("div",{className:"revision-diff-block",children:t.jsx(ge,{before:k.title,after:p.after.title})})]}),(k.tags||p.after.tags)&&t.jsxs("section",{className:"revision-diff-section",children:[t.jsx("h4",{children:"标签"}),t.jsx("div",{className:"revision-diff-block",children:t.jsx(ge,{before:k.tags||"(无)",after:p.after.tags||"(无)"})})]}),t.jsxs("section",{className:"revision-diff-section revision-diff-section--content",children:[t.jsx("h4",{children:"正文"}),t.jsx(Rt,{before:H(k.content),after:H(p.after.content)})]})]}),w==="before"&&t.jsxs("div",{className:"revision-full-view",children:[t.jsx("h4",{children:k.title}),k.tags&&t.jsxs("p",{className:"revision-full-tags",children:["标签:",k.tags]}),t.jsx(J,{html:k.content,isLoggedIn:o})]}),w==="after"&&t.jsxs("div",{className:"revision-full-view",children:[t.jsx("h4",{children:p.after.title}),p.after.tags&&t.jsxs("p",{className:"revision-full-tags",children:["标签:",p.after.tags]}),t.jsx(J,{html:p.after.content,isLoggedIn:o})]})]})]}):t.jsx("div",{className:"post-revision-empty",children:"请从左侧选择一次编辑记录"})})]})]})})}function Ft(n,e){const{overflowY:s}=getComputedStyle(n);return s!=="auto"&&s!=="scroll"&&s!=="overlay"||n.scrollHeight<=n.clientHeight+1?!1:e<0?n.scrollTop>0:n.scrollTop+n.clientHeight{if(!e)return;const s=n.current;if(!s)return;const i=s.closest(".app-shell");if(!i)return;const o=a=>{if(a.ctrlKey||a.metaKey)return;const l=a.target instanceof HTMLElement?a.target:null;if(!l)return;const r=Ot(l,a.deltaY,i);if(r&&r!==s&&s.contains(r)||r===s)return;const d=s.scrollTop;s.scrollTop+=a.deltaY,s.scrollTop!==d&&a.preventDefault()};return i.addEventListener("wheel",o,{passive:!1}),()=>i.removeEventListener("wheel",o)},[n,e])}function Qt(){var se,ne,ie,ae,oe;const{id:n}=qe(),e=Number(n),s=je(),{user:i,refresh:o}=Ue(),[a,l]=m.useState(null),[r,d]=m.useState([]),[f,h]=m.useState(!1),[w,C]=m.useState(!1),[v,b]=m.useState(null),[S,p]=m.useState(!1),[k,x]=m.useState(!0),[u,j]=m.useState(null),[y,P]=m.useState(0),[I,L]=m.useState(!1),[R,A]=m.useState(!1),[g,_]=m.useState(""),[D,F]=m.useState(!1),O=m.useRef(null),B=m.useRef(null),ze=m.useRef(null),U=m.useRef();Bt(O,!k&&!!a);const Q=m.useCallback(async()=>{const c=i?[]:Ie(),N=await z.comments(e,c);return Array.isArray(N.comments)?N.comments:[]},[e,i]),De=async()=>{if(e){x(!0);try{const[c,N]=await Promise.all([z.post(e),Q()]);l(c.post),h(c.liked),C(c.favorited),L(c.can_edit??!1),A(c.is_edited??Xe(c.post.created_at,c.post.updated_at??c.post.created_at)),_(c.edit_block_reason??""),d(N),await o()}catch(c){E.error(c instanceof Error?c.message:"加载失败")}finally{x(!1)}}};m.useEffect(()=>{b(null),De()},[e]);const We=m.useCallback(c=>{const N=document.getElementById(`floor-${c}`);N&&(N.scrollIntoView({behavior:"smooth",block:"center"}),j(c),clearTimeout(U.current),U.current=setTimeout(()=>j(null),2e3))},[]),Me=c=>{if((v==null?void 0:v.id)===c.id){b(null);return}b(c)};m.useLayoutEffect(()=>{if(!v)return;const c=document.getElementById(`reply-box-${v.id}`);c==null||c.scrollIntoView({behavior:"smooth",block:"nearest"})},[v==null?void 0:v.id]),m.useEffect(()=>()=>clearTimeout(U.current),[]);const $e=async()=>{if(!i){s("/login");return}try{const c=await z.like(e);h(c.liked),l(N=>N&&{...N,like_count:c.like_count})}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},Re=async()=>{if(!i){s("/login");return}try{const c=await z.favorite(e);C(c.favorited),E.success(c.favorited?"已收藏":"已取消收藏")}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},K={user:i,submitting:S,submitCount:y,onSubmit:async c=>{p(!0);try{const N=await z.addComment(e,{content:c.content,replyTo:v==null?void 0:v.id,guestNick:c.guestNick,guestEmail:c.guestEmail,guestUrl:c.guestUrl,isPrivate:c.isPrivate});i||kt(N.id),b(null),P(Ye=>Ye+1),E.success("评论成功"),d(await Q()),setTimeout(()=>We(N.floor),100)}catch(N){E.error(N instanceof Error?N.message:"评论失败")}finally{p(!1)}},onCancelReply:()=>b(null)};if(k)return t.jsx("div",{className:"post-detail-loading flex justify-center py-16",children:t.jsx(Ne,{size:"lg"})});if(!a)return t.jsxs("div",{className:"empty-state",children:[t.jsx("p",{children:"帖子不存在"}),t.jsx(T,{variant:"outline",onClick:()=>s("/"),children:"返回首页"})]});const Ae=((ne=(se=a.user)==null?void 0:se.nickname)==null?void 0:ne[0])||"?",ee=((ie=a.tags)==null?void 0:ie.split(/[,,]/).map(c=>c.trim()).filter(Boolean))??[],te=i&&(i.role==="admin"||i.id===a.user_id),Fe=(i==null?void 0:i.role)==="admin",Oe=R&&a.updated_at,Be=async()=>{if(a)try{const c=await z.adminPinPost(e,!a.pinned);l(N=>N&&{...N,pinned:c.pinned}),Je(),window.dispatchEvent(new Event("posts-refresh")),E.success(c.message)}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},Ge=async()=>{if(a)try{const c=await z.adminLockPost(e,!a.edit_locked);l(N=>N&&{...N,edit_locked:c.edit_locked}),(i==null?void 0:i.role)==="admin"?L(!0):(i==null?void 0:i.id)===a.user_id&&c.edit_locked&&(L(!1),_("帖子已被管理员锁定,无法编辑")),E.success(c.message)}catch(c){E.error(c instanceof Error?c.message:"操作失败")}};return t.jsxs("div",{className:"page-wrap post-detail-page",ref:O,children:[t.jsxs("div",{className:"post-detail-header",children:[t.jsxs("div",{className:"post-detail-nav",children:[t.jsxs(T,{variant:"ghost",size:"sm",onClick:()=>s(-1),children:[t.jsx(ot,{}),"返回"]}),a.board&&t.jsx(re,{variant:"green",className:"post-detail-board-tag",children:a.board.name})]}),t.jsxs("div",{className:"post-detail-head",children:[t.jsxs("h1",{className:"post-detail-title",children:[a.pinned&&t.jsx(He,{className:"mr-2",size:18}),a.title]}),t.jsxs("div",{className:"post-detail-author-row",children:[t.jsx("div",{className:"post-avatar post-avatar-lg",children:(ae=a.user)!=null&&ae.avatar?t.jsx("img",{src:a.user.avatar,alt:""}):Ae}),t.jsxs("div",{className:"post-detail-author-info",children:[t.jsx("span",{className:"post-detail-author-name",children:(oe=a.user)==null?void 0:oe.nickname}),t.jsxs("span",{className:"post-detail-meta-line",children:["发布于 ",Y(a.created_at),Oe&&t.jsxs(t.Fragment,{children:[" · 编辑于 ",Y(a.updated_at)]})," · ",a.view_count," 次浏览",a.edit_locked&&t.jsxs("span",{className:"post-detail-locked-tag",title:"管理员已锁定编辑",children:[t.jsx(ce,{size:12})," 已锁定"]})]})]})]})]}),ee.length>0&&t.jsx("div",{className:"post-detail-tags",children:ee.map(c=>t.jsx(re,{variant:"secondary",children:c},c))}),t.jsx(J,{html:a.content||"",isLoggedIn:!!i}),t.jsxs("div",{className:"post-detail-actions",children:[t.jsxs(T,{variant:f?"default":"outline",size:"sm",onClick:$e,children:[t.jsx(lt,{}),"点赞 ",a.like_count]}),t.jsxs(T,{variant:w?"default":"outline",size:"sm",onClick:Re,children:[t.jsx(rt,{}),w?"已收藏":"收藏"]}),I&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>s(`/post/${e}/edit`),children:[t.jsx(ct,{}),"编辑"]}),te&&R&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>F(!0),children:[t.jsx(Ce,{}),"编辑历史"]}),te&&!I&&g&&t.jsx("span",{className:"post-detail-edit-hint",title:g,children:g}),Fe&&t.jsxs(t.Fragment,{children:[t.jsxs(T,{variant:"outline",size:"sm",onClick:Be,children:[t.jsx(dt,{}),a.pinned?"取消置顶":"置顶"]}),t.jsxs(T,{variant:"outline",size:"sm",onClick:Ge,children:[t.jsx(ce,{}),a.edit_locked?"解锁编辑":"锁定编辑"]})]})]})]}),t.jsx(At,{postId:e,currentPost:{title:a.title,content:a.content??"",tags:a.tags??""},open:D,onClose:()=>F(!1),isLoggedIn:!!i}),t.jsxs("div",{className:"comment-section",ref:B,children:[t.jsxs("div",{className:"comment-section-bar",children:[t.jsx("span",{className:"comment-section-title",children:"评论区"}),t.jsxs("span",{className:"comment-section-count",children:[r.length," 条评论"]})]}),!v&&t.jsx("div",{className:"comment-box-wrap",ref:ze,children:t.jsx(de,{...K})}),t.jsx("div",{className:"comment-list-area",children:r.length===0&&!v?t.jsxs("div",{className:"comment-empty",children:[t.jsx("div",{className:"comment-empty-icon",children:"💬"}),t.jsx("p",{children:"暂无评论,来抢沙发吧"})]}):t.jsx(jt,{comments:r,highlightFloor:u,replyToId:(v==null?void 0:v.id)??null,onReply:Me,onCancelReply:()=>b(null),renderReplyBox:c=>t.jsx(de,{...K,replyTo:c,inline:!0},c.id)})})]})]})}export{Qt as default}; diff --git a/embed_static/static/spa/assets/PostDetailPage-Ca0chGU-.js b/embed_static/static/spa/assets/PostDetailPage-Ca0chGU-.js new file mode 100644 index 0000000..0e78330 --- /dev/null +++ b/embed_static/static/spa/assets/PostDetailPage-Ca0chGU-.js @@ -0,0 +1,14 @@ +import{j as t,r as m,e as pe,y as Ye}from"./react-vendor-BdyZmpPe.js";import{B as qe,P as He}from"./PinnedIcon-Dc0ZpCCq.js";import{c as le,b as z,n as E,S as je,h as Ue,B as T,a as Je}from"./index-Cp7Ff9NP.js";import{B as Ve}from"./badge-xzbTTsRq.js";import{h as Xe,a as Y,i as Qe}from"./content-BrFHUpp8.js";import{i as Ze,a1 as Ne,m as Ke,a2 as be,a3 as et,a4 as tt,a5 as we,a6 as st,X as nt,a7 as it,a8 as at,a9 as ot,Q as lt,aa as re,$ as rt,x as ct,ab as dt,ac as ut}from"./ui-vendor-B26O8baZ.js";import{r as mt,P as ft}from"./postContent-ClrHK1rL.js";import{p as ht}from"./purify-vendor-Cx4rtWv4.js";function vt({content:n,onMentionClick:e}){return t.jsx("div",{className:"floor-body",dangerouslySetInnerHTML:{__html:Xe(n)}})}function q(n){var e;return(e=n.user)!=null&&e.nickname?n.user.nickname:n.guest_nick?n.guest_nick:"游客"}function xt(n){return q(n)[0]||"?"}function gt(n){return!n.user_id||n.user_id===0}function pt(n){const e=new Map,s=[];for(const i of n)e.set(i.id,{comment:i,children:[]});for(const i of n){const o=e.get(i.id);i.reply_to&&e.has(i.reply_to)?e.get(i.reply_to).children.push(o):s.push(o)}return s}function jt(n){const e=new Date(n),s=new Date,i=o=>String(o).padStart(2,"0");return e.getFullYear()===s.getFullYear()?`${i(e.getMonth()+1)}月${i(e.getDate())}日`:`${e.getFullYear()}年${e.getMonth()+1}月${e.getDate()}日`}function Ce({node:n,nested:e,highlightFloor:s,replyToId:i,onReply:o,onCancelReply:a,renderReplyBox:l}){var v,b;const r=n.comment,d=q(r),f=gt(r),h=s===r.floor,w=!!r.content_hidden,C=i===r.id;return t.jsxs("div",{id:`floor-${r.floor}`,className:`waline-comment ${e?"nested":""} ${h?"highlight":""}`,children:[t.jsx("div",{className:`waline-comment-avatar ${f&&!((v=r.user)!=null&&v.avatar)?"guest":""}`,children:(b=r.user)!=null&&b.avatar?t.jsx("img",{src:r.user.avatar,alt:""}):xt(r)}),t.jsxs("div",{className:"waline-comment-main",children:[t.jsx("div",{className:"waline-comment-head",children:r.guest_url?t.jsx("a",{href:r.guest_url,target:"_blank",rel:"noopener noreferrer",className:"waline-comment-author",children:d}):t.jsx("span",{className:"waline-comment-author",children:d})}),w?t.jsx("div",{className:"waline-comment-private-mask",children:"该评论为私密评论,仅文章作者与评论发起者可见!"}):t.jsxs("div",{className:"waline-comment-bubble",children:[r.reply_target&&t.jsxs("span",{className:"waline-reply-at",children:["@",q(r.reply_target)]}),t.jsx(vt,{content:r.content})]}),t.jsxs("div",{className:"waline-comment-meta",children:[t.jsxs("span",{className:"waline-comment-date",children:[t.jsx(Ze,{size:14}),jt(r.created_at)]}),C?t.jsxs("button",{type:"button",className:"waline-comment-reply-btn cancel",onClick:a,children:[t.jsx(Ne,{size:14}),"取消"]}):t.jsxs("button",{type:"button",className:"waline-comment-reply-btn",onClick:()=>o(r),children:[t.jsx(Ke,{size:14}),"回复"]})]}),C&&l&&t.jsx("div",{id:`reply-box-${r.id}`,className:"comment-box-wrap inline",children:l(r)}),n.children.length>0&&t.jsx("div",{className:"waline-replies",children:n.children.map(S=>t.jsx(Ce,{node:S,nested:!0,highlightFloor:s,replyToId:i,onReply:o,onCancelReply:a,renderReplyBox:l},S.comment.id))})]})]})}function Nt({comments:n,highlightFloor:e,replyToId:s,onReply:i,onCancelReply:o,renderReplyBox:a}){const l=pt(n);return t.jsx("div",{className:"comment-thread-list",children:l.map(r=>t.jsx(Ce,{node:r,highlightFloor:e,replyToId:s,onReply:i,onCancelReply:o,renderReplyBox:a},r.comment.id))})}const ke=m.forwardRef(({className:n,...e},s)=>t.jsx(be,{className:le("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-[var(--j13-green)] data-[state=unchecked]:bg-input",n),...e,ref:s,children:t.jsx(et,{className:le("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ke.displayName=be.displayName;const bt=["😀","😁","😂","🤣","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","🥰","😗","😙","😚","🙂","🤗","🤩","🤔","🤨","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","🥱","😴","😌","😛","😜","😝","🤤","😒","😓","😔","😕","🙃","🤑","😲","🙁","😖","😞","😟","😤","😢","😭","😦","😧","😨","😩","🤯","😬","😰","😱","🥵","🥶","😳","🤪","😵","🥴","😠","😡","🤬","😷","🤒","🤕","🤢","🤮","🤧","😇","🥳","🥺","🤠","🤡","🤥","🤫","🤭","🧐","🤓","😈","👻","💀","☠️","👽","👾","🤖","🎃","😺","😸","😹","😻","😼","😽","🙀","😿","😾","👋","🤚","🖐","✋","🖖","👌","🤏","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","☝️","👍","👎","✊","👊","🤛","🤜","👏","🙌","👐","🤲","🤝","🙏","💪","🦾","🦿","🦵","🦶","❤️","🧡","💛","💚","💙","💜","🖤","🤍","🤎","💔","❣️","💕","💞","💓","💗","💖","💘","💝","💟","☮️","✨","⭐","🌟","💫","🔥","💥","💯","✅","❌","❓","❗","💢","💤","💦","🎉","🎊","🎁","🏆","🥇","🥈"];function wt({onSelect:n}){return t.jsx("div",{className:"emoji-picker",children:bt.map(e=>t.jsx("button",{type:"button",className:"emoji-picker-item",onClick:()=>n(e),children:e},e))})}const ye="j13_guest_nick",Se="j13_guest_email",Ee="j13_guest_url",_e="j13_my_comment_ids";function Ct(){return{nick:localStorage.getItem(ye)||"",email:localStorage.getItem(Se)||"",url:localStorage.getItem(Ee)||""}}function kt(n){localStorage.setItem(ye,n.nick),localStorage.setItem(Se,n.email),localStorage.setItem(Ee,n.url)}function Pe(){try{const n=localStorage.getItem(_e);if(!n)return[];const e=JSON.parse(n);return Array.isArray(e)?e.filter(s=>typeof s=="number"):[]}catch{return[]}}function yt(n){const e=Pe();e.includes(n)||(e.push(n),localStorage.setItem(_e,JSON.stringify(e.slice(-200))))}function ce({user:n,replyTo:e,inline:s,submitting:i,submitCount:o=0,onSubmit:a,onCancelReply:l}){var A;const r=Ct(),[d,f]=m.useState(""),[h,w]=m.useState(r.nick),[C,v]=m.useState(r.email),[b,S]=m.useState(r.url),[p,k]=m.useState(!1),[x,u]=m.useState(!1),j=m.useRef(null),y=m.useRef(null);m.useEffect(()=>{var g;s&&e&&((g=j.current)==null||g.focus({preventScroll:!0}))},[e==null?void 0:e.id,s]),m.useEffect(()=>{f(""),u(!1),k(!1)},[o]),m.useEffect(()=>{if(!x)return;const g=_=>{y.current&&!y.current.contains(_.target)&&u(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[x]);const P=g=>{const _=j.current;if(_){const D=_.selectionStart??d.length,F=_.selectionEnd??d.length,O=d.slice(0,D)+g+d.slice(F);f(O),requestAnimationFrame(()=>{_.focus();const B=D+g.length;_.setSelectionRange(B,B)})}else f(D=>D+g)},I=()=>{const g=d.trim();g&&(!n&&!h.trim()||(n||kt({nick:h.trim(),email:C.trim(),url:b.trim()}),a({content:g,guestNick:n?void 0:h.trim(),guestEmail:n?void 0:C.trim(),guestUrl:n?void 0:b.trim(),isPrivate:p})))},L=g=>{g.key==="Enter"&&(g.ctrlKey||g.metaKey)&&(g.preventDefault(),I())},R=((A=n==null?void 0:n.nickname)==null?void 0:A[0])||(h==null?void 0:h[0])||"?";return t.jsxs("div",{className:"comment-box",ref:y,children:[t.jsx("div",{className:"comment-box-avatar",children:n!=null&&n.avatar?t.jsx("img",{src:n.avatar,alt:"",className:"comment-box-avatar-img"}):t.jsx("div",{className:`comment-box-avatar-placeholder ${n?"":"guest"}`,children:n?R:t.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor",children:t.jsx("path",{d:"M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"})})})}),t.jsxs("div",{className:"comment-box-main",children:[e&&!s&&t.jsxs("div",{className:"comment-box-reply-hint",children:[t.jsxs("span",{children:["回复 #",e.floor," ",q(e)]}),l&&t.jsx("button",{type:"button",className:"comment-box-reply-cancel",onClick:l,children:"取消"})]}),t.jsxs("div",{className:`comment-box-input-wrap ${p?"private-mode":""}`,children:[t.jsx("textarea",{ref:j,className:"comment-box-textarea",placeholder:p?"正在隐私评论中...":"说点什么吧",value:d,onChange:g=>f(g.target.value),onKeyDown:L,rows:3}),t.jsx("button",{type:"button",className:"comment-box-send",disabled:i||!d.trim()||!n&&!h.trim(),onClick:I,title:"发送",children:t.jsx(tt,{size:16})})]}),!n&&t.jsxs("div",{className:"comment-box-guest-fields",children:[t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["昵称",t.jsx("em",{className:"comment-box-guest-required",children:"必填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"怎么称呼你",autoComplete:"nickname",value:h,onChange:g=>w(g.target.value)})]}),t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["邮箱",t.jsx("em",{className:"comment-box-guest-optional",children:"选填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"name@example.com",type:"email",autoComplete:"email",value:C,onChange:g=>v(g.target.value)})]}),t.jsxs("label",{className:"comment-box-guest-field",children:[t.jsxs("span",{className:"comment-box-guest-label",children:["网址",t.jsx("em",{className:"comment-box-guest-optional",children:"选填"})]}),t.jsx("input",{className:"comment-box-guest-input",placeholder:"https://example.com",type:"url",autoComplete:"url",value:b,onChange:g=>S(g.target.value)})]}),t.jsx("p",{className:"comment-box-guest-hint",children:"邮箱不会公开展示,仅用于站内记录。"})]}),t.jsxs("div",{className:"comment-box-toolbar",children:[t.jsx("button",{type:"button",className:`comment-box-owo ${x?"active":""}`,onClick:()=>u(g=>!g),children:"OwO"}),t.jsxs("label",{className:"comment-box-private",children:[t.jsx(ke,{checked:p,onCheckedChange:k}),t.jsx("span",{children:"隐私评论"})]})]}),x&&t.jsx(wt,{onSelect:P})]})]})}function J({html:n,isLoggedIn:e,className:s="post-detail-content"}){const i=pe(),o=m.useMemo(()=>mt(n,e),[n,e]),a=m.useCallback(l=>{const r=l.target;if(r.closest("[data-members-login]")){l.preventDefault(),i("/login");return}r.closest("[data-members-register]")&&(l.preventDefault(),i("/register"))},[i]);return t.jsx("div",{className:s,onClick:a,dangerouslySetInnerHTML:{__html:o}})}class Ie{diff(e,s,i={}){let o;typeof i=="function"?(o=i,i={}):"callback"in i&&(o=i.callback);const a=this.castInput(e,i),l=this.castInput(s,i),r=this.removeEmpty(this.tokenize(a,i)),d=this.removeEmpty(this.tokenize(l,i));return this.diffWithOptionsObj(r,d,i,o)}diffWithOptionsObj(e,s,i,o){var a;const l=x=>{if(x=this.postProcess(x,i),o){setTimeout(function(){o(x)},0);return}else return x},r=s.length,d=e.length;let f=1,h=r+d;i.maxEditLength!=null&&(h=Math.min(h,i.maxEditLength));const w=(a=i.timeout)!==null&&a!==void 0?a:1/0,C=Date.now()+w,v=[{oldPos:-1,lastComponent:void 0}];let b=this.extractCommon(v[0],s,e,0,i);if(v[0].oldPos+1>=d&&b+1>=r)return l(this.buildValues(v[0].lastComponent,s,e));let S=-1/0,p=1/0;const k=()=>{for(let x=Math.max(S,-f);x<=Math.min(p,f);x+=2){let u;const j=v[x-1],y=v[x+1];j&&(v[x-1]=void 0);let P=!1;if(y){const L=y.oldPos-x;P=y&&0<=L&&L=d&&b+1>=r)return l(this.buildValues(u.lastComponent,s,e))||!0;v[x]=u,u.oldPos+1>=d&&(p=Math.min(p,x-1)),b+1>=r&&(S=Math.max(S,x+1))}f++};if(o)(function x(){setTimeout(function(){if(f>h||Date.now()>C)return o(void 0);k()||x()},0)})();else for(;f<=h&&Date.now()<=C;){const x=k();if(x)return x}}addToPath(e,s,i,o,a){const l=e.lastComponent;return l&&!a.oneChangePerToken&&l.added===s&&l.removed===i?{oldPos:e.oldPos+o,lastComponent:{count:l.count+1,added:s,removed:i,previousComponent:l.previousComponent}}:{oldPos:e.oldPos+o,lastComponent:{count:1,added:s,removed:i,previousComponent:l}}}extractCommon(e,s,i,o,a){const l=s.length,r=i.length;let d=e.oldPos,f=d-o,h=0;for(;f+1C.length?b:C}),h.value=this.join(w)}else h.value=this.join(s.slice(d,d+h.count));d+=h.count,h.added||(f+=h.count)}}return o}}function de(n,e){let s;for(s=0;se.length&&(s=n.length-e.length);let i=e.length;n.length0&&e[l]!=e[a];)a=o[a];e[l]==e[a]&&a++}a=0;for(let l=s;l0&&n[l]!=e[a];)a=o[a];n[l]==e[a]&&a++}return a}function Le(n,e){const s=[];for(const i of Array.from(e.segment(n))){const o=i.segment;s.length&&/\s/.test(s[s.length-1])&&/\s/.test(o)?s[s.length-1]+=o:s.push(o)}return s}function Q(n,e){if(e)return M(n,e)[1];let s;for(s=n.length-1;s>=0&&n[s].match(/\s/);s--);return n.substring(s+1)}function W(n,e){if(e)return M(n,e)[0];const s=n.match(/^\s*/);return s?s[0]:""}function M(n,e){if(!e)return[W(n),Q(n)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');const s=Le(n,e),i=s[0],o=s[s.length-1],a=/\s/.test(i)?i:"",l=/\s/.test(o)?o:"";return[a,l]}const fe="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Et=new RegExp(`[${fe}]+|\\s+|[^${fe}]`,"ug");class _t extends Ie{equals(e,s,i){return i.ignoreCase&&(e=e.toLowerCase(),s=s.toLowerCase()),e.trim()===s.trim()}tokenize(e,s={}){let i;if(s.intlSegmenter){const l=s.intlSegmenter;if(l.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Le(e,l)}else i=e.match(Et)||[];const o=[];let a=null;return i.forEach(l=>{/\s/.test(l)?a==null?o.push(l):o.push(o.pop()+l):a!=null&&/\s/.test(a)?o[o.length-1]==a?o.push(o.pop()+l):o.push(a+l):o.push(l),a=l}),o}join(e){return e.map((s,i)=>i==0?s:s.replace(/^\s+/,"")).join("")}postProcess(e,s){if(!e||s.oneChangePerToken)return e;let i=null,o=null,a=null;return e.forEach(l=>{l.added?o=l:l.removed?a=l:((o||a)&&he(i,a,o,l,s.intlSegmenter),i=l,o=null,a=null)}),(o||a)&&he(i,a,o,null,s.intlSegmenter),e}}const Pt=new _t;function It(n,e,s){return Pt.diff(n,e,s)}function he(n,e,s,i,o){if(e&&s){const[a,l]=M(e.value,o),[r,d]=M(s.value,o);if(n){const f=de(a,r);n.value=X(n.value,r,f),e.value=$(e.value,f),s.value=$(s.value,f)}if(i){const f=ue(l,d);i.value=V(i.value,d,f),e.value=G(e.value,f),s.value=G(s.value,f)}}else if(s){if(n){const a=W(s.value,o);s.value=s.value.substring(a.length)}if(i){const a=W(i.value,o);i.value=i.value.substring(a.length)}}else if(n&&i){const a=W(i.value,o),[l,r]=M(e.value,o),d=de(a,l);e.value=$(e.value,d);const f=ue($(a,d),r);e.value=G(e.value,f),i.value=V(i.value,a,f),n.value=X(n.value,a,a.slice(0,a.length-f.length))}else if(i){const a=W(i.value,o),l=Q(e.value,o),r=me(l,a);e.value=G(e.value,r)}else if(n){const a=Q(n.value,o),l=W(e.value,o),r=me(a,l);e.value=$(e.value,r)}}class Lt extends Ie{constructor(){super(...arguments),this.tokenize=Dt}equals(e,s,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` +`))&&(e=e.trim()),(!i.newlineIsToken||!s.includes(` +`))&&(s=s.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` +`)&&(e=e.slice(0,-1)),s.endsWith(` +`)&&(s=s.slice(0,-1))),super.equals(e,s,i)}}const Tt=new Lt;function zt(n,e,s){return Tt.diff(n,e,s)}function Dt(n,e){e.stripTrailingCr&&(n=n.replace(/\r\n/g,` +`));const s=[],i=n.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let o=0;oi.replaceWith(` +`)),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, blockquote, pre, members-only").forEach(i=>{i.prepend(e.createTextNode(` +`)),i.append(e.createTextNode(` +`))}),(e.body.textContent??"").replace(/\r\n/g,` +`).replace(/\n{3,}/g,` + +`).trim()}function Wt(n,e){const s=n.title.trim()!==e.title.trim(),i=ve(n.tags)!==ve(e.tags),o=H(n.content)!==H(e.content);return{titleChanged:s,tagsChanged:i,contentChanged:o,hasChanges:s||i||o}}function ve(n){return n.split(/[,,]/).map(e=>e.trim()).filter(Boolean).join(",")}function $t(n,e){return zt(n||"",e||"")}function Mt(n,e){return It(n||"",e||"")}function Rt(n){let e=0,s=0;for(const i of n){const o=i.value.split(` +`).filter(a=>a.length>0);i.added?e+=o.length:i.removed&&(s+=o.length)}return{added:e,removed:s}}function xe({before:n,after:e}){const s=Mt(n,e);return n===e?t.jsx("span",{className:"revision-diff-unchanged",children:n||"(空)"}):t.jsx("span",{className:"revision-diff-inline",children:s.map((i,o)=>i.added?t.jsx("ins",{children:i.value},o):i.removed?t.jsx("del",{children:i.value},o):t.jsx("span",{children:i.value},o))})}function At({before:n,after:e}){const s=$t(n,e),{added:i,removed:o}=Rt(s);return n===e?t.jsx("p",{className:"revision-diff-unchanged",children:"正文无变化"}):t.jsxs("div",{className:"revision-diff-lines",children:[t.jsxs("div",{className:"revision-diff-stats",children:[o>0&&t.jsxs("span",{className:"revision-diff-stat revision-diff-stat--del",children:["删除 ",o," 行"]}),i>0&&t.jsxs("span",{className:"revision-diff-stat revision-diff-stat--add",children:["新增 ",i," 行"]})]}),t.jsx("pre",{className:"revision-diff-pre",children:s.map((a,l)=>{const r=a.value.split(` +`);return r.map((d,f)=>{if(f===r.length-1&&d==="")return null;const h=a.added?"revision-diff-line revision-diff-line--add":a.removed?"revision-diff-line revision-diff-line--del":"revision-diff-line revision-diff-line--same",w=a.added?"+":a.removed?"−":" ";return t.jsxs("div",{className:h,children:[t.jsx("span",{className:"revision-diff-gutter","aria-hidden":"true",children:w}),t.jsx("span",{className:"revision-diff-text",children:d||" "})]},`${l}-${f}`)})})})]})}function ge({summary:n}){return n.hasChanges?t.jsxs(t.Fragment,{children:[n.titleChanged&&t.jsx("span",{className:"revision-badge",children:"标题"}),n.contentChanged&&t.jsx("span",{className:"revision-badge",children:"正文"}),n.tagsChanged&&t.jsx("span",{className:"revision-badge",children:"标签"})]}):t.jsx("span",{className:"revision-badge revision-badge--none",children:"无变更"})}function Ft({postId:n,currentPost:e,open:s,onClose:i,isLoggedIn:o}){var x;const[a,l]=m.useState([]),[r,d]=m.useState(null),[f,h]=m.useState(!1),[w,C]=m.useState("diff"),[v,b]=m.useState(!1);m.useEffect(()=>{if(!s){d(null),C("diff"),b(!1);return}h(!0),z.postRevisions(n).then(u=>{const j=u.revisions??[];l(j),j.length>0&&d(j[0].id)}).catch(u=>E.error(u instanceof Error?u.message:"加载历史失败")).finally(()=>h(!1))},[s,n]),m.useEffect(()=>{if(!s)return;const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=u}},[s]);const S=m.useMemo(()=>a.map((u,j)=>{const y=j===0?e:{title:a[j-1].title,content:a[j-1].content,tags:a[j-1].tags},P={title:u.title,content:u.content,tags:u.tags};return{rev:u,after:y,summary:Wt(P,y),index:a.length-j}}),[a,e]),p=S.find(u=>u.rev.id===r)??null;if(!s)return null;const k=p?{title:p.rev.title,content:p.rev.content,tags:p.rev.tags}:null;return t.jsx("div",{className:`post-revision-overlay${v?" post-revision-overlay--fullscreen":""}`,onClick:i,children:t.jsxs("div",{className:`post-revision-panel${v?" post-revision-panel--fullscreen":""}`,onClick:u=>u.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"编辑历史",children:[t.jsxs("header",{className:"post-revision-head",children:[t.jsxs("div",{className:"post-revision-head-left",children:[t.jsx(we,{size:18}),t.jsx("h3",{children:"编辑历史"}),p&&t.jsxs("span",{className:"post-revision-head-sub",children:["第 ",p.index," 次编辑"]})]}),t.jsxs("div",{className:"post-revision-head-actions",children:[t.jsx("div",{className:"post-revision-view-tabs",role:"tablist",children:[["diff",st,"变更对比"],["before",nt,"编辑前"],["after",it,"编辑后"]].map(([u,j,y])=>t.jsxs("button",{type:"button",role:"tab","aria-selected":w===u,className:`post-revision-tab${w===u?" active":""}`,onClick:()=>C(u),children:[t.jsx(j,{size:14}),t.jsx("span",{className:"post-revision-tab-label",children:y})]},u))}),t.jsx("button",{type:"button",className:"post-revision-icon-btn",onClick:()=>b(u=>!u),title:v?"退出全屏":"全屏显示","aria-label":v?"退出全屏":"全屏显示",children:v?t.jsx(at,{size:18}):t.jsx(ot,{size:18})}),t.jsx("button",{type:"button",className:"post-revision-icon-btn",onClick:i,"aria-label":"关闭",children:t.jsx(Ne,{size:18})})]})]}),f?t.jsx("div",{className:"post-revision-loading",children:t.jsx(je,{size:"lg"})}):S.length===0?t.jsx("p",{className:"post-revision-empty",children:"暂无编辑记录"}):t.jsxs("div",{className:"post-revision-body",children:[t.jsxs("aside",{className:"post-revision-sidebar",children:[t.jsx("div",{className:"post-revision-sidebar-label",children:"时间线"}),t.jsx("ul",{className:"post-revision-list",children:S.map(u=>{var j;return t.jsx("li",{children:t.jsxs("button",{type:"button",className:`post-revision-item${r===u.rev.id?" active":""}`,onClick:()=>d(u.rev.id),children:[t.jsxs("div",{className:"post-revision-item-head",children:[t.jsxs("span",{className:"post-revision-item-num",children:["#",u.index]}),t.jsx(ge,{summary:u.summary})]}),t.jsx("span",{className:"post-revision-item-title",children:u.rev.title}),t.jsxs("span",{className:"post-revision-item-meta",children:[((j=u.rev.editor)==null?void 0:j.nickname)??"未知"," · ",Y(u.rev.created_at)]})]})},u.rev.id)})}),t.jsxs("div",{className:"post-revision-current",children:[t.jsx("span",{className:"post-revision-current-label",children:"当前版本"}),t.jsx("span",{className:"post-revision-current-title",children:e.title})]})]}),t.jsx("main",{className:"post-revision-main",children:p&&k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"post-revision-main-head",children:[t.jsxs("div",{children:[t.jsx("span",{className:"post-revision-main-editor",children:((x=p.rev.editor)==null?void 0:x.nickname)??"未知"}),t.jsx("span",{className:"post-revision-main-time",children:Y(p.rev.created_at)})]}),t.jsx(ge,{summary:p.summary})]}),t.jsxs("div",{className:"post-revision-scroll",children:[w==="diff"&&t.jsxs("div",{className:"revision-diff-view",children:[t.jsxs("section",{className:"revision-diff-section",children:[t.jsx("h4",{children:"标题"}),t.jsx("div",{className:"revision-diff-block",children:t.jsx(xe,{before:k.title,after:p.after.title})})]}),(k.tags||p.after.tags)&&t.jsxs("section",{className:"revision-diff-section",children:[t.jsx("h4",{children:"标签"}),t.jsx("div",{className:"revision-diff-block",children:t.jsx(xe,{before:k.tags||"(无)",after:p.after.tags||"(无)"})})]}),t.jsxs("section",{className:"revision-diff-section revision-diff-section--content",children:[t.jsx("h4",{children:"正文"}),t.jsx(At,{before:H(k.content),after:H(p.after.content)})]})]}),w==="before"&&t.jsxs("div",{className:"revision-full-view",children:[t.jsx("h4",{children:k.title}),k.tags&&t.jsxs("p",{className:"revision-full-tags",children:["标签:",k.tags]}),t.jsx(J,{html:k.content,isLoggedIn:o})]}),w==="after"&&t.jsxs("div",{className:"revision-full-view",children:[t.jsx("h4",{children:p.after.title}),p.after.tags&&t.jsxs("p",{className:"revision-full-tags",children:["标签:",p.after.tags]}),t.jsx(J,{html:p.after.content,isLoggedIn:o})]})]})]}):t.jsx("div",{className:"post-revision-empty",children:"请从左侧选择一次编辑记录"})})]})]})})}function Ot(n,e){const{overflowY:s}=getComputedStyle(n);return s!=="auto"&&s!=="scroll"&&s!=="overlay"||n.scrollHeight<=n.clientHeight+1?!1:e<0?n.scrollTop>0:n.scrollTop+n.clientHeight{if(!e)return;const s=n.current;if(!s)return;const i=s.closest(".app-shell");if(!i)return;const o=a=>{if(a.ctrlKey||a.metaKey)return;const l=a.target instanceof HTMLElement?a.target:null;if(!l)return;const r=Bt(l,a.deltaY,i);if(r&&r!==s&&s.contains(r)||r===s)return;const d=s.scrollTop;s.scrollTop+=a.deltaY,s.scrollTop!==d&&a.preventDefault()};return i.addEventListener("wheel",o,{passive:!1}),()=>i.removeEventListener("wheel",o)},[n,e])}function Kt(){var se,ne,ie,ae,oe;const{id:n}=Ye(),e=Number(n),s=pe(),{user:i,refresh:o}=Ue(),[a,l]=m.useState(null),[r,d]=m.useState([]),[f,h]=m.useState(!1),[w,C]=m.useState(!1),[v,b]=m.useState(null),[S,p]=m.useState(!1),[k,x]=m.useState(!0),[u,j]=m.useState(null),[y,P]=m.useState(0),[I,L]=m.useState(!1),[R,A]=m.useState(!1),[g,_]=m.useState(""),[D,F]=m.useState(!1),O=m.useRef(null),B=m.useRef(null),Te=m.useRef(null),U=m.useRef();Gt(O,!k&&!!a);const Z=m.useCallback(async()=>{const c=i?[]:Pe(),N=await z.comments(e,c);return Array.isArray(N.comments)?N.comments:[]},[e,i]),ze=async()=>{if(e){x(!0);try{const[c,N]=await Promise.all([z.post(e),Z()]);l(c.post),h(c.liked),C(c.favorited),L(c.can_edit??!1),A(c.is_edited??Qe(c.post.created_at,c.post.updated_at??c.post.created_at)),_(c.edit_block_reason??""),d(N),await o()}catch(c){E.error(c instanceof Error?c.message:"加载失败")}finally{x(!1)}}};m.useEffect(()=>{b(null),ze()},[e]);const De=m.useCallback(c=>{const N=document.getElementById(`floor-${c}`);N&&(N.scrollIntoView({behavior:"smooth",block:"center"}),j(c),clearTimeout(U.current),U.current=setTimeout(()=>j(null),2e3))},[]),We=c=>{if((v==null?void 0:v.id)===c.id){b(null);return}b(c)};m.useLayoutEffect(()=>{if(!v)return;const c=document.getElementById(`reply-box-${v.id}`);c==null||c.scrollIntoView({behavior:"smooth",block:"nearest"})},[v==null?void 0:v.id]),m.useEffect(()=>()=>clearTimeout(U.current),[]);const $e=async()=>{if(!i){s("/login");return}try{const c=await z.like(e);h(c.liked),l(N=>N&&{...N,like_count:c.like_count})}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},Me=async()=>{if(!i){s("/login");return}try{const c=await z.favorite(e);C(c.favorited),E.success(c.favorited?"已收藏":"已取消收藏")}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},K={user:i,submitting:S,submitCount:y,onSubmit:async c=>{p(!0);try{const N=await z.addComment(e,{content:c.content,replyTo:v==null?void 0:v.id,guestNick:c.guestNick,guestEmail:c.guestEmail,guestUrl:c.guestUrl,isPrivate:c.isPrivate});i||yt(N.id),b(null),P(Ge=>Ge+1),E.success("评论成功"),d(await Z()),setTimeout(()=>De(N.floor),100)}catch(N){E.error(N instanceof Error?N.message:"评论失败")}finally{p(!1)}},onCancelReply:()=>b(null)};if(k)return t.jsx("div",{className:"post-detail-loading flex justify-center py-16",children:t.jsx(je,{size:"lg"})});if(!a)return t.jsxs("div",{className:"empty-state",children:[t.jsx("p",{children:"帖子不存在"}),t.jsx(T,{variant:"outline",onClick:()=>s("/"),children:"返回首页"})]});const Re=((ne=(se=a.user)==null?void 0:se.nickname)==null?void 0:ne[0])||"?",ee=((ie=a.tags)==null?void 0:ie.split(/[,,]/).map(c=>c.trim()).filter(Boolean))??[],te=i&&(i.role==="admin"||i.id===a.user_id),Ae=(i==null?void 0:i.role)==="admin",Fe=R&&a.updated_at,Oe=async()=>{if(a)try{const c=await z.adminPinPost(e,!a.pinned);l(N=>N&&{...N,pinned:c.pinned}),Je(),window.dispatchEvent(new Event("posts-refresh")),E.success(c.message)}catch(c){E.error(c instanceof Error?c.message:"操作失败")}},Be=async()=>{if(a)try{const c=await z.adminLockPost(e,!a.edit_locked);l(N=>N&&{...N,edit_locked:c.edit_locked}),(i==null?void 0:i.role)==="admin"?L(!0):(i==null?void 0:i.id)===a.user_id&&c.edit_locked&&(L(!1),_("帖子已被管理员锁定,无法编辑")),E.success(c.message)}catch(c){E.error(c instanceof Error?c.message:"操作失败")}};return t.jsxs("div",{className:"page-wrap post-detail-page",ref:O,children:[t.jsxs("div",{className:"post-detail-header",children:[t.jsxs("div",{className:"post-detail-nav",children:[t.jsxs(T,{variant:"ghost",size:"sm",onClick:()=>s(-1),children:[t.jsx(lt,{}),"返回"]}),a.board&&t.jsx(qe,{board:a.board,className:"post-detail-board-tag"})]}),t.jsxs("div",{className:"post-detail-head",children:[t.jsxs("h1",{className:"post-detail-title",children:[a.pinned&&t.jsx(He,{className:"mr-2",size:18}),a.title]}),t.jsxs("div",{className:"post-detail-author-row",children:[t.jsx("div",{className:"post-avatar post-avatar-lg",children:(ae=a.user)!=null&&ae.avatar?t.jsx("img",{src:a.user.avatar,alt:""}):Re}),t.jsxs("div",{className:"post-detail-author-info",children:[t.jsx("span",{className:"post-detail-author-name",children:(oe=a.user)==null?void 0:oe.nickname}),t.jsxs("span",{className:"post-detail-meta-line",children:["发布于 ",Y(a.created_at),Fe&&t.jsxs(t.Fragment,{children:[" · 编辑于 ",Y(a.updated_at)]})," · ",a.view_count," 次浏览",a.edit_locked&&t.jsxs("span",{className:"post-detail-locked-tag",title:"管理员已锁定编辑",children:[t.jsx(re,{size:12})," 已锁定"]})]})]})]})]}),ee.length>0&&t.jsx("div",{className:"post-detail-tags",children:ee.map(c=>t.jsx(Ve,{variant:"secondary",children:c},c))}),t.jsx(J,{html:a.content||"",isLoggedIn:!!i}),t.jsxs("div",{className:"post-detail-actions",children:[t.jsxs(T,{variant:f?"default":"outline",size:"sm",onClick:$e,children:[t.jsx(rt,{}),"点赞 ",a.like_count]}),t.jsxs(T,{variant:w?"default":"outline",size:"sm",onClick:Me,children:[t.jsx(ct,{}),w?"已收藏":"收藏"]}),I&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>s(`/post/${e}/edit`),children:[t.jsx(dt,{}),"编辑"]}),te&&R&&t.jsxs(T,{variant:"outline",size:"sm",onClick:()=>F(!0),children:[t.jsx(we,{}),"编辑历史"]}),te&&!I&&g&&t.jsx("span",{className:"post-detail-edit-hint",title:g,children:g}),Ae&&t.jsxs(t.Fragment,{children:[t.jsxs(T,{variant:"outline",size:"sm",onClick:Oe,children:[t.jsx(ut,{}),a.pinned?"取消置顶":"置顶"]}),t.jsxs(T,{variant:"outline",size:"sm",onClick:Be,children:[t.jsx(re,{}),a.edit_locked?"解锁编辑":"锁定编辑"]})]})]})]}),t.jsx(Ft,{postId:e,currentPost:{title:a.title,content:a.content??"",tags:a.tags??""},open:D,onClose:()=>F(!1),isLoggedIn:!!i}),t.jsxs("div",{className:"comment-section",ref:B,children:[t.jsxs("div",{className:"comment-section-bar",children:[t.jsx("span",{className:"comment-section-title",children:"评论区"}),t.jsxs("span",{className:"comment-section-count",children:[r.length," 条评论"]})]}),!v&&t.jsx("div",{className:"comment-box-wrap",ref:Te,children:t.jsx(ce,{...K})}),t.jsx("div",{className:"comment-list-area",children:r.length===0&&!v?t.jsxs("div",{className:"comment-empty",children:[t.jsx("div",{className:"comment-empty-icon",children:"💬"}),t.jsx("p",{children:"暂无评论,来抢沙发吧"})]}):t.jsx(Nt,{comments:r,highlightFloor:u,replyToId:(v==null?void 0:v.id)??null,onReply:We,onCancelReply:()=>b(null),renderReplyBox:c=>t.jsx(ce,{...K,replyTo:c,inline:!0},c.id)})})]})]})}export{Kt as default}; diff --git a/embed_static/static/spa/assets/ProfilePage-DiORLSTl.js b/embed_static/static/spa/assets/ProfilePage-BxbMpG9W.js similarity index 98% rename from embed_static/static/spa/assets/ProfilePage-DiORLSTl.js rename to embed_static/static/spa/assets/ProfilePage-BxbMpG9W.js index b60d296..cdc3be0 100644 --- a/embed_static/static/spa/assets/ProfilePage-DiORLSTl.js +++ b/embed_static/static/spa/assets/ProfilePage-BxbMpG9W.js @@ -1,4 +1,4 @@ -import{x as Gt,r as u,j as s,e as Ht}from"./react-vendor-1fwFMt02.js";import{u as ut,a as ft,F as mt,c as L,d as F,e as T,b as Z,f as G,o as Pt,s as X}from"./form-cra7lKcv.js";import{S as et,B as P,n as z,h as Bt,u as Xt,a as H}from"./index-CucHNnyZ.js";import{I as W}from"./input-DOedlbiC.js";import{B as Yt}from"./badge-CS5odIe6.js";import{D as Vt,a as Kt,b as qt,c as Jt,d as Qt,e as $t}from"./dialog-CtQqbmck.js";import{A as te,a8 as ee,a9 as ie,X as oe,t as re,k as se}from"./ui-vendor-Gb6mai95.js";var gt=!1,E,it,ot,Y,V,Dt,K,rt,st,nt,Rt,at,ht,zt,Et;function C(){if(!gt){gt=!0;var i=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(i),t=/(Mac OS X)|(Windows)|(Linux)/.exec(i);if(at=/\b(iPhone|iP[ao]d)/.exec(i),ht=/\b(iP[ao]d)/.exec(i),nt=/Android/i.exec(i),zt=/FBAN\/\w+;/i.exec(i),Et=/Mobile/i.exec(i),Rt=!!/Win64/.exec(i),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var o=/(?:Trident\/(\d+.\d+))/.exec(i);Dt=o?parseFloat(o[1])+4:E,it=e[2]?parseFloat(e[2]):NaN,ot=e[3]?parseFloat(e[3]):NaN,Y=e[4]?parseFloat(e[4]):NaN,Y?(e=/(?:Chrome\/(\d+\.\d+))/.exec(i),V=e&&e[1]?parseFloat(e[1]):NaN):V=NaN}else E=it=ot=V=Y=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(i);K=r?parseFloat(r[1].replace("_",".")):!0}else K=!1;rt=!!t[2],st=!!t[3]}else K=rt=st=!1}}var ct={ie:function(){return C()||E},ieCompatibilityMode:function(){return C()||Dt>E},ie64:function(){return ct.ie()&&Rt},firefox:function(){return C()||it},opera:function(){return C()||ot},webkit:function(){return C()||Y},safari:function(){return ct.webkit()},chrome:function(){return C()||V},windows:function(){return C()||rt},osx:function(){return C()||K},linux:function(){return C()||st},iphone:function(){return C()||at},mobile:function(){return C()||at||ht||nt||Et},nativeApp:function(){return C()||zt},android:function(){return C()||nt},ipad:function(){return C()||ht}},ne=ct,ae=!!(typeof window<"u"&&window.document&&window.document.createElement),he={canUseDOM:ae},ce=he,At=ce,Mt;At.canUseDOM&&(Mt=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** +import{A as Gt,r as u,j as s,e as Ht}from"./react-vendor-BdyZmpPe.js";import{u as ut,a as ft,F as mt,c as L,d as F,e as T,b as Z,f as G,o as Pt,s as X}from"./form-DggfNWHU.js";import{S as et,B as P,n as z,h as Bt,u as Xt,b as H}from"./index-Cp7Ff9NP.js";import{I as W}from"./input-y6vZyHhN.js";import{B as Yt}from"./badge-xzbTTsRq.js";import{D as Vt,a as Kt,b as qt,c as Jt,d as Qt,e as $t}from"./dialog-DXwuwWJi.js";import{Q as te,at as ee,q as ie,a1 as oe,Y as re,D as se}from"./ui-vendor-B26O8baZ.js";var gt=!1,E,it,ot,Y,V,Dt,K,rt,st,nt,Rt,at,ht,zt,Et;function C(){if(!gt){gt=!0;var i=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(i),t=/(Mac OS X)|(Windows)|(Linux)/.exec(i);if(at=/\b(iPhone|iP[ao]d)/.exec(i),ht=/\b(iP[ao]d)/.exec(i),nt=/Android/i.exec(i),zt=/FBAN\/\w+;/i.exec(i),Et=/Mobile/i.exec(i),Rt=!!/Win64/.exec(i),e){E=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,E&&document&&document.documentMode&&(E=document.documentMode);var o=/(?:Trident\/(\d+.\d+))/.exec(i);Dt=o?parseFloat(o[1])+4:E,it=e[2]?parseFloat(e[2]):NaN,ot=e[3]?parseFloat(e[3]):NaN,Y=e[4]?parseFloat(e[4]):NaN,Y?(e=/(?:Chrome\/(\d+\.\d+))/.exec(i),V=e&&e[1]?parseFloat(e[1]):NaN):V=NaN}else E=it=ot=V=Y=NaN;if(t){if(t[1]){var r=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(i);K=r?parseFloat(r[1].replace("_",".")):!0}else K=!1;rt=!!t[2],st=!!t[3]}else K=rt=st=!1}}var ct={ie:function(){return C()||E},ieCompatibilityMode:function(){return C()||Dt>E},ie64:function(){return ct.ie()&&Rt},firefox:function(){return C()||it},opera:function(){return C()||ot},webkit:function(){return C()||Y},safari:function(){return ct.webkit()},chrome:function(){return C()||V},windows:function(){return C()||rt},osx:function(){return C()||K},linux:function(){return C()||st},iphone:function(){return C()||at},mobile:function(){return C()||at||ht||nt||Et},nativeApp:function(){return C()||zt},android:function(){return C()||nt},ipad:function(){return C()||ht}},ne=ct,ae=!!(typeof window<"u"&&window.document&&window.document.createElement),he={canUseDOM:ae},ce=he,At=ce,Mt;At.canUseDOM&&(Mt=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, diff --git a/embed_static/static/spa/assets/RegisterPage-D4yO0Lp-.js b/embed_static/static/spa/assets/RegisterPage-g5r_djmM.js similarity index 79% rename from embed_static/static/spa/assets/RegisterPage-D4yO0Lp-.js rename to embed_static/static/spa/assets/RegisterPage-g5r_djmM.js index 13b5940..7d23e01 100644 --- a/embed_static/static/spa/assets/RegisterPage-D4yO0Lp-.js +++ b/embed_static/static/spa/assets/RegisterPage-g5r_djmM.js @@ -1 +1 @@ -import{e as g,r as w,j as s,L as F}from"./react-vendor-1fwFMt02.js";import{u as b,a as y,F as k,b as n,c as o,d as t,e as i,f as l,o as N,s as c}from"./form-cra7lKcv.js";import{u as S,h as v,B as C,a as L,n as x}from"./index-CucHNnyZ.js";import{I as m}from"./input-DOedlbiC.js";import"./ui-vendor-Gb6mai95.js";const _=r=>N({username:c().min(1,"请输入用户名"),nickname:c().optional(),password:c().min(r,`密码至少 ${r} 位`)});function $(){const{limits:r}=S(),p=g(),{refresh:h}=v(),[j,d]=w.useState(!1),a=b({resolver:y(_(r.password_min_len)),defaultValues:{username:"",nickname:"",password:""}}),f=async e=>{d(!0);try{await L.register(e.username,e.password,e.nickname||e.username),await h(),x.success("注册成功"),p("/",{replace:!0})}catch(u){x.error(u instanceof Error?u.message:"注册失败")}finally{d(!1)}};return s.jsx("div",{className:"auth-page",children:s.jsxs("div",{className:"auth-box",children:[s.jsx("div",{className:"logo-mark",children:"姜"}),s.jsx("h1",{children:"注册账号"}),s.jsx("p",{className:"subtitle",children:"首个注册用户自动成为管理员"}),s.jsx(k,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(f),className:"space-y-4",children:[s.jsx(n,{control:a.control,name:"username",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"用户名"}),s.jsx(i,{children:s.jsx(m,{placeholder:"3-32 位字母数字下划线",autoComplete:"username",...e})}),s.jsx(l,{})]})}),s.jsx(n,{control:a.control,name:"nickname",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"昵称"}),s.jsx(i,{children:s.jsx(m,{placeholder:"显示名称(可选)",autoComplete:"nickname",...e})}),s.jsx(l,{})]})}),s.jsx(n,{control:a.control,name:"password",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"密码"}),s.jsx(i,{children:s.jsx(m,{type:"password",placeholder:`至少 ${r.password_min_len} 位`,autoComplete:"new-password",...e})}),s.jsx(l,{})]})}),s.jsx(C,{type:"submit",className:"w-full",loading:j,children:"注册"})]})}),s.jsxs("p",{style:{textAlign:"center",marginTop:16,fontSize:13,color:"var(--color-text-3)"},children:["已有账号?",s.jsx(F,{to:"/login",children:"登录"})]})]})})}export{$ as default}; +import{e as g,r as w,j as s,L as b}from"./react-vendor-BdyZmpPe.js";import{u as F,a as y,F as k,b as n,c as o,d as t,e as i,f as l,o as N,s as c}from"./form-DggfNWHU.js";import{u as S,h as v,B as C,b as L,n as x}from"./index-Cp7Ff9NP.js";import{I as m}from"./input-y6vZyHhN.js";import"./ui-vendor-B26O8baZ.js";const _=r=>N({username:c().min(1,"请输入用户名"),nickname:c().optional(),password:c().min(r,`密码至少 ${r} 位`)});function $(){const{limits:r}=S(),p=g(),{refresh:h}=v(),[j,d]=w.useState(!1),a=F({resolver:y(_(r.password_min_len)),defaultValues:{username:"",nickname:"",password:""}}),f=async e=>{d(!0);try{await L.register(e.username,e.password,e.nickname||e.username),await h(),x.success("注册成功"),p("/",{replace:!0})}catch(u){x.error(u instanceof Error?u.message:"注册失败")}finally{d(!1)}};return s.jsx("div",{className:"auth-page",children:s.jsxs("div",{className:"auth-box",children:[s.jsx("div",{className:"logo-mark",children:"姜"}),s.jsx("h1",{children:"注册账号"}),s.jsx("p",{className:"subtitle",children:"首个注册用户自动成为管理员"}),s.jsx(k,{...a,children:s.jsxs("form",{onSubmit:a.handleSubmit(f),className:"space-y-4",children:[s.jsx(n,{control:a.control,name:"username",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"用户名"}),s.jsx(i,{children:s.jsx(m,{placeholder:"3-32 位字母数字下划线",autoComplete:"username",...e})}),s.jsx(l,{})]})}),s.jsx(n,{control:a.control,name:"nickname",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"昵称"}),s.jsx(i,{children:s.jsx(m,{placeholder:"显示名称(可选)",autoComplete:"nickname",...e})}),s.jsx(l,{})]})}),s.jsx(n,{control:a.control,name:"password",render:({field:e})=>s.jsxs(o,{children:[s.jsx(t,{children:"密码"}),s.jsx(i,{children:s.jsx(m,{type:"password",placeholder:`至少 ${r.password_min_len} 位`,autoComplete:"new-password",...e})}),s.jsx(l,{})]})}),s.jsx(C,{type:"submit",className:"w-full",loading:j,children:"注册"})]})}),s.jsxs("p",{style:{textAlign:"center",marginTop:16,fontSize:13,color:"var(--color-text-3)"},children:["已有账号?",s.jsx(b,{to:"/login",children:"登录"})]})]})})}export{$ as default}; diff --git a/embed_static/static/spa/assets/alert-dialog-D0wiVaPM.js b/embed_static/static/spa/assets/alert-dialog-C2PKamsV.js similarity index 83% rename from embed_static/static/spa/assets/alert-dialog-D0wiVaPM.js rename to embed_static/static/spa/assets/alert-dialog-C2PKamsV.js index 17478b3..fa36d8b 100644 --- a/embed_static/static/spa/assets/alert-dialog-D0wiVaPM.js +++ b/embed_static/static/spa/assets/alert-dialog-C2PKamsV.js @@ -1 +1 @@ -import{r as l,j as s}from"./react-vendor-1fwFMt02.js";import{aj as x,ak as g,al as N,am as r,an as i,ao as d,ap as n,aq as m,ar as c}from"./ui-vendor-Gb6mai95.js";import{f as o,k as f}from"./index-CucHNnyZ.js";const C=x,T=g,y=N,p=l.forwardRef(({className:a,...e},t)=>s.jsx(c,{className:o("fixed inset-0 z-[110] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e,ref:t}));p.displayName=c.displayName;const u=l.forwardRef(({className:a,...e},t)=>s.jsxs(y,{children:[s.jsx(p,{}),s.jsx(r,{ref:t,className:o("fixed left-[50%] top-[50%] z-[110] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...e})]}));u.displayName=r.displayName;const A=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col space-y-2 text-center sm:text-left",a),...e});A.displayName="AlertDialogHeader";const D=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});D.displayName="AlertDialogFooter";const j=l.forwardRef(({className:a,...e},t)=>s.jsx(i,{ref:t,className:o("text-lg font-semibold",a),...e}));j.displayName=i.displayName;const w=l.forwardRef(({className:a,...e},t)=>s.jsx(d,{ref:t,className:o("text-sm text-muted-foreground",a),...e}));w.displayName=d.displayName;const b=l.forwardRef(({className:a,...e},t)=>s.jsx(m,{ref:t,className:o(f(),a),...e}));b.displayName=m.displayName;const R=l.forwardRef(({className:a,...e},t)=>s.jsx(n,{ref:t,className:o(f({variant:"outline"}),"mt-2 sm:mt-0",a),...e}));R.displayName=n.displayName;export{C as A,T as a,u as b,A as c,j as d,w as e,D as f,R as g,b as h}; +import{r as l,j as s}from"./react-vendor-BdyZmpPe.js";import{aD as x,aE as g,aF as N,aG as r,aH as i,aI as d,aJ as n,aK as m,aL as c}from"./ui-vendor-B26O8baZ.js";import{c as o,r as f}from"./index-Cp7Ff9NP.js";const T=x,h=g,y=N,p=l.forwardRef(({className:a,...e},t)=>s.jsx(c,{className:o("fixed inset-0 z-[110] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e,ref:t}));p.displayName=c.displayName;const u=l.forwardRef(({className:a,...e},t)=>s.jsxs(y,{children:[s.jsx(p,{}),s.jsx(r,{ref:t,className:o("fixed left-[50%] top-[50%] z-[110] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...e})]}));u.displayName=r.displayName;const A=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col space-y-2 text-center sm:text-left",a),...e});A.displayName="AlertDialogHeader";const D=({className:a,...e})=>s.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});D.displayName="AlertDialogFooter";const j=l.forwardRef(({className:a,...e},t)=>s.jsx(i,{ref:t,className:o("text-lg font-semibold",a),...e}));j.displayName=i.displayName;const w=l.forwardRef(({className:a,...e},t)=>s.jsx(d,{ref:t,className:o("text-sm text-muted-foreground",a),...e}));w.displayName=d.displayName;const b=l.forwardRef(({className:a,...e},t)=>s.jsx(m,{ref:t,className:o(f(),a),...e}));b.displayName=m.displayName;const R=l.forwardRef(({className:a,...e},t)=>s.jsx(n,{ref:t,className:o(f({variant:"outline"}),"mt-2 sm:mt-0",a),...e}));R.displayName=n.displayName;export{T as A,u as a,A as b,j as c,w as d,D as e,R as f,h as g,b as h}; diff --git a/embed_static/static/spa/assets/badge-CS5odIe6.js b/embed_static/static/spa/assets/badge-xzbTTsRq.js similarity index 85% rename from embed_static/static/spa/assets/badge-CS5odIe6.js rename to embed_static/static/spa/assets/badge-xzbTTsRq.js index 70c2dea..0d405bb 100644 --- a/embed_static/static/spa/assets/badge-CS5odIe6.js +++ b/embed_static/static/spa/assets/badge-xzbTTsRq.js @@ -1 +1 @@ -import{j as n}from"./react-vendor-1fwFMt02.js";import{f as a,j as o}from"./index-CucHNnyZ.js";const s=o("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground",green:"border-transparent bg-[var(--j13-green-bg)] text-[var(--j13-green)]",orange:"border-transparent bg-orange-100 text-orange-700 dark:bg-orange-950 dark:text-orange-300"}},defaultVariants:{variant:"default"}});function g({className:r,variant:e,...t}){return n.jsx("div",{className:a(s({variant:e}),r),...t})}export{g as B}; +import{j as n}from"./react-vendor-BdyZmpPe.js";import{c as a,q as o}from"./index-Cp7Ff9NP.js";const s=o("inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground",green:"border-transparent bg-[var(--j13-green-bg)] text-[var(--j13-green)]",orange:"border-transparent bg-orange-100 text-orange-700 dark:bg-orange-950 dark:text-orange-300"}},defaultVariants:{variant:"default"}});function g({className:r,variant:e,...t}){return n.jsx("div",{className:a(s({variant:e}),r),...t})}export{g as B}; diff --git a/embed_static/static/spa/assets/dialog-CtQqbmck.js b/embed_static/static/spa/assets/dialog-CtQqbmck.js deleted file mode 100644 index 54ca2fe..0000000 --- a/embed_static/static/spa/assets/dialog-CtQqbmck.js +++ /dev/null @@ -1 +0,0 @@ -import{r as l,j as t}from"./react-vendor-1fwFMt02.js";import{ab as f,ac as p,ad as d,ae as g,X as x,af as i,ag as n,ah as r}from"./ui-vendor-Gb6mai95.js";import{f as o}from"./index-CucHNnyZ.js";const R=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("fixed inset-0 z-[110] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=r.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-[110] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"关闭"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=n.displayName;export{R as D,y as a,N as b,D as c,b as d,j as e}; diff --git a/embed_static/static/spa/assets/dialog-DXwuwWJi.js b/embed_static/static/spa/assets/dialog-DXwuwWJi.js new file mode 100644 index 0000000..60514af --- /dev/null +++ b/embed_static/static/spa/assets/dialog-DXwuwWJi.js @@ -0,0 +1 @@ +import{r as l,j as t}from"./react-vendor-BdyZmpPe.js";import{av as f,aw as p,ax as d,ay as g,a1 as x,az as i,aA as n,aB as r}from"./ui-vendor-B26O8baZ.js";import{c as o}from"./index-Cp7Ff9NP.js";const R=f,u=p,c=l.forwardRef(({className:a,...e},s)=>t.jsx(r,{ref:s,className:o("fixed inset-0 z-[110] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...e}));c.displayName=r.displayName;const y=l.forwardRef(({className:a,children:e,...s},m)=>t.jsxs(u,{children:[t.jsx(c,{}),t.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-[110] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...s,children:[e,t.jsxs(g,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(x,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"关闭"})]})]})]}));y.displayName=d.displayName;const N=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",a),...e});N.displayName="DialogHeader";const j=({className:a,...e})=>t.jsx("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...e});j.displayName="DialogFooter";const D=l.forwardRef(({className:a,...e},s)=>t.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",a),...e}));D.displayName=i.displayName;const b=l.forwardRef(({className:a,...e},s)=>t.jsx(n,{ref:s,className:o("text-sm text-muted-foreground",a),...e}));b.displayName=n.displayName;export{R as D,y as a,N as b,D as c,b as d,j as e}; diff --git a/embed_static/static/spa/assets/form-cra7lKcv.js b/embed_static/static/spa/assets/form-DggfNWHU.js similarity index 99% rename from embed_static/static/spa/assets/form-cra7lKcv.js rename to embed_static/static/spa/assets/form-DggfNWHU.js index 21613c0..9f92786 100644 --- a/embed_static/static/spa/assets/form-cra7lKcv.js +++ b/embed_static/static/spa/assets/form-DggfNWHU.js @@ -1,4 +1,4 @@ -import{k as S,r as me,j as ye}from"./react-vendor-1fwFMt02.js";import{aa as Gr,u as Gn}from"./ui-vendor-Gb6mai95.js";import{f as Ue,j as Kn}from"./index-CucHNnyZ.js";var Me=e=>e.type==="checkbox",$e=e=>e instanceof Date,Q=e=>e==null;const Kr=e=>typeof e=="object";var M=e=>!Q(e)&&!Array.isArray(e)&&Kr(e)&&!$e(e),$t=e=>M(e)&&e.target?Me(e.target)?e.target.checked:e.target.value:e,qr=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),Yr=e=>{const t=e.constructor&&e.constructor.prototype;return M(t)&&t.hasOwnProperty("isPrototypeOf")},ot=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function B(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(ot&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(M(e)&&Yr(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=B(e[o]));return n}const ve={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},he={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vt="form",Hr="root",Xr=["__proto__","constructor","prototype"];var Le=e=>/^\w*$/.test(e),R=e=>e===void 0,st=e=>e.split(/[.[\]'"]/g).filter(Boolean),v=(e,t,r)=>{if(!t||!M(e))return r;const n=Le(t)?[t]:st(t);if(n.some(s=>Xr.includes(s)))return r;const o=n.reduce((s,i)=>Q(s)?void 0:s[i],e);return R(o)||o===e?R(e[t])?r:e[t]:o},ue=e=>typeof e=="boolean",te=e=>typeof e=="function",C=(e,t,r)=>{let n=-1;const o=Le(t)?[t]:st(t),s=o.length,i=s-1;for(;++nS.useContext(Nt);var Qr=(e,t,r,n=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==pe.all&&(t._proxyFormState[i]=!n||pe.all),r&&(r[i]=!0),e[i]}});return o};const Dt=ot?S.useLayoutEffect:S.useEffect;function qn(e){const t=Pt(),{control:r=t,disabled:n,name:o,exact:s}=e||{},[i,u]=S.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Dt(()=>r._subscribe({name:o,formState:l.current,exact:s,callback:h=>{!n&&u({...r._formState,...h,defaultValues:r._defaultValues})}}),[o,n,s]),S.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Qr(i,r,l.current,!1),[i,r])}var re=e=>typeof e=="string",Ot=(e,t,r,n,o)=>re(e)?(n&&t.watch.add(e),v(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),v(r,s))):(n&&(t.watchAll=!0),r),Et=e=>Q(e)||!Kr(e);const ur=(e,t)=>t.length===0&&!Array.isArray(e)&&!Yr(e);function ae(e,t,r=new WeakMap){if(e===t)return!0;if(Et(e)||Et(t))return Object.is(e,t);if($e(e)&&$e(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(ur(e,n)||ur(t,o))return Object.is(e,t);const s=r.get(e);if(s&&s.has(t))return!0;s?s.add(t):r.set(e,new WeakSet([t]));for(const i of n){const u=e[i];if(!(i in t))return!1;if(i!=="ref"){const l=t[i];if($e(u)&&$e(l)||(M(u)||Array.isArray(u))&&(M(l)||Array.isArray(l))?!ae(u,l,r):!Object.is(u,l))return!1}}return!0}function Yn(e){const t=Pt(),{control:r=t,name:n,defaultValue:o,disabled:s,exact:i,compute:u}=e||{},l=S.useRef(o),h=S.useRef(u),m=S.useRef(void 0),d=S.useRef(r),g=S.useRef(n);h.current=u;const[p,Z]=S.useState(()=>{const O=r._getWatch(n,l.current);return h.current?h.current(O):O}),A=S.useCallback(O=>{const I=Ot(n,r._names,O||r._formValues,!1,l.current);return h.current?h.current(I):I},[r._formValues,r._names,n]),T=S.useCallback(O=>{if(!s){const I=Ot(n,r._names,O||r._formValues,!1,l.current);if(h.current){const V=h.current(I);ae(V,m.current)||(Z(V),m.current=V)}else Z(I)}},[r._formValues,r._names,s,n]);Dt(()=>((d.current!==r||!ae(g.current,n))&&(d.current=r,g.current=n,T()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:O=>{T(O.values)}})),[r,i,n,T]),S.useEffect(()=>r._removeUnmounted());const F=d.current!==r,z=g.current,W=S.useMemo(()=>{if(s)return null;const O=!F&&!ae(z,n);return F||O?A():null},[s,F,n,z,A]);return W!==null?W:p}function Hn(e){const t=Pt(),{name:r,disabled:n,control:o=t,shouldUnregister:s,defaultValue:i,exact:u=!0}=e,l=qr(o._names.array,r),h=S.useMemo(()=>v(o._formValues,r,v(o._defaultValues,r,i)),[o,r,i]),m=Yn({control:o,name:r,defaultValue:h,exact:u}),d=qn({control:o,name:r,exact:u}),g=S.useRef(e),p=S.useRef(null),Z=S.useRef(o.register(r,{...e.rules,value:m,...ue(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const A=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!v(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!v(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!v(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!v(d.validatingFields,r)},error:{enumerable:!0,get:()=>v(d.errors,r)}}),[d,r]),T=S.useCallback(O=>{const I=$t(O);return v(o._fields,r)||(Z.current=o.register(r,{...g.current.rules,value:I})),Z.current.onChange({target:{value:$t(O),name:r},type:ve.CHANGE})},[r,o]),F=S.useCallback(()=>Z.current.onBlur({target:{value:v(o._formValues,r),name:r},type:ve.BLUR}),[r,o._formValues]),z=S.useCallback(O=>{O&&(p.current={focus:()=>te(O.focus)&&O.focus(),select:()=>te(O.select)&&O.select(),setCustomValidity:V=>te(O.setCustomValidity)&&O.setCustomValidity(V),reportValidity:()=>te(O.reportValidity)&&O.reportValidity()});const I=v(o._fields,r);I&&I._f&&O&&(I._f.ref=p.current)},[o._fields,r]),W=S.useMemo(()=>({name:r,value:m,...ue(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:T,onBlur:F,ref:z}),[r,n,d.disabled,T,F,z,m]);return S.useEffect(()=>{const O=o._options.shouldUnregister||s;o.register(r,{...g.current.rules,...ue(g.current.disabled)?{disabled:g.current.disabled}:{}});const I=(V,j)=>{const ne=v(o._fields,V);ne&&ne._f&&(ne._f.mount=j)};if(I(r,!0),O){const V=B(v(s?o._defaultValues:o._options.values||o._defaultValues,r,v(o._options.defaultValues,r,g.current.defaultValue)));C(o._defaultValues,r,V),R(v(o._formValues,r))&&C(o._formValues,r,V)}if(!l&&o.register(r),p.current){const V=v(o._fields,r);V&&V._f&&(V._f.ref=p.current)}return()=>{(l?O&&!o._state.action:O)?o.unregister(r):I(r,!1)}},[r,o,l,s]),S.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),S.useMemo(()=>({field:W,formState:d,fieldState:A}),[W,d,A])}const Xn=e=>e.render(Hn(e)),Ct=S.createContext(null);Ct.displayName="HookFormContext";const Qn=()=>S.useContext(Ct),eo=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:i,setValues:u,trigger:l,formState:h,resetField:m,reset:d,handleSubmit:g,unregister:p,control:Z,register:A,setFocus:T,subscribe:F})=>{const z=S.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:i,setValues:u,trigger:l,formState:h,resetField:m,reset:d,handleSubmit:g,unregister:p,control:Z,register:A,setFocus:T,subscribe:F}),[s,Z,h,n,r,g,A,d,m,o,T,i,u,F,l,p,t]);return S.createElement(Ct.Provider,{value:z},S.createElement(Nt.Provider,{value:z.control},e))};var xt=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},en=e=>Array.isArray(e)?e.filter(Boolean):[],He=e=>Array.isArray(e)?e:[e],ar=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function tn(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&M(o)&&s){const i=tn(o,s);M(i)&&(r[n]=i)}else e[n]&&(r[n]=s)}return r}var X=e=>M(e)&&!Object.keys(e).length,Rt=e=>e.type==="file",Xe=e=>{if(!ot)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},rn=e=>e.type==="select-multiple",jt=e=>e.type==="radio",to=e=>jt(e)||Me(e),bt=e=>Xe(e)&&e.isConnected;function ro(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(te(e[t]))return!0;return!1};function nn(e){return Array.isArray(e)||M(e)&&!oo(e)}function Zt(e,t={}){for(const r in e){const n=e[r];nn(n)?(t[r]=Array.isArray(n)?[]:{},Zt(n,t[r])):R(n)||(t[r]=!0)}return t}function St(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>St(r));return t.some(r=>r!==void 0)?t:void 0}if(M(e)){const t={};for(const r in e){const n=St(e[r]);R(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function ze(e,t,r){r||(r=Zt(t));for(const n in e){const o=e[n];if(nn(o))R(t)||Et(r[n])?r[n]=Zt(o,Array.isArray(o)?[]:{}):ze(o,Q(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!ae(o,s)}}return St(r)||{}}const cr={value:!1,isValid:!1},lr={value:!0,isValid:!0};var on=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!R(e[0].attributes.value)?R(e[0].value)||e[0].value===""?lr:{value:e[0].value,isValid:!0}:lr:cr}return cr},sn=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>R(e)?e:t?e===""?NaN:e&&+e:r&&re(e)?new Date(e):n?n(e):e;const fr={isValid:!1,value:null};var un=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,fr):fr;function dr(e){const t=e.ref;return Rt(t)?t.files:jt(t)?un(e.refs).value:rn(t)?[...t.selectedOptions].map(({value:r})=>r):Me(t)?on(e.refs).value:sn(R(t.value)?e.ref.value:t.value,e)}var so=(e,t,r,n)=>{const o={};for(const s of e){const i=v(t,s);i&&C(o,s,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Qe=e=>e instanceof RegExp,De=e=>R(e)?e:Qe(e)?e.source:M(e)?Qe(e.value)?e.value.source:e.value:e,hr=e=>({isOnSubmit:!e||e===pe.onSubmit,isOnBlur:e===pe.onBlur,isOnChange:e===pe.onChange,isOnAll:e===pe.all,isOnTouch:e===pe.onTouched});const pr="AsyncFunction";var io=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===pr||M(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pr)),uo=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),wt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const xe=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=v(e,o);if(s){const{_f:i,...u}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(xe(u,t))break}else if(M(u)&&xe(u,t))break}}};function mr(e,t,r){const n=v(e,r);if(n||Le(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),i=v(t,s),u=v(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(u&&u.type)return{name:s,error:u};if(u&&u.root&&u.root.type)return{name:`${s}.root`,error:u.root};o.pop()}return{name:r}}var ao=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return X(s)||n&&Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!n||pe.all))},co=(e,t,r)=>!e||!t||e===t||He(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),lo=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,fo=(e,t)=>!en(v(e,t)).length&&q(e,t),_r=(e,t,r)=>{const n=v(e,r),o=Array.isArray(n)?n:[];return C(o,Hr,t[r]),C(e,r,o),e};function gr(e,t,r="validate"){if(re(e)||Array.isArray(e)&&e.every(re)||ue(e)&&!e)return{type:r,message:re(e)?e:"",ref:t}}var Ie=e=>M(e)&&!Qe(e)?e:{value:e,message:""},yr=async(e,t,r,n,o,s)=>{const{ref:i,refs:u,required:l,maxLength:h,minLength:m,min:d,max:g,pattern:p,validate:Z,name:A,valueAsNumber:T,mount:F}=e._f,z=v(r,A);if(!F||t.has(A))return{};const W=u?u[0]:i,O=D=>{if(o&&W.reportValidity){const N=ue(D)?"":D||"";u?u.forEach(G=>G.setCustomValidity(N)):W.setCustomValidity(N),W.reportValidity()}},I={},V=jt(i),j=Me(i),ne=V||j,_e=(T||Rt(i))&&R(i.value)&&R(z)||Xe(i)&&i.value===""||z===""||Array.isArray(z)&&!z.length,ie=xt.bind(null,A,n,I),Be=(D,N,G,J=he.maxLength,ce=he.minLength)=>{const ge=D?N:G;I[A]={type:D?J:ce,message:ge,ref:i,...ie(D?J:ce,ge)}};if(s?!Array.isArray(z)||!z.length:l&&(!ne&&(_e||Q(z))||ue(z)&&!z||j&&!on(u).isValid||V&&!un(u).isValid)){const{value:D,message:N}=re(l)?{value:!!l,message:l}:Ie(l);if(D&&(I[A]={type:he.required,message:N,ref:W,...ie(he.required,N)},!n))return O(N),I}if(!_e&&(!Q(d)||!Q(g))){let D,N;const G=Ie(g),J=Ie(d);if(!Q(z)&&!isNaN(z)){const ce=i.valueAsNumber||z&&+z;Q(G.value)||(D=ce>G.value),Q(J.value)||(N=cenew Date(new Date().toDateString()+" "+We),Se=i.type=="time",Te=i.type=="week";re(G.value)&&z&&(D=Se?ge(z)>ge(G.value):Te?z>G.value:ce>new Date(G.value)),re(J.value)&&z&&(N=Se?ge(z)+D.value,J=!Q(N.value)&&z.length<+N.value;if((G||J)&&(Be(G,D.message,N.message),!n))return O(I[A].message),I}if(p&&!_e&&re(z)){const{value:D,message:N}=Ie(p);if(Qe(D)&&!z.match(D)&&(I[A]={type:he.pattern,message:N,ref:i,...ie(he.pattern,N)},!n))return O(N),I}if(Z){if(te(Z)){const D=await Z(z,r),N=gr(D,W);if(N&&(I[A]={...N,...ie(he.validate,N.message)},!n))return O(N.message),I}else if(M(Z)){let D={};for(const N in Z){if(!X(D)&&!n)break;const G=gr(await Z[N](z,r),W,N);G&&(D={...G,...ie(N,G.message)},O(G.message),n&&(I[A]=D))}if(!X(D)&&(I[A]={ref:W,...D},!n))return I}}return O(!0),I};const ho={mode:pe.onSubmit,reValidateMode:pe.onChange,shouldFocusError:!0},an={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function po(e={}){let t={...ho,...e},r={...B(an),isLoading:te(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=M(t.defaultValues)||M(t.values)?B(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:B(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,h=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...m};let g={...d};const p={array:ar(),state:ar()},Z=t.criteriaMode===pe.all,A=a=>c=>{clearTimeout(h),h=setTimeout(a,c)},T=async a=>{if(!i.keepIsValid&&!t.disabled&&(d.isValid||g.isValid||a)){let c;t.resolver?(c=X((await ie()).errors),F()):c=await N({fields:n,onlyCheckValid:!0,eventType:ve.VALID}),c!==r.isValid&&p.state.next({isValid:c})}},F=(a,c)=>{!t.disabled&&(d.isValidating||d.validatingFields||g.isValidating||g.validatingFields)&&((a||Array.from(u.mount)).forEach(f=>{f&&(c?C(r.validatingFields,f,c):q(r.validatingFields,f))}),p.state.next({validatingFields:r.validatingFields,isValidating:!X(r.validatingFields)}))},z=()=>{r.dirtyFields=ze(o,s)},W=(a,c=[],f,y,w=!0,k=!0)=>{if(y&&f&&!t.disabled){if(i.action=!0,k&&Array.isArray(v(n,a))){const b=f(v(n,a),y.argA,y.argB);w&&C(n,a,b)}if(k&&Array.isArray(v(r.errors,a))){const b=f(v(r.errors,a),y.argA,y.argB);w&&C(r.errors,a,b),fo(r.errors,a)}if((d.touchedFields||g.touchedFields)&&k&&Array.isArray(v(r.touchedFields,a))){const b=f(v(r.touchedFields,a),y.argA,y.argB);w&&C(r.touchedFields,a,b)}(d.dirtyFields||g.dirtyFields)&&z(),p.state.next({name:a,isDirty:J(a,c),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else C(s,a,c)},O=(a,c)=>{C(r.errors,a,c),r.errors={...r.errors},p.state.next({errors:r.errors})},I=a=>{r.errors=a,p.state.next({errors:r.errors,isValid:!1})},V=a=>{const c=Le(a)?[a]:st(a);let f=s,y=o;for(let w=0;w{const w=v(n,a);if(w){if(V(a))return;const k=R(v(s,a)),b=v(s,a,R(f)?v(o,a):f);R(b)||y&&y.defaultChecked||c?C(s,a,c?b:dr(w._f)):Se(a,b),i.mount&&!i.action&&(T(),k&&r.isDirty&&(d.isDirty||g.isDirty)&&(J()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&k&&!R(v(s,a))&&wt(a,u)&&(i.watch=!0))}},ne=(a,c,f,y,w)=>{let k=!1,b=!1;const $={name:a};if(!t.disabled){if(!f||y){(d.isDirty||g.isDirty)&&(b=r.isDirty,r.isDirty=$.isDirty=J(),k=b!==$.isDirty);const P=ae(v(o,a),c);b=!!v(r.dirtyFields,a),P!==r.isDirty?r.dirtyFields=ze(o,s):P?q(r.dirtyFields,a):C(r.dirtyFields,a,!0),$.dirtyFields=r.dirtyFields,k=k||(d.dirtyFields||g.dirtyFields)&&b!==!P}if(f){const P=v(r.touchedFields,a);P||(C(r.touchedFields,a,f),$.touchedFields=r.touchedFields,k=k||(d.touchedFields||g.touchedFields)&&P!==f)}k&&w&&p.state.next($)}return k?$:{}},_e=(a,c,f,y)=>{const w=v(r.errors,a),k=(d.isValid||g.isValid)&&ue(c)&&r.isValid!==c;if(t.delayError&&f?(l=A(()=>O(a,f)),l(t.delayError)):(clearTimeout(h),l=null,f?C(r.errors,a,f):q(r.errors,a),r.errors={...r.errors}),(f?!ae(w,f):w)||!X(y)||k){const b={...y,...k&&ue(c)?{isValid:c}:{},errors:r.errors,name:a};r={...r,...b},p.state.next(b)}},ie=async a=>(F(a,!0),await t.resolver(s,t.context,so(a||u.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),Be=async a=>{const{errors:c}=await ie(a);if(F(a),a){for(const f of a){const y=v(c,f);y?u.array.has(f)&&M(y)&&!Object.keys(y).some(w=>!Number.isNaN(Number(w)))?_r(r.errors,{[f]:y},f):C(r.errors,f,y):q(r.errors,f)}r.errors={...r.errors}}else r.errors=c;return c},D=async({name:a,eventType:c})=>{if(e.validate){const f=await e.validate({formValues:s,formState:r,name:a,eventType:c});if(M(f))for(const y in f){const w=f[y];w&&Ge(`${vt}.${y}`,{message:re(w.message)?w.message:"",type:w.type||he.validate})}else re(f)||!f?Ge(vt,{message:f||"",type:he.validate}):Xt(vt);return f}return!0},N=async({fields:a,onlyCheckValid:c,name:f,eventType:y,context:w={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(w.runRootValidation=!0,!await D({name:f,eventType:y})&&(w.valid=!1,c)))return w.valid;for(const k in a){const b=a[k];if(b){const{_f:$,...P}=b;if($){const K=u.array.has($.name),le=b._f&&io(b._f),de=d.validatingFields||d.isValidating||g.validatingFields||g.isValidating;le&&de&&F([$.name],!0);const ke=await yr(b,u.disabled,s,Z,t.shouldUseNativeValidation&&!c,K);if(le&&de&&F([$.name]),ke[$.name]&&(w.valid=!1,c)||(!c&&(v(ke,$.name)?K?_r(r.errors,ke,$.name):C(r.errors,$.name,ke[$.name]):q(r.errors,$.name)),e.shouldUseNativeValidation&&ke[$.name]))break}!X(P)&&await N({context:w,onlyCheckValid:c,fields:P,name:k,eventType:y})}}return w.valid},G=()=>{for(const a of u.unMount){const c=v(n,a);c&&(c._f.refs?c._f.refs.every(f=>!bt(f)):!bt(c._f.ref))&&mt(a)}u.unMount=new Set},J=(a,c)=>!t.disabled&&(a&&c&&C(s,a,c),!ae(Yt(),o)),ce=(a,c,f)=>Ot(a,u,{...i.mount?s:R(c)?o:re(a)?{[a]:c}:c},f,c),ge=a=>en(v(i.mount?s:o,a,t.shouldUnregister?v(o,a,[]):[])),Se=(a,c,f={},y=!1)=>{const w=v(n,a);let k=c;if(w){const b=w._f;b&&(!b.disabled&&C(s,a,sn(c,b)),k=Xe(b.ref)&&Q(c)?"":c,rn(b.ref)?[...b.ref.options].forEach($=>$.selected=k.includes($.value)):b.refs?Me(b.ref)?b.refs.forEach($=>{(!$.defaultChecked||!$.disabled)&&(Array.isArray(k)?$.checked=!!k.find(P=>P===$.value):$.checked=k===$.value||!!k)}):b.refs.forEach($=>$.checked=$.value===k):Rt(b.ref)?b.ref.value="":(b.ref.value=k,b.ref.type||p.state.next({name:a,values:y?s:B(s)})))}(f.shouldDirty||f.shouldTouch)&&ne(a,k,f.shouldTouch,f.shouldDirty,!0),f.shouldValidate&&pt(a)},Te=(a,c,f,y=!1)=>{for(const w in c){if(!c.hasOwnProperty(w))return;const k=c[w],b=a+"."+w,$=v(n,b);(u.array.has(a)||M(k)||$&&!$._f)&&!$e(k)?Te(b,k,f,y):Se(b,k,f,y)}},We=(a,c,f,y)=>{const w=v(n,a),k=u.array.has(a),b=y?c:B(c),$=v(s,a),P=ae($,b);if(P||C(s,a,b),k)p.array.next({name:a,values:y?s:B(s)}),(d.isDirty||d.dirtyFields||g.isDirty||g.dirtyFields)&&f.shouldDirty&&(z(),p.state.next({name:a,dirtyFields:r.dirtyFields,isDirty:J(a,b)}));else{const K=Array.isArray(b)&&!b.length||X(b);!w||w._f||Q(b)||K?Se(a,b,f,y):Te(a,b,f,y)}if(!P){const K=wt(a,u),le=y?s:B(s);p.state.next({...K&&r,name:i.mount||K?a:void 0,values:le})}},Ne=(a,c,f={})=>We(a,c,f,!1),xn=(a,c={})=>{const f=te(a)?a(s):a;if(!ae(s,f)){s={...s,...f};for(const y of u.mount)We(y,v(f,y),c,!0);p.state.next({...r,name:void 0,type:void 0,values:s}),c.shouldValidate&&T()}},Kt=async a=>{i.mount=!0;const c=a.target;let f=c.name,y=!0;const w=v(n,f),k=P=>{y=Number.isNaN(P)||$e(P)&&isNaN(P.getTime())||ae(P,v(s,f,P))},b=hr(t.mode),$=hr(t.reValidateMode);if(w){let P,K;const le=c.type?dr(w._f):$t(a),de=a.type===ve.BLUR||a.type===ve.FOCUS_OUT,ke=!uo(w._f)&&!e.validate&&!t.resolver&&!v(r.errors,f)&&!w._f.deps||lo(de,v(r.touchedFields,f),r.isSubmitted,$,b),yt=wt(f,u,de);C(s,f,le),de?(!c||!c.readOnly)&&(w._f.onBlur&&w._f.onBlur(a),l&&l(0)):w._f.onChange&&w._f.onChange(a);const Pe=ne(f,le,de),Bn=!X(Pe)||yt;if(!de&&p.state.next({name:f,type:a.type,values:B(s)}),ke)return(d.isValid||g.isValid)&&(t.mode==="onBlur"?de&&T():de||T()),Bn&&p.state.next({name:f,...yt?{}:Pe});if(!t.resolver&&e.validate&&await D({name:f,eventType:a.type}),!de&&yt&&p.state.next({...r}),t.resolver){const{errors:sr}=await ie([f]);if(F([f]),k(le),!y){!X(Pe)&&p.state.next(Pe);return}const Wn=mr(r.errors,n,f),ir=mr(sr,n,Wn.name||f);P=ir.error,f=ir.name,K=X(sr)}else F([f],!0),P=(await yr(w,u.disabled,s,Z,t.shouldUseNativeValidation))[f],F([f]),k(le),y&&(P?K=!1:(d.isValid||g.isValid)&&(K=await N({fields:n,onlyCheckValid:!0,name:f,eventType:a.type})));y&&(w._f.deps&&(!Array.isArray(w._f.deps)||w._f.deps.length>0)&&pt(w._f.deps),_e(f,K,P,Pe))}},qt=(a,c)=>{if(v(r.errors,c)&&a.focus)return a.focus(),1},pt=async(a,c={})=>{let f,y;const w=He(a);if(t.resolver){const k=await Be(R(a)?a:w);f=X(k),y=a?!w.some(b=>v(k,b)):f}else a?(y=(await Promise.all(w.map(async k=>{const b=v(n,k);return await N({fields:b&&b._f?{[k]:b}:b,eventType:ve.TRIGGER})}))).every(Boolean),!(!y&&!r.isValid)&&T()):y=f=await N({fields:n,name:a,eventType:ve.TRIGGER});return p.state.next({...!re(a)||(d.isValid||g.isValid)&&f!==r.isValid?{}:{name:a},...t.resolver||!a?{isValid:f}:{},errors:r.errors}),c.shouldFocus&&!y&&xe(n,qt,a?w:u.mount),y},Yt=(a,c)=>{let f={...i.mount?s:o};return c&&(f=tn(c.dirtyFields?r.dirtyFields:r.touchedFields,f)),R(a)?f:re(a)?v(f,a):a.map(y=>v(f,y))},Ht=(a,c)=>({invalid:!!v((c||r).errors,a),isDirty:!!v((c||r).dirtyFields,a),error:v((c||r).errors,a),isValidating:!!v(r.validatingFields,a),isTouched:!!v((c||r).touchedFields,a)}),Xt=a=>{const c=a?He(a):void 0;c==null||c.forEach(f=>q(r.errors,f)),c?c.forEach(f=>{p.state.next({name:f,errors:r.errors})}):p.state.next({errors:{}})},Ge=(a,c,f)=>{const y=(v(n,a,{_f:{}})._f||{}).ref,w=v(r.errors,a)||{},{ref:k,message:b,type:$,...P}=w;C(r.errors,a,{...P,...c,ref:y}),p.state.next({name:a,errors:r.errors,isValid:!1}),f&&f.shouldFocus&&y&&y.focus&&y.focus()},Rn=(a,c)=>te(a)?p.state.subscribe({next:f=>"values"in f&&a(f.values||ce(void 0,c),f)}):ce(a,c,!0),Qt=a=>p.state.subscribe({next:c=>{if(co(a.name,c.name,a.exact)&&ao(c,a.formState||d,Jn,a.reRenderRoot)){const f={...s};a.callback({values:f,...r,...c,defaultValues:o})}}}).unsubscribe,jn=a=>(i.mount=!0,g={...g,...a.formState},Qt({...a,formState:{...m,...a.formState}})),mt=(a,c={})=>{for(const f of a?He(a):u.mount)u.mount.delete(f),u.array.delete(f),c.keepValue||(q(n,f),q(s,f)),!c.keepError&&q(r.errors,f),!c.keepDirty&&q(r.dirtyFields,f),!c.keepTouched&&q(r.touchedFields,f),!c.keepIsValidating&&q(r.validatingFields,f),!t.shouldUnregister&&!c.keepDefaultValue&&q(o,f);p.state.next({values:B(s)}),p.state.next({...r,...c.keepDirty?{isDirty:J()}:{}}),!c.keepIsValid&&T()},er=({disabled:a,name:c})=>{if(ue(a)&&i.mount||a||u.disabled.has(c)){const w=u.disabled.has(c)!==!!a;a?u.disabled.add(c):u.disabled.delete(c),w&&i.mount&&!i.action&&T()}},_t=(a,c={})=>{let f=v(n,a);const y=ue(c.disabled)||ue(t.disabled),w=!u.registerName.has(a)&&f&&f._f&&!f._f.mount;return C(n,a,{...f||{},_f:{...f&&f._f?f._f:{ref:{name:a}},name:a,mount:!0,...c}}),u.mount.add(a),f&&!w?er({disabled:ue(c.disabled)?c.disabled:t.disabled,name:a}):j(a,!0,c.value),{...y?{disabled:c.disabled||t.disabled}:{},...t.progressive?{required:!!c.required,min:De(c.min),max:De(c.max),minLength:De(c.minLength),maxLength:De(c.maxLength),pattern:De(c.pattern)}:{},name:a,onChange:Kt,onBlur:Kt,ref:k=>{if(k){u.registerName.add(a),_t(a,c),u.registerName.delete(a),f=v(n,a);const b=R(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,$=to(b),P=f._f.refs||[];if($?P.find(K=>K===b):b===f._f.ref)return;C(n,a,{_f:{...f._f,...$?{refs:[...P.filter(bt),b,...Array.isArray(v(o,a))?[{}]:[]],ref:{type:b.type,name:a}}:{ref:b}}}),j(a,!1,void 0,b)}else f=v(n,a,{}),f._f&&(f._f.mount=!1),(t.shouldUnregister||c.shouldUnregister)&&!(qr(u.array,a)&&i.action)&&u.unMount.add(a)}}},gt=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&xe(n,qt,u.mount),Un=a=>{ue(a)&&(p.state.next({disabled:a}),xe(n,(c,f)=>{const y=v(n,f);y&&(c.disabled=y._f.disabled||a,Array.isArray(y._f.refs)&&y._f.refs.forEach(w=>{w.disabled=y._f.disabled||a}))},0,!1))},tr=(a,c)=>async f=>{let y;f&&(f.preventDefault&&f.preventDefault(),f.persist&&f.persist());let w=B(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:k,values:b}=await ie();F(),r.errors=k,w=B(b)}else await N({fields:n,eventType:ve.SUBMIT});if(u.disabled.size)for(const k of u.disabled)q(w,k);if(q(r.errors,Hr),X(r.errors)){p.state.next({errors:{}});try{await a(w,f)}catch(k){y=k}}else c&&await c({...r.errors},f),gt(),setTimeout(gt);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:X(r.errors)&&!y,submitCount:r.submitCount+1,errors:r.errors}),y)throw y},Mn=(a,c={})=>{v(n,a)&&(R(c.defaultValue)?Ne(a,B(v(o,a))):(Ne(a,c.defaultValue),C(o,a,B(c.defaultValue))),c.keepTouched||q(r.touchedFields,a),c.keepDirty||(q(r.dirtyFields,a),r.isDirty=c.defaultValue?J(a,B(v(o,a))):J()),c.keepError||(q(r.errors,a),d.isValid&&T()),p.state.next({...r}))},rr=(a,c={})=>{const f=a?B(a):o,y=B(f),w=X(a),k=y;if(c.keepDefaultValues||(o=f),!c.keepValues){if(c.keepDirtyValues){const b=new Set([...u.mount,...Object.keys(ze(o,s))]);for(const $ of Array.from(b)){const P=v(r.dirtyFields,$),K=v(s,$),le=v(k,$);P&&!R(K)?C(k,$,K):!P&&!R(le)&&Ne($,le)}}else{if(ot&&R(a))for(const b of u.mount){const $=v(n,b);if($&&$._f){const P=Array.isArray($._f.refs)?$._f.refs[0]:$._f.ref;if(Xe(P)){const K=P.closest("form");if(K){K.reset();break}}}}if(c.keepFieldsRef)for(const b of u.mount)Ne(b,v(k,b));else n={}}if(t.shouldUnregister){if(s=c.keepDefaultValues?B(o):{},c.keepFieldsRef)for(const b of u.mount)C(s,b,v(k,b))}else s=B(k);p.array.next({values:{...k}}),p.state.next({values:{...k}})}u={mount:c.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!X(k),i.watch=!!t.shouldUnregister,i.keepIsValid=!!c.keepIsValid,i.action=!1,c.keepErrors||(r.errors={}),p.state.next({submitCount:c.keepSubmitCount?r.submitCount:0,isDirty:w?!1:c.keepDirty?r.isDirty:c.keepValues?J():!!(c.keepDefaultValues&&!ae(a,o)),isSubmitted:c.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:w?{}:c.keepDirtyValues?c.keepDefaultValues&&s?ze(o,s):r.dirtyFields:c.keepDefaultValues&&a?ze(o,a):c.keepDirty?r.dirtyFields:{},touchedFields:c.keepTouched?r.touchedFields:{},errors:c.keepErrors?r.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},nr=(a,c)=>rr(te(a)?a(s):a,{...t.resetOptions,...c}),Ln=(a,c={})=>{const f=v(n,a),y=f&&f._f;if(y){const w=y.refs?y.refs[0]:y.ref;w.focus&&setTimeout(()=>{w.focus(),c.shouldSelect&&te(w.select)&&w.select()})}},Jn=a=>{r={...r,...a}},or={control:{register:_t,unregister:mt,getFieldState:Ht,handleSubmit:tr,setError:Ge,_subscribe:Qt,_runSchema:ie,_updateIsValidating:F,_focusError:gt,_getWatch:ce,_getDirty:J,_setValid:T,_setFieldArray:W,_setDisabledField:er,_setErrors:I,_getFieldArray:ge,_reset:rr,_resetDefaultValues:()=>te(t.defaultValues)&&t.defaultValues().then(a=>{nr(a,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Un,_subjects:p,_proxyFormState:d,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(a){i=a},get _defaultValues(){return o},get _names(){return u},set _names(a){u=a},get _formState(){return r},get _options(){return t},set _options(a){t={...t,...a}}},subscribe:jn,trigger:pt,register:_t,handleSubmit:tr,watch:Rn,setValue:Ne,setValues:xn,getValues:Yt,reset:nr,resetField:Mn,resetDefaultValues:(a,c={})=>{if(o=B(a),!c.keepDirty){const f=ze(o,s);r.dirtyFields=f,r.isDirty=!X(f)}c.keepIsValid||T(),p.state.next({...r,defaultValues:o})},clearErrors:Xt,unregister:mt,setError:Ge,setFocus:Ln,getFieldState:Ht};return{...or,formControl:or}}function uc(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),n=S.useRef(e.formControl),[o,s]=S.useState(()=>({...B(an),isLoading:te(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...l}=po(e);t.current={...l,formState:o}}const i=t.current.control;return i._options=e,Dt(()=>{const u=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(l=>({...l,isReady:!0})),i._formState.isReady=!0,u},[i]),S.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),S.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),S.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),S.useEffect(()=>{if(i._proxyFormState.isDirty){const u=i._getDirty();u!==o.isDirty&&i._subjects.state.next({isDirty:u})}},[i,o.isDirty]),S.useEffect(()=>{var u;e.values&&!ae(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((u=i._options.resetOptions)===null||u===void 0)&&u.keepIsValid||i._setValid(),r.current=e.values,s(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),S.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=S.useMemo(()=>Qr(o,i),[i,o]),t.current}const vr=(e,t,r)=>{if(e&&"reportValidity"in e){const n=v(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},It=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?vr(n.ref,r,e):n&&n.refs&&n.refs.forEach(o=>vr(o,r,e))}},br=(e,t)=>{t.shouldUseNativeValidation&&It(e,t);const r={};for(const n in e){const o=v(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(mo(t.names||Object.keys(e),n)){const i=Object.assign({},v(r,n));C(i,"root",s),C(r,n,i)}else C(r,n,s)}return r},mo=(e,t)=>{const r=wr(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(n=>wr(n).match(`^${r}\\.\\d+`))};function wr(e){return e.replace(/[\[\]]/g,"")}var kr;function _(e,t,r){function n(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,l);const h=i.prototype,m=Object.keys(h);for(let d=0;d{var l,h;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(h=(l=u==null?void 0:u._zod)==null?void 0:l.traits)==null?void 0:h.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Fe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class cn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(kr=globalThis).__zod_globalConfig??(kr.__zod_globalConfig={});const Ut=globalThis.__zod_globalConfig;function Oe(e){return Ut}function ln(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function At(e,t){return typeof t=="bigint"?t.toString():t}function Mt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Lt(e){return e==null}function Jt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(e,t){const r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yo=Mt(()=>{var e;if(Ut.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Re(e){if(et(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dn(e){return Re(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const vo=new Set(["string","number","symbol"]);function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ko(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=be(e._zod.def,{get shape(){const i={};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(i[u]=r.shape[u])}return Ze(this,"shape",i),i},checks:[]});return we(e,s)}function zo(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=be(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete i[u]}return Ze(this,"shape",i),i},checks:[]});return we(e,s)}function $o(e,t){if(!Re(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=be(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return we(e,o)}function Oo(e,t){if(!Re(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=be(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ze(this,"shape",n),n}});return we(e,r)}function Eo(e,t){var n;if((n=e._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=be(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return we(e,r)}function Zo(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=be(t._zod.def,{get shape(){const u=t._zod.def.shape,l={...u};if(r)for(const h in r){if(!(h in u))throw new Error(`Unrecognized key: "${h}"`);r[h]&&(l[h]=e?new e({type:"optional",innerType:u[h]}):u[h])}else for(const h in u)l[h]=e?new e({type:"optional",innerType:u[h]}):u[h];return Ze(this,"shape",l),l},checks:[]});return we(t,i)}function So(e,t,r){const n=be(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Ze(this,"shape",s),s}});return we(t,n)}function Ae(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ke(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ee(e,t,r){var l,h,m,d,g,p;const n=e.message?e.message:Ke((m=(h=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:h.error)==null?void 0:m.call(h,e))??Ke((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Ke((g=r.customError)==null?void 0:g.call(r,e))??Ke((p=r.localeError)==null?void 0:p.call(r,e))??"Invalid input",{inst:o,continue:s,input:i,...u}=e;return u.path??(u.path=[]),u.message=n,t!=null&&t.reportInput&&(u.input=i),u}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function je(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,At,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wt=_("$ZodError",pn),ut=_("$ZodError",pn,{Parent:Error});function Ao(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Fo(e,t=r=>r.message){const r={_errors:[]},n=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(u=>n({issues:u},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{const u=[...s,...i.path];if(u.length===0)r._errors.push(t(i));else{let l=r,h=0;for(;h(t,r,n,o)=>{const s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Fe;if(i.issues.length){const u=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Ee(l,s,Oe())));throw fn(u,o==null?void 0:o.callee),u}return i.value},Vo=at(ut),ct=e=>async(t,r,n,o)=>{const s=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const u=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Ee(l,s,Oe())));throw fn(u,o==null?void 0:o.callee),u}return i.value},To=ct(ut),lt=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Fe;return s.issues.length?{success:!1,error:new(e??Wt)(s.issues.map(i=>Ee(i,o,Oe())))}:{success:!0,data:s.value}},No=lt(ut),ft=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Ee(i,o,Oe())))}:{success:!0,data:s.value}},Po=ft(ut),Do=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return at(e)(t,r,o)},Co=e=>(t,r,n)=>at(e)(t,r,n),xo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ct(e)(t,r,o)},Ro=e=>async(t,r,n)=>ct(e)(t,r,n),jo=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return lt(e)(t,r,o)},Uo=e=>(t,r,n)=>lt(e)(t,r,n),Mo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ft(e)(t,r,o)},Lo=e=>async(t,r,n)=>ft(e)(t,r,n),Jo=/^[cC][0-9a-z]{6,}$/,Bo=/^[0-9a-z]+$/,Wo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Go=/^[0-9a-vA-V]{20}$/,Ko=/^[A-Za-z0-9]{27}$/,qo=/^[a-zA-Z0-9_-]{21}$/,Yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ho=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Or=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function es(){return new RegExp(Qo,"u")}const ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ns=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,os=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ss=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mn=/^[A-Za-z0-9_-]*$/,is=/^https?$/,us=/^\+[1-9]\d{6,14}$/,_n="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",as=new RegExp(`^${_n}$`);function gn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function cs(e){return new RegExp(`^${gn(e)}$`)}function ls(e){const t=gn({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${_n}T(?:${n})$`)}const fs=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ds=/^-?\d+$/,hs=/^-?\d+(?:\.\d+)?$/,ps=/^[^A-Z]*$/,ms=/^[^a-z]*$/,se=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),yn={number:"number",bigint:"bigint",object:"date"},vn=_("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=yn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?n.value<=t.value:n.value{se.init(e,t);const r=yn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_s=_("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):_o(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gs=_("$ZodCheckNumberFormat",(e,t)=>{var i;se.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[o,s]=wo[t.format];e._zod.onattach.push(u=>{const l=u._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=ds)}),e._zod.check=u=>{const l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}ls&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),ys=_("$ZodCheckMaxLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=n.value;if(o.length<=t.maximum)return;const i=Bt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),vs=_("$ZodCheckMinLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Bt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),bs=_("$ZodCheckLengthEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=Bt(o),u=s>t.length;n.issues.push({origin:i,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dt=_("$ZodCheckStringFormat",(e,t)=>{var r,n;se.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ws=_("$ZodCheckRegex",(e,t)=>{dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ks=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ps),dt.init(e,t)}),zs=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ms),dt.init(e,t)}),$s=_("$ZodCheckIncludes",(e,t)=>{se.init(e,t);const r=it(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Os=_("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`^${it(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Es=_("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`.*${it(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zs=_("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Ss{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(` +import{k as S,r as me,j as ye}from"./react-vendor-BdyZmpPe.js";import{au as Gr,_ as Gn}from"./ui-vendor-B26O8baZ.js";import{c as Ue,q as Kn}from"./index-Cp7Ff9NP.js";var Me=e=>e.type==="checkbox",$e=e=>e instanceof Date,Q=e=>e==null;const Kr=e=>typeof e=="object";var M=e=>!Q(e)&&!Array.isArray(e)&&Kr(e)&&!$e(e),$t=e=>M(e)&&e.target?Me(e.target)?e.target.checked:e.target.value:e,qr=(e,t)=>t.split(".").some((r,n,o)=>!isNaN(Number(r))&&e.has(o.slice(0,n).join("."))),Yr=e=>{const t=e.constructor&&e.constructor.prototype;return M(t)&&t.hasOwnProperty("isPrototypeOf")},ot=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function B(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(ot&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(M(e)&&Yr(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=B(e[o]));return n}const ve={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},pe={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},he={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},vt="form",Hr="root",Xr=["__proto__","constructor","prototype"];var Le=e=>/^\w*$/.test(e),R=e=>e===void 0,st=e=>e.split(/[.[\]'"]/g).filter(Boolean),v=(e,t,r)=>{if(!t||!M(e))return r;const n=Le(t)?[t]:st(t);if(n.some(s=>Xr.includes(s)))return r;const o=n.reduce((s,i)=>Q(s)?void 0:s[i],e);return R(o)||o===e?R(e[t])?r:e[t]:o},ue=e=>typeof e=="boolean",te=e=>typeof e=="function",C=(e,t,r)=>{let n=-1;const o=Le(t)?[t]:st(t),s=o.length,i=s-1;for(;++nS.useContext(Nt);var Qr=(e,t,r,n=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==pe.all&&(t._proxyFormState[i]=!n||pe.all),r&&(r[i]=!0),e[i]}});return o};const Dt=ot?S.useLayoutEffect:S.useEffect;function qn(e){const t=Pt(),{control:r=t,disabled:n,name:o,exact:s}=e||{},[i,u]=S.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=S.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Dt(()=>r._subscribe({name:o,formState:l.current,exact:s,callback:h=>{!n&&u({...r._formState,...h,defaultValues:r._defaultValues})}}),[o,n,s]),S.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),S.useMemo(()=>Qr(i,r,l.current,!1),[i,r])}var re=e=>typeof e=="string",Ot=(e,t,r,n,o)=>re(e)?(n&&t.watch.add(e),v(r,e,o)):Array.isArray(e)?e.map(s=>(n&&t.watch.add(s),v(r,s))):(n&&(t.watchAll=!0),r),Et=e=>Q(e)||!Kr(e);const ur=(e,t)=>t.length===0&&!Array.isArray(e)&&!Yr(e);function ae(e,t,r=new WeakMap){if(e===t)return!0;if(Et(e)||Et(t))return Object.is(e,t);if($e(e)&&$e(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(ur(e,n)||ur(t,o))return Object.is(e,t);const s=r.get(e);if(s&&s.has(t))return!0;s?s.add(t):r.set(e,new WeakSet([t]));for(const i of n){const u=e[i];if(!(i in t))return!1;if(i!=="ref"){const l=t[i];if($e(u)&&$e(l)||(M(u)||Array.isArray(u))&&(M(l)||Array.isArray(l))?!ae(u,l,r):!Object.is(u,l))return!1}}return!0}function Yn(e){const t=Pt(),{control:r=t,name:n,defaultValue:o,disabled:s,exact:i,compute:u}=e||{},l=S.useRef(o),h=S.useRef(u),m=S.useRef(void 0),d=S.useRef(r),g=S.useRef(n);h.current=u;const[p,Z]=S.useState(()=>{const O=r._getWatch(n,l.current);return h.current?h.current(O):O}),A=S.useCallback(O=>{const I=Ot(n,r._names,O||r._formValues,!1,l.current);return h.current?h.current(I):I},[r._formValues,r._names,n]),T=S.useCallback(O=>{if(!s){const I=Ot(n,r._names,O||r._formValues,!1,l.current);if(h.current){const V=h.current(I);ae(V,m.current)||(Z(V),m.current=V)}else Z(I)}},[r._formValues,r._names,s,n]);Dt(()=>((d.current!==r||!ae(g.current,n))&&(d.current=r,g.current=n,T()),r._subscribe({name:n,formState:{values:!0},exact:i,callback:O=>{T(O.values)}})),[r,i,n,T]),S.useEffect(()=>r._removeUnmounted());const F=d.current!==r,z=g.current,W=S.useMemo(()=>{if(s)return null;const O=!F&&!ae(z,n);return F||O?A():null},[s,F,n,z,A]);return W!==null?W:p}function Hn(e){const t=Pt(),{name:r,disabled:n,control:o=t,shouldUnregister:s,defaultValue:i,exact:u=!0}=e,l=qr(o._names.array,r),h=S.useMemo(()=>v(o._formValues,r,v(o._defaultValues,r,i)),[o,r,i]),m=Yn({control:o,name:r,defaultValue:h,exact:u}),d=qn({control:o,name:r,exact:u}),g=S.useRef(e),p=S.useRef(null),Z=S.useRef(o.register(r,{...e.rules,value:m,...ue(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const A=S.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!v(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!v(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!v(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!v(d.validatingFields,r)},error:{enumerable:!0,get:()=>v(d.errors,r)}}),[d,r]),T=S.useCallback(O=>{const I=$t(O);return v(o._fields,r)||(Z.current=o.register(r,{...g.current.rules,value:I})),Z.current.onChange({target:{value:$t(O),name:r},type:ve.CHANGE})},[r,o]),F=S.useCallback(()=>Z.current.onBlur({target:{value:v(o._formValues,r),name:r},type:ve.BLUR}),[r,o._formValues]),z=S.useCallback(O=>{O&&(p.current={focus:()=>te(O.focus)&&O.focus(),select:()=>te(O.select)&&O.select(),setCustomValidity:V=>te(O.setCustomValidity)&&O.setCustomValidity(V),reportValidity:()=>te(O.reportValidity)&&O.reportValidity()});const I=v(o._fields,r);I&&I._f&&O&&(I._f.ref=p.current)},[o._fields,r]),W=S.useMemo(()=>({name:r,value:m,...ue(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:T,onBlur:F,ref:z}),[r,n,d.disabled,T,F,z,m]);return S.useEffect(()=>{const O=o._options.shouldUnregister||s;o.register(r,{...g.current.rules,...ue(g.current.disabled)?{disabled:g.current.disabled}:{}});const I=(V,j)=>{const ne=v(o._fields,V);ne&&ne._f&&(ne._f.mount=j)};if(I(r,!0),O){const V=B(v(s?o._defaultValues:o._options.values||o._defaultValues,r,v(o._options.defaultValues,r,g.current.defaultValue)));C(o._defaultValues,r,V),R(v(o._formValues,r))&&C(o._formValues,r,V)}if(!l&&o.register(r),p.current){const V=v(o._fields,r);V&&V._f&&(V._f.ref=p.current)}return()=>{(l?O&&!o._state.action:O)?o.unregister(r):I(r,!1)}},[r,o,l,s]),S.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),S.useMemo(()=>({field:W,formState:d,fieldState:A}),[W,d,A])}const Xn=e=>e.render(Hn(e)),Ct=S.createContext(null);Ct.displayName="HookFormContext";const Qn=()=>S.useContext(Ct),eo=({children:e,watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:i,setValues:u,trigger:l,formState:h,resetField:m,reset:d,handleSubmit:g,unregister:p,control:Z,register:A,setFocus:T,subscribe:F})=>{const z=S.useMemo(()=>({watch:t,getValues:r,getFieldState:n,setError:o,clearErrors:s,setValue:i,setValues:u,trigger:l,formState:h,resetField:m,reset:d,handleSubmit:g,unregister:p,control:Z,register:A,setFocus:T,subscribe:F}),[s,Z,h,n,r,g,A,d,m,o,T,i,u,F,l,p,t]);return S.createElement(Ct.Provider,{value:z},S.createElement(Nt.Provider,{value:z.control},e))};var xt=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},en=e=>Array.isArray(e)?e.filter(Boolean):[],He=e=>Array.isArray(e)?e:[e],ar=()=>{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}};function tn(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const o=e[n],s=t[n];if(o&&M(o)&&s){const i=tn(o,s);M(i)&&(r[n]=i)}else e[n]&&(r[n]=s)}return r}var X=e=>M(e)&&!Object.keys(e).length,Rt=e=>e.type==="file",Xe=e=>{if(!ot)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},rn=e=>e.type==="select-multiple",jt=e=>e.type==="radio",to=e=>jt(e)||Me(e),bt=e=>Xe(e)&&e.isConnected;function ro(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{for(const t in e)if(te(e[t]))return!0;return!1};function nn(e){return Array.isArray(e)||M(e)&&!oo(e)}function Zt(e,t={}){for(const r in e){const n=e[r];nn(n)?(t[r]=Array.isArray(n)?[]:{},Zt(n,t[r])):R(n)||(t[r]=!0)}return t}function St(e){if(e!==!1){if(e===!0)return!0;if(Array.isArray(e)){const t=e.map(r=>St(r));return t.some(r=>r!==void 0)?t:void 0}if(M(e)){const t={};for(const r in e){const n=St(e[r]);R(n)||(t[r]=n)}return Object.keys(t).length?t:void 0}}}function ze(e,t,r){r||(r=Zt(t));for(const n in e){const o=e[n];if(nn(o))R(t)||Et(r[n])?r[n]=Zt(o,Array.isArray(o)?[]:{}):ze(o,Q(t)?{}:t[n],r[n]);else{const s=t[n];r[n]=!ae(o,s)}}return St(r)||{}}const cr={value:!1,isValid:!1},lr={value:!0,isValid:!0};var on=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!R(e[0].attributes.value)?R(e[0].value)||e[0].value===""?lr:{value:e[0].value,isValid:!0}:lr:cr}return cr},sn=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>R(e)?e:t?e===""?NaN:e&&+e:r&&re(e)?new Date(e):n?n(e):e;const fr={isValid:!1,value:null};var un=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,fr):fr;function dr(e){const t=e.ref;return Rt(t)?t.files:jt(t)?un(e.refs).value:rn(t)?[...t.selectedOptions].map(({value:r})=>r):Me(t)?on(e.refs).value:sn(R(t.value)?e.ref.value:t.value,e)}var so=(e,t,r,n)=>{const o={};for(const s of e){const i=v(t,s);i&&C(o,s,i._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},Qe=e=>e instanceof RegExp,De=e=>R(e)?e:Qe(e)?e.source:M(e)?Qe(e.value)?e.value.source:e.value:e,hr=e=>({isOnSubmit:!e||e===pe.onSubmit,isOnBlur:e===pe.onBlur,isOnChange:e===pe.onChange,isOnAll:e===pe.all,isOnTouch:e===pe.onTouched});const pr="AsyncFunction";var io=e=>!!e&&!!e.validate&&!!(te(e.validate)&&e.validate.constructor.name===pr||M(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===pr)),uo=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),wt=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(`${n}.`)));const xe=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const s=v(e,o);if(s){const{_f:i,...u}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!n)return!0;if(i.ref&&t(i.ref,i.name)&&!n)return!0;if(xe(u,t))break}else if(M(u)&&xe(u,t))break}}};function mr(e,t,r){const n=v(e,r);if(n||Le(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const s=o.join("."),i=v(t,s),u=v(e,s);if(i&&!Array.isArray(i)&&r!==s)return{name:r};if(u&&u.type)return{name:s,error:u};if(u&&u.root&&u.root.type)return{name:`${s}.root`,error:u.root};o.pop()}return{name:r}}var ao=(e,t,r,n)=>{r(e);const{name:o,...s}=e;return X(s)||n&&Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!n||pe.all))},co=(e,t,r)=>!e||!t||e===t||He(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),lo=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,fo=(e,t)=>!en(v(e,t)).length&&q(e,t),_r=(e,t,r)=>{const n=v(e,r),o=Array.isArray(n)?n:[];return C(o,Hr,t[r]),C(e,r,o),e};function gr(e,t,r="validate"){if(re(e)||Array.isArray(e)&&e.every(re)||ue(e)&&!e)return{type:r,message:re(e)?e:"",ref:t}}var Ie=e=>M(e)&&!Qe(e)?e:{value:e,message:""},yr=async(e,t,r,n,o,s)=>{const{ref:i,refs:u,required:l,maxLength:h,minLength:m,min:d,max:g,pattern:p,validate:Z,name:A,valueAsNumber:T,mount:F}=e._f,z=v(r,A);if(!F||t.has(A))return{};const W=u?u[0]:i,O=D=>{if(o&&W.reportValidity){const N=ue(D)?"":D||"";u?u.forEach(G=>G.setCustomValidity(N)):W.setCustomValidity(N),W.reportValidity()}},I={},V=jt(i),j=Me(i),ne=V||j,_e=(T||Rt(i))&&R(i.value)&&R(z)||Xe(i)&&i.value===""||z===""||Array.isArray(z)&&!z.length,ie=xt.bind(null,A,n,I),Be=(D,N,G,J=he.maxLength,ce=he.minLength)=>{const ge=D?N:G;I[A]={type:D?J:ce,message:ge,ref:i,...ie(D?J:ce,ge)}};if(s?!Array.isArray(z)||!z.length:l&&(!ne&&(_e||Q(z))||ue(z)&&!z||j&&!on(u).isValid||V&&!un(u).isValid)){const{value:D,message:N}=re(l)?{value:!!l,message:l}:Ie(l);if(D&&(I[A]={type:he.required,message:N,ref:W,...ie(he.required,N)},!n))return O(N),I}if(!_e&&(!Q(d)||!Q(g))){let D,N;const G=Ie(g),J=Ie(d);if(!Q(z)&&!isNaN(z)){const ce=i.valueAsNumber||z&&+z;Q(G.value)||(D=ce>G.value),Q(J.value)||(N=cenew Date(new Date().toDateString()+" "+We),Se=i.type=="time",Te=i.type=="week";re(G.value)&&z&&(D=Se?ge(z)>ge(G.value):Te?z>G.value:ce>new Date(G.value)),re(J.value)&&z&&(N=Se?ge(z)+D.value,J=!Q(N.value)&&z.length<+N.value;if((G||J)&&(Be(G,D.message,N.message),!n))return O(I[A].message),I}if(p&&!_e&&re(z)){const{value:D,message:N}=Ie(p);if(Qe(D)&&!z.match(D)&&(I[A]={type:he.pattern,message:N,ref:i,...ie(he.pattern,N)},!n))return O(N),I}if(Z){if(te(Z)){const D=await Z(z,r),N=gr(D,W);if(N&&(I[A]={...N,...ie(he.validate,N.message)},!n))return O(N.message),I}else if(M(Z)){let D={};for(const N in Z){if(!X(D)&&!n)break;const G=gr(await Z[N](z,r),W,N);G&&(D={...G,...ie(N,G.message)},O(G.message),n&&(I[A]=D))}if(!X(D)&&(I[A]={ref:W,...D},!n))return I}}return O(!0),I};const ho={mode:pe.onSubmit,reValidateMode:pe.onChange,shouldFocusError:!0},an={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function po(e={}){let t={...ho,...e},r={...B(an),isLoading:te(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},n={},o=M(t.defaultValues)||M(t.values)?B(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:B(o),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,h=0;const m={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...m};let g={...d};const p={array:ar(),state:ar()},Z=t.criteriaMode===pe.all,A=a=>c=>{clearTimeout(h),h=setTimeout(a,c)},T=async a=>{if(!i.keepIsValid&&!t.disabled&&(d.isValid||g.isValid||a)){let c;t.resolver?(c=X((await ie()).errors),F()):c=await N({fields:n,onlyCheckValid:!0,eventType:ve.VALID}),c!==r.isValid&&p.state.next({isValid:c})}},F=(a,c)=>{!t.disabled&&(d.isValidating||d.validatingFields||g.isValidating||g.validatingFields)&&((a||Array.from(u.mount)).forEach(f=>{f&&(c?C(r.validatingFields,f,c):q(r.validatingFields,f))}),p.state.next({validatingFields:r.validatingFields,isValidating:!X(r.validatingFields)}))},z=()=>{r.dirtyFields=ze(o,s)},W=(a,c=[],f,y,w=!0,k=!0)=>{if(y&&f&&!t.disabled){if(i.action=!0,k&&Array.isArray(v(n,a))){const b=f(v(n,a),y.argA,y.argB);w&&C(n,a,b)}if(k&&Array.isArray(v(r.errors,a))){const b=f(v(r.errors,a),y.argA,y.argB);w&&C(r.errors,a,b),fo(r.errors,a)}if((d.touchedFields||g.touchedFields)&&k&&Array.isArray(v(r.touchedFields,a))){const b=f(v(r.touchedFields,a),y.argA,y.argB);w&&C(r.touchedFields,a,b)}(d.dirtyFields||g.dirtyFields)&&z(),p.state.next({name:a,isDirty:J(a,c),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else C(s,a,c)},O=(a,c)=>{C(r.errors,a,c),r.errors={...r.errors},p.state.next({errors:r.errors})},I=a=>{r.errors=a,p.state.next({errors:r.errors,isValid:!1})},V=a=>{const c=Le(a)?[a]:st(a);let f=s,y=o;for(let w=0;w{const w=v(n,a);if(w){if(V(a))return;const k=R(v(s,a)),b=v(s,a,R(f)?v(o,a):f);R(b)||y&&y.defaultChecked||c?C(s,a,c?b:dr(w._f)):Se(a,b),i.mount&&!i.action&&(T(),k&&r.isDirty&&(d.isDirty||g.isDirty)&&(J()||(r.isDirty=!1,p.state.next({...r}))),e.shouldUnregister&&k&&!R(v(s,a))&&wt(a,u)&&(i.watch=!0))}},ne=(a,c,f,y,w)=>{let k=!1,b=!1;const $={name:a};if(!t.disabled){if(!f||y){(d.isDirty||g.isDirty)&&(b=r.isDirty,r.isDirty=$.isDirty=J(),k=b!==$.isDirty);const P=ae(v(o,a),c);b=!!v(r.dirtyFields,a),P!==r.isDirty?r.dirtyFields=ze(o,s):P?q(r.dirtyFields,a):C(r.dirtyFields,a,!0),$.dirtyFields=r.dirtyFields,k=k||(d.dirtyFields||g.dirtyFields)&&b!==!P}if(f){const P=v(r.touchedFields,a);P||(C(r.touchedFields,a,f),$.touchedFields=r.touchedFields,k=k||(d.touchedFields||g.touchedFields)&&P!==f)}k&&w&&p.state.next($)}return k?$:{}},_e=(a,c,f,y)=>{const w=v(r.errors,a),k=(d.isValid||g.isValid)&&ue(c)&&r.isValid!==c;if(t.delayError&&f?(l=A(()=>O(a,f)),l(t.delayError)):(clearTimeout(h),l=null,f?C(r.errors,a,f):q(r.errors,a),r.errors={...r.errors}),(f?!ae(w,f):w)||!X(y)||k){const b={...y,...k&&ue(c)?{isValid:c}:{},errors:r.errors,name:a};r={...r,...b},p.state.next(b)}},ie=async a=>(F(a,!0),await t.resolver(s,t.context,so(a||u.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),Be=async a=>{const{errors:c}=await ie(a);if(F(a),a){for(const f of a){const y=v(c,f);y?u.array.has(f)&&M(y)&&!Object.keys(y).some(w=>!Number.isNaN(Number(w)))?_r(r.errors,{[f]:y},f):C(r.errors,f,y):q(r.errors,f)}r.errors={...r.errors}}else r.errors=c;return c},D=async({name:a,eventType:c})=>{if(e.validate){const f=await e.validate({formValues:s,formState:r,name:a,eventType:c});if(M(f))for(const y in f){const w=f[y];w&&Ge(`${vt}.${y}`,{message:re(w.message)?w.message:"",type:w.type||he.validate})}else re(f)||!f?Ge(vt,{message:f||"",type:he.validate}):Xt(vt);return f}return!0},N=async({fields:a,onlyCheckValid:c,name:f,eventType:y,context:w={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(w.runRootValidation=!0,!await D({name:f,eventType:y})&&(w.valid=!1,c)))return w.valid;for(const k in a){const b=a[k];if(b){const{_f:$,...P}=b;if($){const K=u.array.has($.name),le=b._f&&io(b._f),de=d.validatingFields||d.isValidating||g.validatingFields||g.isValidating;le&&de&&F([$.name],!0);const ke=await yr(b,u.disabled,s,Z,t.shouldUseNativeValidation&&!c,K);if(le&&de&&F([$.name]),ke[$.name]&&(w.valid=!1,c)||(!c&&(v(ke,$.name)?K?_r(r.errors,ke,$.name):C(r.errors,$.name,ke[$.name]):q(r.errors,$.name)),e.shouldUseNativeValidation&&ke[$.name]))break}!X(P)&&await N({context:w,onlyCheckValid:c,fields:P,name:k,eventType:y})}}return w.valid},G=()=>{for(const a of u.unMount){const c=v(n,a);c&&(c._f.refs?c._f.refs.every(f=>!bt(f)):!bt(c._f.ref))&&mt(a)}u.unMount=new Set},J=(a,c)=>!t.disabled&&(a&&c&&C(s,a,c),!ae(Yt(),o)),ce=(a,c,f)=>Ot(a,u,{...i.mount?s:R(c)?o:re(a)?{[a]:c}:c},f,c),ge=a=>en(v(i.mount?s:o,a,t.shouldUnregister?v(o,a,[]):[])),Se=(a,c,f={},y=!1)=>{const w=v(n,a);let k=c;if(w){const b=w._f;b&&(!b.disabled&&C(s,a,sn(c,b)),k=Xe(b.ref)&&Q(c)?"":c,rn(b.ref)?[...b.ref.options].forEach($=>$.selected=k.includes($.value)):b.refs?Me(b.ref)?b.refs.forEach($=>{(!$.defaultChecked||!$.disabled)&&(Array.isArray(k)?$.checked=!!k.find(P=>P===$.value):$.checked=k===$.value||!!k)}):b.refs.forEach($=>$.checked=$.value===k):Rt(b.ref)?b.ref.value="":(b.ref.value=k,b.ref.type||p.state.next({name:a,values:y?s:B(s)})))}(f.shouldDirty||f.shouldTouch)&&ne(a,k,f.shouldTouch,f.shouldDirty,!0),f.shouldValidate&&pt(a)},Te=(a,c,f,y=!1)=>{for(const w in c){if(!c.hasOwnProperty(w))return;const k=c[w],b=a+"."+w,$=v(n,b);(u.array.has(a)||M(k)||$&&!$._f)&&!$e(k)?Te(b,k,f,y):Se(b,k,f,y)}},We=(a,c,f,y)=>{const w=v(n,a),k=u.array.has(a),b=y?c:B(c),$=v(s,a),P=ae($,b);if(P||C(s,a,b),k)p.array.next({name:a,values:y?s:B(s)}),(d.isDirty||d.dirtyFields||g.isDirty||g.dirtyFields)&&f.shouldDirty&&(z(),p.state.next({name:a,dirtyFields:r.dirtyFields,isDirty:J(a,b)}));else{const K=Array.isArray(b)&&!b.length||X(b);!w||w._f||Q(b)||K?Se(a,b,f,y):Te(a,b,f,y)}if(!P){const K=wt(a,u),le=y?s:B(s);p.state.next({...K&&r,name:i.mount||K?a:void 0,values:le})}},Ne=(a,c,f={})=>We(a,c,f,!1),xn=(a,c={})=>{const f=te(a)?a(s):a;if(!ae(s,f)){s={...s,...f};for(const y of u.mount)We(y,v(f,y),c,!0);p.state.next({...r,name:void 0,type:void 0,values:s}),c.shouldValidate&&T()}},Kt=async a=>{i.mount=!0;const c=a.target;let f=c.name,y=!0;const w=v(n,f),k=P=>{y=Number.isNaN(P)||$e(P)&&isNaN(P.getTime())||ae(P,v(s,f,P))},b=hr(t.mode),$=hr(t.reValidateMode);if(w){let P,K;const le=c.type?dr(w._f):$t(a),de=a.type===ve.BLUR||a.type===ve.FOCUS_OUT,ke=!uo(w._f)&&!e.validate&&!t.resolver&&!v(r.errors,f)&&!w._f.deps||lo(de,v(r.touchedFields,f),r.isSubmitted,$,b),yt=wt(f,u,de);C(s,f,le),de?(!c||!c.readOnly)&&(w._f.onBlur&&w._f.onBlur(a),l&&l(0)):w._f.onChange&&w._f.onChange(a);const Pe=ne(f,le,de),Bn=!X(Pe)||yt;if(!de&&p.state.next({name:f,type:a.type,values:B(s)}),ke)return(d.isValid||g.isValid)&&(t.mode==="onBlur"?de&&T():de||T()),Bn&&p.state.next({name:f,...yt?{}:Pe});if(!t.resolver&&e.validate&&await D({name:f,eventType:a.type}),!de&&yt&&p.state.next({...r}),t.resolver){const{errors:sr}=await ie([f]);if(F([f]),k(le),!y){!X(Pe)&&p.state.next(Pe);return}const Wn=mr(r.errors,n,f),ir=mr(sr,n,Wn.name||f);P=ir.error,f=ir.name,K=X(sr)}else F([f],!0),P=(await yr(w,u.disabled,s,Z,t.shouldUseNativeValidation))[f],F([f]),k(le),y&&(P?K=!1:(d.isValid||g.isValid)&&(K=await N({fields:n,onlyCheckValid:!0,name:f,eventType:a.type})));y&&(w._f.deps&&(!Array.isArray(w._f.deps)||w._f.deps.length>0)&&pt(w._f.deps),_e(f,K,P,Pe))}},qt=(a,c)=>{if(v(r.errors,c)&&a.focus)return a.focus(),1},pt=async(a,c={})=>{let f,y;const w=He(a);if(t.resolver){const k=await Be(R(a)?a:w);f=X(k),y=a?!w.some(b=>v(k,b)):f}else a?(y=(await Promise.all(w.map(async k=>{const b=v(n,k);return await N({fields:b&&b._f?{[k]:b}:b,eventType:ve.TRIGGER})}))).every(Boolean),!(!y&&!r.isValid)&&T()):y=f=await N({fields:n,name:a,eventType:ve.TRIGGER});return p.state.next({...!re(a)||(d.isValid||g.isValid)&&f!==r.isValid?{}:{name:a},...t.resolver||!a?{isValid:f}:{},errors:r.errors}),c.shouldFocus&&!y&&xe(n,qt,a?w:u.mount),y},Yt=(a,c)=>{let f={...i.mount?s:o};return c&&(f=tn(c.dirtyFields?r.dirtyFields:r.touchedFields,f)),R(a)?f:re(a)?v(f,a):a.map(y=>v(f,y))},Ht=(a,c)=>({invalid:!!v((c||r).errors,a),isDirty:!!v((c||r).dirtyFields,a),error:v((c||r).errors,a),isValidating:!!v(r.validatingFields,a),isTouched:!!v((c||r).touchedFields,a)}),Xt=a=>{const c=a?He(a):void 0;c==null||c.forEach(f=>q(r.errors,f)),c?c.forEach(f=>{p.state.next({name:f,errors:r.errors})}):p.state.next({errors:{}})},Ge=(a,c,f)=>{const y=(v(n,a,{_f:{}})._f||{}).ref,w=v(r.errors,a)||{},{ref:k,message:b,type:$,...P}=w;C(r.errors,a,{...P,...c,ref:y}),p.state.next({name:a,errors:r.errors,isValid:!1}),f&&f.shouldFocus&&y&&y.focus&&y.focus()},Rn=(a,c)=>te(a)?p.state.subscribe({next:f=>"values"in f&&a(f.values||ce(void 0,c),f)}):ce(a,c,!0),Qt=a=>p.state.subscribe({next:c=>{if(co(a.name,c.name,a.exact)&&ao(c,a.formState||d,Jn,a.reRenderRoot)){const f={...s};a.callback({values:f,...r,...c,defaultValues:o})}}}).unsubscribe,jn=a=>(i.mount=!0,g={...g,...a.formState},Qt({...a,formState:{...m,...a.formState}})),mt=(a,c={})=>{for(const f of a?He(a):u.mount)u.mount.delete(f),u.array.delete(f),c.keepValue||(q(n,f),q(s,f)),!c.keepError&&q(r.errors,f),!c.keepDirty&&q(r.dirtyFields,f),!c.keepTouched&&q(r.touchedFields,f),!c.keepIsValidating&&q(r.validatingFields,f),!t.shouldUnregister&&!c.keepDefaultValue&&q(o,f);p.state.next({values:B(s)}),p.state.next({...r,...c.keepDirty?{isDirty:J()}:{}}),!c.keepIsValid&&T()},er=({disabled:a,name:c})=>{if(ue(a)&&i.mount||a||u.disabled.has(c)){const w=u.disabled.has(c)!==!!a;a?u.disabled.add(c):u.disabled.delete(c),w&&i.mount&&!i.action&&T()}},_t=(a,c={})=>{let f=v(n,a);const y=ue(c.disabled)||ue(t.disabled),w=!u.registerName.has(a)&&f&&f._f&&!f._f.mount;return C(n,a,{...f||{},_f:{...f&&f._f?f._f:{ref:{name:a}},name:a,mount:!0,...c}}),u.mount.add(a),f&&!w?er({disabled:ue(c.disabled)?c.disabled:t.disabled,name:a}):j(a,!0,c.value),{...y?{disabled:c.disabled||t.disabled}:{},...t.progressive?{required:!!c.required,min:De(c.min),max:De(c.max),minLength:De(c.minLength),maxLength:De(c.maxLength),pattern:De(c.pattern)}:{},name:a,onChange:Kt,onBlur:Kt,ref:k=>{if(k){u.registerName.add(a),_t(a,c),u.registerName.delete(a),f=v(n,a);const b=R(k.value)&&k.querySelectorAll&&k.querySelectorAll("input,select,textarea")[0]||k,$=to(b),P=f._f.refs||[];if($?P.find(K=>K===b):b===f._f.ref)return;C(n,a,{_f:{...f._f,...$?{refs:[...P.filter(bt),b,...Array.isArray(v(o,a))?[{}]:[]],ref:{type:b.type,name:a}}:{ref:b}}}),j(a,!1,void 0,b)}else f=v(n,a,{}),f._f&&(f._f.mount=!1),(t.shouldUnregister||c.shouldUnregister)&&!(qr(u.array,a)&&i.action)&&u.unMount.add(a)}}},gt=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&xe(n,qt,u.mount),Un=a=>{ue(a)&&(p.state.next({disabled:a}),xe(n,(c,f)=>{const y=v(n,f);y&&(c.disabled=y._f.disabled||a,Array.isArray(y._f.refs)&&y._f.refs.forEach(w=>{w.disabled=y._f.disabled||a}))},0,!1))},tr=(a,c)=>async f=>{let y;f&&(f.preventDefault&&f.preventDefault(),f.persist&&f.persist());let w=B(s);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:k,values:b}=await ie();F(),r.errors=k,w=B(b)}else await N({fields:n,eventType:ve.SUBMIT});if(u.disabled.size)for(const k of u.disabled)q(w,k);if(q(r.errors,Hr),X(r.errors)){p.state.next({errors:{}});try{await a(w,f)}catch(k){y=k}}else c&&await c({...r.errors},f),gt(),setTimeout(gt);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:X(r.errors)&&!y,submitCount:r.submitCount+1,errors:r.errors}),y)throw y},Mn=(a,c={})=>{v(n,a)&&(R(c.defaultValue)?Ne(a,B(v(o,a))):(Ne(a,c.defaultValue),C(o,a,B(c.defaultValue))),c.keepTouched||q(r.touchedFields,a),c.keepDirty||(q(r.dirtyFields,a),r.isDirty=c.defaultValue?J(a,B(v(o,a))):J()),c.keepError||(q(r.errors,a),d.isValid&&T()),p.state.next({...r}))},rr=(a,c={})=>{const f=a?B(a):o,y=B(f),w=X(a),k=y;if(c.keepDefaultValues||(o=f),!c.keepValues){if(c.keepDirtyValues){const b=new Set([...u.mount,...Object.keys(ze(o,s))]);for(const $ of Array.from(b)){const P=v(r.dirtyFields,$),K=v(s,$),le=v(k,$);P&&!R(K)?C(k,$,K):!P&&!R(le)&&Ne($,le)}}else{if(ot&&R(a))for(const b of u.mount){const $=v(n,b);if($&&$._f){const P=Array.isArray($._f.refs)?$._f.refs[0]:$._f.ref;if(Xe(P)){const K=P.closest("form");if(K){K.reset();break}}}}if(c.keepFieldsRef)for(const b of u.mount)Ne(b,v(k,b));else n={}}if(t.shouldUnregister){if(s=c.keepDefaultValues?B(o):{},c.keepFieldsRef)for(const b of u.mount)C(s,b,v(k,b))}else s=B(k);p.array.next({values:{...k}}),p.state.next({values:{...k}})}u={mount:c.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!d.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!X(k),i.watch=!!t.shouldUnregister,i.keepIsValid=!!c.keepIsValid,i.action=!1,c.keepErrors||(r.errors={}),p.state.next({submitCount:c.keepSubmitCount?r.submitCount:0,isDirty:w?!1:c.keepDirty?r.isDirty:c.keepValues?J():!!(c.keepDefaultValues&&!ae(a,o)),isSubmitted:c.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:w?{}:c.keepDirtyValues?c.keepDefaultValues&&s?ze(o,s):r.dirtyFields:c.keepDefaultValues&&a?ze(o,a):c.keepDirty?r.dirtyFields:{},touchedFields:c.keepTouched?r.touchedFields:{},errors:c.keepErrors?r.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},nr=(a,c)=>rr(te(a)?a(s):a,{...t.resetOptions,...c}),Ln=(a,c={})=>{const f=v(n,a),y=f&&f._f;if(y){const w=y.refs?y.refs[0]:y.ref;w.focus&&setTimeout(()=>{w.focus(),c.shouldSelect&&te(w.select)&&w.select()})}},Jn=a=>{r={...r,...a}},or={control:{register:_t,unregister:mt,getFieldState:Ht,handleSubmit:tr,setError:Ge,_subscribe:Qt,_runSchema:ie,_updateIsValidating:F,_focusError:gt,_getWatch:ce,_getDirty:J,_setValid:T,_setFieldArray:W,_setDisabledField:er,_setErrors:I,_getFieldArray:ge,_reset:rr,_resetDefaultValues:()=>te(t.defaultValues)&&t.defaultValues().then(a=>{nr(a,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:Un,_subjects:p,_proxyFormState:d,get _fields(){return n},get _formValues(){return s},get _state(){return i},set _state(a){i=a},get _defaultValues(){return o},get _names(){return u},set _names(a){u=a},get _formState(){return r},get _options(){return t},set _options(a){t={...t,...a}}},subscribe:jn,trigger:pt,register:_t,handleSubmit:tr,watch:Rn,setValue:Ne,setValues:xn,getValues:Yt,reset:nr,resetField:Mn,resetDefaultValues:(a,c={})=>{if(o=B(a),!c.keepDirty){const f=ze(o,s);r.dirtyFields=f,r.isDirty=!X(f)}c.keepIsValid||T(),p.state.next({...r,defaultValues:o})},clearErrors:Xt,unregister:mt,setError:Ge,setFocus:Ln,getFieldState:Ht};return{...or,formControl:or}}function uc(e={}){const t=S.useRef(void 0),r=S.useRef(void 0),n=S.useRef(e.formControl),[o,s]=S.useState(()=>({...B(an),isLoading:te(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:te(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&n.current!==e.formControl)if(n.current=e.formControl,e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!te(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...l}=po(e);t.current={...l,formState:o}}const i=t.current.control;return i._options=e,Dt(()=>{const u=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(l=>({...l,isReady:!0})),i._formState.isReady=!0,u},[i]),S.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),S.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),S.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),S.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),S.useEffect(()=>{if(i._proxyFormState.isDirty){const u=i._getDirty();u!==o.isDirty&&i._subjects.state.next({isDirty:u})}},[i,o.isDirty]),S.useEffect(()=>{var u;e.values&&!ae(e.values,r.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((u=i._options.resetOptions)===null||u===void 0)&&u.keepIsValid||i._setValid(),r.current=e.values,s(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),S.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=S.useMemo(()=>Qr(o,i),[i,o]),t.current}const vr=(e,t,r)=>{if(e&&"reportValidity"in e){const n=v(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},It=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?vr(n.ref,r,e):n&&n.refs&&n.refs.forEach(o=>vr(o,r,e))}},br=(e,t)=>{t.shouldUseNativeValidation&&It(e,t);const r={};for(const n in e){const o=v(t.fields,n),s=Object.assign(e[n]||{},{ref:o&&o.ref});if(mo(t.names||Object.keys(e),n)){const i=Object.assign({},v(r,n));C(i,"root",s),C(r,n,i)}else C(r,n,s)}return r},mo=(e,t)=>{const r=wr(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(n=>wr(n).match(`^${r}\\.\\d+`))};function wr(e){return e.replace(/[\[\]]/g,"")}var kr;function _(e,t,r){function n(u,l){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:l,constr:i,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,l);const h=i.prototype,m=Object.keys(h);for(let d=0;d{var l,h;return r!=null&&r.Parent&&u instanceof r.Parent?!0:(h=(l=u==null?void 0:u._zod)==null?void 0:l.traits)==null?void 0:h.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Fe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class cn extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(kr=globalThis).__zod_globalConfig??(kr.__zod_globalConfig={});const Ut=globalThis.__zod_globalConfig;function Oe(e){return Ut}function ln(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function At(e,t){return typeof t=="bigint"?t.toString():t}function Mt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Lt(e){return e==null}function Jt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _o(e,t){const r=e/t,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n){};function et(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const yo=Mt(()=>{var e;if(Ut.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Re(e){if(et(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(et(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function dn(e){return Re(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const vo=new Set(["string","number","symbol"]);function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function we(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function E(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bo(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const wo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ko(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=be(e._zod.def,{get shape(){const i={};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&(i[u]=r.shape[u])}return Ze(this,"shape",i),i},checks:[]});return we(e,s)}function zo(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=be(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const u in t){if(!(u in r.shape))throw new Error(`Unrecognized key: "${u}"`);t[u]&&delete i[u]}return Ze(this,"shape",i),i},checks:[]});return we(e,s)}function $o(e,t){if(!Re(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=be(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Ze(this,"shape",s),s}});return we(e,o)}function Oo(e,t){if(!Re(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=be(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ze(this,"shape",n),n}});return we(e,r)}function Eo(e,t){var n;if((n=e._zod.def.checks)!=null&&n.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=be(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t._zod.def.shape};return Ze(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return we(e,r)}function Zo(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=be(t._zod.def,{get shape(){const u=t._zod.def.shape,l={...u};if(r)for(const h in r){if(!(h in u))throw new Error(`Unrecognized key: "${h}"`);r[h]&&(l[h]=e?new e({type:"optional",innerType:u[h]}):u[h])}else for(const h in u)l[h]=e?new e({type:"optional",innerType:u[h]}):u[h];return Ze(this,"shape",l),l},checks:[]});return we(t,i)}function So(e,t,r){const n=be(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)s[i]=new e({type:"nonoptional",innerType:o[i]});return Ze(this,"shape",s),s}});return we(t,n)}function Ae(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ke(e){return typeof e=="string"?e:e==null?void 0:e.message}function Ee(e,t,r){var l,h,m,d,g,p;const n=e.message?e.message:Ke((m=(h=(l=e.inst)==null?void 0:l._zod.def)==null?void 0:h.error)==null?void 0:m.call(h,e))??Ke((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Ke((g=r.customError)==null?void 0:g.call(r,e))??Ke((p=r.localeError)==null?void 0:p.call(r,e))??"Invalid input",{inst:o,continue:s,input:i,...u}=e;return u.path??(u.path=[]),u.message=n,t!=null&&t.reportInput&&(u.input=i),u}function Bt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function je(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const pn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,At,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Wt=_("$ZodError",pn),ut=_("$ZodError",pn,{Parent:Error});function Ao(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function Fo(e,t=r=>r.message){const r={_errors:[]},n=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(u=>n({issues:u},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{const u=[...s,...i.path];if(u.length===0)r._errors.push(t(i));else{let l=r,h=0;for(;h(t,r,n,o)=>{const s=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Fe;if(i.issues.length){const u=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Ee(l,s,Oe())));throw fn(u,o==null?void 0:o.callee),u}return i.value},Vo=at(ut),ct=e=>async(t,r,n,o)=>{const s=n?{...n,async:!0}:{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const u=new((o==null?void 0:o.Err)??e)(i.issues.map(l=>Ee(l,s,Oe())));throw fn(u,o==null?void 0:o.callee),u}return i.value},To=ct(ut),lt=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Fe;return s.issues.length?{success:!1,error:new(e??Wt)(s.issues.map(i=>Ee(i,o,Oe())))}:{success:!0,data:s.value}},No=lt(ut),ft=e=>async(t,r,n)=>{const o=n?{...n,async:!0}:{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>Ee(i,o,Oe())))}:{success:!0,data:s.value}},Po=ft(ut),Do=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return at(e)(t,r,o)},Co=e=>(t,r,n)=>at(e)(t,r,n),xo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ct(e)(t,r,o)},Ro=e=>async(t,r,n)=>ct(e)(t,r,n),jo=e=>(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return lt(e)(t,r,o)},Uo=e=>(t,r,n)=>lt(e)(t,r,n),Mo=e=>async(t,r,n)=>{const o=n?{...n,direction:"backward"}:{direction:"backward"};return ft(e)(t,r,o)},Lo=e=>async(t,r,n)=>ft(e)(t,r,n),Jo=/^[cC][0-9a-z]{6,}$/,Bo=/^[0-9a-z]+$/,Wo=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Go=/^[0-9a-vA-V]{20}$/,Ko=/^[A-Za-z0-9]{27}$/,qo=/^[a-zA-Z0-9_-]{21}$/,Yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ho=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Or=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Xo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Qo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function es(){return new RegExp(Qo,"u")}const ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ns=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,os=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ss=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,mn=/^[A-Za-z0-9_-]*$/,is=/^https?$/,us=/^\+[1-9]\d{6,14}$/,_n="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",as=new RegExp(`^${_n}$`);function gn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function cs(e){return new RegExp(`^${gn(e)}$`)}function ls(e){const t=gn({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${_n}T(?:${n})$`)}const fs=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ds=/^-?\d+$/,hs=/^-?\d+(?:\.\d+)?$/,ps=/^[^A-Z]*$/,ms=/^[^a-z]*$/,se=_("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),yn={number:"number",bigint:"bigint",object:"date"},vn=_("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const r=yn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?n.value<=t.value:n.value{se.init(e,t);const r=yn[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_s=_("$ZodCheckMultipleOf",(e,t)=>{se.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):_o(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gs=_("$ZodCheckNumberFormat",(e,t)=>{var i;se.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[o,s]=wo[t.format];e._zod.onattach.push(u=>{const l=u._zod.bag;l.format=t.format,l.minimum=o,l.maximum=s,r&&(l.pattern=ds)}),e._zod.check=u=>{const l=u.value;if(r){if(!Number.isInteger(l)){u.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?u.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):u.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}ls&&u.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),ys=_("$ZodCheckMaxLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const o=n.value;if(o.length<=t.maximum)return;const i=Bt(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),vs=_("$ZodCheckMinLength",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const i=Bt(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),bs=_("$ZodCheckLengthEquals",(e,t)=>{var r;se.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Lt(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const i=Bt(o),u=s>t.length;n.issues.push({origin:i,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),dt=_("$ZodCheckStringFormat",(e,t)=>{var r,n;se.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),ws=_("$ZodCheckRegex",(e,t)=>{dt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ks=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ps),dt.init(e,t)}),zs=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ms),dt.init(e,t)}),$s=_("$ZodCheckIncludes",(e,t)=>{se.init(e,t);const r=it(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Os=_("$ZodCheckStartsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`^${it(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Es=_("$ZodCheckEndsWith",(e,t)=>{se.init(e,t);const r=new RegExp(`.*${it(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zs=_("$ZodCheckOverwrite",(e,t)=>{se.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Ss{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(` `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...r,o.join(` `))}}const Is={major:4,minor:4,patch:3},Y=_("$ZodType",(e,t)=>{var o;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Is;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(u,l,h)=>{let m=Ae(u),d;for(const g of l){if(g._zod.def.when){if(Io(u)||!g._zod.def.when(u))continue}else if(m)continue;const p=u.issues.length,Z=g._zod.check(u);if(Z instanceof Promise&&(h==null?void 0:h.async)===!1)throw new Fe;if(d||Z instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await Z,u.issues.length!==p&&(m||(m=Ae(u,p)))});else{if(u.issues.length===p)continue;m||(m=Ae(u,p))}}return d?d.then(()=>u):u},i=(u,l,h)=>{if(Ae(u))return u.aborted=!0,u;const m=s(l,n,h);if(m instanceof Promise){if(h.async===!1)throw new Fe;return m.then(d=>e._zod.parse(d,h))}return e._zod.parse(m,h)};e._zod.run=(u,l)=>{if(l.skipChecks)return e._zod.parse(u,l);if(l.direction==="backward"){const m=e._zod.parse({value:u.value,issues:[]},{...l,skipChecks:!0});return m instanceof Promise?m.then(d=>i(d,u,l)):i(m,u,l)}const h=e._zod.parse(u,l);if(h instanceof Promise){if(l.async===!1)throw new Fe;return h.then(m=>s(m,n,l))}return s(h,n,l)}}x(e,"~standard",()=>({validate:s=>{var i;try{const u=No(e,s);return u.success?{value:u.data}:{issues:(i=u.error)==null?void 0:i.issues}}catch{return Po(e,s).then(l=>{var h;return l.success?{value:l.data}:{issues:(h=l.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),Gt=_("$ZodString",(e,t)=>{var r;Y.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??fs(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),U=_("$ZodStringFormat",(e,t)=>{dt.init(e,t),Gt.init(e,t)}),As=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ho),U.init(e,t)}),Fs=_("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Or(n))}else t.pattern??(t.pattern=Or());U.init(e,t)}),Vs=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Xo),U.init(e,t)}),Ts=_("$ZodURL",(e,t)=>{U.init(e,t),e._zod.check=r=>{var n;try{const o=r.value.trim();if(!t.normalize&&((n=t.protocol)==null?void 0:n.source)===is.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}const s=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Ns=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=es()),U.init(e,t)}),Ps=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=qo),U.init(e,t)}),Ds=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jo),U.init(e,t)}),Cs=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Bo),U.init(e,t)}),xs=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Wo),U.init(e,t)}),Rs=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Go),U.init(e,t)}),js=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ko),U.init(e,t)}),Us=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ls(t)),U.init(e,t)}),Ms=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=as),U.init(e,t)}),Ls=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=cs(t)),U.init(e,t)}),Js=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Yo),U.init(e,t)}),Bs=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ts),U.init(e,t),e._zod.bag.format="ipv4"}),Ws=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=rs),U.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Gs=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ns),U.init(e,t)}),Ks=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=os),U.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function wn(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const qs=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ss),U.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{wn(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Ys(e){if(!mn.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return wn(r)}const Hs=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=mn),U.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Ys(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Xs=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=us),U.init(e,t)});function Qs(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const ei=_("$ZodJWT",(e,t)=>{U.init(e,t),e._zod.check=r=>{Qs(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),kn=_("$ZodNumber",(e,t)=>{Y.init(e,t),e._zod.pattern=e._zod.bag.pattern??hs,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),ti=_("$ZodNumberFormat",(e,t)=>{gs.init(e,t),kn.init(e,t)}),ri=_("$ZodUnknown",(e,t)=>{Y.init(e,t),e._zod.parse=r=>r}),ni=_("$ZodNever",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Er(e,t,r){e.issues.length&&t.issues.push(...hn(r,e.issues)),t.value[r]=e.value}const oi=_("$ZodArray",(e,t)=>{Y.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let i=0;iEr(h,r,i))):Er(l,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function tt(e,t,r,n,o,s){const i=r in n;if(e.issues.length){if(o&&s&&!i)return;t.issues.push(...hn(r,e.issues))}if(!i&&!o){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?i&&(t.value[r]=void 0):t.value[r]=e.value}function zn(e){var n,o,s,i;const t=Object.keys(e.shape);for(const u of t)if(!((i=(s=(o=(n=e.shape)==null?void 0:n[u])==null?void 0:o._zod)==null?void 0:s.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${u}": expected a Zod schema`);const r=bo(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function $n(e,t,r,n,o,s){const i=[],u=o.keySet,l=o.catchall._zod,h=l.def.type,m=l.optin==="optional",d=l.optout==="optional";for(const g in t){if(g==="__proto__"||u.has(g))continue;if(h==="never"){i.push(g);continue}const p=l.run({value:t[g],issues:[]},n);p instanceof Promise?e.push(p.then(Z=>tt(Z,r,g,t,m,d))):tt(p,r,g,t,m,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const si=_("$ZodObject",(e,t)=>{Y.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const u=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...u};return Object.defineProperty(t,"shape",{value:l}),l}})}const n=Mt(()=>zn(t));x(e._zod,"propValues",()=>{const u=t.shape,l={};for(const h in u){const m=u[h]._zod;if(m.values){l[h]??(l[h]=new Set);for(const d of m.values)l[h].add(d)}}return l});const o=et,s=t.catchall;let i;e._zod.parse=(u,l)=>{i??(i=n.value);const h=u.value;if(!o(h))return u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u;u.value={};const m=[],d=i.shape;for(const g of i.keys){const p=d[g],Z=p._zod.optin==="optional",A=p._zod.optout==="optional",T=p._zod.run({value:h[g],issues:[]},l);T instanceof Promise?m.push(T.then(F=>tt(F,u,g,h,Z,A))):tt(T,u,g,h,Z,A)}return s?$n(m,h,u,l,n.value,e):m.length?Promise.all(m).then(()=>u):u}}),ii=_("$ZodObjectJIT",(e,t)=>{si.init(e,t);const r=e._zod.parse,n=Mt(()=>zn(t)),o=g=>{var W,O;const p=new Ss(["shape","payload","ctx"]),Z=n.value,A=I=>{const V=$r(I);return`shape[${V}]._zod.run({ value: input[${V}], issues: [] }, ctx)`};p.write("const input = payload.value;");const T=Object.create(null);let F=0;for(const I of Z.keys)T[I]=`key_${F++}`;p.write("const newResult = {};");for(const I of Z.keys){const V=T[I],j=$r(I),ne=g[I],_e=((W=ne==null?void 0:ne._zod)==null?void 0:W.optin)==="optional",ie=((O=ne==null?void 0:ne._zod)==null?void 0:O.optout)==="optional";p.write(`const ${V} = ${A(I)};`),_e&&ie?p.write(` if (${V}.issues.length) { diff --git a/embed_static/static/spa/assets/index-2yIymxOj.css b/embed_static/static/spa/assets/index-2yIymxOj.css deleted file mode 100644 index 820241e..0000000 --- a/embed_static/static/spa/assets/index-2yIymxOj.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--j13-font-family);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 210 20% 98%;--foreground: 222 47% 11%;--card: 0 0% 100%;--card-foreground: 222 47% 11%;--popover: 0 0% 100%;--popover-foreground: 222 47% 11%;--primary: 152 72% 36%;--primary-foreground: 0 0% 100%;--secondary: 210 20% 96%;--secondary-foreground: 222 47% 11%;--muted: 210 20% 96%;--muted-foreground: 215 16% 47%;--accent: 152 45% 95%;--accent-foreground: 152 72% 28%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 214 20% 91%;--input: 214 20% 91%;--ring: 152 72% 36%;--radius: .375rem;--color-text-1: hsl(var(--foreground));--color-text-2: hsl(215 16% 35%);--color-text-3: hsl(var(--muted-foreground));--color-text-4: hsl(215 12% 65%);--color-fill-3: hsl(210 20% 94%)}.dark{--background: 240 6% 10%;--foreground: 0 0% 95%;--card: 240 5% 13%;--card-foreground: 0 0% 95%;--popover: 240 5% 13%;--popover-foreground: 0 0% 95%;--primary: 152 58% 46%;--primary-foreground: 0 0% 100%;--secondary: 240 4% 16%;--secondary-foreground: 0 0% 95%;--muted: 240 4% 16%;--muted-foreground: 240 5% 65%;--accent: 152 30% 14%;--accent-foreground: 152 58% 55%;--destructive: 0 63% 45%;--destructive-foreground: 0 0% 95%;--border: 240 4% 18%;--input: 240 4% 18%;--ring: 152 58% 46%;--color-text-1: hsl(var(--foreground));--color-text-2: hsl(240 5% 75%);--color-text-3: hsl(var(--muted-foreground));--color-text-4: hsl(240 5% 50%);--color-fill-3: hsl(240 4% 20%)}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.z-\[110\]{z-index:110}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.block{display:block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-px{height:1px}.min-h-\[60px\]{min-height:60px}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[160px\]{width:160px}.w-\[60px\]{width:60px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.bg-\[var\(--j13-green-bg\)\]{background-color:var(--j13-green-bg)}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-sans{font-family:var(--j13-font-family)}.text-\[0\.8rem\]{font-size:.8rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[var\(--j13-green\)\]{color:var(--j13-green)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}:root{--j13-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", sans-serif;--j13-green: #18a058;--j13-green-hover: #138f4c;--j13-green-bg: rgba(24, 160, 88, .08);--j13-green-soft: #edfbf3;--j13-border: #e8edf2;--j13-border-light: #f0f3f7;--j13-sidebar-w: 210px;--j13-aside-w: 280px;--j13-header-h: 56px;--j13-max-w: 1400px;--j13-article-read-w: 820px;--j13-bg-page: #f5f7fa;--j13-bg-workspace: #f8fafc;--j13-bg-surface: #ffffff;--j13-bg-block: #ffffff;--j13-bg-block-muted: #f1f4f8;--j13-bg-block-accent: #f0faf5;--j13-shadow-soft: 0 1px 2px rgba(15, 23, 42, .04);--j13-shadow-card: 0 2px 8px rgba(15, 23, 42, .05)}.dark{--j13-green: #23c36b;--j13-green-hover: #1fb35f;--j13-green-bg: rgba(35, 195, 107, .12);--j13-green-soft: rgba(35, 195, 107, .08);--j13-border: #2e2e32;--j13-border-light: #262629;--j13-bg-page: #141416;--j13-bg-workspace: #18181b;--j13-bg-surface: #1f1f23;--j13-bg-block: #232328;--j13-bg-block-muted: #1c1c20;--j13-bg-block-accent: rgba(35, 195, 107, .06);--j13-shadow-soft: 0 1px 2px rgba(0, 0, 0, .2);--j13-shadow-card: 0 2px 8px rgba(0, 0, 0, .28)}*{box-sizing:border-box}html{scrollbar-gutter:stable;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;font-family:var(--j13-font-family);text-rendering:optimizeLegibility}html,body,#root{height:100%;margin:0}body{font-family:var(--j13-font-family);font-size:14px;line-height:1.5;color:var(--color-text-1);background:var(--j13-bg-page);overflow:hidden}a{color:var(--j13-green);text-decoration:none}a:hover{text-decoration:underline}.app-shell{height:100%;max-height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:var(--j13-bg-page)}.app-frame{flex:1;min-height:0;height:100%;max-width:var(--j13-max-w);width:100%;margin:0 auto;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid var(--j13-border);border-right:1px solid var(--j13-border);background:var(--j13-bg-surface)}.app-header{height:var(--j13-header-h);flex-shrink:0;z-index:100;background:var(--j13-bg-surface);border-bottom:1px solid var(--j13-border)}.header-inner{height:100%;width:100%;padding:0 20px;display:flex;align-items:center;gap:20px}.header-brand{display:flex;align-items:center;gap:10px;flex-shrink:0;border:none;background:none;padding:4px 0;cursor:pointer;color:inherit;font:inherit}.header-brand:hover .header-logo-text{color:var(--j13-green)}.header-logo-mark{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--j13-green) 0%,#34c471 100%);color:#fff;font-weight:700;font-size:17px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px #1a7f4b47}.header-logo-text{font-size:15px;font-weight:600;letter-spacing:.02em;transition:color .15s}.header-search-wrap{flex:1;min-width:0;max-width:420px;display:flex;align-items:center;gap:8px;height:36px;padding:0 14px;border-radius:999px;background:var(--j13-bg-block-muted);border:1px solid var(--j13-border-light);transition:border-color .2s,background .2s,box-shadow .2s}.header-search-wrap:focus-within{background:var(--j13-bg-surface);border-color:color-mix(in srgb,var(--j13-green) 30%,transparent);box-shadow:0 0 0 3px var(--j13-green-bg)}.header-search-icon{flex-shrink:0;font-size:15px;color:var(--color-text-3)}.header-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-1);font-family:inherit}.header-search-input::-moz-placeholder{color:var(--color-text-4)}.header-search-input::placeholder{color:var(--color-text-4)}.header-search-input::-webkit-search-cancel-button{display:none}.header-search-clear{flex-shrink:0;width:20px;height:20px;border:none;border-radius:50%;background:var(--color-fill-3);color:var(--color-text-3);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background .15s,color .15s}.header-search-clear:hover{background:var(--color-fill-4);color:var(--color-text-1)}.header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0;margin-left:auto}.header-compose-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 16px;border:none;border-radius:999px;background:var(--j13-green);color:#fff;font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s;box-shadow:0 2px 6px #1a7f4b38}.header-compose-btn:hover{background:var(--j13-green-hover);box-shadow:0 3px 10px #1a7f4b4d}.header-compose-btn:active{transform:scale(.97)}.header-action-group{display:flex;align-items:center;gap:4px;padding:3px;border-radius:999px;background:var(--j13-bg-block-muted);border:1px solid var(--j13-border-light)}.header-icon-btn{width:32px;height:32px;border:none;border-radius:50%;background:transparent;color:var(--color-text-2);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}.header-icon-btn:hover{background:var(--color-fill-3);color:var(--color-text-1)}.header-user-btn{width:32px;height:32px;border:none;border-radius:50%;padding:0;cursor:pointer;overflow:hidden;background:var(--j13-green);display:flex;align-items:center;justify-content:center;transition:box-shadow .15s,transform .1s}@media (hover: hover){.header-user-btn:hover{box-shadow:0 0 0 2px var(--j13-green-bg),0 0 0 3px var(--j13-green)}}.header-user-btn:focus-visible{box-shadow:0 0 0 2px var(--j13-green-bg),0 0 0 3px var(--j13-green)}.header-user-btn:focus:not(:focus-visible){outline:none;box-shadow:none}.header-user-avatar{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.header-user-initial{color:#fff;font-size:14px;font-weight:600}.header-login-btn{height:32px;padding:0 14px;border:none;border-radius:999px;background:transparent;color:var(--j13-green);font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;transition:background .15s}.header-login-btn:hover{background:var(--j13-green-bg)}.header-auth-slot{display:inline-block;width:32px;height:32px;border-radius:50%;flex-shrink:0}.header-auth-slot--loading{background:var(--color-fill-3)}.app-body{flex:1;display:flex;min-height:0;width:100%;overflow:hidden;background:var(--j13-bg-surface)}.sidebar{width:var(--j13-sidebar-w);flex-shrink:0;border-right:1px solid var(--j13-border-light);background:var(--j13-bg-surface);overflow-y:auto;padding:12px 0}.sidebar-section{padding:4px 12px 8px;font-size:11px;font-weight:600;color:var(--color-text-3)}.sidebar-nav{display:flex;flex-direction:column;gap:2px;padding:0 8px}.sidebar-nav-item{display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:0 12px;height:36px;border:none;border-radius:6px;background:transparent;color:var(--color-text-1);font-size:14px;cursor:pointer;text-align:left;transition:background .15s,color .15s}.sidebar-nav-item:hover{background:var(--j13-bg-block-muted)}.sidebar-nav-item.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.sidebar-nav-item svg{width:16px;height:16px;flex-shrink:0}.sidebar-nav-item__meta{margin-left:auto;color:var(--color-text-4);font-size:12px}.sidebar-actions{padding:12px;border-top:1px solid var(--j13-border);margin-top:8px}.main-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.content-workspace{flex:1;display:flex;min-width:0;min-height:0;overflow:hidden;background:var(--j13-bg-surface)}.aside-panel{width:var(--j13-aside-w);flex-shrink:0;border-left:1px solid var(--j13-border-light);overflow-y:auto;padding:0;display:flex;flex-direction:column;background:var(--j13-bg-surface)}@media (max-width: 1100px){.aside-panel{display:none}}@media (max-width: 768px){.app-frame{border-left:none;border-right:none}.sidebar{display:none}.header-inner{padding:0 12px;gap:10px}.header-search-wrap{max-width:none}.header-compose-btn{width:34px;padding:0;justify-content:center}.feed-banner-row{flex-direction:row;gap:10px}.board-grid{flex-wrap:nowrap;overflow-x:auto;padding:8px 12px;scrollbar-width:none}.board-grid::-webkit-scrollbar{display:none}}.page-wrap{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;scrollbar-width:none;-ms-overflow-style:none}.page-wrap::-webkit-scrollbar{display:none}.virtual-list-wrap,.post-list-scroll{flex:1;overflow:auto;min-height:0;scrollbar-width:none;-ms-overflow-style:none}.virtual-list-wrap::-webkit-scrollbar,.post-list-scroll::-webkit-scrollbar{display:none}.feed-list-footer{display:flex;justify-content:center;align-items:center;padding:16px 12px}.feed-list-footer--end{font-size:12px;color:var(--color-text-3);padding:10px 12px}.feed-list-footer--history{flex-direction:column;gap:10px}.feed-list-footer__hint{margin:0;font-size:12px;color:var(--color-text-3)}.page-inner{padding:20px 24px;max-width:720px}.page-inner-wide{padding:20px 24px}.page-title{font-size:20px;font-weight:600;margin:0 0 4px}.page-desc{font-size:13px;color:var(--color-text-3);margin:0 0 20px}.content-surface{background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);overflow:hidden}.section-card{background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);padding:20px;margin-bottom:16px}.section-card-title{font-size:15px;font-weight:600;margin:0 0 16px;padding-bottom:12px;border-bottom:1px solid var(--j13-border-light)}.feed-top{flex-shrink:0;border-bottom:1px solid var(--j13-border-light);background:var(--j13-bg-block)}@media (min-width: 900px){.feed-top:not(:has(.feed-head--solo)){display:flex;align-items:center;gap:16px;padding:6px 16px}.feed-top:not(:has(.feed-head--solo)) .feed-head{padding:0;flex-shrink:0}.feed-top:not(:has(.feed-head--solo)) .feed-toolbar{padding:0;flex:1;min-width:0}}.feed-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px 6px}.feed-head--solo{padding-bottom:8px}.feed-head__title{display:flex;align-items:baseline;gap:10px;min-width:0;flex:1}.feed-head h2{margin:0;font-size:15px;font-weight:600;white-space:nowrap}.feed-head__meta{font-size:12px;color:var(--color-text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.feed-head__meta strong{color:var(--j13-green);font-weight:600}.feed-head__dot{margin:0 4px;opacity:.55}.feed-head__clear{flex-shrink:0;border:none;background:transparent;padding:0;font-size:12px;color:var(--j13-green);cursor:pointer;font-family:inherit}.feed-head__clear:hover{text-decoration:underline}.feed-toolbar{display:flex;align-items:center;gap:10px;padding:0 16px 8px}.feed-toolbar__count{flex-shrink:0;font-size:12px;color:var(--color-text-3);white-space:nowrap}.feed-banner{padding:8px 16px;border-bottom:1px solid var(--j13-border-light)}.feed-banner-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.feed-banner-title{flex:1;min-width:0}.feed-banner h2{margin:0;font-size:15px;font-weight:600}.feed-banner p{margin:0;font-size:12px;color:var(--color-text-3);line-height:1.45}.feed-stats{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:6px;font-size:12px;color:var(--color-text-3)}.feed-stats strong{color:var(--j13-green);font-weight:600}.feed-action-slot{display:inline-block;width:88px;height:28px;border-radius:4px;background:var(--color-fill-3)}.feed-actions{min-height:28px}.mobile-board-bar{display:none;padding:8px 12px;gap:8px;overflow-x:auto;border-bottom:1px solid var(--j13-border);background:var(--j13-bg-surface)}@media (max-width: 768px){.mobile-board-bar{display:flex}}.board-chip{flex-shrink:0;padding:4px 12px;border-radius:16px;font-size:13px;border:1px solid var(--j13-border-light);background:var(--j13-bg-block);cursor:pointer}.board-chip.active{background:var(--j13-green-bg);border-color:transparent;color:var(--j13-green);font-weight:600}.board-grid{display:flex;flex-wrap:wrap;gap:8px;padding:10px 20px;border-bottom:1px solid var(--j13-border-light)}.feed-sort-bar{display:flex;align-items:center;gap:2px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.feed-sort-bar::-webkit-scrollbar{display:none}.feed-sort-tab{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:none;border-radius:6px;background:transparent;color:var(--color-text-2);font-family:inherit;font-size:12px;cursor:pointer;flex-shrink:0;white-space:nowrap;transition:background .15s,color .15s}.feed-sort-tab:hover{background:var(--j13-bg-block-muted);color:var(--color-text-1)}.feed-sort-tab.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.feed-sort-tab svg{width:14px;height:14px;flex-shrink:0}@media (max-width: 768px){.feed-head{flex-wrap:wrap;padding:8px 12px 6px}.feed-head__meta{display:none}.feed-toolbar{padding:0 12px 8px}}.board-grid-empty{padding:20px;border-bottom:1px solid var(--j13-border-light)}.board-tab{display:flex;align-items:center;gap:6px;height:36px;max-width:220px;padding:0 14px;border:1px solid var(--j13-border-light);border-radius:8px;background:var(--j13-bg-block);cursor:pointer;transition:border-color .15s,background .15s;font-family:inherit;color:inherit;flex-shrink:0}.board-tab:hover{border-color:var(--j13-green-light, #7cb87c);background:var(--j13-bg-block-muted)}.board-tab.active{border-color:var(--j13-green);background:color-mix(in srgb,var(--j13-green) 10%,var(--j13-bg-block))}.board-tab-icon{font-size:14px;color:var(--j13-green);line-height:1;flex-shrink:0}.board-tab-name{font-size:13px;font-weight:500;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.board-tab-count{flex-shrink:0;min-width:18px;padding:0 6px;height:20px;line-height:20px;font-size:11px;text-align:center;border-radius:10px;background:var(--color-fill-2);color:var(--color-text-3)}.board-tab.active .board-tab-count{background:color-mix(in srgb,var(--j13-green) 20%,transparent);color:var(--j13-green)}.board-tab--skeleton{width:140px;border-color:transparent;background:linear-gradient(90deg,var(--color-fill-2) 25%,var(--color-fill-3) 50%,var(--color-fill-2) 75%);background-size:200% 100%;animation:board-skeleton-shimmer 1.2s ease-in-out infinite;pointer-events:none}.board-grid--skeleton{pointer-events:none}@keyframes board-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.post-list-bar{display:flex;justify-content:space-between;padding:10px 20px;font-size:13px;color:var(--color-text-3);border-bottom:1px solid var(--j13-border-light)}.post-row{display:flex;align-items:flex-start;gap:12px;padding:12px 20px;border-bottom:1px solid var(--j13-border-light);cursor:pointer;transition:background .15s}.post-row:hover{background:var(--j13-bg-block-muted)}.post-avatar{width:36px;height:36px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:14px;font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden}.post-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.post-body{flex:1;min-width:0}.post-title{font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:4px}.post-pinned-icon{display:inline-block;vertical-align:-.15em;flex-shrink:0;color:#e53935;stroke-width:1.5}.post-meta{font-size:12px;color:var(--color-text-3);display:flex;flex-wrap:wrap;gap:8px}.post-stats{display:flex;gap:12px;font-size:12px;color:var(--color-text-3);flex-shrink:0;padding-top:4px}.empty-state{text-align:center;padding:60px 24px;color:var(--color-text-3)}.empty-feed{text-align:center;padding:48px 24px;color:var(--color-text-3)}.empty-feed-icon{font-size:36px;margin-bottom:8px}.post-detail-loading{display:flex;align-items:center;justify-content:center;padding:60px;flex:1}.post-detail-page{display:flex;flex-direction:column;min-height:0;gap:16px;padding:16px 20px 24px;background:var(--j13-bg-workspace)}.post-detail-header{padding:16px 20px 20px;background:var(--j13-bg-surface);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-card);flex-shrink:0}.post-detail-nav{display:flex;align-items:center;gap:8px;margin-bottom:8px}.post-detail-board-tag{margin:0!important}.post-detail-head{margin-bottom:12px}.post-detail-title{font-size:20px;font-weight:600;margin:0 0 12px;line-height:1.45;word-break:break-word}.post-detail-author-row{display:flex;align-items:center;gap:10px}.post-avatar-lg{width:40px;height:40px;font-size:16px}.post-detail-author-info{display:flex;flex-direction:column;gap:2px}.post-detail-author-name{font-size:14px;font-weight:600;color:var(--color-text-1)}.post-detail-meta-line{font-size:12px;color:var(--color-text-3);display:flex;flex-wrap:wrap;align-items:center;gap:4px}.post-detail-locked-tag{display:inline-flex;align-items:center;gap:3px;margin-left:6px;color:hsl(var(--destructive));font-size:11px}.post-detail-edit-hint{font-size:12px;color:var(--color-text-3);align-self:center}.post-revision-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#00000080;display:flex;align-items:center;justify-content:center;padding:16px}.post-revision-overlay--fullscreen{padding:0}.post-revision-panel{background:hsl(var(--background));border-radius:12px;width:min(1080px,100%);height:min(88vh,900px);display:flex;flex-direction:column;box-shadow:0 12px 48px #00000038;overflow:hidden}.post-revision-panel--fullscreen{width:100%;height:100%;max-height:none;border-radius:0}.post-revision-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--j13-border-light);flex-shrink:0}.post-revision-head-left{display:flex;align-items:center;gap:8px;min-width:0}.post-revision-head-left h3{font-size:15px;font-weight:600;margin:0}.post-revision-head-sub{font-size:12px;color:var(--color-text-3);padding-left:8px;border-left:1px solid var(--j13-border-light)}.post-revision-head-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.post-revision-view-tabs{display:flex;gap:2px;background:hsl(var(--muted));border-radius:8px;padding:3px}.post-revision-tab{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border:none;background:none;border-radius:6px;font-size:12px;color:var(--color-text-2);cursor:pointer;white-space:nowrap}.post-revision-tab:hover{color:var(--color-text-1)}.post-revision-tab.active{background:hsl(var(--background));color:var(--color-text-1);font-weight:500;box-shadow:0 1px 3px #00000014}.post-revision-icon-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:none;border-radius:8px;cursor:pointer;color:var(--color-text-3)}.post-revision-icon-btn:hover{background:hsl(var(--muted));color:var(--color-text-1)}.post-revision-loading,.post-revision-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:48px 24px;color:var(--color-text-3);font-size:14px}.post-revision-body{display:flex;flex:1;min-height:0;overflow:hidden}.post-revision-sidebar{width:260px;flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid var(--j13-border-light);min-height:0}.post-revision-sidebar-label{padding:10px 14px 6px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-3)}.post-revision-list{list-style:none;margin:0;padding:4px 8px;overflow-y:auto;flex:1;min-height:0}.post-revision-item{display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;padding:10px 12px;border:none;background:none;border-radius:8px;cursor:pointer;font-size:13px;margin-bottom:2px}.post-revision-item:hover,.post-revision-item.active{background:hsl(var(--muted))}.post-revision-item-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.post-revision-item-num{font-size:11px;font-weight:600;color:var(--color-text-3)}.post-revision-item-title{font-weight:500;color:var(--color-text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.post-revision-item-meta{font-size:11px;color:var(--color-text-3)}.post-revision-badge{font-size:10px;padding:1px 6px;border-radius:4px;background:hsl(var(--primary) / .12);color:hsl(var(--primary));font-weight:500}.post-revision-badge--none{background:hsl(var(--muted));color:var(--color-text-3)}.post-revision-current{padding:12px 14px;border-top:1px solid var(--j13-border-light);background:hsl(var(--muted) / .4);flex-shrink:0}.post-revision-current-label{display:block;font-size:11px;color:var(--color-text-3);margin-bottom:4px}.post-revision-current-title{font-size:13px;font-weight:500;color:var(--color-text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.post-revision-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}.post-revision-main-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-bottom:1px solid var(--j13-border-light);flex-shrink:0}.post-revision-main-editor{font-size:14px;font-weight:600;color:var(--color-text-1);margin-right:8px}.post-revision-main-time{font-size:12px;color:var(--color-text-3)}.post-revision-scroll{flex:1;overflow-y:auto;overflow-x:hidden;min-height:0;padding:16px 20px 24px;-webkit-overflow-scrolling:touch}.revision-diff-view{display:flex;flex-direction:column;gap:20px}.revision-diff-section h4{font-size:12px;font-weight:600;color:var(--color-text-3);text-transform:uppercase;letter-spacing:.04em;margin:0 0 8px}.revision-diff-block{padding:12px 14px;background:hsl(var(--muted) / .35);border-radius:8px;font-size:14px;line-height:1.6;word-break:break-word}.revision-diff-inline del{background:#fbe9e9;color:#8f2424;text-decoration:line-through;border-radius:2px;padding:0 2px}.revision-diff-inline ins{background:#e2f8ea;color:#246b3c;text-decoration:none;border-radius:2px;padding:0 2px}.revision-diff-unchanged{color:var(--color-text-3);font-size:13px}.revision-diff-stats{display:flex;gap:8px;margin-bottom:8px}.revision-diff-stat{font-size:11px;padding:2px 8px;border-radius:4px;font-weight:500}.revision-diff-stat--add{background:#e2f8ea;color:#246b3c}.revision-diff-stat--del{background:#fbe9e9;color:#8f2424}.revision-diff-pre{margin:0;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,monospace;font-size:13px;line-height:1.55;border:1px solid var(--j13-border-light);border-radius:8px;overflow:hidden}.revision-diff-line{display:flex;padding:1px 0;white-space:pre-wrap;word-break:break-word}.revision-diff-line--add{background:#ebfaf0}.revision-diff-line--del{background:#fceeee}.revision-diff-line--same{background:hsl(var(--background))}.revision-diff-gutter{flex-shrink:0;width:24px;text-align:center;color:var(--color-text-3);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:12px}.revision-diff-line--add .revision-diff-gutter{color:#395}.revision-diff-line--del .revision-diff-gutter{color:#b82e2e}.revision-diff-text{flex:1;padding-right:12px}.revision-diff-line--add .revision-diff-text{color:#1f5130}.revision-diff-line--del .revision-diff-text{color:#722;text-decoration:line-through}.revision-full-view h4{font-size:18px;font-weight:600;margin:0 0 8px;line-height:1.4}.revision-full-tags{font-size:13px;color:var(--color-text-3);margin:0 0 16px}@media (max-width: 768px){.post-revision-overlay:not(.post-revision-overlay--fullscreen){padding:0;align-items:stretch}.post-revision-panel:not(.post-revision-panel--fullscreen){width:100%;height:100%;border-radius:0}.post-revision-head{flex-wrap:wrap}.post-revision-head-actions{width:100%;justify-content:space-between}.post-revision-view-tabs{flex:1}.post-revision-tab-label{display:none}.post-revision-tab.active .post-revision-tab-label{display:inline}.post-revision-body{flex-direction:column}.post-revision-sidebar{width:100%;max-height:180px;border-right:none;border-bottom:1px solid var(--j13-border-light)}.post-revision-current{display:none}}.post-detail-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.post-detail-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:28px;padding-top:20px;border-top:1px solid var(--j13-border-light)}.post-detail-content{font-size:15px;line-height:1.75;word-break:break-word;color:var(--color-text-1)}.post-detail-content h1,.post-detail-content h2,.post-detail-content h3,.post-detail-content h4,.post-detail-content h5,.post-detail-content h6{font-weight:700;line-height:1.35;letter-spacing:-.02em;color:var(--color-text-1);margin:1.4em 0 .55em}.post-detail-content>:first-child,.post-detail-content h1:first-child,.post-detail-content h2:first-child,.post-detail-content h3:first-child,.post-detail-content h4:first-child,.post-detail-content h5:first-child,.post-detail-content h6:first-child{margin-top:0}.post-detail-content h1{font-size:1.85em}.post-detail-content h2{font-size:1.55em}.post-detail-content h3{font-size:1.3em}.post-detail-content h4{font-size:1.12em}.post-detail-content h5{font-size:1em}.post-detail-content h6{font-size:.92em;color:var(--color-text-2);font-weight:600}.post-detail-content ul,.post-detail-content ol{margin:0 0 12px;padding-left:1.6em}.post-detail-content ul{list-style-type:disc}.post-detail-content ol{list-style-type:decimal}.post-detail-content li{display:list-item;margin-bottom:4px}.post-detail-content li>ul,.post-detail-content li>ol{margin-top:4px;margin-bottom:0}.post-detail-content hr{margin:24px 0;border:none;border-top:1px solid var(--j13-border)}.post-detail-content members-only,.post-detail-content .post-members-only{display:block;margin:20px 0;border-radius:12px;overflow:hidden}.post-detail-content .post-members-only--visible{border:1px solid rgba(24,160,88,.35);background:linear-gradient(135deg,#18a0580f,#18a05805);box-shadow:inset 0 1px #fff9}.post-detail-content .post-members-only__badge{display:inline-flex;align-items:center;gap:6px;margin:12px 16px 0;padding:4px 10px;border-radius:20px;background:#18a0581f;color:var(--j13-green);font-size:12px;font-weight:600;letter-spacing:.02em}.post-detail-content .post-members-only__badge-icon{display:inline-flex;align-items:center;justify-content:center}.post-detail-content .post-members-only__body{padding:12px 18px 18px}.post-detail-content .post-members-only__body--empty{color:var(--color-text-4);font-style:italic}.post-detail-content .post-members-only--locked{position:relative;border:1px solid rgba(24,160,88,.22);background:var(--j13-bg-surface)}.post-detail-content .post-members-only__locked-wrap{position:relative;min-height:160px}.post-detail-content .post-members-only__badge--locked{position:relative;z-index:2;background:#18a0581a}.post-detail-content .post-members-only__preview{position:relative;z-index:0;padding:8px 20px 20px;filter:blur(5px);opacity:.45;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.post-detail-content .post-members-only__preview-line{height:11px;margin-bottom:12px;border-radius:6px;background:linear-gradient(90deg,var(--j13-bg-block-muted) 0%,var(--color-fill-3) 100%)}.post-detail-content .post-members-only__preview-line--medium{width:88%}.post-detail-content .post-members-only__preview-line--short{width:62%;margin-bottom:0}.post-detail-content .post-members-only__gate{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 20px 20px;gap:6px;background:linear-gradient(180deg,#ffffff8c,#ffffffe0 38%,#ffffffeb);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.post-detail-content .post-members-only__gate-icon{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--j13-bg-surface);color:var(--color-text-3);border:1px solid var(--j13-border);margin-bottom:4px;box-shadow:var(--j13-shadow-soft)}.post-detail-content .post-members-only__gate-title{margin:0;font-size:15px;font-weight:600;color:var(--color-text-1)}.post-detail-content .post-members-only__gate-desc{margin:0 0 8px;font-size:13px;color:var(--color-text-3);line-height:1.5;max-width:280px}.post-detail-content .post-members-only__gate-btn{padding:8px 20px;border:none;border-radius:8px;background:var(--j13-green);color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s,transform .1s}.post-detail-content .post-members-only__gate-btn:hover{background:var(--j13-green-hover);transform:translateY(-1px)}.post-detail-content .post-members-only__gate-alt{margin-top:4px;font-size:12px;color:var(--color-text-3)}.post-detail-content .post-members-only__gate-link{padding:0;border:none;background:none;color:var(--j13-green);font-size:12px;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.post-detail-content .post-members-only__gate-link:hover{color:var(--j13-green-hover)}.dark .post-detail-content .post-members-only--visible{border-color:#23c36b59;background:linear-gradient(135deg,#23c36b1a,#23c36b08);box-shadow:none}.dark .post-detail-content .post-members-only--locked{border-color:#23c36b40;background:var(--j13-bg-surface)}.dark .post-detail-content .post-members-only__gate{background:linear-gradient(180deg,#18181b80,#18181bd1 38%,#18181be6)}.dark .post-detail-content .post-members-only__preview-line{background:linear-gradient(90deg,var(--j13-bg-block-muted) 0%,rgba(255,255,255,.08) 100%)}.article-editor-tools-members{display:inline-flex;align-items:center;gap:6px;margin-left:4px}.article-editor-tools-sep{display:inline-block;width:1px;height:20px;background:var(--j13-border-light);flex-shrink:0}.article-editor-tools .article-tool-btn--members{color:var(--j13-green)}.article-editor-tools .article-tool-btn--members:hover,.article-editor-tools .article-tool-btn--members.active{background:var(--j13-green-bg);color:var(--j13-green-hover)}.post-members-only__exit-btn,.post-members-only__unwrap-btn{margin-left:4px;padding:2px 8px;border:none;border-radius:12px;background:#18a05829;color:var(--j13-green);font-size:11px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:3px;transition:background .12s,color .12s}.post-members-only__unwrap-btn{background:transparent;color:var(--color-text-3)}.post-members-only__exit-btn:hover{background:#18a05847;color:var(--j13-green-hover)}.post-members-only__unwrap-btn:hover{background:var(--j13-bg-block-muted);color:var(--color-text-2)}.post-detail-content strong,.post-detail-content b{font-weight:700;color:var(--color-text-1)}.post-detail-content em,.post-detail-content i{font-style:italic}.post-detail-content img{max-width:100%;border-radius:6px}.post-detail-content p{margin:0 0 12px}.post-detail-content p:last-child{margin-bottom:0}.post-detail-content a{color:var(--j13-green)}.post-detail-content blockquote{margin:12px 0;padding:8px 14px;border-left:3px solid var(--j13-green);background:var(--j13-bg-block-muted);color:var(--color-text-3);border-radius:0 6px 6px 0}.post-detail-content pre,.post-detail-content code{font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:13px}.post-detail-content pre{padding:12px;background:var(--j13-bg-block-muted);border-radius:6px;overflow-x:auto}.post-detail-content code{padding:2px 6px;background:var(--j13-bg-block-muted);border-radius:4px}.comment-section{display:flex;flex-direction:column;background:var(--j13-bg-surface);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-card);flex-shrink:0;overflow:hidden}.comment-section-bar{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px 12px;font-size:15px;font-weight:600;flex-shrink:0;border-bottom:1px solid var(--j13-border-light)}.comment-section-bar:after{content:"";position:absolute;bottom:-1px;left:20px;width:36px;height:2px;background:var(--j13-green);border-radius:1px;transition:width .35s cubic-bezier(.4,0,.2,1)}.comment-section:hover .comment-section-bar:after{width:52px}.comment-section-title{color:var(--color-text-1)}.comment-section-count{font-size:13px;font-weight:400;color:var(--color-text-3)}.floor-jump-tools{display:flex;align-items:center;gap:4px}.comment-list-area{display:flex;flex-direction:column}.comment-empty{text-align:center;padding:48px 24px;color:var(--color-text-3)}.comment-empty-icon{font-size:32px;margin-bottom:8px;opacity:.6}.comment-empty p{margin:0;font-size:13px}.reply-bar{padding:12px 20px 16px;border-top:1px solid var(--j13-border-light);background:var(--j13-bg-block-muted);flex-shrink:0}.comment-box-wrap{padding:16px 20px;border-bottom:1px solid var(--j13-border-light);background:var(--j13-bg-surface);flex-shrink:0}.comment-box-wrap.inline{padding:12px 0 4px;border-bottom:none;background:transparent}.comment-box-wrap.inline .comment-box-avatar,.comment-box-wrap.inline .comment-box-avatar-img,.comment-box-wrap.inline .comment-box-avatar-placeholder{width:32px;height:32px;font-size:13px}.waline-comment-reply-btn.cancel{color:#e74c3c}.waline-comment-reply-btn.cancel:hover{color:#c0392b}.comment-box{display:flex;gap:12px;align-items:flex-start}.comment-box-avatar{flex-shrink:0}.comment-box-avatar-img,.comment-box-avatar-placeholder{width:40px;height:40px;border-radius:50%;-o-object-fit:cover;object-fit:cover}.comment-box-avatar-placeholder{display:flex;align-items:center;justify-content:center;background:var(--j13-green);color:#fff;font-size:16px;font-weight:600}.comment-box-avatar-placeholder.guest{background:var(--color-fill-3);color:var(--color-text-3)}.comment-box-main{flex:1;min-width:0}.comment-box-reply-hint{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--j13-green);margin-bottom:8px}.comment-box-reply-cancel{border:none;background:none;color:var(--color-text-3);cursor:pointer;font-size:12px;padding:0}.comment-box-reply-cancel:hover{color:var(--color-text-1)}.comment-box-input-wrap{position:relative;border:1px solid var(--j13-border-light);border-radius:10px;background:var(--j13-bg-block);transition:border-color .2s,background .2s}.comment-box-input-wrap:focus-within{border-color:rgb(var(--primary-6))}.comment-box-input-wrap.private-mode{background:var(--j13-bg-block-muted);border-color:var(--j13-border)}.comment-box-textarea{display:block;width:100%;min-height:72px;max-height:200px;padding:10px 48px 10px 12px;border:none;outline:none;resize:vertical;font-size:14px;line-height:1.6;font-family:inherit;color:var(--color-text-1);background:transparent;box-sizing:border-box}.comment-box-textarea::-moz-placeholder{color:var(--color-text-4)}.comment-box-textarea::placeholder{color:var(--color-text-4)}.comment-box-send{position:absolute;right:8px;bottom:8px;width:32px;height:32px;border:none;border-radius:50%;background:#27c;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px;transition:background .15s,opacity .15s}.comment-box-send:hover:not(:disabled){background:#1a9bd8}.comment-box-send:disabled{opacity:.45;cursor:not-allowed}.comment-box-guest-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:8px 10px;margin-top:8px}.comment-box-guest-field{display:flex;flex-direction:column;gap:4px;min-width:0}.comment-box-guest-label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--color-text-3)}.comment-box-guest-required,.comment-box-guest-optional{font-style:normal;font-size:11px;line-height:1;padding:2px 6px;border-radius:4px}.comment-box-guest-required{color:rgb(var(--danger-6));background:color-mix(in srgb,rgb(var(--danger-6)) 12%,transparent)}.comment-box-guest-optional{color:var(--color-text-4);background:var(--color-fill-2)}.comment-box-guest-hint{grid-column:1 / -1;margin:0;font-size:12px;color:var(--color-text-4);line-height:1.5}.comment-box-guest-input{height:32px;padding:0 10px;border:1px solid var(--j13-border);border-radius:6px;font-size:13px;color:var(--color-text-1);background:var(--color-bg-1);outline:none;transition:border-color .2s}.comment-box-guest-input:focus{border-color:rgb(var(--primary-6))}.comment-box-guest-input::-moz-placeholder{color:var(--color-text-4)}.comment-box-guest-input::placeholder{color:var(--color-text-4)}.comment-box-toolbar{display:flex;align-items:center;gap:16px;margin-top:8px}.comment-box-owo{border:none;background:none;padding:2px 6px;font-size:13px;font-weight:600;color:var(--color-text-2);cursor:pointer;border-radius:4px;transition:background .15s,color .15s}.comment-box-owo:hover,.comment-box-owo.active{background:#27ccff1f;color:#27c}.comment-box-private{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--color-text-3);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.emoji-picker{display:grid;grid-template-columns:repeat(12,1fr);gap:2px;margin-top:8px;padding:10px;border:1px solid #dcdfe6;border-radius:8px;background:var(--color-bg-1);max-height:200px;overflow-y:auto;box-shadow:0 2px 12px #00000014}.emoji-picker-item{border:none;background:none;font-size:20px;line-height:1;padding:4px;cursor:pointer;border-radius:4px;transition:background .1s}.emoji-picker-item:hover{background:var(--color-fill-2)}.waline-comment{display:flex;gap:12px;padding:16px 20px;border-bottom:1px solid var(--j13-border-light)}.waline-comment.nested{padding:12px 0 0;border-bottom:none}.waline-comment.highlight{animation:floor-highlight 2s ease-out}@keyframes floor-highlight{0%,30%{background:var(--j13-green-bg)}to{background:transparent}}.waline-replies{margin-top:8px}.waline-comment.nested .waline-comment-avatar{width:32px;height:32px;font-size:13px}.waline-comment-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;overflow:hidden;background:var(--j13-green);color:#fff;font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center}.waline-comment-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.waline-comment-avatar.guest{background:var(--color-fill-3);color:var(--color-text-3)}.waline-comment-main{flex:1;min-width:0}.waline-comment-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.waline-comment-author{font-size:14px;font-weight:600;color:var(--color-text-1);text-decoration:none}a.waline-comment-author:hover{color:var(--j13-green)}.waline-comment-bubble{padding:10px 14px;background:var(--j13-bg-block-muted);border-radius:10px;font-size:14px;line-height:1.65;color:var(--color-text-1);word-break:break-word}.waline-reply-at{display:block;color:#27c;font-weight:600;margin-bottom:4px;line-height:1.5}.waline-comment-private-mask{padding:14px 16px;text-align:center;font-size:13px;color:#999;line-height:1.5;border-radius:8px;background:repeating-linear-gradient(-45deg,#f6f6f6,#f6f6f6 8px,#ececec 8px,#ececec 16px)}.waline-comment-bubble .floor-body{font-size:inherit;line-height:inherit;word-break:break-word}.floor-body{font-size:14px;line-height:1.65;word-break:break-word}.waline-comment-bubble .quote-block{margin:6px 0;background:var(--j13-bg-block)}.waline-comment-meta{display:flex;align-items:center;gap:16px;margin-top:8px;font-size:12px;color:var(--color-text-3)}.waline-comment-date{display:flex;align-items:center;gap:4px}.waline-comment-reply-btn{display:flex;align-items:center;gap:4px;border:none;background:none;padding:0;font-size:12px;color:var(--color-text-3);cursor:pointer;transition:color .15s}.waline-comment-reply-btn:hover{color:var(--j13-green)}@media (max-width: 768px){.comment-box-wrap{padding:12px 14px}.comment-box-guest-fields{grid-template-columns:1fr}.emoji-picker{grid-template-columns:repeat(8,1fr)}.waline-comment{padding:12px 14px}}.mention{color:var(--j13-green);font-weight:600}.quote-block{border-left:3px solid var(--j13-green);padding:8px 12px;margin:6px 0 8px;background:var(--j13-bg-block-muted);font-size:13px;color:var(--color-text-3);border-radius:0 8px 8px 0;line-height:1.5;white-space:pre-wrap;word-break:break-word}.quote-block.clickable{cursor:pointer;transition:background .15s,border-color .15s}.quote-block.clickable:hover{background:var(--j13-green-bg);border-left-color:var(--j13-green-hover)}@media (max-width: 768px){.post-detail-page{padding:12px 14px 20px;gap:12px}.post-detail-header{padding:12px 14px 16px}.post-detail-title{font-size:17px}.post-detail-actions{margin-top:20px;padding-top:16px;gap:10px}.comment-section-bar{padding:12px 14px 10px}.comment-section-bar:after{left:14px;width:32px}.comment-section:hover .comment-section-bar:after{width:46px}}.widget-card{background:transparent;border:none;border-radius:0;box-shadow:none;margin-bottom:0;overflow:hidden;border-bottom:1px solid var(--j13-border-light);flex-shrink:0}.widget-card-head{padding:12px 16px 8px;font-size:13px;font-weight:600;border-bottom:none;background:transparent;color:var(--color-text-2)}.widget-card-body{padding:0 16px 14px}.widget-card--about{flex:1;display:flex;flex-direction:column;border-bottom:none;min-height:72px}.widget-card--about .widget-card-body{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;padding:20px 16px}.widget-about-text{margin:0;font-size:12px;color:var(--color-text-3);line-height:1.65}.widget-about-text strong{display:block;margin-bottom:4px;color:var(--j13-green);font-size:13px}.widget-item{padding:6px 0;font-size:13px;cursor:pointer;border-bottom:1px solid var(--j13-border-light);display:flex;align-items:center;gap:6px}.widget-item:last-child{border-bottom:none}.widget-item:hover{color:var(--j13-green)}.widget-online-list{display:flex;flex-wrap:wrap;gap:6px}.widget-online-avatar{width:28px;height:28px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:12px;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0}.widget-online-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.profile-header{display:flex;align-items:center;gap:16px;margin-bottom:24px}.profile-header-card{position:relative;display:flex;align-items:center;gap:20px;padding:24px;margin-bottom:16px;background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);transition:border-color .2s,box-shadow .2s}.profile-header-card--dragover{border-color:color-mix(in srgb,var(--j13-green) 50%,var(--j13-border-light));box-shadow:0 0 0 3px color-mix(in srgb,var(--j13-green) 15%,transparent)}.profile-drop-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;background:color-mix(in srgb,var(--j13-green) 12%,var(--j13-bg-block));color:var(--j13-green);font-size:14px;font-weight:500;pointer-events:none}.profile-avatar-btn{flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;border-radius:50%;line-height:0}.profile-avatar-btn:disabled{cursor:not-allowed}.profile-avatar-lg{position:relative;width:88px;height:88px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:32px;font-weight:600;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:box-shadow .2s}.profile-avatar-lg--pending{box-shadow:0 0 0 3px color-mix(in srgb,var(--j13-green) 40%,transparent)}.profile-avatar-lg img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.profile-avatar-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#00000073;color:#fff;opacity:0;transition:opacity .2s}.profile-avatar-btn:hover .profile-avatar-overlay,.profile-avatar-btn:focus-visible .profile-avatar-overlay{opacity:1}.profile-avatar-btn:disabled .profile-avatar-overlay{opacity:1}.profile-header-info{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:16px}.profile-header-main{min-width:0}.profile-display-name{margin:0 0 4px;font-size:20px;font-weight:600;line-height:1.3}.profile-username{font-size:13px;color:var(--color-text-3)}.profile-avatar-tip{margin:6px 0 0;font-size:12px;color:var(--color-text-3);line-height:1.4}.profile-avatar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.profile-avatar-hint{font-size:13px;color:var(--color-text-3);white-space:nowrap}.profile-form{display:flex;flex-direction:column;gap:16px}.profile-form-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:4px}.profile-form-footer--end{justify-content:flex-end}.profile-form-hint{font-size:12px;color:var(--color-text-3);line-height:1.4}@media (max-width: 520px){.profile-header-card{flex-direction:column;text-align:center;padding:20px 16px}.profile-header-info{flex-direction:column;align-items:center}.profile-form-footer{flex-direction:column;align-items:stretch}.profile-form-hint{text-align:center}}.avatar-crop-dialog{max-width:420px;padding:20px}.avatar-crop-stage{position:relative;width:100%;height:280px;border-radius:8px;overflow:hidden;background:#111}.avatar-crop-loading{display:flex;align-items:center;justify-content:center;height:100%}.avatar-crop-zoom{display:flex;align-items:center;gap:12px;padding:4px 0}.avatar-crop-zoom-label{flex-shrink:0;font-size:13px;color:var(--color-text-3);width:32px}.avatar-crop-zoom input[type=range]{flex:1;height:4px;accent-color:var(--j13-green);cursor:pointer}.admin-entry-card{border-color:color-mix(in srgb,var(--j13-green) 25%,var(--j13-border));background:var(--j13-bg-block-accent)}.auth-page{height:100%;min-height:100dvh;overflow-y:auto;display:flex;align-items:center;justify-content:center;background:var(--j13-bg-page);padding:24px}.auth-box{width:100%;max-width:400px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:12px;box-shadow:var(--j13-shadow-card);padding:32px}.auth-box .logo-mark{width:48px;height:48px;border-radius:12px;background:var(--j13-green);color:#fff;font-size:22px;font-weight:700;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}.auth-box h1{text-align:center;font-size:20px;margin:0 0 4px}.auth-box .subtitle{text-align:center;font-size:13px;color:var(--color-text-3);margin-bottom:24px}.app-body--compose,.content-workspace--compose{background:var(--j13-bg-workspace)}.main-content--compose{overflow-y:auto;overflow-x:hidden}.compose-page{flex:1;display:flex;flex-direction:column;min-height:min(100%,100vh - var(--j13-header-h));overflow:visible;background:radial-gradient(ellipse 80% 50% at 50% -10%,var(--j13-green-bg),transparent),var(--j13-bg-workspace)}.compose-page--empty{align-items:center;justify-content:center}.compose-empty-card{text-align:center;padding:48px 40px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:16px;box-shadow:var(--j13-shadow-card);max-width:400px}.compose-empty-icon{width:56px;height:56px;margin:0 auto 20px;border-radius:14px;background:var(--j13-green-bg);color:var(--j13-green);font-size:24px;display:flex;align-items:center;justify-content:center}.compose-empty-card h2{margin:0 0 8px;font-size:18px;font-weight:600}.compose-empty-card p{margin:0 0 24px;font-size:14px;color:var(--color-text-3);line-height:1.5}.compose-primary-btn,.compose-ghost-btn{padding:10px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;border:none;transition:background .15s,transform .1s}.compose-primary-btn{background:var(--j13-green);color:#fff}.compose-primary-btn:hover{background:var(--j13-green-hover)}.compose-ghost-btn{background:var(--j13-bg-block-muted);color:var(--color-text-2)}.compose-canvas{flex:1;display:flex;flex-direction:column;min-height:min(100%,100vh - var(--j13-header-h));max-width:1200px;width:100%;margin:0 auto;padding:0 32px 32px}.compose-header{display:flex;align-items:center;justify-content:space-between;padding:16px 0 12px;flex-shrink:0}.compose-back{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid var(--j13-border);border-radius:8px;background:var(--j13-bg-surface);color:var(--color-text-2);font-size:13px;cursor:pointer;transition:border-color .15s,color .15s,box-shadow .15s;box-shadow:var(--j13-shadow-soft)}.compose-back:hover{border-color:var(--j13-green);color:var(--j13-green)}.compose-publish-btn{display:inline-flex;align-items:center;gap:8px;padding:10px 22px;border:none;border-radius:8px;background:linear-gradient(135deg,var(--j13-green),var(--j13-green-hover));color:#fff;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 2px 8px #18a0584d;transition:transform .1s,box-shadow .15s,opacity .15s}.compose-publish-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 14px #18a05859}.compose-publish-btn:disabled{opacity:.65;cursor:not-allowed}.compose-meta{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:20px;flex-shrink:0;flex-wrap:wrap}.compose-board-pills{display:flex;flex-wrap:wrap;gap:8px}.compose-board-pill{padding:6px 14px;border:1px solid var(--j13-border);border-radius:20px;background:var(--j13-bg-surface);color:var(--color-text-2);font-size:13px;cursor:pointer;transition:all .15s}.compose-board-pill:hover{border-color:var(--j13-green);color:var(--j13-green)}.compose-board-pill.active{background:var(--j13-green);border-color:var(--j13-green);color:#fff;font-weight:500}.compose-tags-field{display:flex;align-items:center;gap:8px;padding:6px 14px;border:1px solid var(--j13-border);border-radius:20px;background:var(--j13-bg-surface);min-width:220px;transition:border-color .15s}.compose-tags-field:focus-within{border-color:var(--j13-green)}.compose-tags-icon{color:var(--color-text-4);font-size:14px;flex-shrink:0}.compose-tags-field input{flex:1;border:none;background:transparent;outline:none;font-size:13px;color:var(--color-text-1);min-width:0}.compose-tags-field input::-moz-placeholder{color:var(--color-text-4)}.compose-tags-field input::placeholder{color:var(--color-text-4)}.compose-writing{flex:1;display:flex;flex-direction:column;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:16px;box-shadow:var(--j13-shadow-card);padding:28px 32px 0;overflow:visible}.compose-title{width:100%;padding:0;border:none;background:transparent;font-size:32px;font-weight:700;line-height:1.3;letter-spacing:-.02em;color:var(--color-text-1);outline:none}.compose-title::-moz-placeholder{color:var(--color-text-4)}.compose-title::placeholder{color:var(--color-text-4)}.compose-subtitle{margin-top:8px;font-size:13px;color:var(--color-text-3)}.compose-subtitle strong{color:var(--j13-green);font-weight:500}.article-editor{flex:1;display:flex;flex-direction:column;margin-top:24px;border-top:1px solid var(--j13-border-light)}.article-editor-bar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;margin:0 -32px;padding:10px 32px;flex-shrink:0;flex-wrap:wrap;background:var(--j13-bg-surface);border-bottom:1px solid var(--j13-border-light);box-shadow:0 4px 12px #0f172a0a}.ui-tooltip{position:relative;display:inline-flex}.ui-tooltip-bubble{position:absolute;z-index:50;pointer-events:none;opacity:0;visibility:hidden;width:-moz-max-content;width:max-content;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:8px;box-shadow:var(--j13-shadow-card);transition:opacity .1s ease,transform .1s ease,visibility .1s}.ui-tooltip-bubble--compact{padding:5px 10px}.ui-tooltip-bubble--rich{min-width:148px;max-width:220px;padding:7px 12px}.ui-tooltip-bubble__title{display:block;font-size:12px;font-weight:500;line-height:1.4;color:var(--color-text-1)}.ui-tooltip-bubble--compact .ui-tooltip-bubble__title{white-space:nowrap}.ui-tooltip-bubble__hint{display:block;margin-top:3px;font-size:11px;line-height:1.45;color:var(--color-text-3)}.ui-tooltip-bubble--bottom{top:calc(100% + 8px)}.ui-tooltip-bubble--top{bottom:calc(100% + 8px)}.ui-tooltip-bubble--center.ui-tooltip-bubble--bottom{left:50%;transform:translate(-50%) translateY(-2px)}.ui-tooltip-bubble--center.ui-tooltip-bubble--top{left:50%;transform:translate(-50%) translateY(2px)}.ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip-bubble--start.ui-tooltip-bubble--top{left:0;transform:translateY(-2px)}.ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip-bubble--end.ui-tooltip-bubble--top{right:0;left:auto;transform:translateY(-2px)}.ui-tooltip:hover .ui-tooltip-bubble,.ui-tooltip:focus-within .ui-tooltip-bubble{opacity:1;visibility:visible}.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom{transform:translate(-50%) translateY(0)}.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--top{transform:translate(-50%) translateY(0)}.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--top,.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--top{transform:translateY(0)}.article-editor-tools{display:flex;align-items:center;gap:2px;flex-wrap:wrap}.article-tool-btn{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--color-text-2);font-size:13px;cursor:pointer;transition:background .12s,color .12s}.article-tool-btn:hover{background:var(--j13-bg-block-muted);color:var(--j13-green)}.article-tool-btn.active{background:#18a0581f;color:var(--j13-green)}.article-tool-btn strong{font-size:12px;font-weight:700}.article-editor-body{flex:1;display:flex;flex-direction:column;min-height:280px}.article-editor-pane{display:flex;flex:1;min-height:280px;border:1px solid var(--j13-border);border-radius:10px;overflow:hidden;background:var(--j13-bg-block);box-shadow:inset 0 1px #ffffffa6}.article-editor-pane--source{min-height:320px}.article-editor-scroll ::-moz-selection,.article-editor-markdown-input::-moz-selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-editor-scroll ::selection,.article-editor-markdown-input::selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror ::-moz-selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror ::selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror .ProseMirror-selectednode{outline:2px solid color-mix(in srgb,var(--j13-green) 45%,transparent);outline-offset:2px}.dark .article-editor-scroll ::-moz-selection,.dark .article-editor-markdown-input::-moz-selection,.dark .article-prosemirror ::-moz-selection{background:color-mix(in srgb,var(--j13-green) 35%,#2a3f50);color:inherit}.dark .article-editor-scroll ::selection,.dark .article-editor-markdown-input::selection,.dark .article-prosemirror ::selection{background:color-mix(in srgb,var(--j13-green) 35%,#2a3f50);color:inherit}.article-editor-scroll{flex:1;min-width:0;overflow:auto;background:var(--j13-bg-block)}.article-editor-content{flex:1;display:flex;flex-direction:column}.article-editor-content .tiptap,.article-prosemirror{flex:1;min-height:280px;padding:14px 20px 20px;outline:none}.article-prosemirror p.is-editor-empty:first-child:before{color:var(--color-text-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.article-prosemirror p.is-editor-empty::-moz-selection,.article-prosemirror p.is-editor-empty *::-moz-selection{background:transparent}.article-prosemirror p.is-editor-empty::selection,.article-prosemirror p.is-editor-empty *::selection{background:transparent}.article-prosemirror.ProseMirror-focused p.is-editor-empty::-moz-selection{background:transparent}.article-prosemirror.ProseMirror-focused p.is-editor-empty::selection{background:transparent}.article-prosemirror a{color:var(--j13-green);text-decoration:underline;text-underline-offset:2px}.article-prosemirror img{max-width:100%;height:auto;border-radius:8px;margin:12px 0}.editor-members-only.post-members-only--visible{border:1px solid rgba(24,160,88,.45);background:linear-gradient(135deg,#18a05814,#18a05805);border-radius:12px;overflow:hidden;box-shadow:inset 0 1px #ffffff8c}.editor-members-only .post-members-only__badge{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0;padding:10px 14px;border-bottom:1px dashed rgba(24,160,88,.28);border-radius:0;background:#18a0581a;width:100%}.editor-members-only .post-members-only__body{padding:14px 18px 18px;min-height:96px;background:#ffffff73}.dark .editor-members-only .post-members-only__body{background:#0000001f}.post-members-only__shortcut-hint{margin-left:auto;font-size:11px;font-weight:400;color:var(--color-text-3)}.editor-members-only{margin:20px 0}.editor-members-only--selected{box-shadow:0 0 0 2px #18a05859}.article-editor-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0 16px;border-top:1px solid var(--j13-border-light);font-size:12px;color:var(--color-text-4);flex-shrink:0}.article-editor-status-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}.article-editor-status-sep{color:var(--color-text-4);opacity:.6}.article-editor-status-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.article-editor-view-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid var(--j13-border-light);border-radius:8px;background:var(--j13-bg-block);color:var(--color-text-2);font-size:12px;font-weight:500;cursor:pointer;transition:background .12s,border-color .12s,color .12s;flex-shrink:0}.article-editor-view-btn:hover{border-color:var(--j13-green);color:var(--j13-green);background:#18a0580f}.article-editor-view-btn.active{border-color:#18a05873;color:var(--j13-green);background:#18a0581a}.article-editor--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;margin:0!important;padding:0 32px 24px;background:var(--j13-bg-surface);border-top:none}.article-editor--fullscreen .article-editor-bar{margin:0;padding:12px 0}.article-editor--fullscreen.article-editor--rich .article-editor-bar{width:100%;max-width:var(--j13-article-read-w);margin:0 auto}.article-editor--fullscreen .article-editor-body{min-height:0;flex:1}.article-editor--fullscreen.article-editor--rich .article-editor-body{overflow-y:auto;padding:20px 0 0;background:var(--j13-bg-workspace)}.article-editor--fullscreen.article-editor--rich .article-editor-pane{width:100%;max-width:var(--j13-article-read-w);margin:0 auto;min-height:calc(100vh - 176px)}.article-editor--fullscreen .article-editor-scroll,.article-editor--fullscreen .article-editor-content .tiptap,.article-editor--fullscreen .article-prosemirror{min-height:calc(100vh - 220px)}.article-editor--fullscreen .article-editor-markdown{min-height:calc(100vh - 176px)}.article-editor--fullscreen .article-editor-markdown-input,.article-editor--fullscreen .article-editor-markdown-preview,.article-editor--fullscreen .article-editor-pane--source{min-height:calc(100vh - 220px)}.article-editor-tools--markdown{display:flex;align-items:center;gap:8px}.article-editor-tools--markdown-hint{font-size:12px;color:var(--color-text-3)}.article-link-dialog__footer{gap:8px}.article-editor-markdown{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;min-height:320px}.article-editor-markdown-input{display:block;width:100%;min-height:100%;padding:14px 16px 20px;border:none;outline:none;resize:none;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:13px;line-height:1.65;color:var(--color-text-1);background:transparent}.article-editor-markdown-preview{display:flex;flex-direction:column;min-height:320px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:10px;overflow:hidden}.article-editor-markdown-preview-label{padding:8px 16px;border-bottom:1px solid var(--j13-border-light);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-4);flex-shrink:0}.article-editor-markdown-preview-body{flex:1;padding:14px 16px;overflow-y:auto}@media (max-width: 768px){.compose-canvas{padding:0 16px}.compose-writing{padding:20px 16px 0;border-radius:12px}.article-editor--fullscreen{padding:0 16px 16px}.article-editor--fullscreen .article-editor-bar{margin:0;padding:10px 0}.article-editor-markdown{grid-template-columns:1fr;grid-template-rows:minmax(240px,1fr) minmax(240px,1fr)}.article-editor-pane--source{min-height:240px}.article-editor--fullscreen.article-editor--rich .article-editor-pane{max-width:none;margin:0}.article-editor-bar{margin:0 -16px;padding:10px 16px}.article-editor-status{flex-wrap:wrap;align-items:flex-start}.article-editor-status-actions{width:100%;justify-content:flex-end}.compose-title{font-size:24px}.compose-meta{flex-direction:column;align-items:stretch}.compose-tags-field{min-width:0}.compose-header{padding-top:12px}.compose-publish-btn span{display:none}}.page-loader{display:flex;flex:1;align-items:center;justify-content:center;gap:8px;min-height:240px;color:var(--j13-green);font-size:14px}.page-loader__dot{width:8px;height:8px;border-radius:50%;background:currentColor;animation:page-loader-pulse .9s ease-in-out infinite}@keyframes page-loader-pulse{0%,to{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}.admin-shell{min-height:100vh;background:hsl(var(--background))}.admin-topbar{display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 20px;border-bottom:1px solid var(--j13-border);background:hsl(var(--card))}.admin-topbar-brand{display:flex;align-items:center;gap:10px}.admin-topbar-mark{width:32px;height:32px;border-radius:8px;background:var(--j13-green);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}.admin-topbar-title{font-size:14px;font-weight:600;line-height:1.2}.admin-topbar-sub{font-size:12px;color:hsl(var(--muted-foreground))}.admin-topbar-actions{display:flex;align-items:center;gap:12px}.admin-topbar-user{font-size:13px;color:hsl(var(--muted-foreground))}.admin-link-btn{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--j13-green);background:none;border:none;cursor:pointer}.admin-body{display:flex;height:calc(100vh - 56px);overflow:hidden}.admin-sidebar{width:200px;flex-shrink:0;padding:16px 10px;border-right:1px solid var(--j13-border);background:hsl(var(--card));overflow-y:auto}.admin-nav-item{display:flex;align-items:center;gap:8px;width:100%;padding:9px 12px;margin-bottom:2px;border-radius:8px;font-size:13px;color:hsl(var(--muted-foreground));text-decoration:none;transition:background .15s,color .15s}.admin-nav-item:hover{background:var(--j13-green-bg);color:var(--j13-green)}.admin-nav-item.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.admin-main{flex:1;min-width:0;min-height:0;padding:24px;overflow-y:auto}.admin-page-head{margin-bottom:20px}.admin-page-head h1{font-size:22px;font-weight:700;margin-bottom:4px}.admin-page-head p{font-size:13px;color:hsl(var(--muted-foreground))}.admin-stat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-bottom:20px}.admin-stat-card{padding:16px;border-radius:10px;border:1px solid var(--j13-border);background:hsl(var(--card))}.admin-stat-value{font-size:24px;font-weight:700;color:var(--j13-green)}.admin-stat-label{font-size:12px;color:hsl(var(--muted-foreground));margin-top:4px}.admin-card{border:1px solid var(--j13-border);border-radius:10px;background:hsl(var(--card));margin-bottom:16px}.admin-card-body{padding:16px 20px 20px}.admin-card-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--j13-border);font-weight:600;font-size:14px}.admin-card-desc{padding:12px 16px 0;font-size:13px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-card .admin-card-desc+button{margin:12px 16px 16px}.admin-form-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 16px 16px;font-size:13px}.admin-form-row label{color:hsl(var(--muted-foreground));white-space:nowrap}.admin-settings-page{max-width:880px;padding-bottom:24px}.admin-settings-tabs{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:20px;padding-bottom:0;border-bottom:1px solid var(--j13-border)}.admin-settings-tab{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;margin-bottom:-1px;border:none;border-bottom:2px solid transparent;background:none;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .15s,border-color .15s}.admin-settings-tab:hover{color:hsl(var(--foreground))}.admin-settings-tab.active{color:var(--j13-green);border-bottom-color:var(--j13-green)}.admin-settings-panel{display:flex;flex-direction:column;gap:0}.admin-settings-card{margin-bottom:0}.admin-settings-card-badge{font-size:12px;font-weight:500;color:hsl(var(--muted-foreground));padding:2px 8px;border-radius:999px;background:hsl(var(--muted) / .45)}.admin-settings-sections{display:flex;flex-direction:column;gap:20px}.admin-settings-section-head h3{font-size:13px;font-weight:600;margin-bottom:2px}.admin-settings-section-head p{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.45;margin-bottom:10px}.admin-settings-table{border:1px solid var(--j13-border);border-radius:8px;overflow:hidden;background:hsl(var(--background))}.admin-settings-row{display:grid;grid-template-columns:140px 140px 1fr;align-items:center;gap:8px 16px;padding:10px 14px;border-bottom:1px solid var(--j13-border);font-size:13px}.admin-settings-row:last-child{border-bottom:none}.admin-settings-row-label{color:hsl(var(--foreground));font-weight:500}.admin-settings-row-input{display:flex;align-items:center;gap:8px}.admin-settings-input{width:88px;height:32px;padding-top:0;padding-bottom:0}.admin-settings-unit{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap}.admin-settings-row-hint{font-size:12px;color:hsl(var(--muted-foreground))}.admin-settings-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding:14px 16px;border:1px solid var(--j13-border);border-radius:10px;background:hsl(var(--card))}.admin-settings-bar p{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.45;max-width:420px}.admin-settings-filter-body{display:flex;flex-direction:column;gap:12px}.admin-settings-filter-tip{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-settings-filter-tip code,.admin-settings-backup-name code{font-size:11px;background:hsl(var(--muted));padding:1px 5px;border-radius:4px}.admin-settings-filter-textarea{min-height:320px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.55;resize:vertical}.admin-settings-info{display:flex;flex-direction:column;gap:0}.admin-settings-info-row{display:grid;grid-template-columns:88px 1fr;gap:12px 16px;padding:10px 0;border-bottom:1px solid var(--j13-border);font-size:13px}.admin-settings-info-row:last-child{border-bottom:none;padding-bottom:0}.admin-settings-info-row:first-child{padding-top:0}.admin-settings-info-row dt{color:hsl(var(--muted-foreground))}.admin-settings-info-row dd{margin:0;word-break:break-all}.admin-settings-info-row dd code{font-size:12px;background:hsl(var(--muted));padding:2px 6px;border-radius:4px}.admin-settings-backup-body{display:flex;flex-direction:column;align-items:flex-start;gap:10px}.admin-settings-backup-body>p{margin:0;font-size:13px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-settings-backup-name{font-size:12px!important}@media (max-width: 640px){.admin-settings-row{grid-template-columns:1fr;gap:6px;padding:12px 14px}.admin-settings-row-hint{padding-left:0}.admin-settings-bar{flex-direction:column;align-items:stretch}.admin-settings-bar p{max-width:none}.admin-settings-info-row{grid-template-columns:1fr;gap:4px}}.admin-table{width:100%;border-collapse:collapse;font-size:13px}.admin-table th,.admin-table td{padding:10px 14px;text-align:left;border-bottom:1px solid var(--j13-border)}.admin-table th{font-weight:600;color:hsl(var(--muted-foreground));background:hsl(var(--muted) / .3)}.admin-table tr:last-child td{border-bottom:none}.admin-empty{padding:32px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.admin-text-link{background:none;border:none;padding:0;color:var(--j13-green);cursor:pointer;font-size:inherit}.admin-text-link:hover{text-decoration:underline}.admin-search-bar{display:flex;gap:8px;margin-bottom:16px;max-width:480px}.admin-pagination{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px;border-top:1px solid var(--j13-border);font-size:13px}.admin-dl{padding:16px;display:grid;grid-template-columns:120px 1fr;gap:10px 16px;font-size:13px}.admin-dl dt{color:hsl(var(--muted-foreground))}.admin-dl dd code{font-size:12px;background:hsl(var(--muted));padding:2px 6px;border-radius:4px}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:bg-\[var\(--j13-green\)\][data-state=checked]{background-color:var(--j13-green)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.dark\:bg-orange-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(67 20 7 / var(--tw-bg-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/embed_static/static/spa/assets/index-Cp7Ff9NP.js b/embed_static/static/spa/assets/index-Cp7Ff9NP.js new file mode 100644 index 0000000..96337b3 --- /dev/null +++ b/embed_static/static/spa/assets/index-Cp7Ff9NP.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-B75SKkZF.js","assets/react-vendor-BdyZmpPe.js","assets/virtual-vendor-rtLkLCpN.js","assets/PinnedIcon-Dc0ZpCCq.js","assets/ui-vendor-B26O8baZ.js","assets/content-BrFHUpp8.js","assets/PostDetailPage-Ca0chGU-.js","assets/badge-xzbTTsRq.js","assets/postContent-ClrHK1rL.js","assets/purify-vendor-Cx4rtWv4.js","assets/LoginPage-jlZcJP-F.js","assets/form-DggfNWHU.js","assets/input-y6vZyHhN.js","assets/RegisterPage-g5r_djmM.js","assets/ComposePage-eRDSuLA7.js","assets/dialog-DXwuwWJi.js","assets/alert-dialog-C2PKamsV.js","assets/BoardsManagePage-DxLu9n3N.js","assets/textarea-Dcf0-FNg.js","assets/ProfilePage-BxbMpG9W.js","assets/FavoritesPage-rLr3pZbU.js","assets/AdminDashboardPage-C2c-F2-X.js","assets/AdminPostsPage-Boh0BdYW.js","assets/AdminCommentsPage-B23tMV_-.js","assets/AdminUsersPage-GP-G5C8H.js","assets/AdminSettingsPage-BKTiLKhD.js"])))=>i.map(i=>d[i]); +var Js=Object.defineProperty;var Ks=(e,t,s)=>t in e?Js(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var xt=(e,t,s)=>Ks(e,typeof t!="symbol"?t+"":t,s);import{r as b,j as o,e as Je,g as Lt,i as Dt,k as u,m as Xs,O as Mt,N as Qs,n as Zs,p as eo,q as to,t as U,v as vt,w as so}from"./react-vendor-BdyZmpPe.js";import{S as Bt,C as oo,a as $t,P as ao,b as Ft,I as Vt,c as Gt,d as Ut,e as ro,R as Wt,f as no,L as Ht,g as Yt,h as io,T as lo,i as co,M as uo,F as at,j as qt,k as Jt,l as Kt,m as rt,n as Xt,B as Qt,G as Zt,o as es,p as mo,q as po,H as fo,Z as ho,r as go,U as nt,s as bo,t as yo,u as xo,v as vo,w as ts,x as ss,y as wo,W as ko,z as jo,A as No,D as os,E as So,J as _o,K as Eo,N as To,O as as,Q as Co,V as Io,X as Po,Y as Ro,_ as Ao}from"./ui-vendor-B26O8baZ.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))a(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const n of l.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function s(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function a(i){if(i.ep)return;i.ep=!0;const l=s(i);fetch(i.href,l)}})();const rs="j13-theme";function ns(){return localStorage.getItem(rs)==="dark"?"dark":"light"}function is(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e,localStorage.setItem(rs,e)}const zo="modulepreload",Oo=function(e){return"/"+e},wt={},ae=function(t,s,a){let i=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),d=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));i=Promise.allSettled(s.map(m=>{if(m=Oo(m),m in wt)return;wt[m]=!0;const c=m.endsWith(".css"),y=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${y}`))return;const r=document.createElement("link");if(r.rel=c?"stylesheet":zo,c||(r.as="script"),r.crossOrigin="",r.href=m,d&&r.setAttribute("nonce",d),document.head.appendChild(r),c)return new Promise((j,T)=>{r.addEventListener("load",j),r.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return i.then(n=>{for(const d of n||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})},Lo="";async function v(e,t={}){const s=await fetch(Lo+e,{credentials:"same-origin",...t,headers:{...t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t.headers}});let a;try{a=await s.json()}catch{throw new Error("服务器响应异常")}if(!s.ok)throw new Error(a.error||"请求失败");return a}const he={me:()=>v("/api/me"),stats:()=>v("/api/stats"),forumLimits:()=>v("/api/forum-limits"),boards:()=>v("/api/boards"),posts:e=>{const t=new URLSearchParams(e).toString();return v(`/api/posts?${t}`)},hotPosts:()=>v("/api/posts/hot"),post:(e,t)=>{const s=t!=null&&t.skipView?"?skip_view=1":"";return v(`/api/posts/${e}${s}`)},comments:(e,t)=>{const s=t!=null&&t.length?`?my_ids=${t.join(",")}`:"";return v(`/api/posts/${e}/comments${s}`)},notifications:()=>v("/api/notifications"),online:()=>v("/api/online"),presence:()=>v("/api/presence",{method:"POST"}),favorites:()=>v("/api/favorites"),createBoard:e=>v("/api/admin/boards",{method:"POST",body:JSON.stringify(e)}),updateBoard:(e,t)=>v(`/api/admin/boards/${e}`,{method:"PUT",body:JSON.stringify(t)}),deleteBoard:e=>v(`/api/admin/boards/${e}`,{method:"DELETE"}),adminDashboard:()=>v("/api/admin/dashboard"),adminSettings:()=>v("/api/admin/settings"),adminPosts:e=>{const t=new URLSearchParams;e.page&&t.set("page",String(e.page)),e.keyword&&t.set("keyword",e.keyword);const s=t.toString();return v(`/api/admin/posts${s?`?${s}`:""}`)},adminPinPost:(e,t)=>v(`/api/admin/posts/${e}/pin`,{method:"POST",body:JSON.stringify({pinned:t})}),adminLockPost:(e,t)=>v(`/api/admin/posts/${e}/lock`,{method:"POST",body:JSON.stringify({locked:t})}),adminUpdateForumSettings:e=>v("/api/admin/settings/forum",{method:"PUT",body:JSON.stringify(e)}),adminUpdateFilterWords:e=>v("/api/admin/settings/filter-words",{method:"PUT",body:JSON.stringify({content:e})}),postRevisions:e=>v(`/api/posts/${e}/revisions`),postRevision:(e,t)=>v(`/api/posts/${e}/revisions/${t}`),adminDeletePost:e=>v(`/api/admin/posts/${e}`,{method:"DELETE"}),adminComments:(e=1)=>v(`/api/admin/comments?page=${e}`),adminDeleteComment:e=>v(`/api/admin/comments/${e}`,{method:"DELETE"}),adminUsers:(e=1)=>v(`/api/admin/users?page=${e}`),adminBanUser:(e,t)=>v(`/api/admin/users/${e}/ban`,{method:"POST",body:JSON.stringify({banned:t})}),adminBackup:()=>v("/api/admin/backup",{method:"POST"}),updateNickname:e=>{const t=new FormData;return t.append("nickname",e),v("/api/profile/nickname",{method:"POST",body:t,headers:{}})},updatePassword:(e,t)=>{const s=new FormData;return s.append("old_password",e),s.append("new_password",t),v("/api/profile/password",{method:"POST",body:s,headers:{}})},uploadAvatar:e=>{const t=new FormData;return t.append("avatar",e),v("/api/profile/avatar",{method:"POST",body:t,headers:{}})},uploadPostImage:e=>{const t=new FormData;return t.append("image",e),v("/api/uploads/image",{method:"POST",body:t,headers:{}})},createPost:e=>{const t=new FormData;return t.append("board_id",e.board_id),t.append("title",e.title),t.append("content",e.content),t.append("tags",e.tags||""),v("/api/posts",{method:"POST",body:t,headers:{}})},updatePost:(e,t)=>{const s=new FormData;return s.append("title",t.title),s.append("content",t.content),s.append("tags",t.tags||""),v(`/api/posts/${e}`,{method:"PUT",body:s,headers:{}})},login:(e,t)=>{const s=new FormData;return s.append("username",e),s.append("password",t),v("/api/login",{method:"POST",body:s,headers:{}})},register:(e,t,s)=>{const a=new FormData;return a.append("username",e),a.append("password",t),a.append("nickname",s),v("/api/register",{method:"POST",body:a,headers:{}})},logout:()=>v("/api/logout",{method:"POST"}),like:e=>v(`/api/posts/${e}/like`,{method:"POST"}),favorite:e=>v(`/api/posts/${e}/favorite`,{method:"POST"}),addComment:(e,t)=>{const s=new FormData;return s.append("content",t.content),t.replyTo&&s.append("reply_to",String(t.replyTo)),t.guestNick&&s.append("guest_nick",t.guestNick),t.guestEmail&&s.append("guest_email",t.guestEmail),t.guestUrl&&s.append("guest_url",t.guestUrl),t.isPrivate&&s.append("is_private","1"),v(`/api/posts/${e}/comments`,{method:"POST",body:s,headers:{}})},ping:()=>v("/api/ping",{method:"POST"})},ls=b.createContext({user:null,loading:!0,refresh:async()=>{},logout:async()=>{}});function Do({children:e}){const[t,s]=b.useState(null),[a,i]=b.useState(!0),l=b.useCallback(async()=>{try{const d=await he.me();s(d.user??null)}catch{s(null)}finally{i(!1)}},[]);b.useEffect(()=>{l()},[l]);const n=async()=>{await he.logout(),s(null)};return o.jsx(ls.Provider,{value:{user:t,loading:a,refresh:l,logout:n},children:e})}const Ke=()=>b.useContext(ls),cs=b.createContext({theme:"light",toggle:()=>{}});function Mo({children:e}){const[t,s]=b.useState(ns);b.useLayoutEffect(()=>{is(t)},[t]);const a=()=>s(i=>i==="light"?"dark":"light");return o.jsx(cs.Provider,{value:{theme:t,toggle:a},children:e})}const ds=()=>b.useContext(cs);function Bo(e){const[t,s]=b.useState(()=>window.matchMedia(e).matches);return b.useLayoutEffect(()=>{const a=window.matchMedia(e),i=()=>s(a.matches);return a.addEventListener("change",i),()=>a.removeEventListener("change",i)},[e]),t}function xe(){return o.jsxs("div",{className:"page-loader",role:"status","aria-live":"polite",children:[o.jsx("span",{className:"page-loader__dot"}),"加载中…"]})}function us(e){var t,s,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const s=new Array(e.length+t.length);for(let a=0;a({classGroupId:e,validator:t}),ps=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),He="-",kt=[],Vo="arbitrary..",Go=e=>{const t=Wo(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:n=>{if(n.startsWith("[")&&n.endsWith("]"))return Uo(n);const d=n.split(He),m=d[0]===""&&d.length>1?1:0;return fs(d,m,t)},getConflictingClassGroupIds:(n,d)=>{if(d){const m=a[n],c=s[n];return m?c?$o(c,m):m:c||kt}return s[n]||kt}}},fs=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const i=e[t],l=s.nextPart.get(i);if(l){const c=fs(e,t+1,l);if(c)return c}const n=s.validators;if(n===null)return;const d=t===0?e.join(He):e.slice(t).join(He),m=n.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),a=t.slice(0,s);return a?Vo+a:void 0})(),Wo=e=>{const{theme:t,classGroups:s}=e;return Ho(s,t)},Ho=(e,t)=>{const s=ps();for(const a in e){const i=e[a];it(i,s,a,t)}return s},it=(e,t,s,a)=>{const i=e.length;for(let l=0;l{if(typeof e=="string"){qo(e,t,s);return}if(typeof e=="function"){Jo(e,t,s,a);return}Ko(e,t,s,a)},qo=(e,t,s)=>{const a=e===""?t:hs(t,e);a.classGroupId=s},Jo=(e,t,s,a)=>{if(Xo(e)){it(e(a),t,s,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Fo(s,e))},Ko=(e,t,s,a)=>{const i=Object.entries(e),l=i.length;for(let n=0;n{let s=e;const a=t.split(He),i=a.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,Qo=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),a=Object.create(null);const i=(l,n)=>{s[l]=n,t++,t>e&&(t=0,a=s,s=Object.create(null))};return{get(l){let n=s[l];if(n!==void 0)return n;if((n=a[l])!==void 0)return i(l,n),n},set(l,n){l in s?s[l]=n:i(l,n)}}},tt="!",jt=":",Zo=[],Nt=(e,t,s,a,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:a,isExternal:i}),ea=e=>{const{prefix:t,experimentalParseClassName:s}=e;let a=i=>{const l=[];let n=0,d=0,m=0,c;const y=i.length;for(let L=0;Lm?c-m:void 0;return Nt(l,T,j,P)};if(t){const i=t+jt,l=a;a=n=>n.startsWith(i)?l(n.slice(i.length)):Nt(Zo,!1,n,void 0,!0)}if(s){const i=a;a=l=>s({className:l,parseClassName:i})}return a},ta=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,a)=>{t.set(s,1e6+a)}),s=>{const a=[];let i=[];for(let l=0;l0&&(i.sort(),a.push(...i),i=[]),a.push(n)):i.push(n)}return i.length>0&&(i.sort(),a.push(...i)),a}},sa=e=>({cache:Qo(e.cacheSize),parseClassName:ea(e),sortModifiers:ta(e),postfixLookupClassGroupIds:oa(e),...Go(e)}),oa=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let a=0;a{const{parseClassName:s,getClassGroupId:a,getConflictingClassGroupIds:i,sortModifiers:l,postfixLookupClassGroupIds:n}=t,d=[],m=e.trim().split(aa);let c="";for(let y=m.length-1;y>=0;y-=1){const r=m[y],{isExternal:j,modifiers:T,hasImportantModifier:P,baseClassName:L,maybePostfixModifierPosition:O}=s(r);if(j){c=r+(c.length>0?" "+c:c);continue}let _=!!O,$;if(_){const M=L.substring(0,O);$=a(M);const f=$&&n[$]?a(L):void 0;f&&f!==$&&($=f,_=!1)}else $=a(L);if(!$){if(!_){c=r+(c.length>0?" "+c:c);continue}if($=a(L),!$){c=r+(c.length>0?" "+c:c);continue}_=!1}const Q=T.length===0?"":T.length===1?T[0]:l(T).join(":"),te=P?Q+tt:Q,re=te+$;if(d.indexOf(re)>-1)continue;d.push(re);const F=i($,_);for(let M=0;M0?" "+c:c)}return c},na=(...e)=>{let t=0,s,a,i="";for(;t{if(typeof e=="string")return e;let t,s="";for(let a=0;a{let s,a,i,l;const n=m=>{const c=t.reduce((y,r)=>r(y),e());return s=sa(c),a=s.cache.get,i=s.cache.set,l=d,d(m)},d=m=>{const c=a(m);if(c)return c;const y=ra(m,s);return i(m,y),y};return l=n,(...m)=>l(na(...m))},la=[],V=e=>{const t=s=>s[e]||la;return t.isThemeGetter=!0,t},bs=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ys=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ca=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,da=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ua=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ma=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,pa=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fa=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>ca.test(e),N=e=>!!e&&!Number.isNaN(Number(e)),pe=e=>!!e&&Number.isInteger(Number(e)),Ze=e=>e.endsWith("%")&&N(e.slice(0,-1)),ye=e=>da.test(e),xs=()=>!0,ha=e=>ua.test(e)&&!ma.test(e),lt=()=>!1,ga=e=>pa.test(e),ba=e=>fa.test(e),ya=e=>!h(e)&&!g(e),xa=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),va=e=>je(e,ks,lt),h=e=>bs.test(e),Ee=e=>je(e,js,ha),St=e=>je(e,Ta,N),wa=e=>je(e,Ss,xs),ka=e=>je(e,Ns,lt),_t=e=>je(e,vs,lt),ja=e=>je(e,ws,ba),Ve=e=>je(e,_s,ga),g=e=>ys.test(e),Oe=e=>Te(e,js),Na=e=>Te(e,Ns),Et=e=>Te(e,vs),Sa=e=>Te(e,ks),_a=e=>Te(e,ws),Ge=e=>Te(e,_s,!0),Ea=e=>Te(e,Ss,!0),je=(e,t,s)=>{const a=bs.exec(e);return a?a[1]?t(a[1]):s(a[2]):!1},Te=(e,t,s=!1)=>{const a=ys.exec(e);return a?a[1]?t(a[1]):s:!1},vs=e=>e==="position"||e==="percentage",ws=e=>e==="image"||e==="url",ks=e=>e==="length"||e==="size"||e==="bg-size",js=e=>e==="length",Ta=e=>e==="number",Ns=e=>e==="family-name",Ss=e=>e==="number"||e==="weight",_s=e=>e==="shadow",Ca=()=>{const e=V("color"),t=V("font"),s=V("text"),a=V("font-weight"),i=V("tracking"),l=V("leading"),n=V("breakpoint"),d=V("container"),m=V("spacing"),c=V("radius"),y=V("shadow"),r=V("inset-shadow"),j=V("text-shadow"),T=V("drop-shadow"),P=V("blur"),L=V("perspective"),O=V("aspect"),_=V("ease"),$=V("animate"),Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],re=()=>[...te(),g,h],F=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],f=()=>[g,h,m],B=()=>[ke,"full","auto",...f()],ue=()=>[pe,"none","subgrid",g,h],K=()=>["auto",{span:["full",pe,g,h]},pe,g,h],X=()=>[pe,"auto",g,h],W=()=>["auto","min","max","fr",g,h],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...f()],C=()=>[ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...f()],x=()=>[ke,"screen","full","dvw","lvw","svw","min","max","fit",...f()],D=()=>[ke,"screen","full","lh","dvh","lvh","svh","min","max","fit",...f()],p=()=>[e,g,h],Y=()=>[...te(),Et,_t,{position:[g,h]}],Ne=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",Sa,va,{size:[g,h]}],A=()=>[Ze,Oe,Ee],S=()=>["","none","full",c,g,h],I=()=>["",N,Oe,Ee],ie=()=>["solid","dashed","dotted","double"],R=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],z=()=>[N,Ze,Et,_t],Se=()=>["","none",P,g,h],ge=()=>["none",N,g,h],le=()=>["none",N,g,h],Ae=()=>[N,g,h],ve=()=>[ke,"full",...f()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ye],breakpoint:[ye],color:[xs],container:[ye],"drop-shadow":[ye],ease:["in","out","in-out"],font:[ya],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ye],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ye],shadow:[ye],spacing:["px",N],text:[ye],"text-shadow":[ye],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ke,h,g,O]}],container:["container"],"container-type":[{"@container":["","normal","size",g,h]}],"container-named":[xa],columns:[{columns:[N,h,g,d]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:re()}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[pe,"auto",g,h]}],basis:[{basis:[ke,"full","auto",d,...f()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[N,ke,"auto","initial","none",h]}],grow:[{grow:["",N,g,h]}],shrink:[{shrink:["",N,g,h]}],order:[{order:[pe,"first","last","none",g,h]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":X()}],"col-end":[{"col-end":X()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":X()}],"row-end":[{"row-end":X()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:f()}],"gap-x":[{"gap-x":f()}],"gap-y":[{"gap-y":f()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:f()}],px:[{px:f()}],py:[{py:f()}],ps:[{ps:f()}],pe:[{pe:f()}],pbs:[{pbs:f()}],pbe:[{pbe:f()}],pt:[{pt:f()}],pr:[{pr:f()}],pb:[{pb:f()}],pl:[{pl:f()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":f()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":f()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],"inline-size":[{inline:["auto",...x()]}],"min-inline-size":[{"min-inline":["auto",...x()]}],"max-inline-size":[{"max-inline":["none",...x()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[d,"screen",...C()]}],"min-w":[{"min-w":[d,"screen","none",...C()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[n]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",s,Oe,Ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Ea,wa]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ze,h]}],"font-family":[{font:[Na,ka,t]}],"font-features":[{"font-features":[h]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,g,h]}],"line-clamp":[{"line-clamp":[N,"none",g,St]}],leading:[{leading:[l,...f()]}],"list-image":[{"list-image":["none",g,h]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",g,h]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:p()}],"text-color":[{text:p()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[N,"from-font","auto",g,Ee]}],"text-decoration-color":[{decoration:p()}],"underline-offset":[{"underline-offset":[N,"auto",g,h]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:f()}],"tab-size":[{tab:[pe,g,h]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g,h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g,h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:Ne()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pe,g,h],radial:["",g,h],conic:[pe,g,h]},_a,ja]}],"bg-color":[{bg:p()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:p()}],"gradient-via":[{via:p()}],"gradient-to":[{to:p()}],rounded:[{rounded:S()}],"rounded-s":[{"rounded-s":S()}],"rounded-e":[{"rounded-e":S()}],"rounded-t":[{"rounded-t":S()}],"rounded-r":[{"rounded-r":S()}],"rounded-b":[{"rounded-b":S()}],"rounded-l":[{"rounded-l":S()}],"rounded-ss":[{"rounded-ss":S()}],"rounded-se":[{"rounded-se":S()}],"rounded-ee":[{"rounded-ee":S()}],"rounded-es":[{"rounded-es":S()}],"rounded-tl":[{"rounded-tl":S()}],"rounded-tr":[{"rounded-tr":S()}],"rounded-br":[{"rounded-br":S()}],"rounded-bl":[{"rounded-bl":S()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-bs":[{"border-bs":I()}],"border-w-be":[{"border-be":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:p()}],"border-color-x":[{"border-x":p()}],"border-color-y":[{"border-y":p()}],"border-color-s":[{"border-s":p()}],"border-color-e":[{"border-e":p()}],"border-color-bs":[{"border-bs":p()}],"border-color-be":[{"border-be":p()}],"border-color-t":[{"border-t":p()}],"border-color-r":[{"border-r":p()}],"border-color-b":[{"border-b":p()}],"border-color-l":[{"border-l":p()}],"divide-color":[{divide:p()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[N,g,h]}],"outline-w":[{outline:["",N,Oe,Ee]}],"outline-color":[{outline:p()}],shadow:[{shadow:["","none",y,Ge,Ve]}],"shadow-color":[{shadow:p()}],"inset-shadow":[{"inset-shadow":["none",r,Ge,Ve]}],"inset-shadow-color":[{"inset-shadow":p()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:p()}],"ring-offset-w":[{"ring-offset":[N,Ee]}],"ring-offset-color":[{"ring-offset":p()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":p()}],"text-shadow":[{"text-shadow":["none",j,Ge,Ve]}],"text-shadow-color":[{"text-shadow":p()}],opacity:[{opacity:[N,g,h]}],"mix-blend":[{"mix-blend":[...R(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":R()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[N]}],"mask-image-linear-from-pos":[{"mask-linear-from":z()}],"mask-image-linear-to-pos":[{"mask-linear-to":z()}],"mask-image-linear-from-color":[{"mask-linear-from":p()}],"mask-image-linear-to-color":[{"mask-linear-to":p()}],"mask-image-t-from-pos":[{"mask-t-from":z()}],"mask-image-t-to-pos":[{"mask-t-to":z()}],"mask-image-t-from-color":[{"mask-t-from":p()}],"mask-image-t-to-color":[{"mask-t-to":p()}],"mask-image-r-from-pos":[{"mask-r-from":z()}],"mask-image-r-to-pos":[{"mask-r-to":z()}],"mask-image-r-from-color":[{"mask-r-from":p()}],"mask-image-r-to-color":[{"mask-r-to":p()}],"mask-image-b-from-pos":[{"mask-b-from":z()}],"mask-image-b-to-pos":[{"mask-b-to":z()}],"mask-image-b-from-color":[{"mask-b-from":p()}],"mask-image-b-to-color":[{"mask-b-to":p()}],"mask-image-l-from-pos":[{"mask-l-from":z()}],"mask-image-l-to-pos":[{"mask-l-to":z()}],"mask-image-l-from-color":[{"mask-l-from":p()}],"mask-image-l-to-color":[{"mask-l-to":p()}],"mask-image-x-from-pos":[{"mask-x-from":z()}],"mask-image-x-to-pos":[{"mask-x-to":z()}],"mask-image-x-from-color":[{"mask-x-from":p()}],"mask-image-x-to-color":[{"mask-x-to":p()}],"mask-image-y-from-pos":[{"mask-y-from":z()}],"mask-image-y-to-pos":[{"mask-y-to":z()}],"mask-image-y-from-color":[{"mask-y-from":p()}],"mask-image-y-to-color":[{"mask-y-to":p()}],"mask-image-radial":[{"mask-radial":[g,h]}],"mask-image-radial-from-pos":[{"mask-radial-from":z()}],"mask-image-radial-to-pos":[{"mask-radial-to":z()}],"mask-image-radial-from-color":[{"mask-radial-from":p()}],"mask-image-radial-to-color":[{"mask-radial-to":p()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":te()}],"mask-image-conic-pos":[{"mask-conic":[N]}],"mask-image-conic-from-pos":[{"mask-conic-from":z()}],"mask-image-conic-to-pos":[{"mask-conic-to":z()}],"mask-image-conic-from-color":[{"mask-conic-from":p()}],"mask-image-conic-to-color":[{"mask-conic-to":p()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:Ne()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",g,h]}],filter:[{filter:["","none",g,h]}],blur:[{blur:Se()}],brightness:[{brightness:[N,g,h]}],contrast:[{contrast:[N,g,h]}],"drop-shadow":[{"drop-shadow":["","none",T,Ge,Ve]}],"drop-shadow-color":[{"drop-shadow":p()}],grayscale:[{grayscale:["",N,g,h]}],"hue-rotate":[{"hue-rotate":[N,g,h]}],invert:[{invert:["",N,g,h]}],saturate:[{saturate:[N,g,h]}],sepia:[{sepia:["",N,g,h]}],"backdrop-filter":[{"backdrop-filter":["","none",g,h]}],"backdrop-blur":[{"backdrop-blur":Se()}],"backdrop-brightness":[{"backdrop-brightness":[N,g,h]}],"backdrop-contrast":[{"backdrop-contrast":[N,g,h]}],"backdrop-grayscale":[{"backdrop-grayscale":["",N,g,h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[N,g,h]}],"backdrop-invert":[{"backdrop-invert":["",N,g,h]}],"backdrop-opacity":[{"backdrop-opacity":[N,g,h]}],"backdrop-saturate":[{"backdrop-saturate":[N,g,h]}],"backdrop-sepia":[{"backdrop-sepia":["",N,g,h]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":f()}],"border-spacing-x":[{"border-spacing-x":f()}],"border-spacing-y":[{"border-spacing-y":f()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",g,h]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[N,"initial",g,h]}],ease:[{ease:["linear","initial",_,g,h]}],delay:[{delay:[N,g,h]}],animate:[{animate:["none",$,g,h]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[L,g,h]}],"perspective-origin":[{"perspective-origin":re()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[g,h,"","none","gpu","cpu"]}],"transform-origin":[{origin:re()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],zoom:[{zoom:[pe,g,h]}],accent:[{accent:p()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:p()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g,h]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":p()}],"scrollbar-track-color":[{"scrollbar-track":p()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":f()}],"scroll-mx":[{"scroll-mx":f()}],"scroll-my":[{"scroll-my":f()}],"scroll-ms":[{"scroll-ms":f()}],"scroll-me":[{"scroll-me":f()}],"scroll-mbs":[{"scroll-mbs":f()}],"scroll-mbe":[{"scroll-mbe":f()}],"scroll-mt":[{"scroll-mt":f()}],"scroll-mr":[{"scroll-mr":f()}],"scroll-mb":[{"scroll-mb":f()}],"scroll-ml":[{"scroll-ml":f()}],"scroll-p":[{"scroll-p":f()}],"scroll-px":[{"scroll-px":f()}],"scroll-py":[{"scroll-py":f()}],"scroll-ps":[{"scroll-ps":f()}],"scroll-pe":[{"scroll-pe":f()}],"scroll-pbs":[{"scroll-pbs":f()}],"scroll-pbe":[{"scroll-pbe":f()}],"scroll-pt":[{"scroll-pt":f()}],"scroll-pr":[{"scroll-pr":f()}],"scroll-pb":[{"scroll-pb":f()}],"scroll-pl":[{"scroll-pl":f()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g,h]}],fill:[{fill:["none",...p()]}],"stroke-w":[{stroke:[N,Oe,Ee,St]}],stroke:[{stroke:["none",...p()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ia=ia(Ca);function J(...e){return Ia(ms(e))}const Pa=io,Ra=lo,Aa=b.forwardRef(({className:e,inset:t,children:s,...a},i)=>o.jsxs(Bt,{ref:i,className:J("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...a,children:[s,o.jsx(oo,{className:"ml-auto"})]}));Aa.displayName=Bt.displayName;const za=b.forwardRef(({className:e,...t},s)=>o.jsx($t,{ref:s,className:J("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));za.displayName=$t.displayName;const Es=b.forwardRef(({className:e,sideOffset:t=4,...s},a)=>o.jsx(ao,{children:o.jsx(Ft,{ref:a,sideOffset:t,className:J("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));Es.displayName=Ft.displayName;const De=b.forwardRef(({className:e,inset:t,...s},a)=>o.jsx(Vt,{ref:a,className:J("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...s}));De.displayName=Vt.displayName;const Oa=b.forwardRef(({className:e,children:t,checked:s,...a},i)=>o.jsxs(Gt,{ref:i,className:J("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...a,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Ut,{children:o.jsx(ro,{className:"h-4 w-4"})})}),t]}));Oa.displayName=Gt.displayName;const La=b.forwardRef(({className:e,children:t,...s},a)=>o.jsxs(Wt,{ref:a,className:J("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Ut,{children:o.jsx(no,{className:"h-2 w-2 fill-current"})})}),t]}));La.displayName=Wt.displayName;const Da=b.forwardRef(({className:e,inset:t,...s},a)=>o.jsx(Ht,{ref:a,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));Da.displayName=Ht.displayName;const st=b.forwardRef(({className:e,...t},s)=>o.jsx(Yt,{ref:s,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));st.displayName=Yt.displayName;const Ts="j13-cache-boards",Cs="j13-cache-stats";function Is(e){try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function Ps(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function Tt(){return Is(Ts)??[]}function Ct(){return Is(Cs)}function Ma(e){Ps(Ts,e)}function Ba(e){Ps(Cs,e)}const $a=[{key:"latest",label:"最新发帖",hint:"按发布时间",icon:co},{key:"reply",label:"最新回复",hint:"最近有人回复",icon:uo},{key:"hot",label:"热门讨论",hint:"按互动热度",icon:at}];function Rs(e){return e==="reply"||e==="hot"?e:"latest"}function Ye(e,t="latest"){const s=new URLSearchParams;e&&s.set("board",String(e)),t!=="latest"&&s.set("sort",t);const a=s.toString();return a?`/?${a}`:"/"}function en({value:e,onChange:t,postTotal:s}){return o.jsxs("div",{className:"feed-toolbar",children:[o.jsx("div",{className:"feed-sort-bar",role:"tablist","aria-label":"帖子排序",children:$a.map(({key:a,label:i,hint:l,icon:n})=>o.jsxs("button",{type:"button",role:"tab","aria-selected":e===a,title:`${i} · ${l}`,className:J("feed-sort-tab",e===a&&"active"),onClick:()=>t(a),children:[o.jsx(n,{"aria-hidden":!0}),o.jsx("span",{className:"feed-sort-tab__label",children:i})]},a))}),s!=null&&o.jsxs("span",{className:"feed-toolbar__count",children:["共 ",s," 条"]})]})}const As="j13-feed-cache:";function zs(e,t,s){return`${As}${e}:${t}:${s}`}function tn(e,t,s){try{const a=sessionStorage.getItem(zs(e,t,s));return a?JSON.parse(a):null}catch{return null}}function sn(e,t,s,a){try{sessionStorage.setItem(zs(e,t,s),JSON.stringify(a))}catch{}}function Fa(){try{for(let e=sessionStorage.length-1;e>=0;e--){const t=sessionStorage.key(e);t!=null&&t.startsWith(As)&&sessionStorage.removeItem(t)}}catch{}}const Va="feed-reset";function Me(e,t){Fa(),window.dispatchEvent(new Event(Va)),e(t,{state:{refreshFeed:!0}})}const Ue=8,Ga=[{key:"code-2",label:"代码",Icon:qt},{key:"coffee",label:"咖啡",Icon:Jt},{key:"help-circle",label:"问答",Icon:Kt},{key:"message-square",label:"讨论",Icon:rt},{key:"lightbulb",label:"灵感",Icon:Xt},{key:"book-open",label:"阅读",Icon:Qt},{key:"gamepad-2",label:"游戏",Icon:Zt},{key:"palette",label:"设计",Icon:es},{key:"music",label:"音乐",Icon:mo},{key:"camera",label:"摄影",Icon:po},{key:"heart",label:"生活",Icon:fo},{key:"zap",label:"快讯",Icon:ho},{key:"globe",label:"综合",Icon:go},{key:"users",label:"社区",Icon:nt},{key:"briefcase",label:"职场",Icon:bo},{key:"graduation-cap",label:"学习",Icon:yo},{key:"shopping-bag",label:"交易",Icon:xo},{key:"map-pin",label:"本地",Icon:vo},{key:"megaphone",label:"公告",Icon:ts},{key:"flame",label:"热门",Icon:at},{key:"star",label:"精华",Icon:ss},{key:"folder",label:"资源",Icon:wo},{key:"wrench",label:"工具",Icon:ko},{key:"cpu",label:"硬件",Icon:jo}],It=Object.fromEntries(Ga.map(e=>[e.key,e.Icon])),Ua=[qt,Jt,Kt,rt,Xt,Qt,Zt,es];function ct(e){return typeof e=="object"&&e.color_index!=null&&e.color_index>=0?e.color_index%Ue:((typeof e=="number"?e:e.id)%Ue+Ue)%Ue}function Wa(e){return typeof e=="object"&&e.icon&&It[e.icon]?It[e.icon]:Ua[ct(e)]}function Ha({board:e,className:t}){const s=Wa(e);return o.jsx(s,{className:t,"aria-hidden":!0})}const Ya=["/post/","/profile"];function Os(e){return Ya.some(t=>e.startsWith(t))}function qa(e,t){return Os(e)?null:e.startsWith("/favorites")?"favorites":e.startsWith("/admin")?"admin":t===0?"all":String(t)}function Ja({boards:e,activeBoard:t,onSelectBoard:s}){const a=Je(),i=Lt(),[l]=Dt(),n=Rs(l.get("sort")),{user:d}=Ke(),m=(d==null?void 0:d.role)==="admin",c=qa(i.pathname,t),y=(r,j,T,P)=>o.jsxs("button",{type:"button",className:J("sidebar-nav-item",c!=null&&c===r&&"active"),onClick:P,children:[T,o.jsx("span",{className:"flex-1 truncate",children:j})]},r);return o.jsxs("aside",{className:"sidebar",children:[o.jsx("div",{className:"sidebar-section",children:"浏览"}),o.jsxs("nav",{className:"sidebar-nav",children:[y("all","全部帖子",o.jsx(No,{}),()=>{s(0),Me(a,Ye(0,n))}),d&&y("favorites","我的收藏",o.jsx(ss,{}),()=>a("/favorites"))]}),e.length>0&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sidebar-section sidebar-section--boards",children:"板块"}),o.jsx("nav",{className:"sidebar-nav",children:e.map(r=>{const j=c!=null&&c===String(r.id),T=ct(r);return o.jsxs("button",{type:"button",className:J("sidebar-nav-item","sidebar-nav-item--board",j&&"active",j&&`sidebar-nav-item--board-${T}`),onClick:()=>{s(r.id),Me(a,Ye(r.id,n))},children:[o.jsx(Ha,{board:r,className:J("sidebar-board-icon",`sidebar-board-icon--${T}`)}),o.jsx("span",{className:"flex-1 truncate",children:r.name}),(r.post_count??0)>0&&o.jsx("span",{className:"sidebar-nav-item__meta",children:r.post_count})]},r.id)})})]}),m&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"sidebar-section",style:{marginTop:8},children:"管理"}),o.jsx("nav",{className:"sidebar-nav",children:y("admin","管理后台",o.jsx(os,{}),()=>a("/admin/dashboard"))})]})]})}function Ka(e){return e===0?"widget-rank widget-rank--1":e===1?"widget-rank widget-rank--2":e===2?"widget-rank widget-rank--3":"widget-rank"}function Xa({hot:e,notifications:t,online:s,onPostClick:a}){const i=(e==null?void 0:e.slice(0,8))??[],l=(t==null?void 0:t.slice(0,6))??[],n=(s==null?void 0:s.users)??[];return o.jsxs("div",{className:"aside-panel-inner",children:[o.jsxs("div",{className:"widget-card",children:[o.jsxs("div",{className:"widget-card-head",children:[o.jsx(at,{className:"widget-card-icon widget-card-icon--hot","aria-hidden":!0}),"热门帖子"]}),o.jsx("div",{className:"widget-card-body",children:i.length===0?o.jsx("div",{className:"widget-empty",children:"暂无数据"}):i.map((d,m)=>o.jsxs("div",{className:"widget-item",onClick:()=>a(d.id),children:[o.jsx("span",{className:Ka(m),children:m+1}),o.jsx("span",{className:"widget-item-title",children:d.title})]},d.id))})]}),o.jsxs("div",{className:"widget-card",children:[o.jsxs("div",{className:"widget-card-head",children:[o.jsx(ts,{className:"widget-card-icon widget-card-icon--notice","aria-hidden":!0}),"最新动态"]}),o.jsx("div",{className:"widget-card-body",children:l.length===0?o.jsx("div",{className:"widget-empty",children:"暂无动态"}):l.map(d=>o.jsxs("div",{className:"widget-item widget-item--notice",onClick:()=>a(d.id),children:[o.jsx("span",{className:"widget-item-title",children:d.title}),o.jsx("span",{className:"widget-item-time",children:d.created_at})]},d.id))})]}),o.jsxs("div",{className:"widget-card",children:[o.jsxs("div",{className:"widget-card-head",children:[o.jsx(nt,{className:"widget-card-icon widget-card-icon--online","aria-hidden":!0}),"当前浏览 ",o.jsx("span",{className:"widget-head-count",children:(s==null?void 0:s.count)??"—"})," 人"]}),o.jsxs("div",{className:"widget-card-body",children:[o.jsxs("div",{className:"widget-online-meta",children:["会员 ",(s==null?void 0:s.members)??0," · 游客 ",(s==null?void 0:s.guests)??0]}),o.jsxs("div",{className:"widget-online-list",children:[n.map(d=>{var m;return o.jsx("span",{className:"widget-online-avatar",title:d.nickname,children:d.avatar?o.jsx("img",{src:d.avatar,alt:""}):((m=d.nickname)==null?void 0:m[0])||"?"},d.id)}),n.length===0&&o.jsx("span",{className:"widget-empty widget-empty--inline",children:"暂无会员在线"})]})]})]}),o.jsx("div",{className:"widget-card widget-card--about",children:o.jsx("div",{className:"widget-card-body",children:o.jsxs("p",{className:"widget-about-text",children:[o.jsx("strong",{children:"姜十三论坛"}),"拾三一隅,自在交流。轻量社区,专为小圈子打造。"]})})})]})}const Ls={post_title_max:128,post_tags_max:256,post_content_max:5e4,comment_max:5e3,search_keyword_min:1,search_keyword_max:50,page_size_default:30,feed_max_pages:10,feed_max_items:300,password_min_len:6,avatar_max_mb:2};let Re=null,Le=null;function Qa(){return Re?Promise.resolve(Re):Le||(Le=he.forumLimits().then(e=>(Re=e,e)).catch(()=>Ls).finally(()=>{Le=null}),Le)}function Za(){const[e,t]=b.useState(Re??Ls),[s,a]=b.useState(!Re);return b.useEffect(()=>{Qa().then(t).finally(()=>a(!1))},[]),{limits:e,loading:s}}function on(){Re=null}function er(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const tr=e=>{switch(e){case"success":return ar;case"info":return nr;case"warning":return rr;case"error":return ir;default:return null}},sr=Array(12).fill(0),or=({visible:e,className:t})=>u.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},u.createElement("div",{className:"sonner-spinner"},sr.map((s,a)=>u.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),ar=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ir=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),lr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},u.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),cr=()=>{const[e,t]=u.useState(document.hidden);return u.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let ot=1;class dr{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:a,...i}=t,l=typeof(t==null?void 0:t.id)=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:ot++,n=this.toasts.find(m=>m.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),n?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:a}),{...m,...t,id:l,dismissible:d,title:a}):m):this.addToast({title:a,...i,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(a=>a({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let a;s.loading!==void 0&&(a=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let l=a!==void 0,n;const d=i.then(async c=>{if(n=["resolve",c],u.isValidElement(c))l=!1,this.create({id:a,type:"default",message:c});else if(mr(c)&&!c.ok){l=!1;const r=typeof s.error=="function"?await s.error(`HTTP error! status: ${c.status}`):s.error,j=typeof s.description=="function"?await s.description(`HTTP error! status: ${c.status}`):s.description,P=typeof r=="object"&&!u.isValidElement(r)?r:{message:r};this.create({id:a,type:"error",description:j,...P})}else if(c instanceof Error){l=!1;const r=typeof s.error=="function"?await s.error(c):s.error,j=typeof s.description=="function"?await s.description(c):s.description,P=typeof r=="object"&&!u.isValidElement(r)?r:{message:r};this.create({id:a,type:"error",description:j,...P})}else if(s.success!==void 0){l=!1;const r=typeof s.success=="function"?await s.success(c):s.success,j=typeof s.description=="function"?await s.description(c):s.description,P=typeof r=="object"&&!u.isValidElement(r)?r:{message:r};this.create({id:a,type:"success",description:j,...P})}}).catch(async c=>{if(n=["reject",c],s.error!==void 0){l=!1;const y=typeof s.error=="function"?await s.error(c):s.error,r=typeof s.description=="function"?await s.description(c):s.description,T=typeof y=="object"&&!u.isValidElement(y)?y:{message:y};this.create({id:a,type:"error",description:r,...T})}}).finally(()=>{l&&(this.dismiss(a),a=void 0),s.finally==null||s.finally.call(s)}),m=()=>new Promise((c,y)=>d.then(()=>n[0]==="reject"?y(n[1]):c(n[1])).catch(y));return typeof a!="string"&&typeof a!="number"?{unwrap:m}:Object.assign(a,{unwrap:m})},this.custom=(t,s)=>{const a=(s==null?void 0:s.id)||ot++;return this.create({jsx:t(a),id:a,...s}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const ee=new dr,ur=(e,t)=>{const s=(t==null?void 0:t.id)||ot++;return ee.addToast({title:e,...t,id:s}),s},mr=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",pr=ur,fr=()=>ee.toasts,hr=()=>ee.getActiveToasts(),et=Object.assign(pr,{success:ee.success,info:ee.info,warning:ee.warning,error:ee.error,custom:ee.custom,message:ee.message,promise:ee.promise,dismiss:ee.dismiss,loading:ee.loading},{getHistory:fr,getToasts:hr});er("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function We(e){return e.label!==void 0}const gr=3,br="24px",yr="16px",Pt=4e3,xr=356,vr=14,wr=45,kr=200;function fe(...e){return e.filter(Boolean).join(" ")}function jr(e){const[t,s]=e.split("-"),a=[];return t&&a.push(t),s&&a.push(s),a}const Nr=e=>{var t,s,a,i,l,n,d,m,c;const{invert:y,toast:r,unstyled:j,interacting:T,setHeights:P,visibleToasts:L,heights:O,index:_,toasts:$,expanded:Q,removeToast:te,defaultRichColors:re,closeButton:F,style:M,cancelButtonStyle:f,actionButtonStyle:B,className:ue="",descriptionClassName:K="",duration:X,position:W,gap:me,expandByDefault:Z,classNames:w,icons:C,closeButtonAriaLabel:x="Close toast"}=e,[D,p]=u.useState(null),[Y,Ne]=u.useState(null),[E,A]=u.useState(!1),[S,I]=u.useState(!1),[ie,R]=u.useState(!1),[z,Se]=u.useState(!1),[ge,le]=u.useState(!1),[Ae,ve]=u.useState(0),[Ms,dt]=u.useState(0),ze=u.useRef(r.duration||X||Pt),ut=u.useRef(null),be=u.useRef(null),Bs=_===0,$s=_+1<=L,se=r.type,Ce=r.dismissible!==!1,Fs=r.className||"",Vs=r.descriptionClassName||"",Be=u.useMemo(()=>O.findIndex(k=>k.toastId===r.id)||0,[O,r.id]),Gs=u.useMemo(()=>{var k;return(k=r.closeButton)!=null?k:F},[r.closeButton,F]),mt=u.useMemo(()=>r.duration||X||Pt,[r.duration,X]),Xe=u.useRef(0),Ie=u.useRef(0),pt=u.useRef(0),Pe=u.useRef(null),[Us,Ws]=W.split("-"),ft=u.useMemo(()=>O.reduce((k,G,q)=>q>=Be?k:k+G.height,0),[O,Be]),ht=cr(),Hs=r.invert||y,Qe=se==="loading";Ie.current=u.useMemo(()=>Be*me+ft,[Be,ft]),u.useEffect(()=>{ze.current=mt},[mt]),u.useEffect(()=>{A(!0)},[]),u.useEffect(()=>{const k=be.current;if(k){const G=k.getBoundingClientRect().height;return dt(G),P(q=>[{toastId:r.id,height:G,position:r.position},...q]),()=>P(q=>q.filter(oe=>oe.toastId!==r.id))}},[P,r.id]),u.useLayoutEffect(()=>{if(!E)return;const k=be.current,G=k.style.height;k.style.height="auto";const q=k.getBoundingClientRect().height;k.style.height=G,dt(q),P(oe=>oe.find(H=>H.toastId===r.id)?oe.map(H=>H.toastId===r.id?{...H,height:q}:H):[{toastId:r.id,height:q,position:r.position},...oe])},[E,r.title,r.description,P,r.id,r.jsx,r.action,r.cancel]);const we=u.useCallback(()=>{I(!0),ve(Ie.current),P(k=>k.filter(G=>G.toastId!==r.id)),setTimeout(()=>{te(r)},kr)},[r,te,P,Ie]);u.useEffect(()=>{if(r.promise&&se==="loading"||r.duration===1/0||r.type==="loading")return;let k;return Q||T||ht?(()=>{if(pt.current{ze.current!==1/0&&(Xe.current=new Date().getTime(),k=setTimeout(()=>{r.onAutoClose==null||r.onAutoClose.call(r,r),we()},ze.current))})(),()=>clearTimeout(k)},[Q,T,r,se,ht,we]),u.useEffect(()=>{r.delete&&(we(),r.onDismiss==null||r.onDismiss.call(r,r))},[we,r.delete]);function Ys(){var k;if(C!=null&&C.loading){var G;return u.createElement("div",{className:fe(w==null?void 0:w.loader,r==null||(G=r.classNames)==null?void 0:G.loader,"sonner-loader"),"data-visible":se==="loading"},C.loading)}return u.createElement(or,{className:fe(w==null?void 0:w.loader,r==null||(k=r.classNames)==null?void 0:k.loader),visible:se==="loading"})}const qs=r.icon||(C==null?void 0:C[se])||tr(se);var gt,bt;return u.createElement("li",{tabIndex:0,ref:be,className:fe(ue,Fs,w==null?void 0:w.toast,r==null||(t=r.classNames)==null?void 0:t.toast,w==null?void 0:w.default,w==null?void 0:w[se],r==null||(s=r.classNames)==null?void 0:s[se]),"data-sonner-toast":"","data-rich-colors":(gt=r.richColors)!=null?gt:re,"data-styled":!(r.jsx||r.unstyled||j),"data-mounted":E,"data-promise":!!r.promise,"data-swiped":ge,"data-removed":S,"data-visible":$s,"data-y-position":Us,"data-x-position":Ws,"data-index":_,"data-front":Bs,"data-swiping":ie,"data-dismissible":Ce,"data-type":se,"data-invert":Hs,"data-swipe-out":z,"data-swipe-direction":Y,"data-expanded":!!(Q||Z&&E),"data-testid":r.testId,style:{"--index":_,"--toasts-before":_,"--z-index":$.length-_,"--offset":`${S?Ae:Ie.current}px`,"--initial-height":Z?"auto":`${Ms}px`,...M,...r.style},onDragEnd:()=>{R(!1),p(null),Pe.current=null},onPointerDown:k=>{k.button!==2&&(Qe||!Ce||(ut.current=new Date,ve(Ie.current),k.target.setPointerCapture(k.pointerId),k.target.tagName!=="BUTTON"&&(R(!0),Pe.current={x:k.clientX,y:k.clientY})))},onPointerUp:()=>{var k,G,q;if(z||!Ce)return;Pe.current=null;const oe=Number(((k=be.current)==null?void 0:k.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((G=be.current)==null?void 0:G.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),H=new Date().getTime()-((q=ut.current)==null?void 0:q.getTime()),ne=D==="x"?oe:$e,Fe=Math.abs(ne)/H;if(Math.abs(ne)>=wr||Fe>.11){ve(Ie.current),r.onDismiss==null||r.onDismiss.call(r,r),Ne(D==="x"?oe>0?"right":"left":$e>0?"down":"up"),we(),Se(!0);return}else{var ce,de;(ce=be.current)==null||ce.style.setProperty("--swipe-amount-x","0px"),(de=be.current)==null||de.style.setProperty("--swipe-amount-y","0px")}le(!1),R(!1),p(null)},onPointerMove:k=>{var G,q,oe;if(!Pe.current||!Ce||((G=window.getSelection())==null?void 0:G.toString().length)>0)return;const H=k.clientY-Pe.current.y,ne=k.clientX-Pe.current.x;var Fe;const ce=(Fe=e.swipeDirections)!=null?Fe:jr(W);!D&&(Math.abs(ne)>1||Math.abs(H)>1)&&p(Math.abs(ne)>Math.abs(H)?"x":"y");let de={x:0,y:0};const yt=_e=>1/(1.5+Math.abs(_e)/20);if(D==="y"){if(ce.includes("top")||ce.includes("bottom"))if(ce.includes("top")&&H<0||ce.includes("bottom")&&H>0)de.y=H;else{const _e=H*yt(H);de.y=Math.abs(_e)0)de.x=ne;else{const _e=ne*yt(ne);de.x=Math.abs(_e)0||Math.abs(de.y)>0)&&le(!0),(q=be.current)==null||q.style.setProperty("--swipe-amount-x",`${de.x}px`),(oe=be.current)==null||oe.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Gs&&!r.jsx&&se!=="loading"?u.createElement("button",{"aria-label":x,"data-disabled":Qe,"data-close-button":!0,onClick:Qe||!Ce?()=>{}:()=>{we(),r.onDismiss==null||r.onDismiss.call(r,r)},className:fe(w==null?void 0:w.closeButton,r==null||(a=r.classNames)==null?void 0:a.closeButton)},(bt=C==null?void 0:C.close)!=null?bt:lr):null,(se||r.icon||r.promise)&&r.icon!==null&&((C==null?void 0:C[se])!==null||r.icon)?u.createElement("div",{"data-icon":"",className:fe(w==null?void 0:w.icon,r==null||(i=r.classNames)==null?void 0:i.icon)},r.promise||r.type==="loading"&&!r.icon?r.icon||Ys():null,r.type!=="loading"?qs:null):null,u.createElement("div",{"data-content":"",className:fe(w==null?void 0:w.content,r==null||(l=r.classNames)==null?void 0:l.content)},u.createElement("div",{"data-title":"",className:fe(w==null?void 0:w.title,r==null||(n=r.classNames)==null?void 0:n.title)},r.jsx?r.jsx:typeof r.title=="function"?r.title():r.title),r.description?u.createElement("div",{"data-description":"",className:fe(K,Vs,w==null?void 0:w.description,r==null||(d=r.classNames)==null?void 0:d.description)},typeof r.description=="function"?r.description():r.description):null),u.isValidElement(r.cancel)?r.cancel:r.cancel&&We(r.cancel)?u.createElement("button",{"data-button":!0,"data-cancel":!0,style:r.cancelButtonStyle||f,onClick:k=>{We(r.cancel)&&Ce&&(r.cancel.onClick==null||r.cancel.onClick.call(r.cancel,k),we())},className:fe(w==null?void 0:w.cancelButton,r==null||(m=r.classNames)==null?void 0:m.cancelButton)},r.cancel.label):null,u.isValidElement(r.action)?r.action:r.action&&We(r.action)?u.createElement("button",{"data-button":!0,"data-action":!0,style:r.actionButtonStyle||B,onClick:k=>{We(r.action)&&(r.action.onClick==null||r.action.onClick.call(r.action,k),!k.defaultPrevented&&we())},className:fe(w==null?void 0:w.actionButton,r==null||(c=r.classNames)==null?void 0:c.actionButton)},r.action.label):null)};function Rt(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Sr(e,t){const s={};return[e,t].forEach((a,i)=>{const l=i===1,n=l?"--mobile-offset":"--offset",d=l?yr:br;function m(c){["top","right","bottom","left"].forEach(y=>{s[`${n}-${y}`]=typeof c=="number"?`${c}px`:c})}typeof a=="number"||typeof a=="string"?m(a):typeof a=="object"?["top","right","bottom","left"].forEach(c=>{a[c]===void 0?s[`${n}-${c}`]=d:s[`${n}-${c}`]=typeof a[c]=="number"?`${a[c]}px`:a[c]}):m(d)}),s}const _r=u.forwardRef(function(t,s){const{id:a,invert:i,position:l="bottom-right",hotkey:n=["altKey","KeyT"],expand:d,closeButton:m,className:c,offset:y,mobileOffset:r,theme:j="light",richColors:T,duration:P,style:L,visibleToasts:O=gr,toastOptions:_,dir:$=Rt(),gap:Q=vr,icons:te,containerAriaLabel:re="Notifications"}=t,[F,M]=u.useState([]),f=u.useMemo(()=>a?F.filter(E=>E.toasterId===a):F.filter(E=>!E.toasterId),[F,a]),B=u.useMemo(()=>Array.from(new Set([l].concat(f.filter(E=>E.position).map(E=>E.position)))),[f,l]),[ue,K]=u.useState([]),[X,W]=u.useState(!1),[me,Z]=u.useState(!1),[w,C]=u.useState(j!=="system"?j:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),x=u.useRef(null),D=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=u.useRef(null),Y=u.useRef(!1),Ne=u.useCallback(E=>{M(A=>{var S;return(S=A.find(I=>I.id===E.id))!=null&&S.delete||ee.dismiss(E.id),A.filter(({id:I})=>I!==E.id)})},[]);return u.useEffect(()=>ee.subscribe(E=>{if(E.dismiss){requestAnimationFrame(()=>{M(A=>A.map(S=>S.id===E.id?{...S,delete:!0}:S))});return}setTimeout(()=>{Xs.flushSync(()=>{M(A=>{const S=A.findIndex(I=>I.id===E.id);return S!==-1?[...A.slice(0,S),{...A[S],...E},...A.slice(S+1)]:[E,...A]})})})}),[F]),u.useEffect(()=>{if(j!=="system"){C(j);return}if(j==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?C("dark"):C("light")),typeof window>"u")return;const E=window.matchMedia("(prefers-color-scheme: dark)");try{E.addEventListener("change",({matches:A})=>{C(A?"dark":"light")})}catch{E.addListener(({matches:S})=>{try{C(S?"dark":"light")}catch(I){console.error(I)}})}},[j]),u.useEffect(()=>{F.length<=1&&W(!1)},[F]),u.useEffect(()=>{const E=A=>{var S;if(n.every(R=>A[R]||A.code===R)){var ie;W(!0),(ie=x.current)==null||ie.focus()}A.code==="Escape"&&(document.activeElement===x.current||(S=x.current)!=null&&S.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[n]),u.useEffect(()=>{if(x.current)return()=>{p.current&&(p.current.focus({preventScroll:!0}),p.current=null,Y.current=!1)}},[x.current]),u.createElement("section",{ref:s,"aria-label":`${re} ${D}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((E,A)=>{var S;const[I,ie]=E.split("-");return f.length?u.createElement("ol",{key:E,dir:$==="auto"?Rt():$,tabIndex:-1,ref:x,className:c,"data-sonner-toaster":!0,"data-sonner-theme":w,"data-y-position":I,"data-x-position":ie,style:{"--front-toast-height":`${((S=ue[0])==null?void 0:S.height)||0}px`,"--width":`${xr}px`,"--gap":`${Q}px`,...L,...Sr(y,r)},onBlur:R=>{Y.current&&!R.currentTarget.contains(R.relatedTarget)&&(Y.current=!1,p.current&&(p.current.focus({preventScroll:!0}),p.current=null))},onFocus:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,p.current=R.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{me||W(!1)},onDragEnd:()=>W(!1),onPointerDown:R=>{R.target instanceof HTMLElement&&R.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},f.filter(R=>!R.position&&A===0||R.position===E).map((R,z)=>{var Se,ge;return u.createElement(Nr,{key:R.id,icons:te,index:z,toast:R,defaultRichColors:T,duration:(Se=_==null?void 0:_.duration)!=null?Se:P,className:_==null?void 0:_.className,descriptionClassName:_==null?void 0:_.descriptionClassName,invert:i,visibleToasts:O,closeButton:(ge=_==null?void 0:_.closeButton)!=null?ge:m,interacting:me,position:E,style:_==null?void 0:_.style,unstyled:_==null?void 0:_.unstyled,classNames:_==null?void 0:_.classNames,cancelButtonStyle:_==null?void 0:_.cancelButtonStyle,actionButtonStyle:_==null?void 0:_.actionButtonStyle,closeButtonAriaLabel:_==null?void 0:_.closeButtonAriaLabel,removeToast:Ne,toasts:f.filter(le=>le.position==R.position),heights:ue.filter(le=>le.position==R.position),setHeights:K,expandByDefault:d,gap:Q,expanded:X,swipeDirections:t.swipeDirections})})):null}))}),qe={success:e=>et.success(e),error:e=>et.error(e),warning:e=>et.warning(e)};function Er(){var C;const{user:e,loading:t,logout:s}=Ke(),{theme:a,toggle:i}=ds(),l=Bo("(max-width: 768px)"),n=Je(),d=Lt(),[m]=Dt(),c=d.pathname.startsWith("/compose")||/\/post\/\d+\/edit$/.test(d.pathname),[y,r]=b.useState(()=>Tt()),[j,T]=b.useState(()=>Ct()),[P,L]=b.useState(()=>Tt().length>0||!!Ct()),[O,_]=b.useState([]),[$,Q]=b.useState([]),[te,re]=b.useState(null),[F,M]=b.useState(Number(m.get("board"))||0),[f,B]=b.useState(m.get("keyword")||""),ue=Rs(m.get("sort")),{limits:K}=Za();b.useEffect(()=>{M(Number(m.get("board"))||0)},[m]),b.useEffect(()=>{B(m.get("keyword")||"")},[m]);const X=b.useCallback(()=>{Promise.all([he.boards().then(x=>{const D=x.boards??[];return r(D),Ma(D),D}).catch(()=>[]),he.stats().then(x=>(T(x),Ba(x),x)).catch(()=>null)]).finally(()=>L(!0))},[]),W=b.useCallback(()=>{he.online().then(x=>{re({count:x.count??0,members:x.members??0,guests:x.guests??0,users:Array.isArray(x.users)?x.users:[]})}).catch(()=>{})},[]);b.useEffect(()=>{X(),he.hotPosts().then(Y=>_(Array.isArray(Y.posts)?Y.posts:[])).catch(()=>{}),he.notifications().then(Y=>Q(Array.isArray(Y.notifications)?Y.notifications:[])).catch(()=>{}),W(),he.presence().catch(()=>{});const x=setInterval(W,3e4),D=setInterval(()=>he.presence().catch(()=>{}),6e4),p=()=>X();return window.addEventListener("boards-refresh",p),()=>{clearInterval(x),clearInterval(D),window.removeEventListener("boards-refresh",p)}},[X,W]);const me=()=>{const x=f.trim();if(!x){n("/");return}const D=[...x].length;if(K.search_keyword_min>0&&D0&&D>K.search_keyword_max){qe.warning(`搜索关键词最多 ${K.search_keyword_max} 个字`);return}n(`/?keyword=${encodeURIComponent(x)}`)},Z=((C=e==null?void 0:e.nickname)==null?void 0:C.charAt(0))||"?",w=Os(d.pathname)?-1:F;return o.jsx("div",{className:"app-shell",children:o.jsxs("div",{className:"app-frame",children:[o.jsx("header",{className:"app-header",children:o.jsxs("div",{className:"header-inner",children:[o.jsxs("button",{type:"button",className:"header-brand",onClick:()=>Me(n,"/"),children:[o.jsx("span",{className:"header-logo-mark",children:"姜"}),!l&&o.jsx("span",{className:"header-logo-text",children:"姜十三论坛"})]}),!c&&o.jsxs("div",{className:"header-search-wrap",children:[o.jsx(So,{className:"header-search-icon",size:16}),o.jsx("input",{className:"header-search-input",type:"search",placeholder:"搜索帖子...",value:f,onChange:x=>B(x.target.value),maxLength:K.search_keyword_max>0?K.search_keyword_max:void 0,onKeyDown:x=>x.key==="Enter"&&me()}),f&&o.jsx("button",{type:"button",className:"header-search-clear",onClick:()=>{B(""),n("/")},"aria-label":"清除搜索",children:"×"})]}),o.jsxs("div",{className:"header-actions",children:[!c&&o.jsxs("button",{type:"button",className:"header-compose-btn",onClick:()=>n(e?"/compose":"/login"),children:[o.jsx(_o,{size:16}),!l&&o.jsx("span",{children:"发帖"})]}),o.jsxs("div",{className:"header-action-group",children:[o.jsx("button",{type:"button",className:"header-icon-btn",onClick:i,title:a==="light"?"切换暗色模式":"切换亮色模式",children:a==="light"?o.jsx(Eo,{size:18}):o.jsx(To,{size:18})}),t?o.jsx("span",{className:"header-auth-slot header-auth-slot--loading","aria-hidden":!0}):e?o.jsxs(Pa,{children:[o.jsx(Ra,{asChild:!0,children:o.jsx("button",{type:"button",className:"header-user-btn",title:e.nickname,children:e.avatar?o.jsx("img",{src:e.avatar,alt:"",className:"header-user-avatar"}):o.jsx("span",{className:"header-user-initial",children:Z})})}),o.jsxs(Es,{align:"end",className:"w-40",onCloseAutoFocus:x=>x.preventDefault(),children:[o.jsx(De,{onClick:()=>n("/profile"),children:"个人中心"}),o.jsx(De,{onClick:()=>n("/favorites"),children:"我的收藏"}),e.role==="admin"&&o.jsxs(o.Fragment,{children:[o.jsx(st,{}),o.jsx(De,{onClick:()=>n("/admin/dashboard"),children:"管理后台"})]}),o.jsx(st,{}),o.jsx(De,{onClick:()=>s().then(()=>n("/login")),children:"退出登录"})]})]}):o.jsx("button",{type:"button",className:"header-login-btn",onClick:()=>n("/login"),children:"登录"})]})]})]})}),o.jsxs("div",{className:`app-body${c?" app-body--compose":""}`,children:[!c&&o.jsx(Ja,{boards:y,activeBoard:F,onSelectBoard:M}),o.jsxs("div",{className:`content-workspace${c?" content-workspace--compose":""}`,children:[o.jsxs("main",{className:`main-content${c?" main-content--compose":""}`,children:[l&&!c&&o.jsxs("div",{className:"mobile-board-bar",children:[o.jsx("span",{className:`board-chip ${w===0?"active":""}`,onClick:()=>{M(0),Me(n,Ye(0,ue))},children:"全部"}),y.map(x=>{const D=ct(x),p=w===x.id;return o.jsx("span",{className:J("board-chip",p&&"active",p&&`board-chip--${D}`),onClick:()=>{M(x.id),Me(n,Ye(x.id,ue))},children:x.name},x.id)})]}),o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Mt,{context:{boardId:F,keyword:m.get("keyword")||"",setBoardId:M,boards:y,stats:j,layoutReady:P,refreshBoards:X,isMobile:l}})})]}),!c&&o.jsx("aside",{className:"aside-panel",children:o.jsx(Xa,{hot:O,notifications:$,online:te,onPostClick:x=>n(`/post/${x}`)})})]})]})]})})}const Tr={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-8 w-8"};function Cr({className:e,size:t="md"}){return o.jsx(as,{className:J("animate-spin text-[var(--j13-green)]",Tr[t],e),"aria-label":"加载中"})}const Ir=[{to:"/admin/dashboard",label:"仪表盘",icon:os},{to:"/admin/boards",label:"板块管理",icon:Io},{to:"/admin/posts",label:"帖子管理",icon:Po},{to:"/admin/comments",label:"评论管理",icon:rt},{to:"/admin/users",label:"用户管理",icon:nt},{to:"/admin/settings",label:"系统设置",icon:Ro}];function Pr(){const{user:e,loading:t}=Ke(),s=Je();return b.useEffect(()=>{if(!t){if(!e){s("/login");return}e.role!=="admin"&&(qe.warning("需要管理员权限"),s("/"))}},[e,t,s]),t?o.jsx("div",{className:"flex justify-center py-24",children:o.jsx(Cr,{size:"lg"})}):!e||e.role!=="admin"?null:o.jsxs("div",{className:"admin-shell",children:[o.jsxs("header",{className:"admin-topbar",children:[o.jsxs("div",{className:"admin-topbar-brand",children:[o.jsx("div",{className:"admin-topbar-mark",children:"姜"}),o.jsxs("div",{children:[o.jsx("div",{className:"admin-topbar-title",children:"姜十三论坛"}),o.jsx("div",{className:"admin-topbar-sub",children:"管理后台"})]})]}),o.jsxs("div",{className:"admin-topbar-actions",children:[o.jsxs("button",{type:"button",className:"admin-link-btn",onClick:()=>s("/"),children:[o.jsx(Co,{size:16}),"返回论坛"]}),o.jsx("span",{className:"admin-topbar-user",children:e.nickname})]})]}),o.jsxs("div",{className:"admin-body",children:[o.jsx("aside",{className:"admin-sidebar",children:Ir.map(({to:a,label:i,icon:l})=>o.jsxs(Qs,{to:a,className:({isActive:n})=>J("admin-nav-item",n&&"active"),children:[o.jsx(l,{size:16}),i]},a))}),o.jsx("main",{className:"admin-main",children:o.jsx(Mt,{})})]})]})}function an(){const{user:e,loading:t}=Ke(),s=Je();return b.useEffect(()=>{t||(e?e.role!=="admin"&&(qe.warning("需要管理员权限"),s("/")):s("/login"))},[e,t,s]),{user:e,loading:t,ready:!t&&!!e&&e.role==="admin"}}const At=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zt=ms,Rr=(e,t)=>s=>{var a;if((t==null?void 0:t.variants)==null)return zt(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:i,defaultVariants:l}=t,n=Object.keys(i).map(c=>{const y=s==null?void 0:s[c],r=l==null?void 0:l[c];if(y===null)return null;const j=At(y)||At(r);return i[c][j]}),d=s&&Object.entries(s).reduce((c,y)=>{let[r,j]=y;return j===void 0||(c[r]=j),c},{}),m=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((c,y)=>{let{class:r,className:j,...T}=y;return Object.entries(T).every(P=>{let[L,O]=P;return Array.isArray(O)?O.includes({...l,...d}[L]):{...l,...d}[L]===O})?[...c,r,j]:c},[]);return zt(e,n,m,s==null?void 0:s.class,s==null?void 0:s.className)},Ar=Rr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Ds=b.forwardRef(({className:e,variant:t,size:s,asChild:a=!1,loading:i,children:l,disabled:n,...d},m)=>{const c=a?Ao:"button";return o.jsxs(c,{className:J(Ar({variant:t,size:s,className:e})),ref:m,disabled:n||i,...d,children:[i?o.jsx(as,{className:"animate-spin"}):null,l]})});Ds.displayName="Button";class zr extends b.Component{constructor(){super(...arguments);xt(this,"state",{error:null})}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error("[Jiang13Forum]",s,a.componentStack)}render(){return this.state.error?o.jsxs("div",{style:{padding:24,textAlign:"center"},children:[o.jsx("h3",{children:"页面渲染出错"}),o.jsx("p",{style:{color:"var(--color-text-3)",fontSize:13},children:this.state.error.message}),o.jsx(Ds,{size:"sm",onClick:()=>{this.setState({error:null}),window.location.reload()},children:"刷新页面"})]}):this.props.children}}function Or(){const{theme:e}=ds();return o.jsx(_r,{theme:e,position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"font-sans"}}})}const Lr=b.lazy(()=>ae(()=>import("./HomePage-B75SKkZF.js"),__vite__mapDeps([0,1,2,3,4,5]))),Dr=b.lazy(()=>ae(()=>import("./PostDetailPage-Ca0chGU-.js"),__vite__mapDeps([6,1,3,4,7,5,8,9]))),Mr=b.lazy(()=>ae(()=>import("./LoginPage-jlZcJP-F.js"),__vite__mapDeps([10,1,11,4,12]))),Br=b.lazy(()=>ae(()=>import("./RegisterPage-g5r_djmM.js"),__vite__mapDeps([13,1,11,4,12]))),Ot=b.lazy(()=>ae(()=>import("./ComposePage-eRDSuLA7.js"),__vite__mapDeps([14,1,8,9,4,15,12,16]))),$r=b.lazy(()=>ae(()=>import("./BoardsManagePage-DxLu9n3N.js"),__vite__mapDeps([17,1,11,4,12,18,7,15,16]))),Fr=b.lazy(()=>ae(()=>import("./ProfilePage-BxbMpG9W.js"),__vite__mapDeps([19,1,11,4,12,7,15]))),Vr=b.lazy(()=>ae(()=>import("./FavoritesPage-rLr3pZbU.js"),__vite__mapDeps([20,1,5,4]))),Gr=b.lazy(()=>ae(()=>import("./AdminDashboardPage-C2c-F2-X.js"),__vite__mapDeps([21,1,7,4]))),Ur=b.lazy(()=>ae(()=>import("./AdminPostsPage-Boh0BdYW.js"),__vite__mapDeps([22,1,12,7,16,4,5]))),Wr=b.lazy(()=>ae(()=>import("./AdminCommentsPage-B23tMV_-.js"),__vite__mapDeps([23,1,7,16,4]))),Hr=b.lazy(()=>ae(()=>import("./AdminUsersPage-GP-G5C8H.js"),__vite__mapDeps([24,1,7,4]))),Yr=b.lazy(()=>ae(()=>import("./AdminSettingsPage-BKTiLKhD.js"),__vite__mapDeps([25,1,12,18,4]))),qr=Zs(eo(o.jsxs(o.Fragment,{children:[o.jsx(U,{path:"/login",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Mr,{})})}),o.jsx(U,{path:"/register",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Br,{})})}),o.jsx(U,{path:"/boards",element:o.jsx(vt,{to:"/admin/boards",replace:!0})}),o.jsxs(U,{path:"/admin",element:o.jsx(Pr,{}),children:[o.jsx(U,{index:!0,element:o.jsx(vt,{to:"/admin/dashboard",replace:!0})}),o.jsx(U,{path:"dashboard",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Gr,{})})}),o.jsx(U,{path:"boards",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx($r,{})})}),o.jsx(U,{path:"posts",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Ur,{})})}),o.jsx(U,{path:"comments",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Wr,{})})}),o.jsx(U,{path:"users",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Hr,{})})}),o.jsx(U,{path:"settings",element:o.jsx(b.Suspense,{fallback:o.jsx(xe,{}),children:o.jsx(Yr,{})})})]}),o.jsxs(U,{element:o.jsx(Er,{}),children:[o.jsx(U,{path:"/",element:o.jsx(Lr,{})}),o.jsx(U,{path:"/post/:id",element:o.jsx(Dr,{})}),o.jsx(U,{path:"/post/:id/edit",element:o.jsx(Ot,{})}),o.jsx(U,{path:"/compose",element:o.jsx(Ot,{})}),o.jsx(U,{path:"/profile",element:o.jsx(Fr,{})}),o.jsx(U,{path:"/favorites",element:o.jsx(Vr,{})})]})]})));function Jr(){return o.jsx(Mo,{children:o.jsx(Do,{children:o.jsxs(zr,{children:[o.jsx(to,{router:qr}),o.jsx(Or,{})]})})})}is(ns());so.createRoot(document.getElementById("root")).render(o.jsx(u.StrictMode,{children:o.jsx(Jr,{})}));export{Ds as B,Va as F,Cr as S,Fa as a,he as b,J as c,en as d,Me as e,Ye as f,tn as g,Ke as h,ct as i,Wa as j,Ga as k,Ue as l,an as m,qe as n,Ha as o,Rs as p,Rr as q,Ar as r,sn as s,on as t,Za as u}; diff --git a/embed_static/static/spa/assets/index-CucHNnyZ.js b/embed_static/static/spa/assets/index-CucHNnyZ.js deleted file mode 100644 index f985fd7..0000000 --- a/embed_static/static/spa/assets/index-CucHNnyZ.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-DC4iWqJT.js","assets/react-vendor-1fwFMt02.js","assets/virtual-vendor-DDSEW9eW.js","assets/badge-CS5odIe6.js","assets/PinnedIcon-_RgLYKvd.js","assets/ui-vendor-Gb6mai95.js","assets/content-BrFHUpp8.js","assets/PostDetailPage-BjTvWYTM.js","assets/postContent-ClrHK1rL.js","assets/purify-vendor-Cx4rtWv4.js","assets/LoginPage-sbkZASpH.js","assets/form-cra7lKcv.js","assets/input-DOedlbiC.js","assets/RegisterPage-D4yO0Lp-.js","assets/ComposePage-BiusUtIm.js","assets/dialog-CtQqbmck.js","assets/BoardsManagePage-DXFAZqh1.js","assets/textarea-CwI-oiTC.js","assets/alert-dialog-D0wiVaPM.js","assets/ProfilePage-DiORLSTl.js","assets/FavoritesPage-BrE1xy6C.js","assets/AdminDashboardPage-Co9xzcB-.js","assets/AdminPostsPage--PeUmtdb.js","assets/AdminCommentsPage-CQrE8jZ9.js","assets/AdminUsersPage-YBnRhF6k.js","assets/AdminSettingsPage-B63MNTuF.js"])))=>i.map(i=>d[i]); -var Is=Object.defineProperty;var Os=(e,t,s)=>t in e?Is(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ft=(e,t,s)=>Os(e,typeof t!="symbol"?t+"":t,s);import{r as b,j as r,e as qe,g as Pt,i as Rt,k as u,m as Ls,O as zt,N as Ds,B as Ms,n as Bs,p as G,q as ht,t as $s}from"./react-vendor-1fwFMt02.js";import{S as At,C as Fs,a as It,P as Vs,b as Ot,I as Lt,c as Dt,d as Mt,e as Us,R as Bt,f as Gs,L as $t,g as Ft,h as Ws,T as Hs,i as Ys,M as qs,F as Js,H as Ks,j as Xs,k as Vt,l as Qs,m as Zs,n as eo,o as to,p as Ut,A as so,q as oo,r as ro,s as ao,U as no,t as io,u as lo}from"./ui-vendor-Gb6mai95.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const n of l.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&o(n)}).observe(document,{childList:!0,subtree:!0});function s(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=s(i);fetch(i.href,l)}})();const Gt="j13-theme";function Wt(){return localStorage.getItem(Gt)==="dark"?"dark":"light"}function Ht(e){const t=document.documentElement;t.classList.toggle("dark",e==="dark"),t.style.colorScheme=e,localStorage.setItem(Gt,e)}const co="modulepreload",uo=function(e){return"/"+e},gt={},re=function(t,s,o){let i=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),d=(n==null?void 0:n.nonce)||(n==null?void 0:n.getAttribute("nonce"));i=Promise.allSettled(s.map(m=>{if(m=uo(m),m in gt)return;gt[m]=!0;const c=m.endsWith(".css"),x=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${x}`))return;const a=document.createElement("link");if(a.rel=c?"stylesheet":co,c||(a.as="script"),a.crossOrigin="",a.href=m,d&&a.setAttribute("nonce",d),document.head.appendChild(a),c)return new Promise((E,T)=>{a.addEventListener("load",E),a.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${m}`)))})}))}function l(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return i.then(n=>{for(const d of n||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})},mo="";async function v(e,t={}){const s=await fetch(mo+e,{credentials:"same-origin",...t,headers:{...t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t.headers}});let o;try{o=await s.json()}catch{throw new Error("服务器响应异常")}if(!s.ok)throw new Error(o.error||"请求失败");return o}const he={me:()=>v("/api/me"),stats:()=>v("/api/stats"),forumLimits:()=>v("/api/forum-limits"),boards:()=>v("/api/boards"),posts:e=>{const t=new URLSearchParams(e).toString();return v(`/api/posts?${t}`)},hotPosts:()=>v("/api/posts/hot"),post:(e,t)=>{const s=t!=null&&t.skipView?"?skip_view=1":"";return v(`/api/posts/${e}${s}`)},comments:(e,t)=>{const s=t!=null&&t.length?`?my_ids=${t.join(",")}`:"";return v(`/api/posts/${e}/comments${s}`)},notifications:()=>v("/api/notifications"),online:()=>v("/api/online"),presence:()=>v("/api/presence",{method:"POST"}),favorites:()=>v("/api/favorites"),createBoard:e=>v("/api/admin/boards",{method:"POST",body:JSON.stringify(e)}),updateBoard:(e,t)=>v(`/api/admin/boards/${e}`,{method:"PUT",body:JSON.stringify(t)}),deleteBoard:e=>v(`/api/admin/boards/${e}`,{method:"DELETE"}),adminDashboard:()=>v("/api/admin/dashboard"),adminSettings:()=>v("/api/admin/settings"),adminPosts:e=>{const t=new URLSearchParams;e.page&&t.set("page",String(e.page)),e.keyword&&t.set("keyword",e.keyword);const s=t.toString();return v(`/api/admin/posts${s?`?${s}`:""}`)},adminPinPost:(e,t)=>v(`/api/admin/posts/${e}/pin`,{method:"POST",body:JSON.stringify({pinned:t})}),adminLockPost:(e,t)=>v(`/api/admin/posts/${e}/lock`,{method:"POST",body:JSON.stringify({locked:t})}),adminUpdateForumSettings:e=>v("/api/admin/settings/forum",{method:"PUT",body:JSON.stringify(e)}),adminUpdateFilterWords:e=>v("/api/admin/settings/filter-words",{method:"PUT",body:JSON.stringify({content:e})}),postRevisions:e=>v(`/api/posts/${e}/revisions`),postRevision:(e,t)=>v(`/api/posts/${e}/revisions/${t}`),adminDeletePost:e=>v(`/api/admin/posts/${e}`,{method:"DELETE"}),adminComments:(e=1)=>v(`/api/admin/comments?page=${e}`),adminDeleteComment:e=>v(`/api/admin/comments/${e}`,{method:"DELETE"}),adminUsers:(e=1)=>v(`/api/admin/users?page=${e}`),adminBanUser:(e,t)=>v(`/api/admin/users/${e}/ban`,{method:"POST",body:JSON.stringify({banned:t})}),adminBackup:()=>v("/api/admin/backup",{method:"POST"}),updateNickname:e=>{const t=new FormData;return t.append("nickname",e),v("/api/profile/nickname",{method:"POST",body:t,headers:{}})},updatePassword:(e,t)=>{const s=new FormData;return s.append("old_password",e),s.append("new_password",t),v("/api/profile/password",{method:"POST",body:s,headers:{}})},uploadAvatar:e=>{const t=new FormData;return t.append("avatar",e),v("/api/profile/avatar",{method:"POST",body:t,headers:{}})},uploadPostImage:e=>{const t=new FormData;return t.append("image",e),v("/api/uploads/image",{method:"POST",body:t,headers:{}})},createPost:e=>{const t=new FormData;return t.append("board_id",e.board_id),t.append("title",e.title),t.append("content",e.content),t.append("tags",e.tags||""),v("/api/posts",{method:"POST",body:t,headers:{}})},updatePost:(e,t)=>{const s=new FormData;return s.append("title",t.title),s.append("content",t.content),s.append("tags",t.tags||""),v(`/api/posts/${e}`,{method:"PUT",body:s,headers:{}})},login:(e,t)=>{const s=new FormData;return s.append("username",e),s.append("password",t),v("/api/login",{method:"POST",body:s,headers:{}})},register:(e,t,s)=>{const o=new FormData;return o.append("username",e),o.append("password",t),o.append("nickname",s),v("/api/register",{method:"POST",body:o,headers:{}})},logout:()=>v("/api/logout",{method:"POST"}),like:e=>v(`/api/posts/${e}/like`,{method:"POST"}),favorite:e=>v(`/api/posts/${e}/favorite`,{method:"POST"}),addComment:(e,t)=>{const s=new FormData;return s.append("content",t.content),t.replyTo&&s.append("reply_to",String(t.replyTo)),t.guestNick&&s.append("guest_nick",t.guestNick),t.guestEmail&&s.append("guest_email",t.guestEmail),t.guestUrl&&s.append("guest_url",t.guestUrl),t.isPrivate&&s.append("is_private","1"),v(`/api/posts/${e}/comments`,{method:"POST",body:s,headers:{}})},ping:()=>v("/api/ping",{method:"POST"})},Yt=b.createContext({user:null,loading:!0,refresh:async()=>{},logout:async()=>{}});function po({children:e}){const[t,s]=b.useState(null),[o,i]=b.useState(!0),l=b.useCallback(async()=>{try{const d=await he.me();s(d.user??null)}catch{s(null)}finally{i(!1)}},[]);b.useEffect(()=>{l()},[l]);const n=async()=>{await he.logout(),s(null)};return r.jsx(Yt.Provider,{value:{user:t,loading:o,refresh:l,logout:n},children:e})}const Je=()=>b.useContext(Yt),qt=b.createContext({theme:"light",toggle:()=>{}});function fo({children:e}){const[t,s]=b.useState(Wt);b.useLayoutEffect(()=>{Ht(t)},[t]);const o=()=>s(i=>i==="light"?"dark":"light");return r.jsx(qt.Provider,{value:{theme:t,toggle:o},children:e})}const Jt=()=>b.useContext(qt);function ho(e){const[t,s]=b.useState(()=>window.matchMedia(e).matches);return b.useLayoutEffect(()=>{const o=window.matchMedia(e),i=()=>s(o.matches);return o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[e]),t}function ye(){return r.jsxs("div",{className:"page-loader",role:"status","aria-live":"polite",children:[r.jsx("span",{className:"page-loader__dot"}),"加载中…"]})}function Kt(e){var t,s,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const s=new Array(e.length+t.length);for(let o=0;o({classGroupId:e,validator:t}),Qt=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),We="-",bt=[],xo="arbitrary..",yo=e=>{const t=wo(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:n=>{if(n.startsWith("[")&&n.endsWith("]"))return vo(n);const d=n.split(We),m=d[0]===""&&d.length>1?1:0;return Zt(d,m,t)},getConflictingClassGroupIds:(n,d)=>{if(d){const m=o[n],c=s[n];return m?c?go(c,m):m:c||bt}return s[n]||bt}}},Zt=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const i=e[t],l=s.nextPart.get(i);if(l){const c=Zt(e,t+1,l);if(c)return c}const n=s.validators;if(n===null)return;const d=t===0?e.join(We):e.slice(t).join(We),m=n.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),o=t.slice(0,s);return o?xo+o:void 0})(),wo=e=>{const{theme:t,classGroups:s}=e;return ko(s,t)},ko=(e,t)=>{const s=Qt();for(const o in e){const i=e[o];ot(i,s,o,t)}return s},ot=(e,t,s,o)=>{const i=e.length;for(let l=0;l{if(typeof e=="string"){So(e,t,s);return}if(typeof e=="function"){No(e,t,s,o);return}Eo(e,t,s,o)},So=(e,t,s)=>{const o=e===""?t:es(t,e);o.classGroupId=s},No=(e,t,s,o)=>{if(_o(e)){ot(e(o),t,s,o);return}t.validators===null&&(t.validators=[]),t.validators.push(bo(s,e))},Eo=(e,t,s,o)=>{const i=Object.entries(e),l=i.length;for(let n=0;n{let s=e;const o=t.split(We),i=o.length;for(let l=0;l"isThemeGetter"in e&&e.isThemeGetter===!0,To=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),o=Object.create(null);const i=(l,n)=>{s[l]=n,t++,t>e&&(t=0,o=s,s=Object.create(null))};return{get(l){let n=s[l];if(n!==void 0)return n;if((n=o[l])!==void 0)return i(l,n),n},set(l,n){l in s?s[l]=n:i(l,n)}}},et="!",xt=":",Co=[],yt=(e,t,s,o,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:o,isExternal:i}),Po=e=>{const{prefix:t,experimentalParseClassName:s}=e;let o=i=>{const l=[];let n=0,d=0,m=0,c;const x=i.length;for(let L=0;Lm?c-m:void 0;return yt(l,T,E,R)};if(t){const i=t+xt,l=o;o=n=>n.startsWith(i)?l(n.slice(i.length)):yt(Co,!1,n,void 0,!0)}if(s){const i=o;o=l=>s({className:l,parseClassName:i})}return o},Ro=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,o)=>{t.set(s,1e6+o)}),s=>{const o=[];let i=[];for(let l=0;l0&&(i.sort(),o.push(...i),i=[]),o.push(n)):i.push(n)}return i.length>0&&(i.sort(),o.push(...i)),o}},zo=e=>({cache:To(e.cacheSize),parseClassName:Po(e),sortModifiers:Ro(e),postfixLookupClassGroupIds:Ao(e),...yo(e)}),Ao=e=>{const t=Object.create(null),s=e.postfixLookupClassGroups;if(s)for(let o=0;o{const{parseClassName:s,getClassGroupId:o,getConflictingClassGroupIds:i,sortModifiers:l,postfixLookupClassGroupIds:n}=t,d=[],m=e.trim().split(Io);let c="";for(let x=m.length-1;x>=0;x-=1){const a=m[x],{isExternal:E,modifiers:T,hasImportantModifier:R,baseClassName:L,maybePostfixModifierPosition:O}=s(a);if(E){c=a+(c.length>0?" "+c:c);continue}let N=!!O,B;if(N){const D=L.substring(0,O);B=o(D);const p=B&&n[B]?o(L):void 0;p&&p!==B&&(B=p,N=!1)}else B=o(L);if(!B){if(!N){c=a+(c.length>0?" "+c:c);continue}if(B=o(L),!B){c=a+(c.length>0?" "+c:c);continue}N=!1}const X=T.length===0?"":T.length===1?T[0]:l(T).join(":"),te=R?X+et:X,ae=te+B;if(d.indexOf(ae)>-1)continue;d.push(ae);const $=i(B,N);for(let D=0;D<$.length;++D){const p=$[D];d.push(te+p)}c=a+(c.length>0?" "+c:c)}return c},Lo=(...e)=>{let t=0,s,o,i="";for(;t{if(typeof e=="string")return e;let t,s="";for(let o=0;o{let s,o,i,l;const n=m=>{const c=t.reduce((x,a)=>a(x),e());return s=zo(c),o=s.cache.get,i=s.cache.set,l=d,d(m)},d=m=>{const c=o(m);if(c)return c;const x=Oo(m,s);return i(m,x),x};return l=n,(...m)=>l(Lo(...m))},Mo=[],V=e=>{const t=s=>s[e]||Mo;return t.isThemeGetter=!0,t},ss=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,os=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Bo=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,$o=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Fo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vo=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Uo=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Go=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ke=e=>Bo.test(e),j=e=>!!e&&!Number.isNaN(Number(e)),pe=e=>!!e&&Number.isInteger(Number(e)),Qe=e=>e.endsWith("%")&&j(e.slice(0,-1)),xe=e=>$o.test(e),rs=()=>!0,Wo=e=>Fo.test(e)&&!Vo.test(e),rt=()=>!1,Ho=e=>Uo.test(e),Yo=e=>Go.test(e),qo=e=>!f(e)&&!g(e),Jo=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),Ko=e=>je(e,is,rt),f=e=>ss.test(e),_e=e=>je(e,ls,Wo),vt=e=>je(e,rr,j),Xo=e=>je(e,ds,rs),Qo=e=>je(e,cs,rt),wt=e=>je(e,as,rt),Zo=e=>je(e,ns,Yo),Ve=e=>je(e,us,Ho),g=e=>os.test(e),Oe=e=>Te(e,ls),er=e=>Te(e,cs),kt=e=>Te(e,as),tr=e=>Te(e,is),sr=e=>Te(e,ns),Ue=e=>Te(e,us,!0),or=e=>Te(e,ds,!0),je=(e,t,s)=>{const o=ss.exec(e);return o?o[1]?t(o[1]):s(o[2]):!1},Te=(e,t,s=!1)=>{const o=os.exec(e);return o?o[1]?t(o[1]):s:!1},as=e=>e==="position"||e==="percentage",ns=e=>e==="image"||e==="url",is=e=>e==="length"||e==="size"||e==="bg-size",ls=e=>e==="length",rr=e=>e==="number",cs=e=>e==="family-name",ds=e=>e==="number"||e==="weight",us=e=>e==="shadow",ar=()=>{const e=V("color"),t=V("font"),s=V("text"),o=V("font-weight"),i=V("tracking"),l=V("leading"),n=V("breakpoint"),d=V("container"),m=V("spacing"),c=V("radius"),x=V("shadow"),a=V("inset-shadow"),E=V("text-shadow"),T=V("drop-shadow"),R=V("blur"),L=V("perspective"),O=V("aspect"),N=V("ease"),B=V("animate"),X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],te=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],ae=()=>[...te(),g,f],$=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],p=()=>[g,f,m],M=()=>[ke,"full","auto",...p()],ue=()=>[pe,"none","subgrid",g,f],J=()=>["auto",{span:["full",pe,g,f]},pe,g,f],K=()=>[pe,"auto",g,f],W=()=>["auto","min","max","fr",g,f],me=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],w=()=>["auto",...p()],C=()=>[ke,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],y=()=>[ke,"screen","full","dvw","lvw","svw","min","max","fit",...p()],F=()=>[ke,"screen","full","lh","dvh","lvh","svh","min","max","fit",...p()],h=()=>[e,g,f],Y=()=>[...te(),kt,wt,{position:[g,f]}],Se=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",tr,Ko,{size:[g,f]}],A=()=>[Qe,Oe,_e],S=()=>["","none","full",c,g,f],P=()=>["",j,Oe,_e],ie=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],I=()=>[j,Qe,kt,wt],Ne=()=>["","none",R,g,f],ge=()=>["none",j,g,f],le=()=>["none",j,g,f],Ae=()=>[j,g,f],ve=()=>[ke,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[xe],breakpoint:[xe],color:[rs],container:[xe],"drop-shadow":[xe],ease:["in","out","in-out"],font:[qo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[xe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[xe],shadow:[xe],spacing:["px",j],text:[xe],"text-shadow":[xe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ke,f,g,O]}],container:["container"],"container-type":[{"@container":["","normal","size",g,f]}],"container-named":[Jo],columns:[{columns:[j,f,g,d]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:ae()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[pe,"auto",g,f]}],basis:[{basis:[ke,"full","auto",d,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[j,ke,"auto","initial","none",f]}],grow:[{grow:["",j,g,f]}],shrink:[{shrink:["",j,g,f]}],order:[{order:[pe,"first","last","none",g,f]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...me(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...me()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":me()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pbs:[{pbs:p()}],pbe:[{pbe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:w()}],mx:[{mx:w()}],my:[{my:w()}],ms:[{ms:w()}],me:[{me:w()}],mbs:[{mbs:w()}],mbe:[{mbe:w()}],mt:[{mt:w()}],mr:[{mr:w()}],mb:[{mb:w()}],ml:[{ml:w()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:C()}],"inline-size":[{inline:["auto",...y()]}],"min-inline-size":[{"min-inline":["auto",...y()]}],"max-inline-size":[{"max-inline":["none",...y()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[d,"screen",...C()]}],"min-w":[{"min-w":[d,"screen","none",...C()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[n]},...C()]}],h:[{h:["screen","lh",...C()]}],"min-h":[{"min-h":["screen","lh","none",...C()]}],"max-h":[{"max-h":["screen","lh",...C()]}],"font-size":[{text:["base",s,Oe,_e]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,or,Xo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Qe,f]}],"font-family":[{font:[er,Qo,t]}],"font-features":[{"font-features":[f]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,g,f]}],"line-clamp":[{"line-clamp":[j,"none",g,vt]}],leading:[{leading:[l,...p()]}],"list-image":[{"list-image":["none",g,f]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",g,f]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[j,"from-font","auto",g,_e]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[j,"auto",g,f]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"tab-size":[{tab:[pe,g,f]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",g,f]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",g,f]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Y()}],"bg-repeat":[{bg:Se()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pe,g,f],radial:["",g,f],conic:[pe,g,f]},sr,Zo]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:A()}],"gradient-via-pos":[{via:A()}],"gradient-to-pos":[{to:A()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:S()}],"rounded-s":[{"rounded-s":S()}],"rounded-e":[{"rounded-e":S()}],"rounded-t":[{"rounded-t":S()}],"rounded-r":[{"rounded-r":S()}],"rounded-b":[{"rounded-b":S()}],"rounded-l":[{"rounded-l":S()}],"rounded-ss":[{"rounded-ss":S()}],"rounded-se":[{"rounded-se":S()}],"rounded-ee":[{"rounded-ee":S()}],"rounded-es":[{"rounded-es":S()}],"rounded-tl":[{"rounded-tl":S()}],"rounded-tr":[{"rounded-tr":S()}],"rounded-br":[{"rounded-br":S()}],"rounded-bl":[{"rounded-bl":S()}],"border-w":[{border:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-bs":[{"border-bs":P()}],"border-w-be":[{"border-be":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-bs":[{"border-bs":h()}],"border-color-be":[{"border-be":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[j,g,f]}],"outline-w":[{outline:["",j,Oe,_e]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",x,Ue,Ve]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",a,Ue,Ve]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[j,_e]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",E,Ue,Ve]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[j,g,f]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[j]}],"mask-image-linear-from-pos":[{"mask-linear-from":I()}],"mask-image-linear-to-pos":[{"mask-linear-to":I()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":I()}],"mask-image-t-to-pos":[{"mask-t-to":I()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":I()}],"mask-image-r-to-pos":[{"mask-r-to":I()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":I()}],"mask-image-b-to-pos":[{"mask-b-to":I()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":I()}],"mask-image-l-to-pos":[{"mask-l-to":I()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":I()}],"mask-image-x-to-pos":[{"mask-x-to":I()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":I()}],"mask-image-y-to-pos":[{"mask-y-to":I()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[g,f]}],"mask-image-radial-from-pos":[{"mask-radial-from":I()}],"mask-image-radial-to-pos":[{"mask-radial-to":I()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":te()}],"mask-image-conic-pos":[{"mask-conic":[j]}],"mask-image-conic-from-pos":[{"mask-conic-from":I()}],"mask-image-conic-to-pos":[{"mask-conic-to":I()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Y()}],"mask-repeat":[{mask:Se()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",g,f]}],filter:[{filter:["","none",g,f]}],blur:[{blur:Ne()}],brightness:[{brightness:[j,g,f]}],contrast:[{contrast:[j,g,f]}],"drop-shadow":[{"drop-shadow":["","none",T,Ue,Ve]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",j,g,f]}],"hue-rotate":[{"hue-rotate":[j,g,f]}],invert:[{invert:["",j,g,f]}],saturate:[{saturate:[j,g,f]}],sepia:[{sepia:["",j,g,f]}],"backdrop-filter":[{"backdrop-filter":["","none",g,f]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[j,g,f]}],"backdrop-contrast":[{"backdrop-contrast":[j,g,f]}],"backdrop-grayscale":[{"backdrop-grayscale":["",j,g,f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j,g,f]}],"backdrop-invert":[{"backdrop-invert":["",j,g,f]}],"backdrop-opacity":[{"backdrop-opacity":[j,g,f]}],"backdrop-saturate":[{"backdrop-saturate":[j,g,f]}],"backdrop-sepia":[{"backdrop-sepia":["",j,g,f]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",g,f]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[j,"initial",g,f]}],ease:[{ease:["linear","initial",N,g,f]}],delay:[{delay:[j,g,f]}],animate:[{animate:["none",B,g,f]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[L,g,f]}],"perspective-origin":[{"perspective-origin":ae()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:Ae()}],"skew-x":[{"skew-x":Ae()}],"skew-y":[{"skew-y":Ae()}],transform:[{transform:[g,f,"","none","gpu","cpu"]}],"transform-origin":[{origin:ae()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],zoom:[{zoom:[pe,g,f]}],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",g,f]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":h()}],"scrollbar-track-color":[{"scrollbar-track":h()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mbs":[{"scroll-mbs":p()}],"scroll-mbe":[{"scroll-mbe":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pbs":[{"scroll-pbs":p()}],"scroll-pbe":[{"scroll-pbe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",g,f]}],fill:[{fill:["none",...h()]}],"stroke-w":[{stroke:[j,Oe,_e,vt]}],stroke:[{stroke:["none",...h()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nr=Do(ar);function ee(...e){return nr(Xt(e))}const ir=Ws,lr=Hs,cr=b.forwardRef(({className:e,inset:t,children:s,...o},i)=>r.jsxs(At,{ref:i,className:ee("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[s,r.jsx(Fs,{className:"ml-auto"})]}));cr.displayName=At.displayName;const dr=b.forwardRef(({className:e,...t},s)=>r.jsx(It,{ref:s,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));dr.displayName=It.displayName;const ms=b.forwardRef(({className:e,sideOffset:t=4,...s},o)=>r.jsx(Vs,{children:r.jsx(Ot,{ref:o,sideOffset:t,className:ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...s})}));ms.displayName=Ot.displayName;const De=b.forwardRef(({className:e,inset:t,...s},o)=>r.jsx(Lt,{ref:o,className:ee("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...s}));De.displayName=Lt.displayName;const ur=b.forwardRef(({className:e,children:t,checked:s,...o},i)=>r.jsxs(Dt,{ref:i,className:ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:s,...o,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Mt,{children:r.jsx(Us,{className:"h-4 w-4"})})}),t]}));ur.displayName=Dt.displayName;const mr=b.forwardRef(({className:e,children:t,...s},o)=>r.jsxs(Bt,{ref:o,className:ee("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...s,children:[r.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(Mt,{children:r.jsx(Gs,{className:"h-2 w-2 fill-current"})})}),t]}));mr.displayName=Bt.displayName;const pr=b.forwardRef(({className:e,inset:t,...s},o)=>r.jsx($t,{ref:o,className:ee("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...s}));pr.displayName=$t.displayName;const tt=b.forwardRef(({className:e,...t},s)=>r.jsx(Ft,{ref:s,className:ee("-mx-1 my-1 h-px bg-muted",e),...t}));tt.displayName=Ft.displayName;const ps="j13-cache-boards",fs="j13-cache-stats";function hs(e){try{const t=sessionStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function gs(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch{}}function jt(){return hs(ps)??[]}function St(){return hs(fs)}function fr(e){gs(ps,e)}function hr(e){gs(fs,e)}const gr=[{key:"latest",label:"最新发帖",hint:"按发布时间",icon:Ys},{key:"reply",label:"最新回复",hint:"最近有人回复",icon:qs},{key:"hot",label:"热门讨论",hint:"按互动热度",icon:Js}];function bs(e){return e==="reply"||e==="hot"?e:"latest"}function He(e,t="latest"){const s=new URLSearchParams;e&&s.set("board",String(e)),t!=="latest"&&s.set("sort",t);const o=s.toString();return o?`/?${o}`:"/"}function Sa({value:e,onChange:t,postTotal:s}){return r.jsxs("div",{className:"feed-toolbar",children:[r.jsx("div",{className:"feed-sort-bar",role:"tablist","aria-label":"帖子排序",children:gr.map(({key:o,label:i,hint:l,icon:n})=>r.jsxs("button",{type:"button",role:"tab","aria-selected":e===o,title:`${i} · ${l}`,className:ee("feed-sort-tab",e===o&&"active"),onClick:()=>t(o),children:[r.jsx(n,{"aria-hidden":!0}),r.jsx("span",{className:"feed-sort-tab__label",children:i})]},o))}),s!=null&&r.jsxs("span",{className:"feed-toolbar__count",children:["共 ",s," 条"]})]})}const xs="j13-feed-cache:";function ys(e,t,s){return`${xs}${e}:${t}:${s}`}function Na(e,t,s){try{const o=sessionStorage.getItem(ys(e,t,s));return o?JSON.parse(o):null}catch{return null}}function Ea(e,t,s,o){try{sessionStorage.setItem(ys(e,t,s),JSON.stringify(o))}catch{}}function br(){try{for(let e=sessionStorage.length-1;e>=0;e--){const t=sessionStorage.key(e);t!=null&&t.startsWith(xs)&&sessionStorage.removeItem(t)}}catch{}}const xr="feed-reset";function Me(e,t){br(),window.dispatchEvent(new Event(xr)),e(t,{state:{refreshFeed:!0}})}const yr=["/post/","/profile"];function vs(e){return yr.some(t=>e.startsWith(t))}function vr(e,t){return vs(e)?null:e.startsWith("/favorites")?"favorites":e.startsWith("/admin")?"admin":t===0?"all":String(t)}function wr({boards:e,activeBoard:t,onSelectBoard:s}){const o=qe(),i=Pt(),[l]=Rt(),n=bs(l.get("sort")),{user:d}=Je(),m=(d==null?void 0:d.role)==="admin",c=vr(i.pathname,t),x=(a,E,T,R)=>r.jsxs("button",{type:"button",className:ee("sidebar-nav-item",c!=null&&c===a&&"active"),onClick:R,children:[T,r.jsx("span",{className:"flex-1 truncate",children:E})]},a);return r.jsxs("aside",{className:"sidebar",children:[r.jsx("div",{className:"sidebar-section",children:"浏览"}),r.jsxs("nav",{className:"sidebar-nav",children:[x("all","全部帖子",r.jsx(Ks,{}),()=>{s(0),Me(o,He(0,n))}),d&&x("favorites","我的收藏",r.jsx(Xs,{}),()=>o("/favorites"))]}),e.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sidebar-section",style:{marginTop:8},children:"板块"}),r.jsx("nav",{className:"sidebar-nav",children:e.map(a=>r.jsx("button",{type:"button",className:ee("sidebar-nav-item",c!=null&&c===String(a.id)&&"active"),onClick:()=>{s(a.id),Me(o,He(a.id,n))},children:r.jsx("span",{className:"flex-1 truncate",children:a.name})},a.id))})]}),m&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"sidebar-section",style:{marginTop:8},children:"管理"}),r.jsx("nav",{className:"sidebar-nav",children:x("admin","管理后台",r.jsx(Vt,{}),()=>o("/admin/dashboard"))})]})]})}function kr({hot:e,notifications:t,online:s,onPostClick:o}){const i=(e==null?void 0:e.slice(0,8))??[],l=(t==null?void 0:t.slice(0,6))??[],n=(s==null?void 0:s.users)??[];return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"widget-card",children:[r.jsx("div",{className:"widget-card-head",children:"🔥 热门帖子"}),r.jsx("div",{className:"widget-card-body",children:i.length===0?r.jsx("div",{style:{fontSize:13,color:"var(--color-text-3)",padding:"8px 0"},children:"暂无数据"}):i.map((d,m)=>r.jsxs("div",{className:"widget-item",onClick:()=>o(d.id),children:[r.jsx("span",{style:{color:m<3?"#e74c3c":"var(--color-text-3)",fontWeight:600,minWidth:18},children:m+1}),r.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title})]},d.id))})]}),r.jsxs("div",{className:"widget-card",children:[r.jsx("div",{className:"widget-card-head",children:"📢 最新动态"}),r.jsx("div",{className:"widget-card-body",children:l.length===0?r.jsx("div",{style:{fontSize:13,color:"var(--color-text-3)",padding:"8px 0"},children:"暂无动态"}):l.map(d=>r.jsxs("div",{className:"widget-item",onClick:()=>o(d.id),children:[r.jsx("span",{style:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),r.jsx("span",{style:{fontSize:11,color:"var(--color-text-4)",flexShrink:0},children:d.created_at})]},d.id))})]}),r.jsxs("div",{className:"widget-card",children:[r.jsxs("div",{className:"widget-card-head",children:["👀 当前浏览 ",(s==null?void 0:s.count)??"—"," 人"]}),r.jsxs("div",{className:"widget-card-body",children:[r.jsxs("div",{style:{fontSize:12,color:"var(--color-text-3)",marginBottom:8},children:["会员 ",(s==null?void 0:s.members)??0," · 游客 ",(s==null?void 0:s.guests)??0]}),r.jsxs("div",{className:"widget-online-list",children:[n.map(d=>{var m;return r.jsx("span",{className:"widget-online-avatar",title:d.nickname,children:d.avatar?r.jsx("img",{src:d.avatar,alt:""}):((m=d.nickname)==null?void 0:m[0])||"?"},d.id)}),n.length===0&&r.jsx("span",{style:{fontSize:13,color:"var(--color-text-3)"},children:"暂无会员在线"})]})]})]}),r.jsx("div",{className:"widget-card widget-card--about",children:r.jsx("div",{className:"widget-card-body",children:r.jsxs("p",{className:"widget-about-text",children:[r.jsx("strong",{children:"姜十三论坛"}),"拾三一隅,自在交流。轻量社区,专为小圈子打造。"]})})})]})}const ws={post_title_max:128,post_tags_max:256,post_content_max:5e4,comment_max:5e3,search_keyword_min:1,search_keyword_max:50,page_size_default:30,feed_max_pages:10,feed_max_items:300,password_min_len:6,avatar_max_mb:2};let ze=null,Le=null;function jr(){return ze?Promise.resolve(ze):Le||(Le=he.forumLimits().then(e=>(ze=e,e)).catch(()=>ws).finally(()=>{Le=null}),Le)}function Sr(){const[e,t]=b.useState(ze??ws),[s,o]=b.useState(!ze);return b.useEffect(()=>{jr().then(t).finally(()=>o(!1))},[]),{limits:e,loading:s}}function _a(){ze=null}function Nr(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",t.appendChild(s),s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e))}const Er=e=>{switch(e){case"success":return Cr;case"info":return Rr;case"warning":return Pr;case"error":return zr;default:return null}},_r=Array(12).fill(0),Tr=({visible:e,className:t})=>u.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},u.createElement("div",{className:"sonner-spinner"},_r.map((s,o)=>u.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),Cr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Pr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Rr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),zr=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},u.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ar=u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},u.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),u.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ir=()=>{const[e,t]=u.useState(document.hidden);return u.useEffect(()=>{const s=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",s),()=>window.removeEventListener("visibilitychange",s)},[]),e};let st=1;class Or{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const s=this.subscribers.indexOf(t);this.subscribers.splice(s,1)}),this.publish=t=>{this.subscribers.forEach(s=>s(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var s;const{message:o,...i}=t,l=typeof(t==null?void 0:t.id)=="number"||((s=t.id)==null?void 0:s.length)>0?t.id:st++,n=this.toasts.find(m=>m.id===l),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),n?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...t,id:l,title:o}),{...m,...t,id:l,dismissible:d,title:o}):m):this.addToast({title:o,...i,dismissible:d,id:l}),l},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(s=>s({id:t,dismiss:!0})))):this.toasts.forEach(s=>{this.subscribers.forEach(o=>o({id:s.id,dismiss:!0}))}),t),this.message=(t,s)=>this.create({...s,message:t}),this.error=(t,s)=>this.create({...s,message:t,type:"error"}),this.success=(t,s)=>this.create({...s,type:"success",message:t}),this.info=(t,s)=>this.create({...s,type:"info",message:t}),this.warning=(t,s)=>this.create({...s,type:"warning",message:t}),this.loading=(t,s)=>this.create({...s,type:"loading",message:t}),this.promise=(t,s)=>{if(!s)return;let o;s.loading!==void 0&&(o=this.create({...s,promise:t,type:"loading",message:s.loading,description:typeof s.description!="function"?s.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let l=o!==void 0,n;const d=i.then(async c=>{if(n=["resolve",c],u.isValidElement(c))l=!1,this.create({id:o,type:"default",message:c});else if(Dr(c)&&!c.ok){l=!1;const a=typeof s.error=="function"?await s.error(`HTTP error! status: ${c.status}`):s.error,E=typeof s.description=="function"?await s.description(`HTTP error! status: ${c.status}`):s.description,R=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:o,type:"error",description:E,...R})}else if(c instanceof Error){l=!1;const a=typeof s.error=="function"?await s.error(c):s.error,E=typeof s.description=="function"?await s.description(c):s.description,R=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:o,type:"error",description:E,...R})}else if(s.success!==void 0){l=!1;const a=typeof s.success=="function"?await s.success(c):s.success,E=typeof s.description=="function"?await s.description(c):s.description,R=typeof a=="object"&&!u.isValidElement(a)?a:{message:a};this.create({id:o,type:"success",description:E,...R})}}).catch(async c=>{if(n=["reject",c],s.error!==void 0){l=!1;const x=typeof s.error=="function"?await s.error(c):s.error,a=typeof s.description=="function"?await s.description(c):s.description,T=typeof x=="object"&&!u.isValidElement(x)?x:{message:x};this.create({id:o,type:"error",description:a,...T})}}).finally(()=>{l&&(this.dismiss(o),o=void 0),s.finally==null||s.finally.call(s)}),m=()=>new Promise((c,x)=>d.then(()=>n[0]==="reject"?x(n[1]):c(n[1])).catch(x));return typeof o!="string"&&typeof o!="number"?{unwrap:m}:Object.assign(o,{unwrap:m})},this.custom=(t,s)=>{const o=(s==null?void 0:s.id)||st++;return this.create({jsx:t(o),id:o,...s}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Z=new Or,Lr=(e,t)=>{const s=(t==null?void 0:t.id)||st++;return Z.addToast({title:e,...t,id:s}),s},Dr=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Mr=Lr,Br=()=>Z.toasts,$r=()=>Z.getActiveToasts(),Ze=Object.assign(Mr,{success:Z.success,info:Z.info,warning:Z.warning,error:Z.error,custom:Z.custom,message:Z.message,promise:Z.promise,dismiss:Z.dismiss,loading:Z.loading},{getHistory:Br,getToasts:$r});Nr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Ge(e){return e.label!==void 0}const Fr=3,Vr="24px",Ur="16px",Nt=4e3,Gr=356,Wr=14,Hr=45,Yr=200;function fe(...e){return e.filter(Boolean).join(" ")}function qr(e){const[t,s]=e.split("-"),o=[];return t&&o.push(t),s&&o.push(s),o}const Jr=e=>{var t,s,o,i,l,n,d,m,c;const{invert:x,toast:a,unstyled:E,interacting:T,setHeights:R,visibleToasts:L,heights:O,index:N,toasts:B,expanded:X,removeToast:te,defaultRichColors:ae,closeButton:$,style:D,cancelButtonStyle:p,actionButtonStyle:M,className:ue="",descriptionClassName:J="",duration:K,position:W,gap:me,expandByDefault:Q,classNames:w,icons:C,closeButtonAriaLabel:y="Close toast"}=e,[F,h]=u.useState(null),[Y,Se]=u.useState(null),[_,A]=u.useState(!1),[S,P]=u.useState(!1),[ie,z]=u.useState(!1),[I,Ne]=u.useState(!1),[ge,le]=u.useState(!1),[Ae,ve]=u.useState(0),[js,at]=u.useState(0),Ie=u.useRef(a.duration||K||Nt),nt=u.useRef(null),be=u.useRef(null),Ss=N===0,Ns=N+1<=L,se=a.type,Ce=a.dismissible!==!1,Es=a.className||"",_s=a.descriptionClassName||"",Be=u.useMemo(()=>O.findIndex(k=>k.toastId===a.id)||0,[O,a.id]),Ts=u.useMemo(()=>{var k;return(k=a.closeButton)!=null?k:$},[a.closeButton,$]),it=u.useMemo(()=>a.duration||K||Nt,[a.duration,K]),Ke=u.useRef(0),Pe=u.useRef(0),lt=u.useRef(0),Re=u.useRef(null),[Cs,Ps]=W.split("-"),ct=u.useMemo(()=>O.reduce((k,U,q)=>q>=Be?k:k+U.height,0),[O,Be]),dt=Ir(),Rs=a.invert||x,Xe=se==="loading";Pe.current=u.useMemo(()=>Be*me+ct,[Be,ct]),u.useEffect(()=>{Ie.current=it},[it]),u.useEffect(()=>{A(!0)},[]),u.useEffect(()=>{const k=be.current;if(k){const U=k.getBoundingClientRect().height;return at(U),R(q=>[{toastId:a.id,height:U,position:a.position},...q]),()=>R(q=>q.filter(oe=>oe.toastId!==a.id))}},[R,a.id]),u.useLayoutEffect(()=>{if(!_)return;const k=be.current,U=k.style.height;k.style.height="auto";const q=k.getBoundingClientRect().height;k.style.height=U,at(q),R(oe=>oe.find(H=>H.toastId===a.id)?oe.map(H=>H.toastId===a.id?{...H,height:q}:H):[{toastId:a.id,height:q,position:a.position},...oe])},[_,a.title,a.description,R,a.id,a.jsx,a.action,a.cancel]);const we=u.useCallback(()=>{P(!0),ve(Pe.current),R(k=>k.filter(U=>U.toastId!==a.id)),setTimeout(()=>{te(a)},Yr)},[a,te,R,Pe]);u.useEffect(()=>{if(a.promise&&se==="loading"||a.duration===1/0||a.type==="loading")return;let k;return X||T||dt?(()=>{if(lt.current{Ie.current!==1/0&&(Ke.current=new Date().getTime(),k=setTimeout(()=>{a.onAutoClose==null||a.onAutoClose.call(a,a),we()},Ie.current))})(),()=>clearTimeout(k)},[X,T,a,se,dt,we]),u.useEffect(()=>{a.delete&&(we(),a.onDismiss==null||a.onDismiss.call(a,a))},[we,a.delete]);function zs(){var k;if(C!=null&&C.loading){var U;return u.createElement("div",{className:fe(w==null?void 0:w.loader,a==null||(U=a.classNames)==null?void 0:U.loader,"sonner-loader"),"data-visible":se==="loading"},C.loading)}return u.createElement(Tr,{className:fe(w==null?void 0:w.loader,a==null||(k=a.classNames)==null?void 0:k.loader),visible:se==="loading"})}const As=a.icon||(C==null?void 0:C[se])||Er(se);var ut,mt;return u.createElement("li",{tabIndex:0,ref:be,className:fe(ue,Es,w==null?void 0:w.toast,a==null||(t=a.classNames)==null?void 0:t.toast,w==null?void 0:w.default,w==null?void 0:w[se],a==null||(s=a.classNames)==null?void 0:s[se]),"data-sonner-toast":"","data-rich-colors":(ut=a.richColors)!=null?ut:ae,"data-styled":!(a.jsx||a.unstyled||E),"data-mounted":_,"data-promise":!!a.promise,"data-swiped":ge,"data-removed":S,"data-visible":Ns,"data-y-position":Cs,"data-x-position":Ps,"data-index":N,"data-front":Ss,"data-swiping":ie,"data-dismissible":Ce,"data-type":se,"data-invert":Rs,"data-swipe-out":I,"data-swipe-direction":Y,"data-expanded":!!(X||Q&&_),"data-testid":a.testId,style:{"--index":N,"--toasts-before":N,"--z-index":B.length-N,"--offset":`${S?Ae:Pe.current}px`,"--initial-height":Q?"auto":`${js}px`,...D,...a.style},onDragEnd:()=>{z(!1),h(null),Re.current=null},onPointerDown:k=>{k.button!==2&&(Xe||!Ce||(nt.current=new Date,ve(Pe.current),k.target.setPointerCapture(k.pointerId),k.target.tagName!=="BUTTON"&&(z(!0),Re.current={x:k.clientX,y:k.clientY})))},onPointerUp:()=>{var k,U,q;if(I||!Ce)return;Re.current=null;const oe=Number(((k=be.current)==null?void 0:k.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$e=Number(((U=be.current)==null?void 0:U.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),H=new Date().getTime()-((q=nt.current)==null?void 0:q.getTime()),ne=F==="x"?oe:$e,Fe=Math.abs(ne)/H;if(Math.abs(ne)>=Hr||Fe>.11){ve(Pe.current),a.onDismiss==null||a.onDismiss.call(a,a),Se(F==="x"?oe>0?"right":"left":$e>0?"down":"up"),we(),Ne(!0);return}else{var ce,de;(ce=be.current)==null||ce.style.setProperty("--swipe-amount-x","0px"),(de=be.current)==null||de.style.setProperty("--swipe-amount-y","0px")}le(!1),z(!1),h(null)},onPointerMove:k=>{var U,q,oe;if(!Re.current||!Ce||((U=window.getSelection())==null?void 0:U.toString().length)>0)return;const H=k.clientY-Re.current.y,ne=k.clientX-Re.current.x;var Fe;const ce=(Fe=e.swipeDirections)!=null?Fe:qr(W);!F&&(Math.abs(ne)>1||Math.abs(H)>1)&&h(Math.abs(ne)>Math.abs(H)?"x":"y");let de={x:0,y:0};const pt=Ee=>1/(1.5+Math.abs(Ee)/20);if(F==="y"){if(ce.includes("top")||ce.includes("bottom"))if(ce.includes("top")&&H<0||ce.includes("bottom")&&H>0)de.y=H;else{const Ee=H*pt(H);de.y=Math.abs(Ee)0)de.x=ne;else{const Ee=ne*pt(ne);de.x=Math.abs(Ee)0||Math.abs(de.y)>0)&&le(!0),(q=be.current)==null||q.style.setProperty("--swipe-amount-x",`${de.x}px`),(oe=be.current)==null||oe.style.setProperty("--swipe-amount-y",`${de.y}px`)}},Ts&&!a.jsx&&se!=="loading"?u.createElement("button",{"aria-label":y,"data-disabled":Xe,"data-close-button":!0,onClick:Xe||!Ce?()=>{}:()=>{we(),a.onDismiss==null||a.onDismiss.call(a,a)},className:fe(w==null?void 0:w.closeButton,a==null||(o=a.classNames)==null?void 0:o.closeButton)},(mt=C==null?void 0:C.close)!=null?mt:Ar):null,(se||a.icon||a.promise)&&a.icon!==null&&((C==null?void 0:C[se])!==null||a.icon)?u.createElement("div",{"data-icon":"",className:fe(w==null?void 0:w.icon,a==null||(i=a.classNames)==null?void 0:i.icon)},a.promise||a.type==="loading"&&!a.icon?a.icon||zs():null,a.type!=="loading"?As:null):null,u.createElement("div",{"data-content":"",className:fe(w==null?void 0:w.content,a==null||(l=a.classNames)==null?void 0:l.content)},u.createElement("div",{"data-title":"",className:fe(w==null?void 0:w.title,a==null||(n=a.classNames)==null?void 0:n.title)},a.jsx?a.jsx:typeof a.title=="function"?a.title():a.title),a.description?u.createElement("div",{"data-description":"",className:fe(J,_s,w==null?void 0:w.description,a==null||(d=a.classNames)==null?void 0:d.description)},typeof a.description=="function"?a.description():a.description):null),u.isValidElement(a.cancel)?a.cancel:a.cancel&&Ge(a.cancel)?u.createElement("button",{"data-button":!0,"data-cancel":!0,style:a.cancelButtonStyle||p,onClick:k=>{Ge(a.cancel)&&Ce&&(a.cancel.onClick==null||a.cancel.onClick.call(a.cancel,k),we())},className:fe(w==null?void 0:w.cancelButton,a==null||(m=a.classNames)==null?void 0:m.cancelButton)},a.cancel.label):null,u.isValidElement(a.action)?a.action:a.action&&Ge(a.action)?u.createElement("button",{"data-button":!0,"data-action":!0,style:a.actionButtonStyle||M,onClick:k=>{Ge(a.action)&&(a.action.onClick==null||a.action.onClick.call(a.action,k),!k.defaultPrevented&&we())},className:fe(w==null?void 0:w.actionButton,a==null||(c=a.classNames)==null?void 0:c.actionButton)},a.action.label):null)};function Et(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Kr(e,t){const s={};return[e,t].forEach((o,i)=>{const l=i===1,n=l?"--mobile-offset":"--offset",d=l?Ur:Vr;function m(c){["top","right","bottom","left"].forEach(x=>{s[`${n}-${x}`]=typeof c=="number"?`${c}px`:c})}typeof o=="number"||typeof o=="string"?m(o):typeof o=="object"?["top","right","bottom","left"].forEach(c=>{o[c]===void 0?s[`${n}-${c}`]=d:s[`${n}-${c}`]=typeof o[c]=="number"?`${o[c]}px`:o[c]}):m(d)}),s}const Xr=u.forwardRef(function(t,s){const{id:o,invert:i,position:l="bottom-right",hotkey:n=["altKey","KeyT"],expand:d,closeButton:m,className:c,offset:x,mobileOffset:a,theme:E="light",richColors:T,duration:R,style:L,visibleToasts:O=Fr,toastOptions:N,dir:B=Et(),gap:X=Wr,icons:te,containerAriaLabel:ae="Notifications"}=t,[$,D]=u.useState([]),p=u.useMemo(()=>o?$.filter(_=>_.toasterId===o):$.filter(_=>!_.toasterId),[$,o]),M=u.useMemo(()=>Array.from(new Set([l].concat(p.filter(_=>_.position).map(_=>_.position)))),[p,l]),[ue,J]=u.useState([]),[K,W]=u.useState(!1),[me,Q]=u.useState(!1),[w,C]=u.useState(E!=="system"?E:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),y=u.useRef(null),F=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),h=u.useRef(null),Y=u.useRef(!1),Se=u.useCallback(_=>{D(A=>{var S;return(S=A.find(P=>P.id===_.id))!=null&&S.delete||Z.dismiss(_.id),A.filter(({id:P})=>P!==_.id)})},[]);return u.useEffect(()=>Z.subscribe(_=>{if(_.dismiss){requestAnimationFrame(()=>{D(A=>A.map(S=>S.id===_.id?{...S,delete:!0}:S))});return}setTimeout(()=>{Ls.flushSync(()=>{D(A=>{const S=A.findIndex(P=>P.id===_.id);return S!==-1?[...A.slice(0,S),{...A[S],..._},...A.slice(S+1)]:[_,...A]})})})}),[$]),u.useEffect(()=>{if(E!=="system"){C(E);return}if(E==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?C("dark"):C("light")),typeof window>"u")return;const _=window.matchMedia("(prefers-color-scheme: dark)");try{_.addEventListener("change",({matches:A})=>{C(A?"dark":"light")})}catch{_.addListener(({matches:S})=>{try{C(S?"dark":"light")}catch(P){console.error(P)}})}},[E]),u.useEffect(()=>{$.length<=1&&W(!1)},[$]),u.useEffect(()=>{const _=A=>{var S;if(n.every(z=>A[z]||A.code===z)){var ie;W(!0),(ie=y.current)==null||ie.focus()}A.code==="Escape"&&(document.activeElement===y.current||(S=y.current)!=null&&S.contains(document.activeElement))&&W(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[n]),u.useEffect(()=>{if(y.current)return()=>{h.current&&(h.current.focus({preventScroll:!0}),h.current=null,Y.current=!1)}},[y.current]),u.createElement("section",{ref:s,"aria-label":`${ae} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((_,A)=>{var S;const[P,ie]=_.split("-");return p.length?u.createElement("ol",{key:_,dir:B==="auto"?Et():B,tabIndex:-1,ref:y,className:c,"data-sonner-toaster":!0,"data-sonner-theme":w,"data-y-position":P,"data-x-position":ie,style:{"--front-toast-height":`${((S=ue[0])==null?void 0:S.height)||0}px`,"--width":`${Gr}px`,"--gap":`${X}px`,...L,...Kr(x,a)},onBlur:z=>{Y.current&&!z.currentTarget.contains(z.relatedTarget)&&(Y.current=!1,h.current&&(h.current.focus({preventScroll:!0}),h.current=null))},onFocus:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||Y.current||(Y.current=!0,h.current=z.relatedTarget)},onMouseEnter:()=>W(!0),onMouseMove:()=>W(!0),onMouseLeave:()=>{me||W(!1)},onDragEnd:()=>W(!1),onPointerDown:z=>{z.target instanceof HTMLElement&&z.target.dataset.dismissible==="false"||Q(!0)},onPointerUp:()=>Q(!1)},p.filter(z=>!z.position&&A===0||z.position===_).map((z,I)=>{var Ne,ge;return u.createElement(Jr,{key:z.id,icons:te,index:I,toast:z,defaultRichColors:T,duration:(Ne=N==null?void 0:N.duration)!=null?Ne:R,className:N==null?void 0:N.className,descriptionClassName:N==null?void 0:N.descriptionClassName,invert:i,visibleToasts:O,closeButton:(ge=N==null?void 0:N.closeButton)!=null?ge:m,interacting:me,position:_,style:N==null?void 0:N.style,unstyled:N==null?void 0:N.unstyled,classNames:N==null?void 0:N.classNames,cancelButtonStyle:N==null?void 0:N.cancelButtonStyle,actionButtonStyle:N==null?void 0:N.actionButtonStyle,closeButtonAriaLabel:N==null?void 0:N.closeButtonAriaLabel,removeToast:Se,toasts:p.filter(le=>le.position==z.position),heights:ue.filter(le=>le.position==z.position),setHeights:J,expandByDefault:d,gap:X,expanded:K,swipeDirections:t.swipeDirections})})):null}))}),Ye={success:e=>Ze.success(e),error:e=>Ze.error(e),warning:e=>Ze.warning(e)};function Qr(){var C;const{user:e,loading:t,logout:s}=Je(),{theme:o,toggle:i}=Jt(),l=ho("(max-width: 768px)"),n=qe(),d=Pt(),[m]=Rt(),c=d.pathname.startsWith("/compose")||/\/post\/\d+\/edit$/.test(d.pathname),[x,a]=b.useState(()=>jt()),[E,T]=b.useState(()=>St()),[R,L]=b.useState(()=>jt().length>0||!!St()),[O,N]=b.useState([]),[B,X]=b.useState([]),[te,ae]=b.useState(null),[$,D]=b.useState(Number(m.get("board"))||0),[p,M]=b.useState(m.get("keyword")||""),ue=bs(m.get("sort")),{limits:J}=Sr();b.useEffect(()=>{D(Number(m.get("board"))||0)},[m]),b.useEffect(()=>{M(m.get("keyword")||"")},[m]);const K=b.useCallback(()=>{Promise.all([he.boards().then(y=>{const F=y.boards??[];return a(F),fr(F),F}).catch(()=>[]),he.stats().then(y=>(T(y),hr(y),y)).catch(()=>null)]).finally(()=>L(!0))},[]),W=b.useCallback(()=>{he.online().then(y=>{ae({count:y.count??0,members:y.members??0,guests:y.guests??0,users:Array.isArray(y.users)?y.users:[]})}).catch(()=>{})},[]);b.useEffect(()=>{K(),he.hotPosts().then(Y=>N(Array.isArray(Y.posts)?Y.posts:[])).catch(()=>{}),he.notifications().then(Y=>X(Array.isArray(Y.notifications)?Y.notifications:[])).catch(()=>{}),W(),he.presence().catch(()=>{});const y=setInterval(W,3e4),F=setInterval(()=>he.presence().catch(()=>{}),6e4),h=()=>K();return window.addEventListener("boards-refresh",h),()=>{clearInterval(y),clearInterval(F),window.removeEventListener("boards-refresh",h)}},[K,W]);const me=()=>{const y=p.trim();if(!y){n("/");return}const F=[...y].length;if(J.search_keyword_min>0&&F0&&F>J.search_keyword_max){Ye.warning(`搜索关键词最多 ${J.search_keyword_max} 个字`);return}n(`/?keyword=${encodeURIComponent(y)}`)},Q=((C=e==null?void 0:e.nickname)==null?void 0:C.charAt(0))||"?",w=vs(d.pathname)?-1:$;return r.jsx("div",{className:"app-shell",children:r.jsxs("div",{className:"app-frame",children:[r.jsx("header",{className:"app-header",children:r.jsxs("div",{className:"header-inner",children:[r.jsxs("button",{type:"button",className:"header-brand",onClick:()=>Me(n,"/"),children:[r.jsx("span",{className:"header-logo-mark",children:"姜"}),!l&&r.jsx("span",{className:"header-logo-text",children:"姜十三论坛"})]}),!c&&r.jsxs("div",{className:"header-search-wrap",children:[r.jsx(Qs,{className:"header-search-icon",size:16}),r.jsx("input",{className:"header-search-input",type:"search",placeholder:"搜索帖子...",value:p,onChange:y=>M(y.target.value),maxLength:J.search_keyword_max>0?J.search_keyword_max:void 0,onKeyDown:y=>y.key==="Enter"&&me()}),p&&r.jsx("button",{type:"button",className:"header-search-clear",onClick:()=>{M(""),n("/")},"aria-label":"清除搜索",children:"×"})]}),r.jsxs("div",{className:"header-actions",children:[!c&&r.jsxs("button",{type:"button",className:"header-compose-btn",onClick:()=>n(e?"/compose":"/login"),children:[r.jsx(Zs,{size:16}),!l&&r.jsx("span",{children:"发帖"})]}),r.jsxs("div",{className:"header-action-group",children:[r.jsx("button",{type:"button",className:"header-icon-btn",onClick:i,title:o==="light"?"切换暗色模式":"切换亮色模式",children:o==="light"?r.jsx(eo,{size:18}):r.jsx(to,{size:18})}),t?r.jsx("span",{className:"header-auth-slot header-auth-slot--loading","aria-hidden":!0}):e?r.jsxs(ir,{children:[r.jsx(lr,{asChild:!0,children:r.jsx("button",{type:"button",className:"header-user-btn",title:e.nickname,children:e.avatar?r.jsx("img",{src:e.avatar,alt:"",className:"header-user-avatar"}):r.jsx("span",{className:"header-user-initial",children:Q})})}),r.jsxs(ms,{align:"end",className:"w-40",onCloseAutoFocus:y=>y.preventDefault(),children:[r.jsx(De,{onClick:()=>n("/profile"),children:"个人中心"}),r.jsx(De,{onClick:()=>n("/favorites"),children:"我的收藏"}),e.role==="admin"&&r.jsxs(r.Fragment,{children:[r.jsx(tt,{}),r.jsx(De,{onClick:()=>n("/admin/dashboard"),children:"管理后台"})]}),r.jsx(tt,{}),r.jsx(De,{onClick:()=>s().then(()=>n("/login")),children:"退出登录"})]})]}):r.jsx("button",{type:"button",className:"header-login-btn",onClick:()=>n("/login"),children:"登录"})]})]})]})}),r.jsxs("div",{className:`app-body${c?" app-body--compose":""}`,children:[!c&&r.jsx(wr,{boards:x,activeBoard:$,onSelectBoard:D}),r.jsxs("div",{className:`content-workspace${c?" content-workspace--compose":""}`,children:[r.jsxs("main",{className:`main-content${c?" main-content--compose":""}`,children:[l&&!c&&r.jsxs("div",{className:"mobile-board-bar",children:[r.jsx("span",{className:`board-chip ${w===0?"active":""}`,onClick:()=>{D(0),Me(n,He(0,ue))},children:"全部"}),x.map(y=>r.jsx("span",{className:`board-chip ${w===y.id?"active":""}`,onClick:()=>{D(y.id),Me(n,He(y.id,ue))},children:y.name},y.id))]}),r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(zt,{context:{boardId:$,keyword:m.get("keyword")||"",setBoardId:D,boards:x,stats:E,layoutReady:R,refreshBoards:K,isMobile:l}})})]}),!c&&r.jsx("aside",{className:"aside-panel",children:r.jsx(kr,{hot:O,notifications:B,online:te,onPostClick:y=>n(`/post/${y}`)})})]})]})]})})}const Zr={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-8 w-8"};function ea({className:e,size:t="md"}){return r.jsx(Ut,{className:ee("animate-spin text-[var(--j13-green)]",Zr[t],e),"aria-label":"加载中"})}const ta=[{to:"/admin/dashboard",label:"仪表盘",icon:Vt},{to:"/admin/boards",label:"板块管理",icon:oo},{to:"/admin/posts",label:"帖子管理",icon:ro},{to:"/admin/comments",label:"评论管理",icon:ao},{to:"/admin/users",label:"用户管理",icon:no},{to:"/admin/settings",label:"系统设置",icon:io}];function sa(){const{user:e,loading:t}=Je(),s=qe();return b.useEffect(()=>{if(!t){if(!e){s("/login");return}e.role!=="admin"&&(Ye.warning("需要管理员权限"),s("/"))}},[e,t,s]),t?r.jsx("div",{className:"flex justify-center py-24",children:r.jsx(ea,{size:"lg"})}):!e||e.role!=="admin"?null:r.jsxs("div",{className:"admin-shell",children:[r.jsxs("header",{className:"admin-topbar",children:[r.jsxs("div",{className:"admin-topbar-brand",children:[r.jsx("div",{className:"admin-topbar-mark",children:"姜"}),r.jsxs("div",{children:[r.jsx("div",{className:"admin-topbar-title",children:"姜十三论坛"}),r.jsx("div",{className:"admin-topbar-sub",children:"管理后台"})]})]}),r.jsxs("div",{className:"admin-topbar-actions",children:[r.jsxs("button",{type:"button",className:"admin-link-btn",onClick:()=>s("/"),children:[r.jsx(so,{size:16}),"返回论坛"]}),r.jsx("span",{className:"admin-topbar-user",children:e.nickname})]})]}),r.jsxs("div",{className:"admin-body",children:[r.jsx("aside",{className:"admin-sidebar",children:ta.map(({to:o,label:i,icon:l})=>r.jsxs(Ds,{to:o,className:({isActive:n})=>ee("admin-nav-item",n&&"active"),children:[r.jsx(l,{size:16}),i]},o))}),r.jsx("main",{className:"admin-main",children:r.jsx(zt,{})})]})]})}function Ta(){const{user:e,loading:t}=Je(),s=qe();return b.useEffect(()=>{t||(e?e.role!=="admin"&&(Ye.warning("需要管理员权限"),s("/")):s("/login"))},[e,t,s]),{user:e,loading:t,ready:!t&&!!e&&e.role==="admin"}}const _t=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Tt=Xt,oa=(e,t)=>s=>{var o;if((t==null?void 0:t.variants)==null)return Tt(e,s==null?void 0:s.class,s==null?void 0:s.className);const{variants:i,defaultVariants:l}=t,n=Object.keys(i).map(c=>{const x=s==null?void 0:s[c],a=l==null?void 0:l[c];if(x===null)return null;const E=_t(x)||_t(a);return i[c][E]}),d=s&&Object.entries(s).reduce((c,x)=>{let[a,E]=x;return E===void 0||(c[a]=E),c},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,x)=>{let{class:a,className:E,...T}=x;return Object.entries(T).every(R=>{let[L,O]=R;return Array.isArray(O)?O.includes({...l,...d}[L]):{...l,...d}[L]===O})?[...c,a,E]:c},[]);return Tt(e,n,m,s==null?void 0:s.class,s==null?void 0:s.className)},ra=oa("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),ks=b.forwardRef(({className:e,variant:t,size:s,asChild:o=!1,loading:i,children:l,disabled:n,...d},m)=>{const c=o?lo:"button";return r.jsxs(c,{className:ee(ra({variant:t,size:s,className:e})),ref:m,disabled:n||i,...d,children:[i?r.jsx(Ut,{className:"animate-spin"}):null,l]})});ks.displayName="Button";class aa extends b.Component{constructor(){super(...arguments);ft(this,"state",{error:null})}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,o){console.error("[Jiang13Forum]",s,o.componentStack)}render(){return this.state.error?r.jsxs("div",{style:{padding:24,textAlign:"center"},children:[r.jsx("h3",{children:"页面渲染出错"}),r.jsx("p",{style:{color:"var(--color-text-3)",fontSize:13},children:this.state.error.message}),r.jsx(ks,{size:"sm",onClick:()=>{this.setState({error:null}),window.location.reload()},children:"刷新页面"})]}):this.props.children}}function na(){const{theme:e}=Jt();return r.jsx(Xr,{theme:e,position:"top-center",richColors:!0,closeButton:!0,toastOptions:{classNames:{toast:"font-sans"}}})}const ia=b.lazy(()=>re(()=>import("./HomePage-DC4iWqJT.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),la=b.lazy(()=>re(()=>import("./PostDetailPage-BjTvWYTM.js"),__vite__mapDeps([7,1,4,5,3,6,8,9]))),ca=b.lazy(()=>re(()=>import("./LoginPage-sbkZASpH.js"),__vite__mapDeps([10,1,11,5,12]))),da=b.lazy(()=>re(()=>import("./RegisterPage-D4yO0Lp-.js"),__vite__mapDeps([13,1,11,5,12]))),Ct=b.lazy(()=>re(()=>import("./ComposePage-BiusUtIm.js"),__vite__mapDeps([14,1,8,9,5,15,12]))),ua=b.lazy(()=>re(()=>import("./BoardsManagePage-DXFAZqh1.js"),__vite__mapDeps([16,1,11,5,12,17,3,15,18]))),ma=b.lazy(()=>re(()=>import("./ProfilePage-DiORLSTl.js"),__vite__mapDeps([19,1,11,5,12,3,15]))),pa=b.lazy(()=>re(()=>import("./FavoritesPage-BrE1xy6C.js"),__vite__mapDeps([20,1,6,5]))),fa=b.lazy(()=>re(()=>import("./AdminDashboardPage-Co9xzcB-.js"),__vite__mapDeps([21,1,3,5]))),ha=b.lazy(()=>re(()=>import("./AdminPostsPage--PeUmtdb.js"),__vite__mapDeps([22,1,12,3,18,5,6]))),ga=b.lazy(()=>re(()=>import("./AdminCommentsPage-CQrE8jZ9.js"),__vite__mapDeps([23,1,3,18,5]))),ba=b.lazy(()=>re(()=>import("./AdminUsersPage-YBnRhF6k.js"),__vite__mapDeps([24,1,3,5]))),xa=b.lazy(()=>re(()=>import("./AdminSettingsPage-B63MNTuF.js"),__vite__mapDeps([25,1,12,17,5])));function ya(){return r.jsx(fo,{children:r.jsx(po,{children:r.jsxs(aa,{children:[r.jsx(Ms,{children:r.jsxs(Bs,{children:[r.jsx(G,{path:"/login",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(ca,{})})}),r.jsx(G,{path:"/register",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(da,{})})}),r.jsx(G,{path:"/boards",element:r.jsx(ht,{to:"/admin/boards",replace:!0})}),r.jsxs(G,{path:"/admin",element:r.jsx(sa,{}),children:[r.jsx(G,{index:!0,element:r.jsx(ht,{to:"/admin/dashboard",replace:!0})}),r.jsx(G,{path:"dashboard",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(fa,{})})}),r.jsx(G,{path:"boards",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(ua,{})})}),r.jsx(G,{path:"posts",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(ha,{})})}),r.jsx(G,{path:"comments",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(ga,{})})}),r.jsx(G,{path:"users",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(ba,{})})}),r.jsx(G,{path:"settings",element:r.jsx(b.Suspense,{fallback:r.jsx(ye,{}),children:r.jsx(xa,{})})})]}),r.jsxs(G,{element:r.jsx(Qr,{}),children:[r.jsx(G,{path:"/",element:r.jsx(ia,{})}),r.jsx(G,{path:"/post/:id",element:r.jsx(la,{})}),r.jsx(G,{path:"/post/:id/edit",element:r.jsx(Ct,{})}),r.jsx(G,{path:"/compose",element:r.jsx(Ct,{})}),r.jsx(G,{path:"/profile",element:r.jsx(ma,{})}),r.jsx(G,{path:"/favorites",element:r.jsx(pa,{})})]})]})}),r.jsx(na,{})]})})})}Ht(Wt());$s.createRoot(document.getElementById("root")).render(r.jsx(u.StrictMode,{children:r.jsx(ya,{})}));export{ks as B,xr as F,ea as S,he as a,Sa as b,br as c,Me as d,He as e,ee as f,Na as g,Je as h,Ta as i,oa as j,ra as k,_a as l,Ye as n,bs as p,Ea as s,Sr as u}; diff --git a/embed_static/static/spa/assets/index-xhm8HZjc.css b/embed_static/static/spa/assets/index-xhm8HZjc.css new file mode 100644 index 0000000..dc4b610 --- /dev/null +++ b/embed_static/static/spa/assets/index-xhm8HZjc.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--j13-font-family);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 210 20% 98%;--foreground: 222 47% 11%;--card: 0 0% 100%;--card-foreground: 222 47% 11%;--popover: 0 0% 100%;--popover-foreground: 222 47% 11%;--primary: 152 72% 36%;--primary-foreground: 0 0% 100%;--secondary: 210 20% 96%;--secondary-foreground: 222 47% 11%;--muted: 210 20% 96%;--muted-foreground: 215 16% 47%;--accent: 152 45% 95%;--accent-foreground: 152 72% 28%;--destructive: 0 84% 60%;--destructive-foreground: 0 0% 100%;--border: 214 20% 91%;--input: 214 20% 91%;--ring: 152 72% 36%;--radius: .375rem;--color-text-1: hsl(var(--foreground));--color-text-2: hsl(215 16% 35%);--color-text-3: hsl(var(--muted-foreground));--color-text-4: hsl(215 12% 65%);--color-fill-3: hsl(210 20% 94%)}.dark{--background: 240 6% 10%;--foreground: 0 0% 95%;--card: 240 5% 13%;--card-foreground: 0 0% 95%;--popover: 240 5% 13%;--popover-foreground: 0 0% 95%;--primary: 152 58% 46%;--primary-foreground: 0 0% 100%;--secondary: 240 4% 16%;--secondary-foreground: 0 0% 95%;--muted: 240 4% 16%;--muted-foreground: 240 5% 65%;--accent: 152 30% 14%;--accent-foreground: 152 58% 55%;--destructive: 0 63% 45%;--destructive-foreground: 0 0% 95%;--border: 240 4% 18%;--input: 240 4% 18%;--ring: 152 58% 46%;--color-text-1: hsl(var(--foreground));--color-text-2: hsl(240 5% 75%);--color-text-3: hsl(var(--muted-foreground));--color-text-4: hsl(240 5% 50%);--color-fill-3: hsl(240 4% 20%)}.\!container{width:100%!important}.container{width:100%}@media (min-width: 640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media (min-width: 768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media (min-width: 1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media (min-width: 1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media (min-width: 1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-4{right:1rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-50{z-index:50}.z-\[110\]{z-index:110}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.block{display:block}.\!inline{display:inline!important}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-2{height:.5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-px{height:1px}.min-h-\[60px\]{min-height:60px}.w-2{width:.5rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[160px\]{width:160px}.w-\[52px\]{width:52px}.w-\[60px\]{width:60px}.w-\[70px\]{width:70px}.w-\[80px\]{width:80px}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.max-w-\[120px\]{max-width:120px}.max-w-\[200px\]{max-width:200px}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.rounded-full{border-radius:9999px}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.bg-\[var\(--j13-green-bg\)\]{background-color:var(--j13-green-bg)}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-100{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.fill-current{fill:currentColor}.p-1{padding:.25rem}.p-3{padding:.75rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-24{padding-top:6rem;padding-bottom:6rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.font-sans{font-family:var(--j13-font-family)}.text-\[0\.8rem\]{font-size:.8rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-\[var\(--j13-green\)\]{color:var(--j13-green)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}:root{--j13-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", sans-serif;--j13-green: #18a058;--j13-green-hover: #138f4c;--j13-green-bg: rgba(24, 160, 88, .08);--j13-green-soft: #edfbf3;--j13-border: #e8edf2;--j13-border-light: #f0f3f7;--j13-sidebar-w: 210px;--j13-aside-w: 280px;--j13-header-h: 56px;--j13-max-w: 1400px;--j13-article-read-w: 820px;--j13-bg-page: #f5f7fa;--j13-bg-workspace: #f8fafc;--j13-bg-surface: #ffffff;--j13-bg-block: #ffffff;--j13-bg-block-muted: #f1f4f8;--j13-bg-block-accent: #f0faf5;--j13-shadow-soft: 0 1px 2px rgba(15, 23, 42, .04);--j13-shadow-card: 0 2px 8px rgba(15, 23, 42, .05);--board-0-color: #18a058;--board-0-bg: rgba(24, 160, 88, .1);--board-1-color: #3498db;--board-1-bg: rgba(52, 152, 219, .1);--board-2-color: #9b59b6;--board-2-bg: rgba(155, 89, 182, .1);--board-3-color: #e67e22;--board-3-bg: rgba(230, 126, 34, .1);--board-4-color: #e74c3c;--board-4-bg: rgba(231, 76, 60, .1);--board-5-color: #1abc9c;--board-5-bg: rgba(26, 188, 156, .1);--board-6-color: #6366f1;--board-6-bg: rgba(99, 102, 241, .1);--board-7-color: #f59e0b;--board-7-bg: rgba(245, 158, 11, .12)}.dark{--j13-green: #23c36b;--j13-green-hover: #1fb35f;--j13-green-bg: rgba(35, 195, 107, .12);--j13-green-soft: rgba(35, 195, 107, .08);--j13-border: #2e2e32;--j13-border-light: #262629;--j13-bg-page: #141416;--j13-bg-workspace: #18181b;--j13-bg-surface: #1f1f23;--j13-bg-block: #232328;--j13-bg-block-muted: #1c1c20;--j13-bg-block-accent: rgba(35, 195, 107, .06);--j13-shadow-soft: 0 1px 2px rgba(0, 0, 0, .2);--j13-shadow-card: 0 2px 8px rgba(0, 0, 0, .28);--board-0-color: #23c36b;--board-0-bg: rgba(35, 195, 107, .14);--board-1-color: #5dade2;--board-1-bg: rgba(93, 173, 226, .14);--board-2-color: #bb86fc;--board-2-bg: rgba(187, 134, 252, .14);--board-3-color: #f0a050;--board-3-bg: rgba(240, 160, 80, .14);--board-4-color: #ff7b72;--board-4-bg: rgba(255, 123, 114, .14);--board-5-color: #3dd6b5;--board-5-bg: rgba(61, 214, 181, .14);--board-6-color: #818cf8;--board-6-bg: rgba(129, 140, 248, .14);--board-7-color: #fbbf24;--board-7-bg: rgba(251, 191, 36, .14)}.dark .app-shell{background:radial-gradient(ellipse 70% 45% at 50% -10%,rgba(35,195,107,.08),transparent 70%),var(--j13-bg-page)}*{box-sizing:border-box}html{scrollbar-gutter:stable;-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;font-family:var(--j13-font-family);text-rendering:optimizeLegibility}html,body,#root{height:100%;margin:0}body{font-family:var(--j13-font-family);font-size:14px;line-height:1.5;color:var(--color-text-1);background:var(--j13-bg-page);overflow:hidden}a{color:var(--j13-green);text-decoration:none}a:hover{text-decoration:underline}.app-shell{height:100%;max-height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:radial-gradient(ellipse 70% 45% at 50% -10%,rgba(24,160,88,.07),transparent 70%),var(--j13-bg-page)}.app-frame{flex:1;min-height:0;height:100%;max-width:var(--j13-max-w);width:100%;margin:0 auto;display:flex;flex-direction:column;overflow:hidden;border-left:1px solid var(--j13-border);border-right:1px solid var(--j13-border);background:var(--j13-bg-surface)}.app-header{height:var(--j13-header-h);flex-shrink:0;z-index:100;background:var(--j13-bg-surface);border-bottom:1px solid var(--j13-border)}.header-inner{height:100%;width:100%;padding:0 20px;display:flex;align-items:center;gap:20px}.header-brand{display:flex;align-items:center;gap:10px;flex-shrink:0;border:none;background:none;padding:4px 0;cursor:pointer;color:inherit;font:inherit}.header-brand:hover .header-logo-text{color:var(--j13-green)}.header-logo-mark{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--j13-green) 0%,#34c471 100%);color:#fff;font-weight:700;font-size:17px;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px #1a7f4b47}.header-logo-text{font-size:15px;font-weight:600;letter-spacing:.02em;transition:color .15s}.header-search-wrap{flex:1;min-width:0;max-width:420px;display:flex;align-items:center;gap:8px;height:36px;padding:0 14px;border-radius:999px;background:var(--j13-bg-block-muted);border:1px solid var(--j13-border-light);transition:border-color .2s,background .2s,box-shadow .2s}.header-search-wrap:focus-within{background:var(--j13-bg-surface);border-color:color-mix(in srgb,var(--j13-green) 30%,transparent);box-shadow:0 0 0 3px var(--j13-green-bg)}.header-search-icon{flex-shrink:0;font-size:15px;color:var(--color-text-3)}.header-search-input{flex:1;min-width:0;border:none;outline:none;background:transparent;font-size:14px;color:var(--color-text-1);font-family:inherit}.header-search-input::-moz-placeholder{color:var(--color-text-4)}.header-search-input::placeholder{color:var(--color-text-4)}.header-search-input::-webkit-search-cancel-button{display:none}.header-search-clear{flex-shrink:0;width:20px;height:20px;border:none;border-radius:50%;background:var(--color-fill-3);color:var(--color-text-3);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;transition:background .15s,color .15s}.header-search-clear:hover{background:var(--color-fill-4);color:var(--color-text-1)}.header-actions{display:flex;align-items:center;gap:10px;flex-shrink:0;margin-left:auto}.header-compose-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 16px;border:none;border-radius:999px;background:var(--j13-green);color:#fff;font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s;box-shadow:0 2px 6px #1a7f4b38}.header-compose-btn:hover{background:var(--j13-green-hover);box-shadow:0 3px 10px #1a7f4b4d}.header-compose-btn:active{transform:scale(.97)}.header-action-group{display:flex;align-items:center;gap:4px;padding:3px;border-radius:999px;background:var(--j13-bg-block-muted);border:1px solid var(--j13-border-light)}.header-icon-btn{width:32px;height:32px;border:none;border-radius:50%;background:transparent;color:var(--color-text-2);font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .15s,color .15s}.header-icon-btn:hover{background:var(--color-fill-3);color:var(--color-text-1)}.header-user-btn{width:32px;height:32px;border:none;border-radius:50%;padding:0;cursor:pointer;overflow:hidden;background:var(--j13-green);display:flex;align-items:center;justify-content:center;transition:box-shadow .15s,transform .1s}@media (hover: hover){.header-user-btn:hover{box-shadow:0 0 0 2px var(--j13-green-bg),0 0 0 3px var(--j13-green)}}.header-user-btn:focus-visible{box-shadow:0 0 0 2px var(--j13-green-bg),0 0 0 3px var(--j13-green)}.header-user-btn:focus:not(:focus-visible){outline:none;box-shadow:none}.header-user-avatar{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.header-user-initial{color:#fff;font-size:14px;font-weight:600}.header-login-btn{height:32px;padding:0 14px;border:none;border-radius:999px;background:transparent;color:var(--j13-green);font-size:13px;font-weight:500;font-family:inherit;cursor:pointer;transition:background .15s}.header-login-btn:hover{background:var(--j13-green-bg)}.header-auth-slot{display:inline-block;width:32px;height:32px;border-radius:50%;flex-shrink:0}.header-auth-slot--loading{background:var(--color-fill-3)}.app-body{flex:1;display:flex;min-height:0;width:100%;overflow:hidden;background:var(--j13-bg-surface)}.sidebar{width:var(--j13-sidebar-w);flex-shrink:0;border-right:1px solid var(--j13-border-light);background:var(--j13-bg-surface);overflow-y:auto;padding:12px 0}.sidebar-section{padding:4px 12px 8px;font-size:11px;font-weight:600;color:var(--color-text-3)}.sidebar-nav{display:flex;flex-direction:column;gap:2px;padding:0 8px}.sidebar-nav-item{display:flex;align-items:center;gap:8px;width:100%;margin:0;padding:0 12px;height:36px;border:none;border-radius:6px;background:transparent;color:var(--color-text-1);font-size:14px;cursor:pointer;text-align:left;transition:background .15s,color .15s}.sidebar-nav-item:hover{background:var(--j13-bg-block-muted)}.sidebar-nav-item.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.sidebar-nav-item svg{width:16px;height:16px;flex-shrink:0}.sidebar-nav-item__meta{margin-left:auto;color:var(--color-text-4);font-size:12px}.sidebar-nav-item--board .sidebar-board-icon{opacity:.88}.sidebar-nav-item--board.active .sidebar-board-icon{opacity:1}.sidebar-nav-item--board.active.sidebar-nav-item--board-0{background:var(--board-0-bg);color:var(--board-0-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-1{background:var(--board-1-bg);color:var(--board-1-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-2{background:var(--board-2-bg);color:var(--board-2-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-3{background:var(--board-3-bg);color:var(--board-3-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-4{background:var(--board-4-bg);color:var(--board-4-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-5{background:var(--board-5-bg);color:var(--board-5-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-6{background:var(--board-6-bg);color:var(--board-6-color)}.sidebar-nav-item--board.active.sidebar-nav-item--board-7{background:var(--board-7-bg);color:var(--board-7-color)}.sidebar-board-icon--0{color:var(--board-0-color)}.sidebar-board-icon--1{color:var(--board-1-color)}.sidebar-board-icon--2{color:var(--board-2-color)}.sidebar-board-icon--3{color:var(--board-3-color)}.sidebar-board-icon--4{color:var(--board-4-color)}.sidebar-board-icon--5{color:var(--board-5-color)}.sidebar-board-icon--6{color:var(--board-6-color)}.sidebar-board-icon--7{color:var(--board-7-color)}.sidebar-section--boards{margin-top:8px}.sidebar-actions{padding:12px;border-top:1px solid var(--j13-border);margin-top:8px}.main-content{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;background:var(--j13-bg-workspace)}.content-workspace{flex:1;display:flex;min-width:0;min-height:0;overflow:hidden;background:var(--j13-bg-surface)}.aside-panel{width:var(--j13-aside-w);flex-shrink:0;border-left:1px solid var(--j13-border-light);overflow-y:auto;padding:0;display:flex;flex-direction:column;background:var(--j13-bg-workspace)}.aside-panel-inner{display:flex;flex-direction:column;gap:10px;padding:12px;flex:1}@media (max-width: 1100px){.aside-panel{display:none}}@media (max-width: 768px){.app-frame{border-left:none;border-right:none}.sidebar{display:none}.header-inner{padding:0 12px;gap:10px}.header-search-wrap{max-width:none}.header-compose-btn{width:34px;padding:0;justify-content:center}.feed-banner-row{flex-direction:row;gap:10px}.board-grid{flex-wrap:nowrap;overflow-x:auto;padding:8px 12px;scrollbar-width:none}.board-grid::-webkit-scrollbar{display:none}}.page-wrap{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;scrollbar-width:none;-ms-overflow-style:none;padding:12px}.feed-panel{flex:1;min-height:0;display:flex;flex-direction:column;border:1px solid var(--j13-border-light);border-radius:12px;background:var(--j13-bg-block);box-shadow:var(--j13-shadow-card);overflow:hidden}.page-wrap::-webkit-scrollbar{display:none}.virtual-list-wrap,.post-list-scroll{flex:1;overflow:auto;min-height:0;scrollbar-width:none;-ms-overflow-style:none}.virtual-list-wrap::-webkit-scrollbar,.post-list-scroll::-webkit-scrollbar{display:none}.feed-list-footer{display:flex;justify-content:center;align-items:center;padding:16px 12px}.feed-list-footer--end{font-size:12px;color:var(--color-text-3);padding:10px 12px}.feed-list-footer--history{flex-direction:column;gap:10px}.feed-list-footer__hint{margin:0;font-size:12px;color:var(--color-text-3)}.page-inner{padding:20px 24px;max-width:720px}.page-inner-wide{padding:20px 24px}.page-title{font-size:20px;font-weight:600;margin:0 0 4px}.page-desc{font-size:13px;color:var(--color-text-3);margin:0 0 20px}.content-surface{background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);overflow:hidden}.feed-panel .content-surface{background:transparent;border:none;border-radius:0;box-shadow:none}.section-card{background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);padding:20px;margin-bottom:16px}.section-card-title{font-size:15px;font-weight:600;margin:0 0 16px;padding-bottom:12px;border-bottom:1px solid var(--j13-border-light)}.feed-top{flex-shrink:0;border-bottom:1px solid var(--j13-border-light);background:var(--j13-bg-block);position:relative}.feed-top:after{content:"";position:absolute;left:16px;right:16px;bottom:0;height:1px;background:linear-gradient(90deg,var(--j13-green) 0%,transparent 55%);opacity:.35;pointer-events:none}@media (min-width: 900px){.feed-top:not(:has(.feed-head--solo)){display:flex;align-items:center;gap:16px;padding:6px 16px}.feed-top:not(:has(.feed-head--solo)) .feed-head{padding:0;flex-shrink:0}.feed-top:not(:has(.feed-head--solo)) .feed-toolbar{padding:0;flex:1;min-width:0}}.feed-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px 6px}.feed-head--solo{padding-bottom:8px}.feed-head__title{display:flex;align-items:baseline;gap:10px;min-width:0;flex:1}.feed-head h2{margin:0;font-size:15px;font-weight:600;white-space:nowrap}.feed-head__meta{font-size:12px;color:var(--color-text-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.feed-head__stats{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.feed-stat-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:999px;font-size:11px;color:var(--color-text-3);background:var(--j13-bg-block-muted);white-space:nowrap}.feed-stat-chip svg{width:12px;height:12px;color:var(--j13-green);opacity:.85}.feed-stat-chip strong,.feed-head__meta strong{color:var(--j13-green);font-weight:600}.feed-head__dot{margin:0 4px;opacity:.55}.feed-head__clear{flex-shrink:0;border:none;background:transparent;padding:0;font-size:12px;color:var(--j13-green);cursor:pointer;font-family:inherit}.feed-head__clear:hover{text-decoration:underline}.feed-toolbar{display:flex;align-items:center;gap:10px;padding:0 16px 8px}.feed-toolbar__count{flex-shrink:0;font-size:12px;color:var(--color-text-3);white-space:nowrap}.feed-banner{padding:8px 16px;border-bottom:1px solid var(--j13-border-light)}.feed-banner-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.feed-banner-title{flex:1;min-width:0}.feed-banner h2{margin:0;font-size:15px;font-weight:600}.feed-banner p{margin:0;font-size:12px;color:var(--color-text-3);line-height:1.45}.feed-stats{display:flex;flex-wrap:wrap;gap:8px 12px;margin-top:6px;font-size:12px;color:var(--color-text-3)}.feed-stats strong{color:var(--j13-green);font-weight:600}.feed-action-slot{display:inline-block;width:88px;height:28px;border-radius:4px;background:var(--color-fill-3)}.feed-actions{min-height:28px}.mobile-board-bar{display:none;padding:8px 12px;gap:8px;overflow-x:auto;border-bottom:1px solid var(--j13-border);background:var(--j13-bg-surface)}@media (max-width: 768px){.mobile-board-bar{display:flex}}.board-chip{flex-shrink:0;padding:4px 12px;border-radius:16px;font-size:13px;border:1px solid var(--j13-border-light);background:var(--j13-bg-block);cursor:pointer}.board-chip.active{background:var(--j13-green-bg);border-color:transparent;color:var(--j13-green);font-weight:600}.board-chip.active.board-chip--0{background:var(--board-0-bg);color:var(--board-0-color)}.board-chip.active.board-chip--1{background:var(--board-1-bg);color:var(--board-1-color)}.board-chip.active.board-chip--2{background:var(--board-2-bg);color:var(--board-2-color)}.board-chip.active.board-chip--3{background:var(--board-3-bg);color:var(--board-3-color)}.board-chip.active.board-chip--4{background:var(--board-4-bg);color:var(--board-4-color)}.board-chip.active.board-chip--5{background:var(--board-5-bg);color:var(--board-5-color)}.board-chip.active.board-chip--6{background:var(--board-6-bg);color:var(--board-6-color)}.board-chip.active.board-chip--7{background:var(--board-7-bg);color:var(--board-7-color)}.board-grid{display:flex;flex-wrap:wrap;gap:8px;padding:10px 20px;border-bottom:1px solid var(--j13-border-light)}.feed-sort-bar{display:flex;align-items:center;gap:2px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.feed-sort-bar::-webkit-scrollbar{display:none}.feed-sort-tab{display:inline-flex;align-items:center;gap:5px;height:28px;padding:0 10px;border:none;border-radius:6px;background:transparent;color:var(--color-text-2);font-family:inherit;font-size:12px;cursor:pointer;flex-shrink:0;white-space:nowrap;transition:background .15s,color .15s}.feed-sort-tab:hover{background:var(--j13-bg-block-muted);color:var(--color-text-1)}.feed-sort-tab.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.feed-sort-tab svg{width:14px;height:14px;flex-shrink:0}@media (max-width: 768px){.feed-head{flex-wrap:wrap;padding:8px 12px 6px}.feed-head__meta,.feed-head__stats{display:none}.feed-toolbar{padding:0 12px 8px}.page-wrap{padding:0}.feed-panel{border:none;border-radius:0;box-shadow:none}}.board-grid-empty{padding:20px;border-bottom:1px solid var(--j13-border-light)}.board-tab{display:flex;align-items:center;gap:6px;height:36px;max-width:220px;padding:0 14px;border:1px solid var(--j13-border-light);border-radius:8px;background:var(--j13-bg-block);cursor:pointer;transition:border-color .15s,background .15s;font-family:inherit;color:inherit;flex-shrink:0}.board-tab:hover{border-color:var(--j13-green-light, #7cb87c);background:var(--j13-bg-block-muted)}.board-tab.active{border-color:var(--j13-green);background:color-mix(in srgb,var(--j13-green) 10%,var(--j13-bg-block))}.board-tab-icon{font-size:14px;color:var(--j13-green);line-height:1;flex-shrink:0}.board-tab-name{font-size:13px;font-weight:500;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.board-tab-count{flex-shrink:0;min-width:18px;padding:0 6px;height:20px;line-height:20px;font-size:11px;text-align:center;border-radius:10px;background:var(--color-fill-2);color:var(--color-text-3)}.board-tab.active .board-tab-count{background:color-mix(in srgb,var(--j13-green) 20%,transparent);color:var(--j13-green)}.board-tab--skeleton{width:140px;border-color:transparent;background:linear-gradient(90deg,var(--color-fill-2) 25%,var(--color-fill-3) 50%,var(--color-fill-2) 75%);background-size:200% 100%;animation:board-skeleton-shimmer 1.2s ease-in-out infinite;pointer-events:none}.board-grid--skeleton{pointer-events:none}@keyframes board-skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.post-list-bar{display:flex;justify-content:space-between;padding:10px 20px;font-size:13px;color:var(--color-text-3);border-bottom:1px solid var(--j13-border-light)}.post-row{display:flex;align-items:flex-start;gap:12px;padding:12px 20px;border-bottom:1px solid var(--j13-border-light);cursor:pointer;transition:background .15s,box-shadow .15s;position:relative}.post-row:before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:0 3px 3px 0;background:var(--j13-green);opacity:0;transition:opacity .15s}.post-row:hover{background:var(--j13-bg-block-accent)}.post-row:hover:before{opacity:1}.post-row:hover .post-title{color:var(--j13-green)}.post-avatar{width:36px;height:36px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:14px;font-weight:600;display:flex;align-items:center;justify-content:center;flex-shrink:0;overflow:hidden;box-shadow:0 0 0 2px var(--j13-bg-block),0 0 0 3px var(--j13-border);transition:box-shadow .15s}.post-row:hover .post-avatar{box-shadow:0 0 0 2px var(--j13-bg-block),0 0 0 3px var(--j13-green)}.post-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.post-body{flex:1;min-width:0}.post-title{font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:4px;color:var(--color-text-1);transition:color .15s}.post-pinned-icon{display:inline-block;vertical-align:-.15em;flex-shrink:0;color:#e53935;stroke-width:1.5}.post-meta{font-size:12px;color:var(--color-text-3);display:flex;flex-wrap:wrap;gap:8px;align-items:center}.post-stats{display:flex;gap:8px;flex-shrink:0;padding-top:2px}.post-stat{display:inline-flex;align-items:center;gap:4px;padding:3px 8px;border-radius:999px;font-size:11px;color:var(--color-text-3);background:var(--j13-bg-block-muted);transition:background .15s,color .15s}.post-stat svg{width:12px;height:12px;flex-shrink:0}.post-row:hover .post-stat{background:var(--j13-green-bg);color:var(--j13-green)}.post-stat--zero{opacity:.55}.board-badge{display:inline-flex;align-items:center;padding:1px 7px;border-radius:4px;font-size:11px;font-weight:600;line-height:1.5;white-space:nowrap}.board-badge--0{background:var(--board-0-bg);color:var(--board-0-color)}.board-badge--1{background:var(--board-1-bg);color:var(--board-1-color)}.board-badge--2{background:var(--board-2-bg);color:var(--board-2-color)}.board-badge--3{background:var(--board-3-bg);color:var(--board-3-color)}.board-badge--4{background:var(--board-4-bg);color:var(--board-4-color)}.board-badge--5{background:var(--board-5-bg);color:var(--board-5-color)}.board-badge--6{background:var(--board-6-bg);color:var(--board-6-color)}.board-badge--7{background:var(--board-7-bg);color:var(--board-7-color)}.board-manage-dialog{max-width:520px}.board-appearance-picker__preview{display:flex;align-items:center;gap:10px;margin-bottom:10px}.board-appearance-picker__preview-icon{width:36px;height:36px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;background:var(--j13-bg-block-muted)}.board-appearance-picker__preview-icon svg{width:20px;height:20px}.board-appearance-picker__preview-hint{font-size:12px;color:var(--color-text-3)}.board-icon-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:6px}.board-icon-option{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1;border:1px solid var(--j13-border-light);border-radius:8px;background:var(--j13-bg-block);color:var(--color-text-2);cursor:pointer;transition:border-color .15s,background .15s,color .15s}.board-icon-option svg{width:18px;height:18px}.board-icon-option:hover{border-color:var(--j13-green);background:var(--j13-bg-block-muted)}.board-icon-option--active{border-color:var(--j13-green);background:var(--j13-green-bg);color:var(--j13-green)}.board-icon-option__auto{font-size:12px;font-weight:700;color:var(--color-text-3)}.board-color-grid{display:flex;flex-wrap:wrap;gap:8px}.board-color-option{width:28px;height:28px;border-radius:50%;border:2px solid transparent;cursor:pointer;flex-shrink:0;transition:transform .12s,box-shadow .12s}.board-color-option:hover{transform:scale(1.08)}.board-color-option--active{box-shadow:0 0 0 2px var(--j13-bg-block),0 0 0 3px var(--j13-green)}.board-color-option--auto{display:inline-flex;align-items:center;justify-content:center;background:var(--j13-bg-block-muted);font-size:11px;font-weight:700;color:var(--color-text-3)}.board-color-option--0{background:var(--board-0-color)}.board-color-option--1{background:var(--board-1-color)}.board-color-option--2{background:var(--board-2-color)}.board-color-option--3{background:var(--board-3-color)}.board-color-option--4{background:var(--board-4-color)}.board-color-option--5{background:var(--board-5-color)}.board-color-option--6{background:var(--board-6-color)}.board-color-option--7{background:var(--board-7-color)}.board-table-icon{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--j13-bg-block-muted)}.board-table-icon svg{width:18px;height:18px}@keyframes skeleton-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.skeleton{background:linear-gradient(90deg,var(--j13-bg-block-muted) 0%,var(--j13-bg-block) 45%,var(--j13-bg-block-muted) 90%);background-size:200% 100%;animation:skeleton-shimmer 1.5s ease-in-out infinite;border-radius:6px}.post-row--skeleton{pointer-events:none;cursor:default}.post-row--skeleton:before{display:none}.post-row--skeleton:hover{background:transparent}.skeleton--avatar{width:36px;height:36px;border-radius:50%;flex-shrink:0}.skeleton--title{height:14px;margin-bottom:8px;max-width:100%}.skeleton-meta-row{display:flex;align-items:center;gap:8px}.skeleton--badge{width:52px;height:18px;border-radius:4px;flex-shrink:0}.skeleton--meta{height:12px;width:56px;flex-shrink:0}.skeleton--meta-short{width:72px}.skeleton--stat{width:36px;height:22px;border-radius:999px}.empty-state{text-align:center;padding:60px 24px;color:var(--color-text-3)}.empty-feed{text-align:center;padding:48px 24px;color:var(--color-text-3)}.empty-feed-icon{font-size:36px;margin-bottom:8px}.post-detail-loading{display:flex;align-items:center;justify-content:center;padding:60px;flex:1}.post-detail-page{display:flex;flex-direction:column;min-height:0;gap:16px;padding:16px 20px 24px;background:var(--j13-bg-workspace)}.post-detail-header{padding:16px 20px 20px;background:var(--j13-bg-surface);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-card);flex-shrink:0}.post-detail-nav{display:flex;align-items:center;gap:8px;margin-bottom:8px}.post-detail-board-tag{margin:0!important}.post-detail-head{margin-bottom:12px}.post-detail-title{font-size:20px;font-weight:600;margin:0 0 12px;line-height:1.45;word-break:break-word}.post-detail-author-row{display:flex;align-items:center;gap:10px}.post-avatar-lg{width:40px;height:40px;font-size:16px}.post-detail-author-info{display:flex;flex-direction:column;gap:2px}.post-detail-author-name{font-size:14px;font-weight:600;color:var(--color-text-1)}.post-detail-meta-line{font-size:12px;color:var(--color-text-3);display:flex;flex-wrap:wrap;align-items:center;gap:4px}.post-detail-locked-tag{display:inline-flex;align-items:center;gap:3px;margin-left:6px;color:hsl(var(--destructive));font-size:11px}.post-detail-edit-hint{font-size:12px;color:var(--color-text-3);align-self:center}.post-revision-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#00000080;display:flex;align-items:center;justify-content:center;padding:16px}.post-revision-overlay--fullscreen{padding:0}.post-revision-panel{background:hsl(var(--background));border-radius:12px;width:min(1080px,100%);height:min(88vh,900px);display:flex;flex-direction:column;box-shadow:0 12px 48px #00000038;overflow:hidden}.post-revision-panel--fullscreen{width:100%;height:100%;max-height:none;border-radius:0}.post-revision-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-bottom:1px solid var(--j13-border-light);flex-shrink:0}.post-revision-head-left{display:flex;align-items:center;gap:8px;min-width:0}.post-revision-head-left h3{font-size:15px;font-weight:600;margin:0}.post-revision-head-sub{font-size:12px;color:var(--color-text-3);padding-left:8px;border-left:1px solid var(--j13-border-light)}.post-revision-head-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.post-revision-view-tabs{display:flex;gap:2px;background:hsl(var(--muted));border-radius:8px;padding:3px}.post-revision-tab{display:inline-flex;align-items:center;gap:4px;padding:5px 10px;border:none;background:none;border-radius:6px;font-size:12px;color:var(--color-text-2);cursor:pointer;white-space:nowrap}.post-revision-tab:hover{color:var(--color-text-1)}.post-revision-tab.active{background:hsl(var(--background));color:var(--color-text-1);font-weight:500;box-shadow:0 1px 3px #00000014}.post-revision-icon-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:none;border-radius:8px;cursor:pointer;color:var(--color-text-3)}.post-revision-icon-btn:hover{background:hsl(var(--muted));color:var(--color-text-1)}.post-revision-loading,.post-revision-empty{flex:1;display:flex;align-items:center;justify-content:center;padding:48px 24px;color:var(--color-text-3);font-size:14px}.post-revision-body{display:flex;flex:1;min-height:0;overflow:hidden}.post-revision-sidebar{width:260px;flex-shrink:0;display:flex;flex-direction:column;border-right:1px solid var(--j13-border-light);min-height:0}.post-revision-sidebar-label{padding:10px 14px 6px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--color-text-3)}.post-revision-list{list-style:none;margin:0;padding:4px 8px;overflow-y:auto;flex:1;min-height:0}.post-revision-item{display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;padding:10px 12px;border:none;background:none;border-radius:8px;cursor:pointer;font-size:13px;margin-bottom:2px}.post-revision-item:hover,.post-revision-item.active{background:hsl(var(--muted))}.post-revision-item-head{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.post-revision-item-num{font-size:11px;font-weight:600;color:var(--color-text-3)}.post-revision-item-title{font-weight:500;color:var(--color-text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.post-revision-item-meta{font-size:11px;color:var(--color-text-3)}.post-revision-badge{font-size:10px;padding:1px 6px;border-radius:4px;background:hsl(var(--primary) / .12);color:hsl(var(--primary));font-weight:500}.post-revision-badge--none{background:hsl(var(--muted));color:var(--color-text-3)}.post-revision-current{padding:12px 14px;border-top:1px solid var(--j13-border-light);background:hsl(var(--muted) / .4);flex-shrink:0}.post-revision-current-label{display:block;font-size:11px;color:var(--color-text-3);margin-bottom:4px}.post-revision-current-title{font-size:13px;font-weight:500;color:var(--color-text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.post-revision-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}.post-revision-main-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-bottom:1px solid var(--j13-border-light);flex-shrink:0}.post-revision-main-editor{font-size:14px;font-weight:600;color:var(--color-text-1);margin-right:8px}.post-revision-main-time{font-size:12px;color:var(--color-text-3)}.post-revision-scroll{flex:1;overflow-y:auto;overflow-x:hidden;min-height:0;padding:16px 20px 24px;-webkit-overflow-scrolling:touch}.revision-diff-view{display:flex;flex-direction:column;gap:20px}.revision-diff-section h4{font-size:12px;font-weight:600;color:var(--color-text-3);text-transform:uppercase;letter-spacing:.04em;margin:0 0 8px}.revision-diff-block{padding:12px 14px;background:hsl(var(--muted) / .35);border-radius:8px;font-size:14px;line-height:1.6;word-break:break-word}.revision-diff-inline del{background:#fbe9e9;color:#8f2424;text-decoration:line-through;border-radius:2px;padding:0 2px}.revision-diff-inline ins{background:#e2f8ea;color:#246b3c;text-decoration:none;border-radius:2px;padding:0 2px}.revision-diff-unchanged{color:var(--color-text-3);font-size:13px}.revision-diff-stats{display:flex;gap:8px;margin-bottom:8px}.revision-diff-stat{font-size:11px;padding:2px 8px;border-radius:4px;font-weight:500}.revision-diff-stat--add{background:#e2f8ea;color:#246b3c}.revision-diff-stat--del{background:#fbe9e9;color:#8f2424}.revision-diff-pre{margin:0;font-family:ui-monospace,Cascadia Code,Source Code Pro,Menlo,monospace;font-size:13px;line-height:1.55;border:1px solid var(--j13-border-light);border-radius:8px;overflow:hidden}.revision-diff-line{display:flex;padding:1px 0;white-space:pre-wrap;word-break:break-word}.revision-diff-line--add{background:#ebfaf0}.revision-diff-line--del{background:#fceeee}.revision-diff-line--same{background:hsl(var(--background))}.revision-diff-gutter{flex-shrink:0;width:24px;text-align:center;color:var(--color-text-3);-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:12px}.revision-diff-line--add .revision-diff-gutter{color:#395}.revision-diff-line--del .revision-diff-gutter{color:#b82e2e}.revision-diff-text{flex:1;padding-right:12px}.revision-diff-line--add .revision-diff-text{color:#1f5130}.revision-diff-line--del .revision-diff-text{color:#722;text-decoration:line-through}.revision-full-view h4{font-size:18px;font-weight:600;margin:0 0 8px;line-height:1.4}.revision-full-tags{font-size:13px;color:var(--color-text-3);margin:0 0 16px}@media (max-width: 768px){.post-revision-overlay:not(.post-revision-overlay--fullscreen){padding:0;align-items:stretch}.post-revision-panel:not(.post-revision-panel--fullscreen){width:100%;height:100%;border-radius:0}.post-revision-head{flex-wrap:wrap}.post-revision-head-actions{width:100%;justify-content:space-between}.post-revision-view-tabs{flex:1}.post-revision-tab-label{display:none}.post-revision-tab.active .post-revision-tab-label{display:inline}.post-revision-body{flex-direction:column}.post-revision-sidebar{width:100%;max-height:180px;border-right:none;border-bottom:1px solid var(--j13-border-light)}.post-revision-current{display:none}}.post-detail-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.post-detail-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:12px;margin-top:28px;padding-top:20px;border-top:1px solid var(--j13-border-light)}.post-detail-content{font-size:15px;line-height:1.75;word-break:break-word;color:var(--color-text-1)}.post-detail-content h1,.post-detail-content h2,.post-detail-content h3,.post-detail-content h4,.post-detail-content h5,.post-detail-content h6{font-weight:700;line-height:1.35;letter-spacing:-.02em;color:var(--color-text-1);margin:1.4em 0 .55em}.post-detail-content>:first-child,.post-detail-content h1:first-child,.post-detail-content h2:first-child,.post-detail-content h3:first-child,.post-detail-content h4:first-child,.post-detail-content h5:first-child,.post-detail-content h6:first-child{margin-top:0}.post-detail-content h1{font-size:1.85em}.post-detail-content h2{font-size:1.55em}.post-detail-content h3{font-size:1.3em}.post-detail-content h4{font-size:1.12em}.post-detail-content h5{font-size:1em}.post-detail-content h6{font-size:.92em;color:var(--color-text-2);font-weight:600}.post-detail-content ul,.post-detail-content ol{margin:0 0 12px;padding-left:1.6em}.post-detail-content ul{list-style-type:disc}.post-detail-content ol{list-style-type:decimal}.post-detail-content li{display:list-item;margin-bottom:4px}.post-detail-content li>ul,.post-detail-content li>ol{margin-top:4px;margin-bottom:0}.post-detail-content hr{margin:24px 0;border:none;border-top:1px solid var(--j13-border)}.post-detail-content members-only,.post-detail-content .post-members-only{display:block;margin:20px 0;border-radius:12px;overflow:hidden}.post-detail-content .post-members-only--visible{border:1px solid rgba(24,160,88,.35);background:linear-gradient(135deg,#18a0580f,#18a05805);box-shadow:inset 0 1px #fff9}.post-detail-content .post-members-only__badge{display:inline-flex;align-items:center;gap:6px;margin:12px 16px 0;padding:4px 10px;border-radius:20px;background:#18a0581f;color:var(--j13-green);font-size:12px;font-weight:600;letter-spacing:.02em}.post-detail-content .post-members-only__badge-icon{display:inline-flex;align-items:center;justify-content:center}.post-detail-content .post-members-only__body{padding:12px 18px 18px}.post-detail-content .post-members-only__body--empty{color:var(--color-text-4);font-style:italic}.post-detail-content .post-members-only--locked{position:relative;border:1px solid rgba(24,160,88,.22);background:var(--j13-bg-surface)}.post-detail-content .post-members-only__locked-wrap{position:relative;min-height:160px}.post-detail-content .post-members-only__badge--locked{position:relative;z-index:2;background:#18a0581a}.post-detail-content .post-members-only__preview{position:relative;z-index:0;padding:8px 20px 20px;filter:blur(5px);opacity:.45;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}.post-detail-content .post-members-only__preview-line{height:11px;margin-bottom:12px;border-radius:6px;background:linear-gradient(90deg,var(--j13-bg-block-muted) 0%,var(--color-fill-3) 100%)}.post-detail-content .post-members-only__preview-line--medium{width:88%}.post-detail-content .post-members-only__preview-line--short{width:62%;margin-bottom:0}.post-detail-content .post-members-only__gate{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 20px 20px;gap:6px;background:linear-gradient(180deg,#ffffff8c,#ffffffe0 38%,#ffffffeb);-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}.post-detail-content .post-members-only__gate-icon{width:48px;height:48px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--j13-bg-surface);color:var(--color-text-3);border:1px solid var(--j13-border);margin-bottom:4px;box-shadow:var(--j13-shadow-soft)}.post-detail-content .post-members-only__gate-title{margin:0;font-size:15px;font-weight:600;color:var(--color-text-1)}.post-detail-content .post-members-only__gate-desc{margin:0 0 8px;font-size:13px;color:var(--color-text-3);line-height:1.5;max-width:280px}.post-detail-content .post-members-only__gate-btn{padding:8px 20px;border:none;border-radius:8px;background:var(--j13-green);color:#fff;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s,transform .1s}.post-detail-content .post-members-only__gate-btn:hover{background:var(--j13-green-hover);transform:translateY(-1px)}.post-detail-content .post-members-only__gate-alt{margin-top:4px;font-size:12px;color:var(--color-text-3)}.post-detail-content .post-members-only__gate-link{padding:0;border:none;background:none;color:var(--j13-green);font-size:12px;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.post-detail-content .post-members-only__gate-link:hover{color:var(--j13-green-hover)}.dark .post-detail-content .post-members-only--visible{border-color:#23c36b59;background:linear-gradient(135deg,#23c36b1a,#23c36b08);box-shadow:none}.dark .post-detail-content .post-members-only--locked{border-color:#23c36b40;background:var(--j13-bg-surface)}.dark .post-detail-content .post-members-only__gate{background:linear-gradient(180deg,#18181b80,#18181bd1 38%,#18181be6)}.dark .post-detail-content .post-members-only__preview-line{background:linear-gradient(90deg,var(--j13-bg-block-muted) 0%,rgba(255,255,255,.08) 100%)}.article-editor-tools-members{display:inline-flex;align-items:center;gap:6px;margin-left:4px}.article-editor-tools-sep{display:inline-block;width:1px;height:20px;background:var(--j13-border-light);flex-shrink:0}.article-editor-tools .article-tool-btn--members{color:var(--j13-green)}.article-editor-tools .article-tool-btn--members:hover,.article-editor-tools .article-tool-btn--members.active{background:var(--j13-green-bg);color:var(--j13-green-hover)}.post-members-only__exit-btn,.post-members-only__unwrap-btn{margin-left:4px;padding:2px 8px;border:none;border-radius:12px;background:#18a05829;color:var(--j13-green);font-size:11px;font-weight:500;cursor:pointer;display:inline-flex;align-items:center;gap:3px;transition:background .12s,color .12s}.post-members-only__unwrap-btn{background:transparent;color:var(--color-text-3)}.post-members-only__exit-btn:hover{background:#18a05847;color:var(--j13-green-hover)}.post-members-only__unwrap-btn:hover{background:var(--j13-bg-block-muted);color:var(--color-text-2)}.post-detail-content strong,.post-detail-content b{font-weight:700;color:var(--color-text-1)}.post-detail-content em,.post-detail-content i{font-style:italic}.post-detail-content img{max-width:100%;border-radius:6px}.post-detail-content p{margin:0 0 12px}.post-detail-content p:last-child{margin-bottom:0}.post-detail-content a{color:var(--j13-green)}.post-detail-content blockquote{margin:12px 0;padding:8px 14px;border-left:3px solid var(--j13-green);background:var(--j13-bg-block-muted);color:var(--color-text-3);border-radius:0 6px 6px 0}.post-detail-content pre,.post-detail-content code{font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:13px}.post-detail-content pre{padding:12px;background:var(--j13-bg-block-muted);border-radius:6px;overflow-x:auto}.post-detail-content code{padding:2px 6px;background:var(--j13-bg-block-muted);border-radius:4px}.comment-section{display:flex;flex-direction:column;background:var(--j13-bg-surface);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-card);flex-shrink:0;overflow:hidden}.comment-section-bar{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px 12px;font-size:15px;font-weight:600;flex-shrink:0;border-bottom:1px solid var(--j13-border-light)}.comment-section-bar:after{content:"";position:absolute;bottom:-1px;left:20px;width:36px;height:2px;background:var(--j13-green);border-radius:1px;transition:width .35s cubic-bezier(.4,0,.2,1)}.comment-section:hover .comment-section-bar:after{width:52px}.comment-section-title{color:var(--color-text-1)}.comment-section-count{font-size:13px;font-weight:400;color:var(--color-text-3)}.floor-jump-tools{display:flex;align-items:center;gap:4px}.comment-list-area{display:flex;flex-direction:column}.comment-empty{text-align:center;padding:48px 24px;color:var(--color-text-3)}.comment-empty-icon{font-size:32px;margin-bottom:8px;opacity:.6}.comment-empty p{margin:0;font-size:13px}.reply-bar{padding:12px 20px 16px;border-top:1px solid var(--j13-border-light);background:var(--j13-bg-block-muted);flex-shrink:0}.comment-box-wrap{padding:16px 20px;border-bottom:1px solid var(--j13-border-light);background:var(--j13-bg-surface);flex-shrink:0}.comment-box-wrap.inline{padding:12px 0 4px;border-bottom:none;background:transparent}.comment-box-wrap.inline .comment-box-avatar,.comment-box-wrap.inline .comment-box-avatar-img,.comment-box-wrap.inline .comment-box-avatar-placeholder{width:32px;height:32px;font-size:13px}.waline-comment-reply-btn.cancel{color:#e74c3c}.waline-comment-reply-btn.cancel:hover{color:#c0392b}.comment-box{display:flex;gap:12px;align-items:flex-start}.comment-box-avatar{flex-shrink:0}.comment-box-avatar-img,.comment-box-avatar-placeholder{width:40px;height:40px;border-radius:50%;-o-object-fit:cover;object-fit:cover}.comment-box-avatar-placeholder{display:flex;align-items:center;justify-content:center;background:var(--j13-green);color:#fff;font-size:16px;font-weight:600}.comment-box-avatar-placeholder.guest{background:var(--color-fill-3);color:var(--color-text-3)}.comment-box-main{flex:1;min-width:0}.comment-box-reply-hint{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--j13-green);margin-bottom:8px}.comment-box-reply-cancel{border:none;background:none;color:var(--color-text-3);cursor:pointer;font-size:12px;padding:0}.comment-box-reply-cancel:hover{color:var(--color-text-1)}.comment-box-input-wrap{position:relative;border:1px solid var(--j13-border-light);border-radius:10px;background:var(--j13-bg-block);transition:border-color .2s,background .2s}.comment-box-input-wrap:focus-within{border-color:rgb(var(--primary-6))}.comment-box-input-wrap.private-mode{background:var(--j13-bg-block-muted);border-color:var(--j13-border)}.comment-box-textarea{display:block;width:100%;min-height:72px;max-height:200px;padding:10px 48px 10px 12px;border:none;outline:none;resize:vertical;font-size:14px;line-height:1.6;font-family:inherit;color:var(--color-text-1);background:transparent;box-sizing:border-box}.comment-box-textarea::-moz-placeholder{color:var(--color-text-4)}.comment-box-textarea::placeholder{color:var(--color-text-4)}.comment-box-send{position:absolute;right:8px;bottom:8px;width:32px;height:32px;border:none;border-radius:50%;background:#27c;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:14px;transition:background .15s,opacity .15s}.comment-box-send:hover:not(:disabled){background:#1a9bd8}.comment-box-send:disabled{opacity:.45;cursor:not-allowed}.comment-box-guest-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:8px 10px;margin-top:8px}.comment-box-guest-field{display:flex;flex-direction:column;gap:4px;min-width:0}.comment-box-guest-label{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--color-text-3)}.comment-box-guest-required,.comment-box-guest-optional{font-style:normal;font-size:11px;line-height:1;padding:2px 6px;border-radius:4px}.comment-box-guest-required{color:rgb(var(--danger-6));background:color-mix(in srgb,rgb(var(--danger-6)) 12%,transparent)}.comment-box-guest-optional{color:var(--color-text-4);background:var(--color-fill-2)}.comment-box-guest-hint{grid-column:1 / -1;margin:0;font-size:12px;color:var(--color-text-4);line-height:1.5}.comment-box-guest-input{height:32px;padding:0 10px;border:1px solid var(--j13-border);border-radius:6px;font-size:13px;color:var(--color-text-1);background:var(--color-bg-1);outline:none;transition:border-color .2s}.comment-box-guest-input:focus{border-color:rgb(var(--primary-6))}.comment-box-guest-input::-moz-placeholder{color:var(--color-text-4)}.comment-box-guest-input::placeholder{color:var(--color-text-4)}.comment-box-toolbar{display:flex;align-items:center;gap:16px;margin-top:8px}.comment-box-owo{border:none;background:none;padding:2px 6px;font-size:13px;font-weight:600;color:var(--color-text-2);cursor:pointer;border-radius:4px;transition:background .15s,color .15s}.comment-box-owo:hover,.comment-box-owo.active{background:#27ccff1f;color:#27c}.comment-box-private{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--color-text-3);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.emoji-picker{display:grid;grid-template-columns:repeat(12,1fr);gap:2px;margin-top:8px;padding:10px;border:1px solid #dcdfe6;border-radius:8px;background:var(--color-bg-1);max-height:200px;overflow-y:auto;box-shadow:0 2px 12px #00000014}.emoji-picker-item{border:none;background:none;font-size:20px;line-height:1;padding:4px;cursor:pointer;border-radius:4px;transition:background .1s}.emoji-picker-item:hover{background:var(--color-fill-2)}.waline-comment{display:flex;gap:12px;padding:16px 20px;border-bottom:1px solid var(--j13-border-light)}.waline-comment.nested{padding:12px 0 0;border-bottom:none}.waline-comment.highlight{animation:floor-highlight 2s ease-out}@keyframes floor-highlight{0%,30%{background:var(--j13-green-bg)}to{background:transparent}}.waline-replies{margin-top:8px}.waline-comment.nested .waline-comment-avatar{width:32px;height:32px;font-size:13px}.waline-comment-avatar{flex-shrink:0;width:40px;height:40px;border-radius:50%;overflow:hidden;background:var(--j13-green);color:#fff;font-size:16px;font-weight:600;display:flex;align-items:center;justify-content:center}.waline-comment-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.waline-comment-avatar.guest{background:var(--color-fill-3);color:var(--color-text-3)}.waline-comment-main{flex:1;min-width:0}.waline-comment-head{display:flex;align-items:center;gap:8px;margin-bottom:6px}.waline-comment-author{font-size:14px;font-weight:600;color:var(--color-text-1);text-decoration:none}a.waline-comment-author:hover{color:var(--j13-green)}.waline-comment-bubble{padding:10px 14px;background:var(--j13-bg-block-muted);border-radius:10px;font-size:14px;line-height:1.65;color:var(--color-text-1);word-break:break-word}.waline-reply-at{display:block;color:#27c;font-weight:600;margin-bottom:4px;line-height:1.5}.waline-comment-private-mask{padding:14px 16px;text-align:center;font-size:13px;color:#999;line-height:1.5;border-radius:8px;background:repeating-linear-gradient(-45deg,#f6f6f6,#f6f6f6 8px,#ececec 8px,#ececec 16px)}.waline-comment-bubble .floor-body{font-size:inherit;line-height:inherit;word-break:break-word}.floor-body{font-size:14px;line-height:1.65;word-break:break-word}.waline-comment-bubble .quote-block{margin:6px 0;background:var(--j13-bg-block)}.waline-comment-meta{display:flex;align-items:center;gap:16px;margin-top:8px;font-size:12px;color:var(--color-text-3)}.waline-comment-date{display:flex;align-items:center;gap:4px}.waline-comment-reply-btn{display:flex;align-items:center;gap:4px;border:none;background:none;padding:0;font-size:12px;color:var(--color-text-3);cursor:pointer;transition:color .15s}.waline-comment-reply-btn:hover{color:var(--j13-green)}@media (max-width: 768px){.comment-box-wrap{padding:12px 14px}.comment-box-guest-fields{grid-template-columns:1fr}.emoji-picker{grid-template-columns:repeat(8,1fr)}.waline-comment{padding:12px 14px}}.mention{color:var(--j13-green);font-weight:600}.quote-block{border-left:3px solid var(--j13-green);padding:8px 12px;margin:6px 0 8px;background:var(--j13-bg-block-muted);font-size:13px;color:var(--color-text-3);border-radius:0 8px 8px 0;line-height:1.5;white-space:pre-wrap;word-break:break-word}.quote-block.clickable{cursor:pointer;transition:background .15s,border-color .15s}.quote-block.clickable:hover{background:var(--j13-green-bg);border-left-color:var(--j13-green-hover)}@media (max-width: 768px){.post-detail-page{padding:12px 14px 20px;gap:12px}.post-detail-header{padding:12px 14px 16px}.post-detail-title{font-size:17px}.post-detail-actions{margin-top:20px;padding-top:16px;gap:10px}.comment-section-bar{padding:12px 14px 10px}.comment-section-bar:after{left:14px;width:32px}.comment-section:hover .comment-section-bar:after{width:46px}}.widget-card{background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:10px;box-shadow:var(--j13-shadow-soft);margin-bottom:0;overflow:hidden;flex-shrink:0}.widget-card-head{display:flex;align-items:center;gap:6px;padding:10px 14px 8px;font-size:13px;font-weight:600;border-bottom:1px solid var(--j13-border-light);background:var(--j13-bg-block-muted);color:var(--color-text-2)}.widget-card-icon{width:15px;height:15px;flex-shrink:0}.widget-card-icon--hot{color:#e74c3c}.widget-card-icon--notice{color:#3498db}.widget-card-icon--online{color:var(--j13-green)}.widget-head-count{color:var(--j13-green);font-weight:700}.widget-card-body{padding:6px 14px 12px}.widget-card--about{flex:1;display:flex;flex-direction:column;border-bottom:none;min-height:72px}.widget-card--about .widget-card-body{flex:1;display:flex;align-items:center;justify-content:center;text-align:center;padding:20px 16px}.widget-about-text{margin:0;font-size:12px;color:var(--color-text-3);line-height:1.65}.widget-about-text strong{display:block;margin-bottom:4px;color:var(--j13-green);font-size:13px}.widget-item{padding:7px 0;font-size:13px;cursor:pointer;border-bottom:1px solid var(--j13-border-light);display:flex;align-items:center;gap:8px;border-radius:4px;transition:background .12s,color .12s}.widget-item:last-child{border-bottom:none}.widget-item:hover{color:var(--j13-green);background:var(--j13-bg-block-accent);padding-left:6px;padding-right:6px;margin-left:-6px;margin-right:-6px}.widget-item-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.widget-item-time{font-size:11px;color:var(--color-text-4);flex-shrink:0}.widget-rank{min-width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;border-radius:4px;font-size:11px;font-weight:700;color:var(--color-text-3);background:var(--j13-bg-block-muted);flex-shrink:0}.widget-rank--1{color:#fff;background:linear-gradient(135deg,#e74c3c,#c0392b)}.widget-rank--2{color:#fff;background:linear-gradient(135deg,#e67e22,#d35400)}.widget-rank--3{color:#fff;background:linear-gradient(135deg,#f1c40f,#e67e22)}.widget-empty{font-size:13px;color:var(--color-text-3);padding:8px 0}.widget-empty--inline{padding:0}.widget-online-meta{font-size:12px;color:var(--color-text-3);margin-bottom:8px}.widget-online-list{display:flex;flex-wrap:wrap;gap:6px}.widget-online-avatar{width:28px;height:28px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:12px;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;flex-shrink:0}.widget-online-avatar img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.profile-header{display:flex;align-items:center;gap:16px;margin-bottom:24px}.profile-header-card{position:relative;display:flex;align-items:center;gap:20px;padding:24px;margin-bottom:16px;background:var(--j13-bg-block);border:1px solid var(--j13-border-light);border-radius:12px;box-shadow:var(--j13-shadow-soft);transition:border-color .2s,box-shadow .2s}.profile-header-card--dragover{border-color:color-mix(in srgb,var(--j13-green) 50%,var(--j13-border-light));box-shadow:0 0 0 3px color-mix(in srgb,var(--j13-green) 15%,transparent)}.profile-drop-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border-radius:12px;background:color-mix(in srgb,var(--j13-green) 12%,var(--j13-bg-block));color:var(--j13-green);font-size:14px;font-weight:500;pointer-events:none}.profile-avatar-btn{flex-shrink:0;padding:0;border:none;background:none;cursor:pointer;border-radius:50%;line-height:0}.profile-avatar-btn:disabled{cursor:not-allowed}.profile-avatar-lg{position:relative;width:88px;height:88px;border-radius:50%;background:var(--j13-green);color:#fff;font-size:32px;font-weight:600;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:box-shadow .2s}.profile-avatar-lg--pending{box-shadow:0 0 0 3px color-mix(in srgb,var(--j13-green) 40%,transparent)}.profile-avatar-lg img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.profile-avatar-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:#00000073;color:#fff;opacity:0;transition:opacity .2s}.profile-avatar-btn:hover .profile-avatar-overlay,.profile-avatar-btn:focus-visible .profile-avatar-overlay{opacity:1}.profile-avatar-btn:disabled .profile-avatar-overlay{opacity:1}.profile-header-info{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:16px}.profile-header-main{min-width:0}.profile-display-name{margin:0 0 4px;font-size:20px;font-weight:600;line-height:1.3}.profile-username{font-size:13px;color:var(--color-text-3)}.profile-avatar-tip{margin:6px 0 0;font-size:12px;color:var(--color-text-3);line-height:1.4}.profile-avatar-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.profile-avatar-hint{font-size:13px;color:var(--color-text-3);white-space:nowrap}.profile-form{display:flex;flex-direction:column;gap:16px}.profile-form-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:4px}.profile-form-footer--end{justify-content:flex-end}.profile-form-hint{font-size:12px;color:var(--color-text-3);line-height:1.4}@media (max-width: 520px){.profile-header-card{flex-direction:column;text-align:center;padding:20px 16px}.profile-header-info{flex-direction:column;align-items:center}.profile-form-footer{flex-direction:column;align-items:stretch}.profile-form-hint{text-align:center}}.avatar-crop-dialog{max-width:420px;padding:20px}.avatar-crop-stage{position:relative;width:100%;height:280px;border-radius:8px;overflow:hidden;background:#111}.avatar-crop-loading{display:flex;align-items:center;justify-content:center;height:100%}.avatar-crop-zoom{display:flex;align-items:center;gap:12px;padding:4px 0}.avatar-crop-zoom-label{flex-shrink:0;font-size:13px;color:var(--color-text-3);width:32px}.avatar-crop-zoom input[type=range]{flex:1;height:4px;accent-color:var(--j13-green);cursor:pointer}.admin-entry-card{border-color:color-mix(in srgb,var(--j13-green) 25%,var(--j13-border));background:var(--j13-bg-block-accent)}.auth-page{height:100%;min-height:100dvh;overflow-y:auto;display:flex;align-items:center;justify-content:center;background:var(--j13-bg-page);padding:24px}.auth-box{width:100%;max-width:400px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:12px;box-shadow:var(--j13-shadow-card);padding:32px}.auth-box .logo-mark{width:48px;height:48px;border-radius:12px;background:var(--j13-green);color:#fff;font-size:22px;font-weight:700;display:flex;align-items:center;justify-content:center;margin:0 auto 16px}.auth-box h1{text-align:center;font-size:20px;margin:0 0 4px}.auth-box .subtitle{text-align:center;font-size:13px;color:var(--color-text-3);margin-bottom:24px}.app-body--compose,.content-workspace--compose{background:var(--j13-bg-workspace)}.main-content--compose{overflow-y:auto;overflow-x:hidden}.compose-page{flex:1;display:flex;flex-direction:column;min-height:min(100%,100vh - var(--j13-header-h));overflow:visible;background:radial-gradient(ellipse 80% 50% at 50% -10%,var(--j13-green-bg),transparent),var(--j13-bg-workspace)}.compose-page--empty{align-items:center;justify-content:center}.compose-empty-card{text-align:center;padding:48px 40px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:16px;box-shadow:var(--j13-shadow-card);max-width:400px}.compose-empty-icon{width:56px;height:56px;margin:0 auto 20px;border-radius:14px;background:var(--j13-green-bg);color:var(--j13-green);font-size:24px;display:flex;align-items:center;justify-content:center}.compose-empty-card h2{margin:0 0 8px;font-size:18px;font-weight:600}.compose-empty-card p{margin:0 0 24px;font-size:14px;color:var(--color-text-3);line-height:1.5}.compose-primary-btn,.compose-ghost-btn{padding:10px 24px;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;border:none;transition:background .15s,transform .1s}.compose-primary-btn{background:var(--j13-green);color:#fff}.compose-primary-btn:hover{background:var(--j13-green-hover)}.compose-ghost-btn{background:var(--j13-bg-block-muted);color:var(--color-text-2)}.compose-canvas{flex:1;display:flex;flex-direction:column;min-height:min(100%,100vh - var(--j13-header-h));max-width:1200px;width:100%;margin:0 auto;padding:0 32px 32px}.compose-header{display:flex;align-items:center;justify-content:space-between;padding:16px 0 12px;flex-shrink:0}.compose-back{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid var(--j13-border);border-radius:8px;background:var(--j13-bg-surface);color:var(--color-text-2);font-size:13px;cursor:pointer;transition:border-color .15s,color .15s,box-shadow .15s;box-shadow:var(--j13-shadow-soft)}.compose-back:hover{border-color:var(--j13-green);color:var(--j13-green)}.compose-publish-btn{display:inline-flex;align-items:center;gap:8px;padding:10px 22px;border:none;border-radius:8px;background:linear-gradient(135deg,var(--j13-green),var(--j13-green-hover));color:#fff;font-size:14px;font-weight:600;cursor:pointer;box-shadow:0 2px 8px #18a0584d;transition:transform .1s,box-shadow .15s,opacity .15s}.compose-publish-btn:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 14px #18a05859}.compose-publish-btn:disabled{opacity:.65;cursor:not-allowed}.compose-meta{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:20px;flex-shrink:0;flex-wrap:wrap}.compose-board-pills{display:flex;flex-wrap:wrap;gap:8px}.compose-board-pill{padding:6px 14px;border:1px solid var(--j13-border);border-radius:20px;background:var(--j13-bg-surface);color:var(--color-text-2);font-size:13px;cursor:pointer;transition:all .15s}.compose-board-pill:hover{border-color:var(--j13-green);color:var(--j13-green)}.compose-board-pill.active{background:var(--j13-green);border-color:var(--j13-green);color:#fff;font-weight:500}.compose-tags-field{display:flex;align-items:center;gap:8px;padding:6px 14px;border:1px solid var(--j13-border);border-radius:20px;background:var(--j13-bg-surface);min-width:220px;transition:border-color .15s}.compose-tags-field:focus-within{border-color:var(--j13-green)}.compose-tags-icon{color:var(--color-text-4);font-size:14px;flex-shrink:0}.compose-tags-field input{flex:1;border:none;background:transparent;outline:none;font-size:13px;color:var(--color-text-1);min-width:0}.compose-tags-field input::-moz-placeholder{color:var(--color-text-4)}.compose-tags-field input::placeholder{color:var(--color-text-4)}.compose-writing{flex:1;display:flex;flex-direction:column;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:16px;box-shadow:var(--j13-shadow-card);padding:28px 32px 0;overflow:visible}.compose-title{width:100%;padding:0;border:none;background:transparent;font-size:32px;font-weight:700;line-height:1.3;letter-spacing:-.02em;color:var(--color-text-1);outline:none}.compose-title::-moz-placeholder{color:var(--color-text-4)}.compose-title::placeholder{color:var(--color-text-4)}.compose-subtitle{margin-top:8px;font-size:13px;color:var(--color-text-3)}.compose-subtitle strong{color:var(--j13-green);font-weight:500}.article-editor{flex:1;display:flex;flex-direction:column;margin-top:24px;border-top:1px solid var(--j13-border-light)}.article-editor-bar{position:sticky;top:0;z-index:30;display:flex;align-items:center;gap:12px;margin:0 -32px;padding:10px 32px;flex-shrink:0;flex-wrap:wrap;background:var(--j13-bg-surface);border-bottom:1px solid var(--j13-border-light);box-shadow:0 4px 12px #0f172a0a}.ui-tooltip{position:relative;display:inline-flex}.ui-tooltip-bubble{position:absolute;z-index:50;pointer-events:none;opacity:0;visibility:hidden;width:-moz-max-content;width:max-content;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:8px;box-shadow:var(--j13-shadow-card);transition:opacity .1s ease,transform .1s ease,visibility .1s}.ui-tooltip-bubble--compact{padding:5px 10px}.ui-tooltip-bubble--rich{min-width:148px;max-width:220px;padding:7px 12px}.ui-tooltip-bubble__title{display:block;font-size:12px;font-weight:500;line-height:1.4;color:var(--color-text-1)}.ui-tooltip-bubble--compact .ui-tooltip-bubble__title{white-space:nowrap}.ui-tooltip-bubble__hint{display:block;margin-top:3px;font-size:11px;line-height:1.45;color:var(--color-text-3)}.ui-tooltip-bubble--bottom{top:calc(100% + 8px)}.ui-tooltip-bubble--top{bottom:calc(100% + 8px)}.ui-tooltip-bubble--center.ui-tooltip-bubble--bottom{left:50%;transform:translate(-50%) translateY(-2px)}.ui-tooltip-bubble--center.ui-tooltip-bubble--top{left:50%;transform:translate(-50%) translateY(2px)}.ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip-bubble--start.ui-tooltip-bubble--top{left:0;transform:translateY(-2px)}.ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip-bubble--end.ui-tooltip-bubble--top{right:0;left:auto;transform:translateY(-2px)}.ui-tooltip:hover .ui-tooltip-bubble,.ui-tooltip:focus-within .ui-tooltip-bubble{opacity:1;visibility:visible}.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--bottom{transform:translate(-50%) translateY(0)}.ui-tooltip:hover .ui-tooltip-bubble--center.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--center.ui-tooltip-bubble--top{transform:translate(-50%) translateY(0)}.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip:hover .ui-tooltip-bubble--start.ui-tooltip-bubble--top,.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip:hover .ui-tooltip-bubble--end.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--start.ui-tooltip-bubble--top,.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--bottom,.ui-tooltip:focus-within .ui-tooltip-bubble--end.ui-tooltip-bubble--top{transform:translateY(0)}.article-editor-tools{display:flex;align-items:center;gap:2px;flex-wrap:wrap}.article-tool-btn{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:6px;background:transparent;color:var(--color-text-2);font-size:13px;cursor:pointer;transition:background .12s,color .12s}.article-tool-btn:hover{background:var(--j13-bg-block-muted);color:var(--j13-green)}.article-tool-btn.active{background:#18a0581f;color:var(--j13-green)}.article-tool-btn strong{font-size:12px;font-weight:700}.article-editor-body{flex:1;display:flex;flex-direction:column;min-height:280px}.article-editor-pane{display:flex;flex:1;min-height:280px;border:1px solid var(--j13-border);border-radius:10px;overflow:hidden;background:var(--j13-bg-block);box-shadow:inset 0 1px #ffffffa6}.article-editor-pane--source{min-height:320px}.article-editor-scroll ::-moz-selection,.article-editor-markdown-input::-moz-selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-editor-scroll ::selection,.article-editor-markdown-input::selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror ::-moz-selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror ::selection{background:color-mix(in srgb,var(--j13-green) 24%,#d6e8f0);color:inherit}.article-prosemirror .ProseMirror-selectednode{outline:2px solid color-mix(in srgb,var(--j13-green) 45%,transparent);outline-offset:2px}.dark .article-editor-scroll ::-moz-selection,.dark .article-editor-markdown-input::-moz-selection,.dark .article-prosemirror ::-moz-selection{background:color-mix(in srgb,var(--j13-green) 35%,#2a3f50);color:inherit}.dark .article-editor-scroll ::selection,.dark .article-editor-markdown-input::selection,.dark .article-prosemirror ::selection{background:color-mix(in srgb,var(--j13-green) 35%,#2a3f50);color:inherit}.article-editor-scroll{flex:1;min-width:0;overflow:auto;background:var(--j13-bg-block)}.article-editor-content{flex:1;display:flex;flex-direction:column}.article-editor-content .tiptap,.article-prosemirror{flex:1;min-height:280px;padding:14px 20px 20px;outline:none}.article-prosemirror p.is-editor-empty:first-child:before{color:var(--color-text-4);content:attr(data-placeholder);float:left;height:0;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.article-prosemirror p.is-editor-empty::-moz-selection,.article-prosemirror p.is-editor-empty *::-moz-selection{background:transparent}.article-prosemirror p.is-editor-empty::selection,.article-prosemirror p.is-editor-empty *::selection{background:transparent}.article-prosemirror.ProseMirror-focused p.is-editor-empty::-moz-selection{background:transparent}.article-prosemirror.ProseMirror-focused p.is-editor-empty::selection{background:transparent}.article-prosemirror a{color:var(--j13-green);text-decoration:underline;text-underline-offset:2px}.article-prosemirror img{max-width:100%;height:auto;border-radius:8px;margin:12px 0}.editor-members-only.post-members-only--visible{border:1px solid rgba(24,160,88,.45);background:linear-gradient(135deg,#18a05814,#18a05805);border-radius:12px;overflow:hidden;box-shadow:inset 0 1px #ffffff8c}.editor-members-only .post-members-only__badge{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0;padding:10px 14px;border-bottom:1px dashed rgba(24,160,88,.28);border-radius:0;background:#18a0581a;width:100%}.editor-members-only .post-members-only__body{padding:14px 18px 18px;min-height:96px;background:#ffffff73}.dark .editor-members-only .post-members-only__body{background:#0000001f}.post-members-only__shortcut-hint{margin-left:auto;font-size:11px;font-weight:400;color:var(--color-text-3)}.editor-members-only{margin:20px 0}.editor-members-only--selected{box-shadow:0 0 0 2px #18a05859}.article-editor-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0 16px;border-top:1px solid var(--j13-border-light);font-size:12px;color:var(--color-text-4);flex-shrink:0}.article-editor-status-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}.article-editor-status-sep{color:var(--color-text-4);opacity:.6}.article-editor-status-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.article-editor-view-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border:1px solid var(--j13-border-light);border-radius:8px;background:var(--j13-bg-block);color:var(--color-text-2);font-size:12px;font-weight:500;cursor:pointer;transition:background .12s,border-color .12s,color .12s;flex-shrink:0}.article-editor-view-btn:hover{border-color:var(--j13-green);color:var(--j13-green);background:#18a0580f}.article-editor-view-btn.active{border-color:#18a05873;color:var(--j13-green);background:#18a0581a}.article-editor--fullscreen{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;margin:0!important;padding:0 32px 24px;background:var(--j13-bg-surface);border-top:none}.article-editor--fullscreen .article-editor-bar{margin:0;padding:12px 0}.article-editor--fullscreen.article-editor--rich .article-editor-bar{width:100%;max-width:var(--j13-article-read-w);margin:0 auto}.article-editor--fullscreen .article-editor-body{min-height:0;flex:1}.article-editor--fullscreen.article-editor--rich .article-editor-body{overflow-y:auto;padding:20px 0 0;background:var(--j13-bg-workspace)}.article-editor--fullscreen.article-editor--rich .article-editor-pane{width:100%;max-width:var(--j13-article-read-w);margin:0 auto;min-height:calc(100vh - 176px)}.article-editor--fullscreen .article-editor-scroll,.article-editor--fullscreen .article-editor-content .tiptap,.article-editor--fullscreen .article-prosemirror{min-height:calc(100vh - 220px)}.article-editor--fullscreen .article-editor-markdown{min-height:calc(100vh - 176px)}.article-editor--fullscreen .article-editor-markdown-input,.article-editor--fullscreen .article-editor-markdown-preview,.article-editor--fullscreen .article-editor-pane--source{min-height:calc(100vh - 220px)}.article-editor-tools--markdown{display:flex;align-items:center;gap:8px}.article-editor-tools--markdown-hint{font-size:12px;color:var(--color-text-3)}.article-link-dialog__footer{gap:8px}.article-editor-markdown{flex:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;min-height:320px}.article-editor-markdown-input{display:block;width:100%;min-height:100%;padding:14px 16px 20px;border:none;outline:none;resize:none;font-family:ui-monospace,Cascadia Code,Consolas,monospace;font-size:13px;line-height:1.65;color:var(--color-text-1);background:transparent}.article-editor-markdown-preview{display:flex;flex-direction:column;min-height:320px;background:var(--j13-bg-surface);border:1px solid var(--j13-border);border-radius:10px;overflow:hidden}.article-editor-markdown-preview-label{padding:8px 16px;border-bottom:1px solid var(--j13-border-light);font-size:11px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--color-text-4);flex-shrink:0}.article-editor-markdown-preview-body{flex:1;padding:14px 16px;overflow-y:auto}@media (max-width: 768px){.compose-canvas{padding:0 16px}.compose-writing{padding:20px 16px 0;border-radius:12px}.article-editor--fullscreen{padding:0 16px 16px}.article-editor--fullscreen .article-editor-bar{margin:0;padding:10px 0}.article-editor-markdown{grid-template-columns:1fr;grid-template-rows:minmax(240px,1fr) minmax(240px,1fr)}.article-editor-pane--source{min-height:240px}.article-editor--fullscreen.article-editor--rich .article-editor-pane{max-width:none;margin:0}.article-editor-bar{margin:0 -16px;padding:10px 16px}.article-editor-status{flex-wrap:wrap;align-items:flex-start}.article-editor-status-actions{width:100%;justify-content:flex-end}.compose-title{font-size:24px}.compose-meta{flex-direction:column;align-items:stretch}.compose-tags-field{min-width:0}.compose-header{padding-top:12px}.compose-publish-btn span{display:none}}.page-loader{display:flex;flex:1;align-items:center;justify-content:center;gap:8px;min-height:240px;color:var(--j13-green);font-size:14px}.page-loader__dot{width:8px;height:8px;border-radius:50%;background:currentColor;animation:page-loader-pulse .9s ease-in-out infinite}@keyframes page-loader-pulse{0%,to{opacity:.35;transform:scale(.85)}50%{opacity:1;transform:scale(1)}}.admin-shell{min-height:100vh;background:hsl(var(--background))}.admin-topbar{display:flex;align-items:center;justify-content:space-between;height:56px;padding:0 20px;border-bottom:1px solid var(--j13-border);background:hsl(var(--card))}.admin-topbar-brand{display:flex;align-items:center;gap:10px}.admin-topbar-mark{width:32px;height:32px;border-radius:8px;background:var(--j13-green);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700}.admin-topbar-title{font-size:14px;font-weight:600;line-height:1.2}.admin-topbar-sub{font-size:12px;color:hsl(var(--muted-foreground))}.admin-topbar-actions{display:flex;align-items:center;gap:12px}.admin-topbar-user{font-size:13px;color:hsl(var(--muted-foreground))}.admin-link-btn{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--j13-green);background:none;border:none;cursor:pointer}.admin-body{display:flex;height:calc(100vh - 56px);overflow:hidden}.admin-sidebar{width:200px;flex-shrink:0;padding:16px 10px;border-right:1px solid var(--j13-border);background:hsl(var(--card));overflow-y:auto}.admin-nav-item{display:flex;align-items:center;gap:8px;width:100%;padding:9px 12px;margin-bottom:2px;border-radius:8px;font-size:13px;color:hsl(var(--muted-foreground));text-decoration:none;transition:background .15s,color .15s}.admin-nav-item:hover{background:var(--j13-green-bg);color:var(--j13-green)}.admin-nav-item.active{background:var(--j13-green-bg);color:var(--j13-green);font-weight:600}.admin-main{flex:1;min-width:0;min-height:0;padding:24px;overflow-y:auto}.admin-page-head{margin-bottom:20px}.admin-page-head h1{font-size:22px;font-weight:700;margin-bottom:4px}.admin-page-head p{font-size:13px;color:hsl(var(--muted-foreground))}.admin-stat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin-bottom:20px}.admin-stat-card{padding:16px;border-radius:10px;border:1px solid var(--j13-border);background:hsl(var(--card))}.admin-stat-value{font-size:24px;font-weight:700;color:var(--j13-green)}.admin-stat-label{font-size:12px;color:hsl(var(--muted-foreground));margin-top:4px}.admin-card{border:1px solid var(--j13-border);border-radius:10px;background:hsl(var(--card));margin-bottom:16px}.admin-card-body{padding:16px 20px 20px}.admin-card-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--j13-border);font-weight:600;font-size:14px}.admin-card-desc{padding:12px 16px 0;font-size:13px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-card .admin-card-desc+button{margin:12px 16px 16px}.admin-form-row{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:12px 16px 16px;font-size:13px}.admin-form-row label{color:hsl(var(--muted-foreground));white-space:nowrap}.admin-settings-page{max-width:880px;padding-bottom:24px}.admin-settings-tabs{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:20px;padding-bottom:0;border-bottom:1px solid var(--j13-border)}.admin-settings-tab{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;margin-bottom:-1px;border:none;border-bottom:2px solid transparent;background:none;font-size:13px;font-weight:500;color:hsl(var(--muted-foreground));cursor:pointer;transition:color .15s,border-color .15s}.admin-settings-tab:hover{color:hsl(var(--foreground))}.admin-settings-tab.active{color:var(--j13-green);border-bottom-color:var(--j13-green)}.admin-settings-panel{display:flex;flex-direction:column;gap:0}.admin-settings-card{margin-bottom:0}.admin-settings-card-badge{font-size:12px;font-weight:500;color:hsl(var(--muted-foreground));padding:2px 8px;border-radius:999px;background:hsl(var(--muted) / .45)}.admin-settings-sections{display:flex;flex-direction:column;gap:20px}.admin-settings-section-head h3{font-size:13px;font-weight:600;margin-bottom:2px}.admin-settings-section-head p{font-size:12px;color:hsl(var(--muted-foreground));line-height:1.45;margin-bottom:10px}.admin-settings-table{border:1px solid var(--j13-border);border-radius:8px;overflow:hidden;background:hsl(var(--background))}.admin-settings-row{display:grid;grid-template-columns:140px 140px 1fr;align-items:center;gap:8px 16px;padding:10px 14px;border-bottom:1px solid var(--j13-border);font-size:13px}.admin-settings-row:last-child{border-bottom:none}.admin-settings-row-label{color:hsl(var(--foreground));font-weight:500}.admin-settings-row-input{display:flex;align-items:center;gap:8px}.admin-settings-input{width:88px;height:32px;padding-top:0;padding-bottom:0}.admin-settings-unit{font-size:12px;color:hsl(var(--muted-foreground));white-space:nowrap}.admin-settings-row-hint{font-size:12px;color:hsl(var(--muted-foreground))}.admin-settings-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding:14px 16px;border:1px solid var(--j13-border);border-radius:10px;background:hsl(var(--card))}.admin-settings-bar p{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.45;max-width:420px}.admin-settings-filter-body{display:flex;flex-direction:column;gap:12px}.admin-settings-filter-tip{margin:0;font-size:12px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-settings-filter-tip code,.admin-settings-backup-name code{font-size:11px;background:hsl(var(--muted));padding:1px 5px;border-radius:4px}.admin-settings-filter-textarea{min-height:320px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px;line-height:1.55;resize:vertical}.admin-settings-info{display:flex;flex-direction:column;gap:0}.admin-settings-info-row{display:grid;grid-template-columns:88px 1fr;gap:12px 16px;padding:10px 0;border-bottom:1px solid var(--j13-border);font-size:13px}.admin-settings-info-row:last-child{border-bottom:none;padding-bottom:0}.admin-settings-info-row:first-child{padding-top:0}.admin-settings-info-row dt{color:hsl(var(--muted-foreground))}.admin-settings-info-row dd{margin:0;word-break:break-all}.admin-settings-info-row dd code{font-size:12px;background:hsl(var(--muted));padding:2px 6px;border-radius:4px}.admin-settings-backup-body{display:flex;flex-direction:column;align-items:flex-start;gap:10px}.admin-settings-backup-body>p{margin:0;font-size:13px;color:hsl(var(--muted-foreground));line-height:1.5}.admin-settings-backup-name{font-size:12px!important}@media (max-width: 640px){.admin-settings-row{grid-template-columns:1fr;gap:6px;padding:12px 14px}.admin-settings-row-hint{padding-left:0}.admin-settings-bar{flex-direction:column;align-items:stretch}.admin-settings-bar p{max-width:none}.admin-settings-info-row{grid-template-columns:1fr;gap:4px}}.admin-table{width:100%;border-collapse:collapse;font-size:13px}.admin-table th,.admin-table td{padding:10px 14px;text-align:left;border-bottom:1px solid var(--j13-border)}.admin-table th{font-weight:600;color:hsl(var(--muted-foreground));background:hsl(var(--muted) / .3)}.admin-table tr:last-child td{border-bottom:none}.admin-empty{padding:32px;text-align:center;color:hsl(var(--muted-foreground));font-size:13px}.admin-text-link{background:none;border:none;padding:0;color:var(--j13-green);cursor:pointer;font-size:inherit}.admin-text-link:hover{text-decoration:underline}.admin-search-bar{display:flex;gap:8px;margin-bottom:16px;max-width:480px}.admin-pagination{display:flex;align-items:center;justify-content:center;gap:12px;padding:12px;border-top:1px solid var(--j13-border);font-size:13px}.admin-dl{padding:16px;display:grid;grid-template-columns:120px 1fr;gap:10px 16px;font-size:13px}.admin-dl dt{color:hsl(var(--muted-foreground))}.admin-dl dd code{font-size:12px;background:hsl(var(--muted));padding:2px 6px;border-radius:4px}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[state\=checked\]\:translate-x-4[data-state=checked]{--tw-translate-x: 1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:bg-\[var\(--j13-green\)\][data-state=checked]{background-color:var(--j13-green)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.dark\:bg-orange-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(67 20 7 / var(--tw-bg-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px} diff --git a/embed_static/static/spa/assets/input-DOedlbiC.js b/embed_static/static/spa/assets/input-y6vZyHhN.js similarity index 77% rename from embed_static/static/spa/assets/input-DOedlbiC.js rename to embed_static/static/spa/assets/input-y6vZyHhN.js index 0062b4d..561fedf 100644 --- a/embed_static/static/spa/assets/input-DOedlbiC.js +++ b/embed_static/static/spa/assets/input-y6vZyHhN.js @@ -1 +1 @@ -import{r as t,j as i}from"./react-vendor-1fwFMt02.js";import{f as n}from"./index-CucHNnyZ.js";const a=t.forwardRef(({className:e,type:o,...r},s)=>i.jsx("input",{type:o,className:n("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...r}));a.displayName="Input";export{a as I}; +import{r as t,j as i}from"./react-vendor-BdyZmpPe.js";import{c as n}from"./index-Cp7Ff9NP.js";const a=t.forwardRef(({className:e,type:o,...r},s)=>i.jsx("input",{type:o,className:n("flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:s,...r}));a.displayName="Input";export{a as I}; diff --git a/embed_static/static/spa/assets/react-vendor-1fwFMt02.js b/embed_static/static/spa/assets/react-vendor-1fwFMt02.js deleted file mode 100644 index 88e80b6..0000000 --- a/embed_static/static/spa/assets/react-vendor-1fwFMt02.js +++ /dev/null @@ -1,67 +0,0 @@ -function id(e,t){for(var n=0;nr[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Ea(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ca={exports:{}},Wl={},Pa={exports:{}},z={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Rr=Symbol.for("react.element"),ud=Symbol.for("react.portal"),sd=Symbol.for("react.fragment"),ad=Symbol.for("react.strict_mode"),cd=Symbol.for("react.profiler"),fd=Symbol.for("react.provider"),dd=Symbol.for("react.context"),pd=Symbol.for("react.forward_ref"),hd=Symbol.for("react.suspense"),md=Symbol.for("react.memo"),vd=Symbol.for("react.lazy"),Yu=Symbol.iterator;function gd(e){return e===null||typeof e!="object"?null:(e=Yu&&e[Yu]||e["@@iterator"],typeof e=="function"?e:null)}var _a={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ra=Object.assign,La={};function Mn(e,t,n){this.props=e,this.context=t,this.refs=La,this.updater=n||_a}Mn.prototype.isReactComponent={};Mn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Mn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Na(){}Na.prototype=Mn.prototype;function Vi(e,t,n){this.props=e,this.context=t,this.refs=La,this.updater=n||_a}var Hi=Vi.prototype=new Na;Hi.constructor=Vi;Ra(Hi,Mn.prototype);Hi.isPureReactComponent=!0;var Gu=Array.isArray,Oa=Object.prototype.hasOwnProperty,Qi={current:null},Ta={key:!0,ref:!0,__self:!0,__source:!0};function za(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Oa.call(t,r)&&!Ta.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,ne=C[Y];if(0>>1;Yl(fo,T))Utl(Dr,fo)?(C[Y]=Dr,C[Ut]=T,Y=Ut):(C[Y]=fo,C[jt]=T,Y=jt);else if(Utl(Dr,T))C[Y]=Dr,C[Ut]=T,Y=Ut;else break e}}return O}function l(C,O){var T=C.sortIndex-O.sortIndex;return T!==0?T:C.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,u=i.now();e.unstable_now=function(){return i.now()-u}}var s=[],a=[],d=1,f=null,m=3,v=!1,g=!1,w=!1,S=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(C){for(var O=n(a);O!==null;){if(O.callback===null)r(a);else if(O.startTime<=C)r(a),O.sortIndex=O.expirationTime,t(s,O);else break;O=n(a)}}function y(C){if(w=!1,h(C),!g)if(n(s)!==null)g=!0,X(x);else{var O=n(a);O!==null&&te(y,O.startTime-C)}}function x(C,O){g=!1,w&&(w=!1,p(R),R=-1),v=!0;var T=m;try{for(h(O),f=n(s);f!==null&&(!(f.expirationTime>O)||C&&!A());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,m=f.priorityLevel;var ne=Y(f.expirationTime<=O);O=e.unstable_now(),typeof ne=="function"?f.callback=ne:f===n(s)&&r(s),h(O)}else r(s);f=n(s)}if(f!==null)var Mr=!0;else{var jt=n(a);jt!==null&&te(y,jt.startTime-O),Mr=!1}return Mr}finally{f=null,m=T,v=!1}}var P=!1,_=null,R=-1,M=5,N=-1;function A(){return!(e.unstable_now()-NC||125Y?(C.sortIndex=T,t(a,C),n(s)===null&&C===n(a)&&(w?(p(R),R=-1):w=!0,te(y,T-Y))):(C.sortIndex=ne,t(s,C),g||v||(g=!0,X(x))),C},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(C){var O=m;return function(){var T=m;m=O;try{return C.apply(this,arguments)}finally{m=T}}}})(Ia);Aa.exports=Ia;var Od=Aa.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Td=k,_e=Od;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vo=Object.prototype.hasOwnProperty,zd=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,qu={},bu={};function Md(e){return Vo.call(bu,e)?!0:Vo.call(qu,e)?!1:zd.test(e)?bu[e]=!0:(qu[e]=!0,!1)}function Dd(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Fd(e,t,n,r){if(t===null||typeof t>"u"||Dd(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function me(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ue[e]=new me(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ue[t]=new me(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ue[e]=new me(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ue[e]=new me(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ue[e]=new me(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ue[e]=new me(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ue[e]=new me(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ue[e]=new me(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ue[e]=new me(e,5,!1,e.toLowerCase(),null,!1,!1)});var Xi=/[\-:]([a-z])/g;function Yi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Xi,Yi);ue[t]=new me(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Xi,Yi);ue[t]=new me(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Xi,Yi);ue[t]=new me(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ue[e]=new me(e,1,!1,e.toLowerCase(),null,!1,!1)});ue.xlinkHref=new me("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ue[e]=new me(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gi(e,t,n,r){var l=ue.hasOwnProperty(t)?ue[t]:null;(l!==null?l.type!==0:r||!(2u||l[i]!==o[u]){var s=` -`+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{mo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Yn(e):""}function Ad(e){switch(e.tag){case 5:return Yn(e.type);case 16:return Yn("Lazy");case 13:return Yn("Suspense");case 19:return Yn("SuspenseList");case 0:case 2:case 15:return e=vo(e.type,!1),e;case 11:return e=vo(e.type.render,!1),e;case 1:return e=vo(e.type,!0),e;default:return""}}function Xo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case on:return"Fragment";case ln:return"Portal";case Ho:return"Profiler";case Ji:return"StrictMode";case Qo:return"Suspense";case Ko:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $a:return(e.displayName||"Context")+".Consumer";case Ua:return(e._context.displayName||"Context")+".Provider";case Zi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case qi:return t=e.displayName||null,t!==null?t:Xo(e.type)||"Memo";case mt:t=e._payload,e=e._init;try{return Xo(e(t))}catch{}}return null}function Id(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Xo(t);case 8:return t===Ji?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Tt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function jd(e){var t=Wa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ir(e){e._valueTracker||(e._valueTracker=jd(e))}function Va(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function dl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yo(e,t){var n=t.checked;return H({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ts(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ha(e,t){t=t.checked,t!=null&&Gi(e,"checked",t,!1)}function Go(e,t){Ha(e,t);var n=Tt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Jo(e,t.type,Tt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ns(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Jo(e,t,n){(t!=="number"||dl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gn=Array.isArray;function gn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=jr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function sr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var qn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ud=["Webkit","ms","Moz","O"];Object.keys(qn).forEach(function(e){Ud.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),qn[t]=qn[e]})});function Ya(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||qn.hasOwnProperty(e)&&qn[e]?(""+t).trim():t+"px"}function Ga(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Ya(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var $d=H({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function bo(e,t){if(t){if($d[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function ei(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ti=null;function bi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ni=null,yn=null,wn=null;function os(e){if(e=Or(e)){if(typeof ni!="function")throw Error(E(280));var t=e.stateNode;t&&(t=Xl(t),ni(e.stateNode,e.type,t))}}function Ja(e){yn?wn?wn.push(e):wn=[e]:yn=e}function Za(){if(yn){var e=yn,t=wn;if(wn=yn=null,os(e),t)for(e=0;e>>=0,e===0?32:31-(Zd(e)/qd|0)|0}var Ur=64,$r=4194304;function Jn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function vl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=Jn(u):(o&=i,o!==0&&(r=Jn(o)))}else i=n&~l,i!==0?r=Jn(i):o!==0&&(r=Jn(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Lr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$e(t),e[t]=n}function np(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=er),hs=" ",ms=!1;function gc(e,t){switch(e){case"keyup":return Op.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var un=!1;function zp(e,t){switch(e){case"compositionend":return yc(t);case"keypress":return t.which!==32?null:(ms=!0,hs);case"textInput":return e=t.data,e===hs&&ms?null:e;default:return null}}function Mp(e,t){if(un)return e==="compositionend"||!uu&&gc(e,t)?(e=mc(),nl=lu=wt=null,un=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ws(n)}}function kc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ec(){for(var e=window,t=dl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=dl(e.document)}return t}function su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Wp(e){var t=Ec(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kc(n.ownerDocument.documentElement,n)){if(r!==null&&su(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Ss(n,o);var i=Ss(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,sn=null,si=null,nr=null,ai=!1;function xs(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ai||sn==null||sn!==dl(r)||(r=sn,"selectionStart"in r&&su(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),nr&&hr(nr,r)||(nr=r,r=wl(si,"onSelect"),0fn||(e.current=mi[fn],mi[fn]=null,fn--)}function I(e,t){fn++,mi[fn]=e.current,e.current=t}var zt={},fe=At(zt),ye=At(!1),Yt=zt;function Pn(e,t){var n=e.type.contextTypes;if(!n)return zt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function we(e){return e=e.childContextTypes,e!=null}function xl(){U(ye),U(fe)}function Ls(e,t,n){if(fe.current!==zt)throw Error(E(168));I(fe,t),I(ye,n)}function zc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(E(108,Id(e)||"Unknown",l));return H({},n,r)}function kl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zt,Yt=fe.current,I(fe,e),I(ye,ye.current),!0}function Ns(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=zc(e,t,Yt),r.__reactInternalMemoizedMergedChildContext=e,U(ye),U(fe),I(fe,e)):U(ye),I(ye,n)}var tt=null,Yl=!1,Oo=!1;function Mc(e){tt===null?tt=[e]:tt.push(e)}function eh(e){Yl=!0,Mc(e)}function It(){if(!Oo&&tt!==null){Oo=!0;var e=0,t=F;try{var n=tt;for(F=1;e>=i,l-=i,nt=1<<32-$e(t)+l|n<R?(M=_,_=null):M=_.sibling;var N=m(p,_,h[R],y);if(N===null){_===null&&(_=M);break}e&&_&&N.alternate===null&&t(p,_),c=o(N,c,R),P===null?x=N:P.sibling=N,P=N,_=M}if(R===h.length)return n(p,_),$&&Bt(p,R),x;if(_===null){for(;RR?(M=_,_=null):M=_.sibling;var A=m(p,_,N.value,y);if(A===null){_===null&&(_=M);break}e&&_&&A.alternate===null&&t(p,_),c=o(A,c,R),P===null?x=A:P.sibling=A,P=A,_=M}if(N.done)return n(p,_),$&&Bt(p,R),x;if(_===null){for(;!N.done;R++,N=h.next())N=f(p,N.value,y),N!==null&&(c=o(N,c,R),P===null?x=N:P.sibling=N,P=N);return $&&Bt(p,R),x}for(_=r(p,_);!N.done;R++,N=h.next())N=v(_,p,R,N.value,y),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?R:N.key),c=o(N,c,R),P===null?x=N:P.sibling=N,P=N);return e&&_.forEach(function(q){return t(p,q)}),$&&Bt(p,R),x}function S(p,c,h,y){if(typeof h=="object"&&h!==null&&h.type===on&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Ar:e:{for(var x=h.key,P=c;P!==null;){if(P.key===x){if(x=h.type,x===on){if(P.tag===7){n(p,P.sibling),c=l(P,h.props.children),c.return=p,p=c;break e}}else if(P.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===mt&&zs(x)===P.type){n(p,P.sibling),c=l(P,h.props),c.ref=Qn(p,P,h),c.return=p,p=c;break e}n(p,P);break}else t(p,P);P=P.sibling}h.type===on?(c=Xt(h.props.children,p.mode,y,h.key),c.return=p,p=c):(y=cl(h.type,h.key,h.props,null,p.mode,y),y.ref=Qn(p,c,h),y.return=p,p=y)}return i(p);case ln:e:{for(P=h.key;c!==null;){if(c.key===P)if(c.tag===4&&c.stateNode.containerInfo===h.containerInfo&&c.stateNode.implementation===h.implementation){n(p,c.sibling),c=l(c,h.children||[]),c.return=p,p=c;break e}else{n(p,c);break}else t(p,c);c=c.sibling}c=jo(h,p.mode,y),c.return=p,p=c}return i(p);case mt:return P=h._init,S(p,c,P(h._payload),y)}if(Gn(h))return g(p,c,h,y);if($n(h))return w(p,c,h,y);Xr(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,c!==null&&c.tag===6?(n(p,c.sibling),c=l(c,h),c.return=p,p=c):(n(p,c),c=Io(h,p.mode,y),c.return=p,p=c),i(p)):n(p,c)}return S}var Rn=Ic(!0),jc=Ic(!1),Pl=At(null),_l=null,hn=null,du=null;function pu(){du=hn=_l=null}function hu(e){var t=Pl.current;U(Pl),e._currentValue=t}function yi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xn(e,t){_l=e,du=hn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ge=!0),e.firstContext=null)}function De(e){var t=e._currentValue;if(du!==e)if(e={context:e,memoizedValue:t,next:null},hn===null){if(_l===null)throw Error(E(308));hn=e,_l.dependencies={lanes:0,firstContext:e}}else hn=hn.next=e;return t}var Ht=null;function mu(e){Ht===null?Ht=[e]:Ht.push(e)}function Uc(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,mu(t)):(n.next=l.next,l.next=n),t.interleaved=n,ut(e,r)}function ut(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vt=!1;function vu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $c(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function lt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _t(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,D&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,ut(e,n)}return l=r.interleaved,l===null?(t.next=t,mu(r)):(t.next=l.next,l.next=t),r.interleaved=t,ut(e,n)}function ll(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tu(e,n)}}function Ms(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Rl(e,t,n,r){var l=e.updateQueue;vt=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var s=u,a=s.next;s.next=null,i===null?o=a:i.next=a,i=s;var d=e.alternate;d!==null&&(d=d.updateQueue,u=d.lastBaseUpdate,u!==i&&(u===null?d.firstBaseUpdate=a:u.next=a,d.lastBaseUpdate=s))}if(o!==null){var f=l.baseState;i=0,d=a=s=null,u=o;do{var m=u.lane,v=u.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:v,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var g=e,w=u;switch(m=t,v=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){f=g.call(v,f,m);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,m=typeof g=="function"?g.call(v,f,m):g,m==null)break e;f=H({},f,m);break e;case 2:vt=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else v={eventTime:v,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},d===null?(a=d=v,s=f):d=d.next=v,i|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(d===null&&(s=f),l.baseState=s,l.firstBaseUpdate=a,l.lastBaseUpdate=d,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Zt|=i,e.lanes=i,e.memoizedState=f}}function Ds(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=zo.transition;zo.transition={};try{e(!1),t()}finally{F=n,zo.transition=r}}function rf(){return Fe().memoizedState}function lh(e,t,n){var r=Lt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},lf(e))of(t,n);else if(n=Uc(e,t,n,r),n!==null){var l=pe();Be(n,e,r,l),uf(n,t,r)}}function oh(e,t,n){var r=Lt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(lf(e))of(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,We(u,i)){var s=t.interleaved;s===null?(l.next=l,mu(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=Uc(e,t,l,r),n!==null&&(l=pe(),Be(n,e,r,l),uf(n,t,r))}}function lf(e){var t=e.alternate;return e===W||t!==null&&t===W}function of(e,t){rr=Nl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function uf(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tu(e,n)}}var Ol={readContext:De,useCallback:se,useContext:se,useEffect:se,useImperativeHandle:se,useInsertionEffect:se,useLayoutEffect:se,useMemo:se,useReducer:se,useRef:se,useState:se,useDebugValue:se,useDeferredValue:se,useTransition:se,useMutableSource:se,useSyncExternalStore:se,useId:se,unstable_isNewReconciler:!1},ih={readContext:De,useCallback:function(e,t){return Ke().memoizedState=[e,t===void 0?null:t],e},useContext:De,useEffect:As,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,il(4194308,4,qc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return il(4194308,4,e,t)},useInsertionEffect:function(e,t){return il(4,2,e,t)},useMemo:function(e,t){var n=Ke();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ke();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=lh.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Ke();return e={current:e},t.memoizedState=e},useState:Fs,useDebugValue:Cu,useDeferredValue:function(e){return Ke().memoizedState=e},useTransition:function(){var e=Fs(!1),t=e[0];return e=rh.bind(null,e[1]),Ke().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=W,l=Ke();if($){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),le===null)throw Error(E(349));Jt&30||Hc(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,As(Kc.bind(null,r,o,e),[e]),r.flags|=2048,kr(9,Qc.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ke(),t=le.identifierPrefix;if($){var n=rt,r=nt;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Sr++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Xe]=t,e[gr]=r,gf(e,t,!1,!1),t.stateNode=e;e:{switch(i=ei(n,r),n){case"dialog":j("cancel",e),j("close",e),l=r;break;case"iframe":case"object":case"embed":j("load",e),l=r;break;case"video":case"audio":for(l=0;lOn&&(t.flags|=128,r=!0,Kn(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ll(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!$)return ae(t),null}else 2*G()-o.renderingStartTime>On&&n!==1073741824&&(t.flags|=128,r=!0,Kn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=G(),t.sibling=null,n=B.current,I(B,r?n&1|2:n&1),t):(ae(t),null);case 22:case 23:return Ou(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?xe&1073741824&&(ae(t),t.subtreeFlags&6&&(t.flags|=8192)):ae(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function hh(e,t){switch(cu(t),t.tag){case 1:return we(t.type)&&xl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ln(),U(ye),U(fe),wu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yu(t),null;case 13:if(U(B),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));_n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(B),null;case 4:return Ln(),null;case 10:return hu(t.type._context),null;case 22:case 23:return Ou(),null;case 24:return null;default:return null}}var Gr=!1,ce=!1,mh=typeof WeakSet=="function"?WeakSet:Set,L=null;function mn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){K(e,t,r)}else n.current=null}function Ri(e,t,n){try{n()}catch(r){K(e,t,r)}}var Xs=!1;function vh(e,t){if(ci=gl,e=Ec(),su(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,d=0,f=e,m=null;t:for(;;){for(var v;f!==n||l!==0&&f.nodeType!==3||(u=i+l),f!==o||r!==0&&f.nodeType!==3||(s=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(v=f.firstChild)!==null;)m=f,f=v;for(;;){if(f===e)break t;if(m===n&&++a===l&&(u=i),m===o&&++d===r&&(s=i),(v=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=v}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(fi={focusedElem:e,selectionRange:n},gl=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,S=g.memoizedState,p=t.stateNode,c=p.getSnapshotBeforeUpdate(t.elementType===t.type?w:Ie(t.type,w),S);p.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(y){K(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return g=Xs,Xs=!1,g}function lr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Ri(t,n,o)}l=l.next}while(l!==r)}}function Zl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Li(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Sf(e){var t=e.alternate;t!==null&&(e.alternate=null,Sf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xe],delete t[gr],delete t[hi],delete t[qp],delete t[bp])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xf(e){return e.tag===5||e.tag===3||e.tag===4}function Ys(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ni(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Sl));else if(r!==4&&(e=e.child,e!==null))for(Ni(e,t,n),e=e.sibling;e!==null;)Ni(e,t,n),e=e.sibling}function Oi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Oi(e,t,n),e=e.sibling;e!==null;)Oi(e,t,n),e=e.sibling}var oe=null,je=!1;function ht(e,t,n){for(n=n.child;n!==null;)kf(e,t,n),n=n.sibling}function kf(e,t,n){if(Ge&&typeof Ge.onCommitFiberUnmount=="function")try{Ge.onCommitFiberUnmount(Vl,n)}catch{}switch(n.tag){case 5:ce||mn(n,t);case 6:var r=oe,l=je;oe=null,ht(e,t,n),oe=r,je=l,oe!==null&&(je?(e=oe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):oe.removeChild(n.stateNode));break;case 18:oe!==null&&(je?(e=oe,n=n.stateNode,e.nodeType===8?No(e.parentNode,n):e.nodeType===1&&No(e,n),dr(e)):No(oe,n.stateNode));break;case 4:r=oe,l=je,oe=n.stateNode.containerInfo,je=!0,ht(e,t,n),oe=r,je=l;break;case 0:case 11:case 14:case 15:if(!ce&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Ri(n,t,i),l=l.next}while(l!==r)}ht(e,t,n);break;case 1:if(!ce&&(mn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){K(n,t,u)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(ce=(r=ce)||n.memoizedState!==null,ht(e,t,n),ce=r):ht(e,t,n);break;default:ht(e,t,n)}}function Gs(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new mh),t.forEach(function(r){var l=Ph.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Ae(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=G()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*yh(r/1960))-r,10e?16:e,St===null)var r=!1;else{if(e=St,St=null,Ml=0,D&6)throw Error(E(331));var l=D;for(D|=4,L=e.current;L!==null;){var o=L,i=o.child;if(L.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sG()-Lu?Kt(e,0):Ru|=n),Se(e,t)}function Of(e,t){t===0&&(e.mode&1?(t=$r,$r<<=1,!($r&130023424)&&($r=4194304)):t=1);var n=pe();e=ut(e,t),e!==null&&(Lr(e,t,n),Se(e,n))}function Ch(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Ph(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),Of(e,n)}var Tf;Tf=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ye.current)ge=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ge=!1,dh(e,t,n);ge=!!(e.flags&131072)}else ge=!1,$&&t.flags&1048576&&Dc(t,Cl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ul(e,t),e=t.pendingProps;var l=Pn(t,fe.current);xn(t,n),l=xu(null,t,r,e,l,n);var o=ku();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,we(r)?(o=!0,kl(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,vu(t),l.updater=Jl,t.stateNode=l,l._reactInternals=t,Si(t,r,e,n),t=Ei(null,t,r,!0,o,n)):(t.tag=0,$&&o&&au(t),de(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ul(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Rh(r),e=Ie(r,e),l){case 0:t=ki(null,t,r,e,n);break e;case 1:t=Hs(null,t,r,e,n);break e;case 11:t=Ws(null,t,r,e,n);break e;case 14:t=Vs(null,t,r,Ie(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),ki(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Hs(e,t,r,l,n);case 3:e:{if(hf(t),e===null)throw Error(E(387));r=t.pendingProps,o=t.memoizedState,l=o.element,$c(e,t),Rl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=Nn(Error(E(423)),t),t=Qs(e,t,r,n,l);break e}else if(r!==l){l=Nn(Error(E(424)),t),t=Qs(e,t,r,n,l);break e}else for(Ee=Pt(t.stateNode.containerInfo.firstChild),Ce=t,$=!0,Ue=null,n=jc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(_n(),r===l){t=st(e,t,n);break e}de(e,t,r,n)}t=t.child}return t;case 5:return Bc(t),e===null&&gi(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,di(r,l)?i=null:o!==null&&di(r,o)&&(t.flags|=32),pf(e,t),de(e,t,i,n),t.child;case 6:return e===null&&gi(t),null;case 13:return mf(e,t,n);case 4:return gu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rn(t,null,r,n):de(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Ws(e,t,r,l,n);case 7:return de(e,t,t.pendingProps,n),t.child;case 8:return de(e,t,t.pendingProps.children,n),t.child;case 12:return de(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,I(Pl,r._currentValue),r._currentValue=i,o!==null)if(We(o.value,i)){if(o.children===l.children&&!ye.current){t=st(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=lt(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),yi(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(E(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),yi(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}de(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,xn(t,n),l=De(l),r=r(l),t.flags|=1,de(e,t,r,n),t.child;case 14:return r=t.type,l=Ie(r,t.pendingProps),l=Ie(r.type,l),Vs(e,t,r,l,n);case 15:return ff(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),ul(e,t),t.tag=1,we(r)?(e=!0,kl(t)):e=!1,xn(t,n),sf(t,r,l),Si(t,r,l,n),Ei(null,t,r,!0,e,n);case 19:return vf(e,t,n);case 22:return df(e,t,n)}throw Error(E(156,t.tag))};function zf(e,t){return lc(e,t)}function _h(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ze(e,t,n,r){return new _h(e,t,n,r)}function zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Rh(e){if(typeof e=="function")return zu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Zi)return 11;if(e===qi)return 14}return 2}function Nt(e,t){var n=e.alternate;return n===null?(n=ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function cl(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")zu(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case on:return Xt(n.children,l,o,t);case Ji:i=8,l|=8;break;case Ho:return e=ze(12,n,t,l|2),e.elementType=Ho,e.lanes=o,e;case Qo:return e=ze(13,n,t,l),e.elementType=Qo,e.lanes=o,e;case Ko:return e=ze(19,n,t,l),e.elementType=Ko,e.lanes=o,e;case Ba:return bl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ua:i=10;break e;case $a:i=9;break e;case Zi:i=11;break e;case qi:i=14;break e;case mt:i=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Xt(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function bl(e,t,n,r){return e=ze(22,e,r,t),e.elementType=Ba,e.lanes=n,e.stateNode={isHidden:!1},e}function Io(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function jo(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lh(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=yo(0),this.expirationTimes=yo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yo(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Mu(e,t,n,r,l,o,i,u,s){return e=new Lh(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},vu(o),e}function Nh(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Af)}catch(e){console.error(e)}}Af(),Fa.exports=Re;var Iu=Fa.exports;const Fv=Ea(Iu);var ra=Iu;Zu.createRoot=ra.createRoot,Zu.hydrateRoot=ra.hydrateRoot;/** - * @remix-run/router v1.23.3 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Cr(){return Cr=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function ju(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Fh(){return Math.random().toString(36).substr(2,8)}function oa(e,t){return{usr:e.state,key:e.key,idx:t}}function Fi(e,t,n,r){return n===void 0&&(n=null),Cr({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?An(t):t,{state:n,key:t&&t.key||r||Fh()})}function Al(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function An(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Ah(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,u=xt.Pop,s=null,a=d();a==null&&(a=0,i.replaceState(Cr({},i.state,{idx:a}),""));function d(){return(i.state||{idx:null}).idx}function f(){u=xt.Pop;let S=d(),p=S==null?null:S-a;a=S,s&&s({action:u,location:w.location,delta:p})}function m(S,p){u=xt.Push;let c=Fi(w.location,S,p);a=d()+1;let h=oa(c,a),y=w.createHref(c);try{i.pushState(h,"",y)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;l.location.assign(y)}o&&s&&s({action:u,location:w.location,delta:1})}function v(S,p){u=xt.Replace;let c=Fi(w.location,S,p);a=d();let h=oa(c,a),y=w.createHref(c);i.replaceState(h,"",y),o&&s&&s({action:u,location:w.location,delta:0})}function g(S){let p=l.location.origin!=="null"?l.location.origin:l.location.href,c=typeof S=="string"?S:Al(S);return c=c.replace(/ $/,"%20"),V(p,"No window.location.(origin|href) available to create URL for href: "+c),new URL(c,p)}let w={get action(){return u},get location(){return e(l,i)},listen(S){if(s)throw new Error("A history only accepts one active listener");return l.addEventListener(la,f),s=S,()=>{l.removeEventListener(la,f),s=null}},createHref(S){return t(l,S)},createURL:g,encodeLocation(S){let p=g(S);return{pathname:p.pathname,search:p.search,hash:p.hash}},push:m,replace:v,go(S){return i.go(S)}};return w}var ia;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(ia||(ia={}));function Ih(e,t,n){return n===void 0&&(n="/"),jh(e,t,n)}function jh(e,t,n,r){let l=typeof t=="string"?An(t):t,o=Tn(l.pathname||"/",n);if(o==null)return null;let i=If(e);Uh(i);let u=null,s=Jh(o);for(let a=0;u==null&&a{let s={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};s.relativePath.startsWith("/")&&(V(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),s.relativePath=s.relativePath.slice(r.length));let a=Ot([r,s.relativePath]),d=n.concat(s);o.children&&o.children.length>0&&(V(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+a+'".')),If(o.children,t,d,a)),!(o.path==null&&!o.index)&&t.push({path:a,score:Kh(a,o.index),routesMeta:d})};return e.forEach((o,i)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))l(o,i);else for(let s of jf(o.path))l(o,i,s)}),t}function jf(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=jf(r.join("/")),u=[];return u.push(...i.map(s=>s===""?o:[o,s].join("/"))),l&&u.push(...i),u.map(s=>e.startsWith("/")&&s===""?"/":s)}function Uh(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Xh(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const $h=/^:[\w-]+$/,Bh=3,Wh=2,Vh=1,Hh=10,Qh=-2,ua=e=>e==="*";function Kh(e,t){let n=e.split("/"),r=n.length;return n.some(ua)&&(r+=Qh),t&&(r+=Wh),n.filter(l=>!ua(l)).reduce((l,o)=>l+($h.test(o)?Bh:o===""?Vh:Hh),r)}function Xh(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function Yh(e,t,n){let{routesMeta:r}=e,l={},o="/",i=[];for(let u=0;u{let{paramName:m,isOptional:v}=d;if(m==="*"){let w=u[f]||"";i=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=u[f];return v&&!g?a[m]=void 0:a[m]=(g||"").replace(/%2F/g,"/"),a},{}),pathname:o,pathnameBase:i,pattern:e}}function Gh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ju(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,u,s)=>(r.push({paramName:u,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function Jh(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ju(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Tn(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const Zh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qh=e=>Zh.test(e);function bh(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?An(e):e,o;if(n)if(qh(n))o=n;else{if(n.includes("//")){let i=n;n=Uf(n),ju(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?o=sa(n.substring(1),"/"):o=sa(n,t)}else o=t;return{pathname:o,search:nm(r),hash:rm(l)}}function sa(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function Uo(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function em(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Uu(e,t){let n=em(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $u(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=An(e):(l=Cr({},e),V(!l.pathname||!l.pathname.includes("?"),Uo("?","pathname","search",l)),V(!l.pathname||!l.pathname.includes("#"),Uo("#","pathname","hash",l)),V(!l.search||!l.search.includes("#"),Uo("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,u;if(i==null)u=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let m=i.split("/");for(;m[0]==="..";)m.shift(),f-=1;l.pathname=m.join("/")}u=f>=0?t[f]:"/"}let s=bh(l,u),a=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&n.endsWith("/");return!s.pathname.endsWith("/")&&(a||d)&&(s.pathname+="/"),s}const Uf=e=>e.replace(/\/\/+/g,"/"),Ot=e=>Uf(e.join("/")),tm=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),nm=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,rm=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function lm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $f=["post","put","patch","delete"];new Set($f);const om=["get",...$f];new Set(om);/** - * React Router v6.30.4 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Pr(){return Pr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{u.current=!0}),k.useCallback(function(a,d){if(d===void 0&&(d={}),!u.current)return;if(typeof a=="number"){r.go(a);return}let f=$u(a,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ot([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,o,e])}const Hf=k.createContext(null);function Av(){return k.useContext(Hf)}function sm(e){let t=k.useContext(qe).outlet;return t&&k.createElement(Hf.Provider,{value:e},t)}function Iv(){let{matches:e}=k.useContext(qe),t=e[e.length-1];return t?t.params:{}}function io(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=k.useContext(dt),{matches:l}=k.useContext(qe),{pathname:o}=nn(),i=JSON.stringify(Uu(l,r.v7_relativeSplatPath));return k.useMemo(()=>$u(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function am(e,t){return cm(e,t)}function cm(e,t,n,r){In()||V(!1);let{navigator:l}=k.useContext(dt),{matches:o}=k.useContext(qe),i=o[o.length-1],u=i?i.params:{};i&&i.pathname;let s=i?i.pathnameBase:"/";i&&i.route;let a=nn(),d;if(t){var f;let S=typeof t=="string"?An(t):t;s==="/"||(f=S.pathname)!=null&&f.startsWith(s)||V(!1),d=S}else d=a;let m=d.pathname||"/",v=m;if(s!=="/"){let S=s.replace(/^\//,"").split("/");v="/"+m.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=Ih(e,{pathname:v}),w=mm(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},u,S.params),pathname:Ot([s,l.encodeLocation?l.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?s:Ot([s,l.encodeLocation?l.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r);return t&&w?k.createElement(oo.Provider,{value:{location:Pr({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:xt.Pop}},w):w}function fm(){let e=wm(),t=lm(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:l},n):null,null)}const dm=k.createElement(fm,null);class pm extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?k.createElement(qe.Provider,{value:this.props.routeContext},k.createElement(Wf.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function hm(e){let{routeContext:t,match:n,children:r}=e,l=k.useContext(lo);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(qe.Provider,{value:t},r)}function mm(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,u=(l=n)==null?void 0:l.errors;if(u!=null){let d=i.findIndex(f=>f.route.id&&(u==null?void 0:u[f.route.id])!==void 0);d>=0||V(!1),i=i.slice(0,Math.min(i.length,d+1))}let s=!1,a=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,a+1):i=[i[0]];break}}}return i.reduceRight((d,f,m)=>{let v,g=!1,w=null,S=null;n&&(v=u&&f.route.id?u[f.route.id]:void 0,w=f.route.errorElement||dm,s&&(a<0&&m===0?(xm("route-fallback"),g=!0,S=null):a===m&&(g=!0,S=f.route.hydrateFallbackElement||null)));let p=t.concat(i.slice(0,m+1)),c=()=>{let h;return v?h=w:g?h=S:f.route.Component?h=k.createElement(f.route.Component,null):f.route.element?h=f.route.element:h=d,k.createElement(hm,{match:f,routeContext:{outlet:d,matches:p,isDataRoute:n!=null},children:h})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?k.createElement(pm,{location:n.location,revalidation:n.revalidation,component:w,error:v,children:c(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):c()},null)}var Qf=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Qf||{}),Kf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Kf||{});function vm(e){let t=k.useContext(lo);return t||V(!1),t}function gm(e){let t=k.useContext(Bf);return t||V(!1),t}function ym(e){let t=k.useContext(qe);return t||V(!1),t}function Xf(e){let t=ym(),n=t.matches[t.matches.length-1];return n.route.id||V(!1),n.route.id}function wm(){var e;let t=k.useContext(Wf),n=gm(),r=Xf();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Sm(){let{router:e}=vm(Qf.UseNavigateStable),t=Xf(Kf.UseNavigateStable),n=k.useRef(!1);return Vf(()=>{n.current=!0}),k.useCallback(function(l,o){o===void 0&&(o={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Pr({fromRouteId:t},o)))},[e,t])}const aa={};function xm(e,t,n){aa[e]||(aa[e]=!0)}function km(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function jv(e){let{to:t,replace:n,state:r,relative:l}=e;In()||V(!1);let{future:o,static:i}=k.useContext(dt),{matches:u}=k.useContext(qe),{pathname:s}=nn(),a=Bu(),d=$u(t,Uu(u,o.v7_relativeSplatPath),s,l==="path"),f=JSON.stringify(d);return k.useEffect(()=>a(JSON.parse(f),{replace:n,state:r,relative:l}),[a,f,l,n,r]),null}function Uv(e){return sm(e.context)}function Em(e){V(!1)}function Cm(e){let{basename:t="/",children:n=null,location:r,navigationType:l=xt.Pop,navigator:o,static:i=!1,future:u}=e;In()&&V(!1);let s=t.replace(/^\/*/,"/"),a=k.useMemo(()=>({basename:s,navigator:o,static:i,future:Pr({v7_relativeSplatPath:!1},u)}),[s,u,o,i]);typeof r=="string"&&(r=An(r));let{pathname:d="/",search:f="",hash:m="",state:v=null,key:g="default"}=r,w=k.useMemo(()=>{let S=Tn(d,s);return S==null?null:{location:{pathname:S,search:f,hash:m,state:v,key:g},navigationType:l}},[s,d,f,m,v,g,l]);return w==null?null:k.createElement(dt.Provider,{value:a},k.createElement(oo.Provider,{children:n,value:w}))}function $v(e){let{children:t,location:n}=e;return am(Ii(t),n)}new Promise(()=>{});function Ii(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,l)=>{if(!k.isValidElement(r))return;let o=[...t,l];if(r.type===k.Fragment){n.push.apply(n,Ii(r.props.children,o));return}r.type!==Em&&V(!1),!r.props.index||!r.props.children||V(!1);let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Ii(r.props.children,o)),n.push(i)}),n}/** - * React Router DOM v6.30.4 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function Rm(e,t){let n=ji(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}const Lm=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Nm=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Om="6";try{window.__reactRouterVersion=Om}catch{}const Tm=k.createContext({isTransitioning:!1}),zm="startTransition",ca=Ed[zm];function Bv(e){let{basename:t,children:n,future:r,window:l}=e,o=k.useRef();o.current==null&&(o.current=Dh({window:l,v5Compat:!0}));let i=o.current,[u,s]=k.useState({action:i.action,location:i.location}),{v7_startTransition:a}=r||{},d=k.useCallback(f=>{a&&ca?ca(()=>s(f)):s(f)},[s,a]);return k.useLayoutEffect(()=>i.listen(d),[i,d]),k.useEffect(()=>km(r),[r]),k.createElement(Cm,{basename:t,children:n,location:u.location,navigationType:u.action,navigator:i,future:r})}const Mm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Dm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fm=k.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:i,state:u,target:s,to:a,preventScrollReset:d,viewTransition:f}=t,m=Yf(t,Lm),{basename:v}=k.useContext(dt),g,w=!1;if(typeof a=="string"&&Dm.test(a)&&(g=a,Mm))try{let h=new URL(window.location.href),y=a.startsWith("//")?new URL(h.protocol+a):new URL(a),x=Tn(y.pathname,v);y.origin===h.origin&&x!=null?a=x+y.search+y.hash:w=!0}catch{}let S=im(a,{relative:l}),p=Im(a,{replace:i,state:u,target:s,preventScrollReset:d,relative:l,viewTransition:f});function c(h){r&&r(h),h.defaultPrevented||p(h)}return k.createElement("a",Il({},m,{href:g||S,onClick:w||o?r:c,ref:n,target:s}))}),Wv=k.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:o="",end:i=!1,style:u,to:s,viewTransition:a,children:d}=t,f=Yf(t,Nm),m=io(s,{relative:f.relative}),v=nn(),g=k.useContext(Bf),{navigator:w,basename:S}=k.useContext(dt),p=g!=null&&jm(m)&&a===!0,c=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,h=v.pathname,y=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;l||(h=h.toLowerCase(),y=y?y.toLowerCase():null,c=c.toLowerCase()),y&&S&&(y=Tn(y,S)||y);const x=c!=="/"&&c.endsWith("/")?c.length-1:c.length;let P=h===c||!i&&h.startsWith(c)&&h.charAt(x)==="/",_=y!=null&&(y===c||!i&&y.startsWith(c)&&y.charAt(c.length)==="/"),R={isActive:P,isPending:_,isTransitioning:p},M=P?r:void 0,N;typeof o=="function"?N=o(R):N=[o,P?"active":null,_?"pending":null,p?"transitioning":null].filter(Boolean).join(" ");let A=typeof u=="function"?u(R):u;return k.createElement(Fm,Il({},f,{"aria-current":M,className:N,ref:n,style:A,to:s,viewTransition:a}),typeof d=="function"?d(R):d)});var Ui;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ui||(Ui={}));var fa;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fa||(fa={}));function Am(e){let t=k.useContext(lo);return t||V(!1),t}function Im(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:i,viewTransition:u}=t===void 0?{}:t,s=Bu(),a=nn(),d=io(e,{relative:i});return k.useCallback(f=>{if(_m(f,n)){f.preventDefault();let m=r!==void 0?r:Al(a)===Al(d);s(e,{replace:m,state:l,preventScrollReset:o,relative:i,viewTransition:u})}},[a,s,d,r,l,n,e,o,i,u])}function Vv(e){let t=k.useRef(ji(e)),n=k.useRef(!1),r=nn(),l=k.useMemo(()=>Rm(r.search,n.current?null:t.current),[r.search]),o=Bu(),i=k.useCallback((u,s)=>{const a=ji(typeof u=="function"?u(l):u);n.current=!0,o("?"+a,s)},[o,l]);return[l,i]}function jm(e,t){t===void 0&&(t={});let n=k.useContext(Tm);n==null&&V(!1);let{basename:r}=Am(Ui.useViewTransitionState),l=io(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Tn(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Tn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ai(l.pathname,i)!=null||Ai(l.pathname,o)!=null}const Um=["top","right","bottom","left"],Mt=Math.min,ke=Math.max,jl=Math.round,qr=Math.floor,Ze=e=>({x:e,y:e}),$m={left:"right",right:"left",bottom:"top",top:"bottom"};function $i(e,t,n){return ke(e,Mt(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function ct(e){return e.split("-")[0]}function jn(e){return e.split("-")[1]}function Wu(e){return e==="x"?"y":"x"}function Vu(e){return e==="y"?"height":"width"}function Ye(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Hu(e){return Wu(Ye(e))}function Bm(e,t,n){n===void 0&&(n=!1);const r=jn(e),l=Hu(e),o=Vu(l);let i=l==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Ul(i)),[i,Ul(i)]}function Wm(e){const t=Ul(e);return[Bi(e),t,Bi(t)]}function Bi(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const da=["left","right"],pa=["right","left"],Vm=["top","bottom"],Hm=["bottom","top"];function Qm(e,t,n){switch(e){case"top":case"bottom":return n?t?pa:da:t?da:pa;case"left":case"right":return t?Vm:Hm;default:return[]}}function Km(e,t,n,r){const l=jn(e);let o=Qm(ct(e),n==="start",r);return l&&(o=o.map(i=>i+"-"+l),t&&(o=o.concat(o.map(Bi)))),o}function Ul(e){const t=ct(e);return $m[t]+e.slice(t.length)}function Xm(e){return{top:0,right:0,bottom:0,left:0,...e}}function Gf(e){return typeof e!="number"?Xm(e):{top:e,right:e,bottom:e,left:e}}function $l(e){const{x:t,y:n,width:r,height:l}=e;return{width:r,height:l,top:n,left:t,right:t+r,bottom:n+l,x:t,y:n}}function ha(e,t,n){let{reference:r,floating:l}=e;const o=Ye(t),i=Hu(t),u=Vu(i),s=ct(t),a=o==="y",d=r.x+r.width/2-l.width/2,f=r.y+r.height/2-l.height/2,m=r[u]/2-l[u]/2;let v;switch(s){case"top":v={x:d,y:r.y-l.height};break;case"bottom":v={x:d,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:f};break;case"left":v={x:r.x-l.width,y:f};break;default:v={x:r.x,y:r.y}}switch(jn(t)){case"start":v[i]-=m*(n&&a?-1:1);break;case"end":v[i]+=m*(n&&a?-1:1);break}return v}async function Ym(e,t){var n;t===void 0&&(t={});const{x:r,y:l,platform:o,rects:i,elements:u,strategy:s}=e,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:m=!1,padding:v=0}=at(t,e),g=Gf(v),S=u[m?f==="floating"?"reference":"floating":f],p=$l(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(S)))==null||n?S:S.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:a,rootBoundary:d,strategy:s})),c=f==="floating"?{x:r,y:l,width:i.floating.width,height:i.floating.height}:i.reference,h=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),y=await(o.isElement==null?void 0:o.isElement(h))?await(o.getScale==null?void 0:o.getScale(h))||{x:1,y:1}:{x:1,y:1},x=$l(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:c,offsetParent:h,strategy:s}):c);return{top:(p.top-x.top+g.top)/y.y,bottom:(x.bottom-p.bottom+g.bottom)/y.y,left:(p.left-x.left+g.left)/y.x,right:(x.right-p.right+g.right)/y.x}}const Gm=50,Jm=async(e,t,n)=>{const{placement:r="bottom",strategy:l="absolute",middleware:o=[],platform:i}=n,u=i.detectOverflow?i:{...i,detectOverflow:Ym},s=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:l}),{x:d,y:f}=ha(a,r,s),m=r,v=0;const g={};for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:l,rects:o,platform:i,elements:u,middlewareData:s}=t,{element:a,padding:d=0}=at(e,t)||{};if(a==null)return{};const f=Gf(d),m={x:n,y:r},v=Hu(l),g=Vu(v),w=await i.getDimensions(a),S=v==="y",p=S?"top":"left",c=S?"bottom":"right",h=S?"clientHeight":"clientWidth",y=o.reference[g]+o.reference[v]-m[v]-o.floating[g],x=m[v]-o.reference[v],P=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let _=P?P[h]:0;(!_||!await(i.isElement==null?void 0:i.isElement(P)))&&(_=u.floating[h]||o.floating[g]);const R=y/2-x/2,M=_/2-w[g]/2-1,N=Mt(f[p],M),A=Mt(f[c],M),q=N,J=_-w[g]-A,Q=_/2-w[g]/2+R,Ne=$i(q,Q,J),X=!s.arrow&&jn(l)!=null&&Q!==Ne&&o.reference[g]/2-(QQ<=0)){var A,q;const Q=(((A=o.flip)==null?void 0:A.index)||0)+1,Ne=_[Q];if(Ne&&(!(f==="alignment"?c!==Ye(Ne):!1)||N.every(C=>Ye(C.placement)===c?C.overflows[0]>0:!0)))return{data:{index:Q,overflows:N},reset:{placement:Ne}};let X=(q=N.filter(te=>te.overflows[0]<=0).sort((te,C)=>te.overflows[1]-C.overflows[1])[0])==null?void 0:q.placement;if(!X)switch(v){case"bestFit":{var J;const te=(J=N.filter(C=>{if(P){const O=Ye(C.placement);return O===c||O==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(O=>O>0).reduce((O,T)=>O+T,0)]).sort((C,O)=>C[1]-O[1])[0])==null?void 0:J[0];te&&(X=te);break}case"initialPlacement":X=u;break}if(l!==X)return{reset:{placement:X}}}return{}}}};function ma(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function va(e){return Um.some(t=>e[t]>=0)}const bm=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:l="referenceHidden",...o}=at(e,t);switch(l){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),u=ma(i,n.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:va(u)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),u=ma(i,n.floating);return{data:{escapedOffsets:u,escaped:va(u)}}}default:return{}}}}},Jf=new Set(["left","top"]);async function ev(e,t){const{placement:n,platform:r,elements:l}=e,o=await(r.isRTL==null?void 0:r.isRTL(l.floating)),i=ct(n),u=jn(n),s=Ye(n)==="y",a=Jf.has(i)?-1:1,d=o&&s?-1:1,f=at(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&typeof g=="number"&&(v=u==="end"?g*-1:g),s?{x:v*d,y:m*a}:{x:m*a,y:v*d}}const tv=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:l,y:o,placement:i,middlewareData:u}=t,s=await ev(t,e);return i===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:l+s.x,y:o+s.y,data:{...s,placement:i}}}}},nv=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:l,platform:o}=t,{mainAxis:i=!0,crossAxis:u=!1,limiter:s={fn:p=>{let{x:c,y:h}=p;return{x:c,y:h}}},...a}=at(e,t),d={x:n,y:r},f=await o.detectOverflow(t,a),m=Ye(ct(l)),v=Wu(m);let g=d[v],w=d[m];if(i){const p=v==="y"?"top":"left",c=v==="y"?"bottom":"right",h=g+f[p],y=g-f[c];g=$i(h,g,y)}if(u){const p=m==="y"?"top":"left",c=m==="y"?"bottom":"right",h=w+f[p],y=w-f[c];w=$i(h,w,y)}const S=s.fn({...t,[v]:g,[m]:w});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:i,[m]:u}}}}}},rv=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:l,rects:o,middlewareData:i}=t,{offset:u=0,mainAxis:s=!0,crossAxis:a=!0}=at(e,t),d={x:n,y:r},f=Ye(l),m=Wu(f);let v=d[m],g=d[f];const w=at(u,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(s){const h=m==="y"?"height":"width",y=o.reference[m]-o.floating[h]+S.mainAxis,x=o.reference[m]+o.reference[h]-S.mainAxis;vx&&(v=x)}if(a){var p,c;const h=m==="y"?"width":"height",y=Jf.has(ct(l)),x=o.reference[f]-o.floating[h]+(y&&((p=i.offset)==null?void 0:p[f])||0)+(y?0:S.crossAxis),P=o.reference[f]+o.reference[h]+(y?0:((c=i.offset)==null?void 0:c[f])||0)-(y?S.crossAxis:0);gP&&(g=P)}return{[m]:v,[f]:g}}}},lv=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:l,rects:o,platform:i,elements:u}=t,{apply:s=()=>{},...a}=at(e,t),d=await i.detectOverflow(t,a),f=ct(l),m=jn(l),v=Ye(l)==="y",{width:g,height:w}=o.floating;let S,p;f==="top"||f==="bottom"?(S=f,p=m===(await(i.isRTL==null?void 0:i.isRTL(u.floating))?"start":"end")?"left":"right"):(p=f,S=m==="end"?"top":"bottom");const c=w-d.top-d.bottom,h=g-d.left-d.right,y=Mt(w-d[S],c),x=Mt(g-d[p],h),P=!t.middlewareData.shift;let _=y,R=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(R=h),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=c),P&&!m){const N=ke(d.left,0),A=ke(d.right,0),q=ke(d.top,0),J=ke(d.bottom,0);v?R=g-2*(N!==0||A!==0?N+A:ke(d.left,d.right)):_=w-2*(q!==0||J!==0?q+J:ke(d.top,d.bottom))}await s({...t,availableWidth:R,availableHeight:_});const M=await i.getDimensions(u.floating);return g!==M.width||w!==M.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function Un(e){return Zf(e)?(e.nodeName||"").toLowerCase():"#document"}function Pe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function be(e){var t;return(t=(Zf(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zf(e){return uo()?e instanceof Node||e instanceof Pe(e).Node:!1}function Ve(e){return uo()?e instanceof Element||e instanceof Pe(e).Element:!1}function pt(e){return uo()?e instanceof HTMLElement||e instanceof Pe(e).HTMLElement:!1}function ga(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pe(e).ShadowRoot}function zr(e){const{overflow:t,overflowX:n,overflowY:r,display:l}=He(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&l!=="inline"&&l!=="contents"}function ov(e){return/^(table|td|th)$/.test(Un(e))}function so(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const iv=/transform|translate|scale|rotate|perspective|filter/,uv=/paint|layout|strict|content/,$t=e=>!!e&&e!=="none";let $o;function Qu(e){const t=Ve(e)?He(e):e;return $t(t.transform)||$t(t.translate)||$t(t.scale)||$t(t.rotate)||$t(t.perspective)||!Ku()&&($t(t.backdropFilter)||$t(t.filter))||iv.test(t.willChange||"")||uv.test(t.contain||"")}function sv(e){let t=Dt(e);for(;pt(t)&&!zn(t);){if(Qu(t))return t;if(so(t))return null;t=Dt(t)}return null}function Ku(){return $o==null&&($o=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),$o}function zn(e){return/^(html|body|#document)$/.test(Un(e))}function He(e){return Pe(e).getComputedStyle(e)}function ao(e){return Ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dt(e){if(Un(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ga(e)&&e.host||be(e);return ga(t)?t.host:t}function qf(e){const t=Dt(e);return zn(t)?e.ownerDocument?e.ownerDocument.body:e.body:pt(t)&&zr(t)?t:qf(t)}function _r(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=qf(e),o=l===((r=e.ownerDocument)==null?void 0:r.body),i=Pe(l);if(o){const u=Wi(i);return t.concat(i,i.visualViewport||[],zr(l)?l:[],u&&n?_r(u):[])}else return t.concat(l,_r(l,[],n))}function Wi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bf(e){const t=He(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const l=pt(e),o=l?e.offsetWidth:n,i=l?e.offsetHeight:r,u=jl(n)!==o||jl(r)!==i;return u&&(n=o,r=i),{width:n,height:r,$:u}}function Xu(e){return Ve(e)?e:e.contextElement}function En(e){const t=Xu(e);if(!pt(t))return Ze(1);const n=t.getBoundingClientRect(),{width:r,height:l,$:o}=bf(t);let i=(o?jl(n.width):n.width)/r,u=(o?jl(n.height):n.height)/l;return(!i||!Number.isFinite(i))&&(i=1),(!u||!Number.isFinite(u))&&(u=1),{x:i,y:u}}const av=Ze(0);function ed(e){const t=Pe(e);return!Ku()||!t.visualViewport?av:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cv(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Pe(e)?!1:t}function bt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),o=Xu(e);let i=Ze(1);t&&(r?Ve(r)&&(i=En(r)):i=En(e));const u=cv(o,n,r)?ed(o):Ze(0);let s=(l.left+u.x)/i.x,a=(l.top+u.y)/i.y,d=l.width/i.x,f=l.height/i.y;if(o){const m=Pe(o),v=r&&Ve(r)?Pe(r):r;let g=m,w=Wi(g);for(;w&&r&&v!==g;){const S=En(w),p=w.getBoundingClientRect(),c=He(w),h=p.left+(w.clientLeft+parseFloat(c.paddingLeft))*S.x,y=p.top+(w.clientTop+parseFloat(c.paddingTop))*S.y;s*=S.x,a*=S.y,d*=S.x,f*=S.y,s+=h,a+=y,g=Pe(w),w=Wi(g)}}return $l({width:d,height:f,x:s,y:a})}function co(e,t){const n=ao(e).scrollLeft;return t?t.left+n:bt(be(e)).left+n}function td(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-co(e,n),l=n.top+t.scrollTop;return{x:r,y:l}}function fv(e){let{elements:t,rect:n,offsetParent:r,strategy:l}=e;const o=l==="fixed",i=be(r),u=t?so(t.floating):!1;if(r===i||u&&o)return n;let s={scrollLeft:0,scrollTop:0},a=Ze(1);const d=Ze(0),f=pt(r);if((f||!f&&!o)&&((Un(r)!=="body"||zr(i))&&(s=ao(r)),f)){const v=bt(r);a=En(r),d.x=v.x+r.clientLeft,d.y=v.y+r.clientTop}const m=i&&!f&&!o?td(i,s):Ze(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+d.x+m.x,y:n.y*a.y-s.scrollTop*a.y+d.y+m.y}}function dv(e){return Array.from(e.getClientRects())}function pv(e){const t=be(e),n=ao(e),r=e.ownerDocument.body,l=ke(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ke(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+co(e);const u=-n.scrollTop;return He(r).direction==="rtl"&&(i+=ke(t.clientWidth,r.clientWidth)-l),{width:l,height:o,x:i,y:u}}const ya=25;function hv(e,t){const n=Pe(e),r=be(e),l=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,u=0,s=0;if(l){o=l.width,i=l.height;const d=Ku();(!d||d&&t==="fixed")&&(u=l.offsetLeft,s=l.offsetTop)}const a=co(r);if(a<=0){const d=r.ownerDocument,f=d.body,m=getComputedStyle(f),v=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-v);g<=ya&&(o-=g)}else a<=ya&&(o+=a);return{width:o,height:i,x:u,y:s}}function mv(e,t){const n=bt(e,!0,t==="fixed"),r=n.top+e.clientTop,l=n.left+e.clientLeft,o=pt(e)?En(e):Ze(1),i=e.clientWidth*o.x,u=e.clientHeight*o.y,s=l*o.x,a=r*o.y;return{width:i,height:u,x:s,y:a}}function wa(e,t,n){let r;if(t==="viewport")r=hv(e,n);else if(t==="document")r=pv(be(e));else if(Ve(t))r=mv(t,n);else{const l=ed(e);r={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return $l(r)}function nd(e,t){const n=Dt(e);return n===t||!Ve(n)||zn(n)?!1:He(n).position==="fixed"||nd(n,t)}function vv(e,t){const n=t.get(e);if(n)return n;let r=_r(e,[],!1).filter(u=>Ve(u)&&Un(u)!=="body"),l=null;const o=He(e).position==="fixed";let i=o?Dt(e):e;for(;Ve(i)&&!zn(i);){const u=He(i),s=Qu(i);!s&&u.position==="fixed"&&(l=null),(o?!s&&!l:!s&&u.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||zr(i)&&!s&&nd(e,i))?r=r.filter(d=>d!==i):l=u,i=Dt(i)}return t.set(e,r),r}function gv(e){let{element:t,boundary:n,rootBoundary:r,strategy:l}=e;const i=[...n==="clippingAncestors"?so(t)?[]:vv(t,this._c):[].concat(n),r],u=wa(t,i[0],l);let s=u.top,a=u.right,d=u.bottom,f=u.left;for(let m=1;m{i(!1,1e-7)},1e3)}_===1&&!ld(a,e.getBoundingClientRect())&&i(),y=!1}try{n=new IntersectionObserver(x,{...h,root:l.ownerDocument})}catch{n=new IntersectionObserver(x,h)}n.observe(e)}return i(!0),o}function Hv(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:l=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,a=Xu(e),d=l||o?[...a?_r(a):[],...t?_r(t):[]]:[];d.forEach(p=>{l&&p.addEventListener("scroll",n,{passive:!0}),o&&p.addEventListener("resize",n)});const f=a&&u?Ev(a,n):null;let m=-1,v=null;i&&(v=new ResizeObserver(p=>{let[c]=p;c&&c.target===a&&v&&t&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var h;(h=v)==null||h.observe(t)})),n()}),a&&!s&&v.observe(a),t&&v.observe(t));let g,w=s?bt(e):null;s&&S();function S(){const p=bt(e);w&&!ld(w,p)&&n(),w=p,g=requestAnimationFrame(S)}return n(),()=>{var p;d.forEach(c=>{l&&c.removeEventListener("scroll",n),o&&c.removeEventListener("resize",n)}),f==null||f(),(p=v)==null||p.disconnect(),v=null,s&&cancelAnimationFrame(g)}}const Cv=tv,Pv=nv,_v=qm,Rv=lv,Lv=bm,xa=Zm,Nv=rv,Ov=(e,t,n)=>{const r=new Map,l={platform:kv,...n},o={...l.platform,_c:r};return Jm(e,t,{...l,platform:o})};var Tv=typeof document<"u",zv=function(){},fl=Tv?k.useLayoutEffect:zv;function Bl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Bl(e[r],t[r]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,l[r]))return!1;for(r=n;r--!==0;){const o=l[r];if(!(o==="_owner"&&e.$$typeof)&&!Bl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function od(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ka(e,t){const n=od(e);return Math.round(t*n)/n}function Wo(e){const t=k.useRef(e);return fl(()=>{t.current=e}),t}function Qv(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:l,elements:{reference:o,floating:i}={},transform:u=!0,whileElementsMounted:s,open:a}=e,[d,f]=k.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=k.useState(r);Bl(m,r)||v(r);const[g,w]=k.useState(null),[S,p]=k.useState(null),c=k.useCallback(C=>{C!==P.current&&(P.current=C,w(C))},[]),h=k.useCallback(C=>{C!==_.current&&(_.current=C,p(C))},[]),y=o||g,x=i||S,P=k.useRef(null),_=k.useRef(null),R=k.useRef(d),M=s!=null,N=Wo(s),A=Wo(l),q=Wo(a),J=k.useCallback(()=>{if(!P.current||!_.current)return;const C={placement:t,strategy:n,middleware:m};A.current&&(C.platform=A.current),Ov(P.current,_.current,C).then(O=>{const T={...O,isPositioned:q.current!==!1};Q.current&&!Bl(R.current,T)&&(R.current=T,Iu.flushSync(()=>{f(T)}))})},[m,t,n,A,q]);fl(()=>{a===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(C=>({...C,isPositioned:!1})))},[a]);const Q=k.useRef(!1);fl(()=>(Q.current=!0,()=>{Q.current=!1}),[]),fl(()=>{if(y&&(P.current=y),x&&(_.current=x),y&&x){if(N.current)return N.current(y,x,J);J()}},[y,x,J,N,M]);const Ne=k.useMemo(()=>({reference:P,floating:_,setReference:c,setFloating:h}),[c,h]),X=k.useMemo(()=>({reference:y,floating:x}),[y,x]),te=k.useMemo(()=>{const C={position:n,left:0,top:0};if(!X.floating)return C;const O=ka(X.floating,d.x),T=ka(X.floating,d.y);return u?{...C,transform:"translate("+O+"px, "+T+"px)",...od(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:T}},[n,u,X.floating,d.x,d.y]);return k.useMemo(()=>({...d,update:J,refs:Ne,elements:X,floatingStyles:te}),[d,J,Ne,X,te])}const Mv=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:l}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?xa({element:r.current,padding:l}).fn(n):{}:r?xa({element:r,padding:l}).fn(n):{}}}},Kv=(e,t)=>{const n=Cv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xv=(e,t)=>{const n=Pv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yv=(e,t)=>({fn:Nv(e).fn,options:[e,t]}),Gv=(e,t)=>{const n=_v(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jv=(e,t)=>{const n=Rv(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zv=(e,t)=>{const n=Lv(e);return{name:n.name,fn:n.fn,options:[e,t]}},qv=(e,t)=>{const n=Mv(e);return{name:n.name,fn:n.fn,options:[e,t]}};export{Bv as B,Fm as L,Wv as N,Uv as O,Ed as R,Iu as a,Jv as b,qv as c,Hv as d,Bu as e,Gv as f,nn as g,Zv as h,Vv as i,Dv as j,kd as k,Yv as l,Fv as m,$v as n,Kv as o,Em as p,jv as q,k as r,Xv as s,Zu as t,Qv as u,Av as v,Iv as w,Ea as x}; diff --git a/embed_static/static/spa/assets/react-vendor-BdyZmpPe.js b/embed_static/static/spa/assets/react-vendor-BdyZmpPe.js new file mode 100644 index 0000000..faa5959 --- /dev/null +++ b/embed_static/static/spa/assets/react-vendor-BdyZmpPe.js @@ -0,0 +1,68 @@ +function yf(e,t){for(var n=0;nr[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function wf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Sf={exports:{}},ri={},xf={exports:{}},G={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ml=Symbol.for("react.element"),Rh=Symbol.for("react.portal"),Ph=Symbol.for("react.fragment"),_h=Symbol.for("react.strict_mode"),Lh=Symbol.for("react.profiler"),Th=Symbol.for("react.provider"),Dh=Symbol.for("react.context"),Nh=Symbol.for("react.forward_ref"),Mh=Symbol.for("react.suspense"),Oh=Symbol.for("react.memo"),zh=Symbol.for("react.lazy"),Ls=Symbol.iterator;function Fh(e){return e===null||typeof e!="object"?null:(e=Ls&&e[Ls]||e["@@iterator"],typeof e=="function"?e:null)}var Ef={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kf=Object.assign,Cf={};function Mr(e,t,n){this.props=e,this.context=t,this.refs=Cf,this.updater=n||Ef}Mr.prototype.isReactComponent={};Mr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Mr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rf(){}Rf.prototype=Mr.prototype;function su(e,t,n){this.props=e,this.context=t,this.refs=Cf,this.updater=n||Ef}var cu=su.prototype=new Rf;cu.constructor=su;kf(cu,Mr.prototype);cu.isPureReactComponent=!0;var Ts=Array.isArray,Pf=Object.prototype.hasOwnProperty,fu={current:null},_f={key:!0,ref:!0,__self:!0,__source:!0};function Lf(e,t,n){var r,l={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Pf.call(t,r)&&!_f.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,le=L[re];if(0>>1;rel(Ae,V))Iel(ot,Ae)?(L[re]=ot,L[Ie]=V,re=Ie):(L[re]=Ae,L[Ge]=V,re=Ge);else if(Iel(ot,V))L[re]=ot,L[Ie]=V,re=Ie;else break e}}return U}function l(L,U){var V=L.sortIndex-U.sortIndex;return V!==0?V:L.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var u=[],s=[],f=1,c=null,p=3,v=!1,w=!1,S=!1,P=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var U=n(s);U!==null;){if(U.callback===null)r(s);else if(U.startTime<=L)r(s),U.sortIndex=U.expirationTime,t(u,U);else break;U=n(s)}}function E(L){if(S=!1,m(L),!w)if(n(u)!==null)w=!0,oe(R);else{var U=n(s);U!==null&&de(E,U.startTime-L)}}function R(L,U){w=!1,S&&(S=!1,h(_),_=-1),v=!0;var V=p;try{for(m(U),c=n(u);c!==null&&(!(c.expirationTime>U)||L&&!H());){var re=c.callback;if(typeof re=="function"){c.callback=null,p=c.priorityLevel;var le=re(c.expirationTime<=U);U=e.unstable_now(),typeof le=="function"?c.callback=le:c===n(u)&&r(u),m(U)}else r(u);c=n(u)}if(c!==null)var dt=!0;else{var Ge=n(s);Ge!==null&&de(E,Ge.startTime-U),dt=!1}return dt}finally{c=null,p=V,v=!1}}var T=!1,y=null,_=-1,I=5,M=-1;function H(){return!(e.unstable_now()-ML||125re?(L.sortIndex=V,t(s,L),n(u)===null&&L===n(s)&&(S?(h(_),_=-1):S=!0,de(E,V-re))):(L.sortIndex=le,t(u,L),w||v||(w=!0,oe(R))),L},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(L){var U=p;return function(){var V=p;p=U;try{return L.apply(this,arguments)}finally{p=V}}}})(Of);Mf.exports=Of;var Xh=Mf.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Gh=C,nt=Xh;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sa=Object.prototype.hasOwnProperty,Jh=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ms={},Os={};function Zh(e){return sa.call(Os,e)?!0:sa.call(Ms,e)?!1:Jh.test(e)?Os[e]=!0:(Ms[e]=!0,!1)}function qh(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bh(e,t,n,r){if(t===null||typeof t>"u"||qh(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ve(e,t,n,r,l,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Ne={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ne[e]=new Ve(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ne[t]=new Ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ne[e]=new Ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ne[e]=new Ve(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ne[e]=new Ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ne[e]=new Ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ne[e]=new Ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ne[e]=new Ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ne[e]=new Ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var pu=/[\-:]([a-z])/g;function hu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(pu,hu);Ne[t]=new Ve(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(pu,hu);Ne[t]=new Ve(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(pu,hu);Ne[t]=new Ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ne[e]=new Ve(e,1,!1,e.toLowerCase(),null,!1,!1)});Ne.xlinkHref=new Ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ne[e]=new Ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function mu(e,t,n,r){var l=Ne.hasOwnProperty(t)?Ne[t]:null;(l!==null?l.type!==0:r||!(2a||l[i]!==o[a]){var u=` +`+l[i].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=i&&0<=a);break}}}finally{Oi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qr(e):""}function em(e){switch(e.tag){case 5:return qr(e.type);case 16:return qr("Lazy");case 13:return qr("Suspense");case 19:return qr("SuspenseList");case 0:case 2:case 15:return e=zi(e.type,!1),e;case 11:return e=zi(e.type.render,!1),e;case 1:return e=zi(e.type,!0),e;default:return""}}function pa(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lr:return"Fragment";case rr:return"Portal";case ca:return"Profiler";case vu:return"StrictMode";case fa:return"Suspense";case da:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Af:return(e.displayName||"Context")+".Consumer";case Ff:return(e._context.displayName||"Context")+".Provider";case gu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yu:return t=e.displayName||null,t!==null?t:pa(e.type)||"Memo";case tn:t=e._payload,e=e._init;try{return pa(e(t))}catch{}}return null}function tm(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pa(t);case 8:return t===vu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function nm(e){var t=Uf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xl(e){e._valueTracker||(e._valueTracker=nm(e))}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Uf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Po(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ha(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Bf(e,t){t=t.checked,t!=null&&mu(e,"checked",t,!1)}function ma(e,t){Bf(e,t);var n=gn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?va(e,t.type,n):t.hasOwnProperty("defaultValue")&&va(e,t.type,gn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function As(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function va(e,t,n){(t!=="number"||Po(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var br=Array.isArray;function mr(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Gl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rm=["Webkit","ms","Moz","O"];Object.keys(rl).forEach(function(e){rm.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),rl[t]=rl[e]})});function Hf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||rl.hasOwnProperty(e)&&rl[e]?(""+t).trim():t+"px"}function Qf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Hf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var lm=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wa(e,t){if(t){if(lm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function Sa(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xa=null;function wu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ea=null,vr=null,gr=null;function js(e){if(e=Fl(e)){if(typeof Ea!="function")throw Error(N(280));var t=e.stateNode;t&&(t=ui(t),Ea(e.stateNode,e.type,t))}}function Kf(e){vr?gr?gr.push(e):gr=[e]:vr=e}function Yf(){if(vr){var e=vr,t=gr;if(gr=vr=null,js(e),t)for(e=0;e>>=0,e===0?32:31-(mm(e)/vm|0)|0}var Jl=64,Zl=4194304;function el(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Do(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~l;a!==0?r=el(a):(o&=i,o!==0&&(r=el(o)))}else i=n&~l,i!==0?r=el(i):o!==0&&(r=el(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ol(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function Sm(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ol),Xs=" ",Gs=!1;function pd(e,t){switch(e){case"keyup":return Xm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var or=!1;function Jm(e,t){switch(e){case"compositionend":return hd(t);case"keypress":return t.which!==32?null:(Gs=!0,Xs);case"textInput":return e=t.data,e===Xs&&Gs?null:e;default:return null}}function Zm(e,t){if(or)return e==="compositionend"||!_u&&pd(e,t)?(e=fd(),mo=Cu=on=null,or=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=bs(n)}}function yd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wd(){for(var e=window,t=Po();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Po(e.document)}return t}function Lu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function iv(e){var t=wd(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yd(n.ownerDocument.documentElement,n)){if(r!==null&&Lu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=ec(n,o);var i=ec(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ir=null,La=null,al=null,Ta=!1;function tc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ta||ir==null||ir!==Po(r)||(r=ir,"selectionStart"in r&&Lu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),al&&wl(al,r)||(al=r,r=Oo(La,"onSelect"),0sr||(e.current=Fa[sr],Fa[sr]=null,sr--)}function ae(e,t){sr++,Fa[sr]=e.current,e.current=t}var yn={},Fe=En(yn),Ke=En(!1),jn=yn;function kr(e,t){var n=e.type.contextTypes;if(!n)return yn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ye(e){return e=e.childContextTypes,e!=null}function Fo(){se(Ke),se(Fe)}function uc(e,t,n){if(Fe.current!==yn)throw Error(N(168));ae(Fe,t),ae(Ke,n)}function Ld(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(N(108,tm(e)||"Unknown",l));return me({},n,r)}function Ao(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yn,jn=Fe.current,ae(Fe,e),ae(Ke,Ke.current),!0}function sc(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Ld(e,t,jn),r.__reactInternalMemoizedMergedChildContext=e,se(Ke),se(Fe),ae(Fe,e)):se(Ke),ae(Ke,n)}var It=null,si=!1,Xi=!1;function Td(e){It===null?It=[e]:It.push(e)}function yv(e){si=!0,Td(e)}function kn(){if(!Xi&&It!==null){Xi=!0;var e=0,t=ne;try{var n=It;for(ne=1;e>=i,l-=i,Ut=1<<32-yt(t)+l|n<_?(I=y,y=null):I=y.sibling;var M=p(h,y,m[_],E);if(M===null){y===null&&(y=I);break}e&&y&&M.alternate===null&&t(h,y),d=o(M,d,_),T===null?R=M:T.sibling=M,T=M,y=I}if(_===m.length)return n(h,y),fe&&Tn(h,_),R;if(y===null){for(;__?(I=y,y=null):I=y.sibling;var H=p(h,y,M.value,E);if(H===null){y===null&&(y=I);break}e&&y&&H.alternate===null&&t(h,y),d=o(H,d,_),T===null?R=H:T.sibling=H,T=H,y=I}if(M.done)return n(h,y),fe&&Tn(h,_),R;if(y===null){for(;!M.done;_++,M=m.next())M=c(h,M.value,E),M!==null&&(d=o(M,d,_),T===null?R=M:T.sibling=M,T=M);return fe&&Tn(h,_),R}for(y=r(h,y);!M.done;_++,M=m.next())M=v(y,h,_,M.value,E),M!==null&&(e&&M.alternate!==null&&y.delete(M.key===null?_:M.key),d=o(M,d,_),T===null?R=M:T.sibling=M,T=M);return e&&y.forEach(function(Y){return t(h,Y)}),fe&&Tn(h,_),R}function P(h,d,m,E){if(typeof m=="object"&&m!==null&&m.type===lr&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Yl:e:{for(var R=m.key,T=d;T!==null;){if(T.key===R){if(R=m.type,R===lr){if(T.tag===7){n(h,T.sibling),d=l(T,m.props.children),d.return=h,h=d;break e}}else if(T.elementType===R||typeof R=="object"&&R!==null&&R.$$typeof===tn&&dc(R)===T.type){n(h,T.sibling),d=l(T,m.props),d.ref=Yr(h,T,m),d.return=h,h=d;break e}n(h,T);break}else t(h,T);T=T.sibling}m.type===lr?(d=Un(m.props.children,h.mode,E,m.key),d.return=h,h=d):(E=ko(m.type,m.key,m.props,null,h.mode,E),E.ref=Yr(h,d,m),E.return=h,h=E)}return i(h);case rr:e:{for(T=m.key;d!==null;){if(d.key===T)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(h,d.sibling),d=l(d,m.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=na(m,h.mode,E),d.return=h,h=d}return i(h);case tn:return T=m._init,P(h,d,T(m._payload),E)}if(br(m))return w(h,d,m,E);if(Vr(m))return S(h,d,m,E);lo(h,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(h,d.sibling),d=l(d,m),d.return=h,h=d):(n(h,d),d=ta(m,h.mode,E),d.return=h,h=d),i(h)):n(h,d)}return P}var Rr=Od(!0),zd=Od(!1),jo=En(null),Bo=null,dr=null,Mu=null;function Ou(){Mu=dr=Bo=null}function zu(e){var t=jo.current;se(jo),e._currentValue=t}function Ua(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function wr(e,t){Bo=e,Mu=dr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function ct(e){var t=e._currentValue;if(Mu!==e)if(e={context:e,memoizedValue:t,next:null},dr===null){if(Bo===null)throw Error(N(308));dr=e,Bo.dependencies={lanes:0,firstContext:e}}else dr=dr.next=e;return t}var zn=null;function Fu(e){zn===null?zn=[e]:zn.push(e)}function Fd(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Fu(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ht(e,r)}function Ht(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var nn=!1;function Au(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ad(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ht(e,n)}return l=r.interleaved,l===null?(t.next=t,Fu(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ht(e,n)}function go(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xu(e,n)}}function pc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?l=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?l=o=t:o=o.next=t}else l=o=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function $o(e,t,n,r){var l=e.updateQueue;nn=!1;var o=l.firstBaseUpdate,i=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,s=u.next;u.next=null,i===null?o=s:i.next=s,i=u;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==i&&(a===null?f.firstBaseUpdate=s:a.next=s,f.lastBaseUpdate=u))}if(o!==null){var c=l.baseState;i=0,f=s=u=null,a=o;do{var p=a.lane,v=a.eventTime;if((r&p)===p){f!==null&&(f=f.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,S=a;switch(p=t,v=n,S.tag){case 1:if(w=S.payload,typeof w=="function"){c=w.call(v,c,p);break e}c=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,p=typeof w=="function"?w.call(v,c,p):w,p==null)break e;c=me({},c,p);break e;case 2:nn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=l.effects,p===null?l.effects=[a]:p.push(a))}else v={eventTime:v,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(s=f=v,u=c):f=f.next=v,i|=p;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;p=a,a=p.next,p.next=null,l.lastBaseUpdate=p,l.shared.pending=null}}while(!0);if(f===null&&(u=c),l.baseState=u,l.firstBaseUpdate=s,l.lastBaseUpdate=f,t=l.shared.interleaved,t!==null){l=t;do i|=l.lane,l=l.next;while(l!==t)}else o===null&&(l.shared.lanes=0);Vn|=i,e.lanes=i,e.memoizedState=c}}function hc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ji.transition;Ji.transition={};try{e(!1),t()}finally{ne=n,Ji.transition=r}}function bd(){return ft().memoizedState}function Ev(e,t,n){var r=mn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ep(e))tp(t,n);else if(n=Fd(e,t,n,r),n!==null){var l=Be();wt(n,e,r,l),np(n,t,r)}}function kv(e,t,n){var r=mn(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ep(e))tp(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(l.hasEagerState=!0,l.eagerState=a,St(a,i)){var u=t.interleaved;u===null?(l.next=l,Fu(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Fd(e,t,l,r),n!==null&&(l=Be(),wt(n,e,r,l),np(n,t,r))}}function ep(e){var t=e.alternate;return e===he||t!==null&&t===he}function tp(e,t){ul=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function np(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xu(e,n)}}var Ho={readContext:ct,useCallback:Me,useContext:Me,useEffect:Me,useImperativeHandle:Me,useInsertionEffect:Me,useLayoutEffect:Me,useMemo:Me,useReducer:Me,useRef:Me,useState:Me,useDebugValue:Me,useDeferredValue:Me,useTransition:Me,useMutableSource:Me,useSyncExternalStore:Me,useId:Me,unstable_isNewReconciler:!1},Cv={readContext:ct,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:vc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wo(4194308,4,Xd.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wo(4194308,4,e,t)},useInsertionEffect:function(e,t){return wo(4,2,e,t)},useMemo:function(e,t){var n=Pt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Pt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Ev.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:mc,useDebugValue:Hu,useDeferredValue:function(e){return Pt().memoizedState=e},useTransition:function(){var e=mc(!1),t=e[0];return e=xv.bind(null,e[1]),Pt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,l=Pt();if(fe){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),_e===null)throw Error(N(349));$n&30||Bd(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,vc(Vd.bind(null,r,o,e),[e]),r.flags|=2048,_l(9,$d.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Pt(),t=_e.identifierPrefix;if(fe){var n=jt,r=Ut;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Rl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[_t]=t,e[El]=r,dp(e,t,!1,!1),t.stateNode=e;e:{switch(i=Sa(n,r),n){case"dialog":ue("cancel",e),ue("close",e),l=r;break;case"iframe":case"object":case"embed":ue("load",e),l=r;break;case"video":case"audio":for(l=0;lLr&&(t.flags|=128,r=!0,Xr(o,!1),t.lanes=4194304)}else{if(!r)if(e=Vo(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xr(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!fe)return Oe(t),null}else 2*Se()-o.renderingStartTime>Lr&&n!==1073741824&&(t.flags|=128,r=!0,Xr(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Se(),t.sibling=null,n=pe.current,ae(pe,r?n&1|2:n&1),t):(Oe(t),null);case 22:case 23:return Ju(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Je&1073741824&&(Oe(t),t.subtreeFlags&6&&(t.flags|=8192)):Oe(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function Mv(e,t){switch(Du(t),t.tag){case 1:return Ye(t.type)&&Fo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pr(),se(Ke),se(Fe),ju(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Uu(t),null;case 13:if(se(pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));Cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(pe),null;case 4:return Pr(),null;case 10:return zu(t.type._context),null;case 22:case 23:return Ju(),null;case 24:return null;default:return null}}var io=!1,ze=!1,Ov=typeof WeakSet=="function"?WeakSet:Set,z=null;function pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function Ya(e,t,n){try{n()}catch(r){we(e,t,r)}}var _c=!1;function zv(e,t){if(Da=No,e=wd(),Lu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,u=-1,s=0,f=0,c=e,p=null;t:for(;;){for(var v;c!==n||l!==0&&c.nodeType!==3||(a=i+l),c!==o||r!==0&&c.nodeType!==3||(u=i+r),c.nodeType===3&&(i+=c.nodeValue.length),(v=c.firstChild)!==null;)p=c,c=v;for(;;){if(c===e)break t;if(p===n&&++s===l&&(a=i),p===o&&++f===r&&(u=i),(v=c.nextSibling)!==null)break;c=p,p=c.parentNode}c=v}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Na={focusedElem:e,selectionRange:n},No=!1,z=t;z!==null;)if(t=z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,z=e;else for(;z!==null;){t=z;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,P=w.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?S:ht(t.type,S),P);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(E){we(t,t.return,E)}if(e=t.sibling,e!==null){e.return=t.return,z=e;break}z=t.return}return w=_c,_c=!1,w}function sl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Ya(t,n,o)}l=l.next}while(l!==r)}}function di(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Xa(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mp(e){var t=e.alternate;t!==null&&(e.alternate=null,mp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[_t],delete t[El],delete t[za],delete t[vv],delete t[gv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function vp(e){return e.tag===5||e.tag===3||e.tag===4}function Lc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vp(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ga(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=zo));else if(r!==4&&(e=e.child,e!==null))for(Ga(e,t,n),e=e.sibling;e!==null;)Ga(e,t,n),e=e.sibling}function Ja(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ja(e,t,n),e=e.sibling;e!==null;)Ja(e,t,n),e=e.sibling}var Te=null,mt=!1;function bt(e,t,n){for(n=n.child;n!==null;)gp(e,t,n),n=n.sibling}function gp(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(li,n)}catch{}switch(n.tag){case 5:ze||pr(n,t);case 6:var r=Te,l=mt;Te=null,bt(e,t,n),Te=r,mt=l,Te!==null&&(mt?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(mt?(e=Te,n=n.stateNode,e.nodeType===8?Yi(e.parentNode,n):e.nodeType===1&&Yi(e,n),gl(e)):Yi(Te,n.stateNode));break;case 4:r=Te,l=mt,Te=n.stateNode.containerInfo,mt=!0,bt(e,t,n),Te=r,mt=l;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Ya(n,t,i),l=l.next}while(l!==r)}bt(e,t,n);break;case 1:if(!ze&&(pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){we(n,t,a)}bt(e,t,n);break;case 21:bt(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,bt(e,t,n),ze=r):bt(e,t,n);break;default:bt(e,t,n)}}function Tc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ov),t.forEach(function(r){var l=Wv.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function pt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=Se()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Av(r/1960))-r,10e?16:e,an===null)var r=!1;else{if(e=an,an=null,Yo=0,q&6)throw Error(N(331));var l=q;for(q|=4,z=e.current;z!==null;){var o=z,i=o.child;if(z.flags&16){var a=o.deletions;if(a!==null){for(var u=0;uSe()-Xu?In(e,0):Yu|=n),Xe(e,t)}function Rp(e,t){t===0&&(e.mode&1?(t=Zl,Zl<<=1,!(Zl&130023424)&&(Zl=4194304)):t=1);var n=Be();e=Ht(e,t),e!==null&&(Ol(e,t,n),Xe(e,n))}function Vv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rp(e,n)}function Wv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Rp(e,n)}var Pp;Pp=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ke.current)Qe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Qe=!1,Dv(e,t,n);Qe=!!(e.flags&131072)}else Qe=!1,fe&&t.flags&1048576&&Dd(t,Uo,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;So(e,t),e=t.pendingProps;var l=kr(t,Fe.current);wr(t,n),l=$u(null,t,r,e,l,n);var o=Vu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ye(r)?(o=!0,Ao(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Au(t),l.updater=fi,t.stateNode=l,l._reactInternals=t,Ba(t,r,e,n),t=Wa(null,t,r,!0,o,n)):(t.tag=0,fe&&o&&Tu(t),je(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(So(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Qv(r),e=ht(r,e),l){case 0:t=Va(null,t,r,e,n);break e;case 1:t=Cc(null,t,r,e,n);break e;case 11:t=Ec(null,t,r,e,n);break e;case 14:t=kc(null,t,r,ht(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),Va(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),Cc(e,t,r,l,n);case 3:e:{if(sp(t),e===null)throw Error(N(387));r=t.pendingProps,o=t.memoizedState,l=o.element,Ad(e,t),$o(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=_r(Error(N(423)),t),t=Rc(e,t,r,n,l);break e}else if(r!==l){l=_r(Error(N(424)),t),t=Rc(e,t,r,n,l);break e}else for(be=dn(t.stateNode.containerInfo.firstChild),et=t,fe=!0,gt=null,n=zd(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Cr(),r===l){t=Qt(e,t,n);break e}je(e,t,r,n)}t=t.child}return t;case 5:return Id(t),e===null&&Ia(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Ma(r,l)?i=null:o!==null&&Ma(r,o)&&(t.flags|=32),up(e,t),je(e,t,i,n),t.child;case 6:return e===null&&Ia(t),null;case 13:return cp(e,t,n);case 4:return Iu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rr(t,null,r,n):je(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),Ec(e,t,r,l,n);case 7:return je(e,t,t.pendingProps,n),t.child;case 8:return je(e,t,t.pendingProps.children,n),t.child;case 12:return je(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,ae(jo,r._currentValue),r._currentValue=i,o!==null)if(St(o.value,i)){if(o.children===l.children&&!Ke.current){t=Qt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=Bt(-1,n&-n),u.tag=2;var s=o.updateQueue;if(s!==null){s=s.shared;var f=s.pending;f===null?u.next=u:(u.next=f.next,f.next=u),s.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Ua(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(N(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Ua(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}je(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,wr(t,n),l=ct(l),r=r(l),t.flags|=1,je(e,t,r,n),t.child;case 14:return r=t.type,l=ht(r,t.pendingProps),l=ht(r.type,l),kc(e,t,r,l,n);case 15:return ip(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ht(r,l),So(e,t),t.tag=1,Ye(r)?(e=!0,Ao(t)):e=!1,wr(t,n),rp(t,r,l),Ba(t,r,l,n),Wa(null,t,r,!0,e,n);case 19:return fp(e,t,n);case 22:return ap(e,t,n)}throw Error(N(156,t.tag))};function _p(e,t){return ed(e,t)}function Hv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ut(e,t,n,r){return new Hv(e,t,n,r)}function qu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qv(e){if(typeof e=="function")return qu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gu)return 11;if(e===yu)return 14}return 2}function vn(e,t){var n=e.alternate;return n===null?(n=ut(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ko(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")qu(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case lr:return Un(n.children,l,o,t);case vu:i=8,l|=8;break;case ca:return e=ut(12,n,t,l|2),e.elementType=ca,e.lanes=o,e;case fa:return e=ut(13,n,t,l),e.elementType=fa,e.lanes=o,e;case da:return e=ut(19,n,t,l),e.elementType=da,e.lanes=o,e;case If:return hi(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ff:i=10;break e;case Af:i=9;break e;case gu:i=11;break e;case yu:i=14;break e;case tn:i=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=ut(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function Un(e,t,n,r){return e=ut(7,e,r,t),e.lanes=n,e}function hi(e,t,n,r){return e=ut(22,e,r,t),e.elementType=If,e.lanes=n,e.stateNode={isHidden:!1},e}function ta(e,t,n){return e=ut(6,e,null,t),e.lanes=n,e}function na(e,t,n){return t=ut(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Kv(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ai(0),this.expirationTimes=Ai(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function bu(e,t,n,r,l,o,i,a,u){return e=new Kv(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ut(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Au(o),e}function Yv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Np)}catch(e){console.error(e)}}Np(),Nf.exports=rt;var wi=Nf.exports;const qv=wf(wi),bv=yf({__proto__:null,default:qv},[wi]);var Ic=wi;Ns.createRoot=Ic.createRoot,Ns.hydrateRoot=Ic.hydrateRoot;/** + * @remix-run/router v1.23.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function tg(){return Math.random().toString(36).substr(2,8)}function jc(e,t){return{usr:e.state,key:e.key,idx:t}}function Tl(e,t,n,r){return n===void 0&&(n=null),ce({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Cn(t):t,{state:n,key:t&&t.key||r||tg()})}function Qn(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Cn(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ng(e,t,n,r){r===void 0&&(r={});let{window:l=document.defaultView,v5Compat:o=!1}=r,i=l.history,a=Ee.Pop,u=null,s=f();s==null&&(s=0,i.replaceState(ce({},i.state,{idx:s}),""));function f(){return(i.state||{idx:null}).idx}function c(){a=Ee.Pop;let P=f(),h=P==null?null:P-s;s=P,u&&u({action:a,location:S.location,delta:h})}function p(P,h){a=Ee.Push;let d=Tl(S.location,P,h);s=f()+1;let m=jc(d,s),E=S.createHref(d);try{i.pushState(m,"",E)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;l.location.assign(E)}o&&u&&u({action:a,location:S.location,delta:1})}function v(P,h){a=Ee.Replace;let d=Tl(S.location,P,h);s=f();let m=jc(d,s),E=S.createHref(d);i.replaceState(m,"",E),o&&u&&u({action:a,location:S.location,delta:0})}function w(P){let h=l.location.origin!=="null"?l.location.origin:l.location.href,d=typeof P=="string"?P:Qn(P);return d=d.replace(/ $/,"%20"),Q(h,"No window.location.(origin|href) available to create URL for href: "+d),new URL(d,h)}let S={get action(){return a},get location(){return e(l,i)},listen(P){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(Uc,c),u=P,()=>{l.removeEventListener(Uc,c),u=null}},createHref(P){return t(l,P)},createURL:w,encodeLocation(P){let h=w(P);return{pathname:h.pathname,search:h.search,hash:h.hash}},push:p,replace:v,go(P){return i.go(P)}};return S}var te;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(te||(te={}));const rg=new Set(["lazy","caseSensitive","path","id","index","children"]);function lg(e){return e.index===!0}function Jo(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((l,o)=>{let i=[...n,String(o)],a=typeof l.id=="string"?l.id:i.join("-");if(Q(l.index!==!0||!l.children,"Cannot specify children on an index route"),Q(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),lg(l)){let u=ce({},l,t(l),{id:a});return r[a]=u,u}else{let u=ce({},l,t(l),{id:a,children:void 0});return r[a]=u,l.children&&(u.children=Jo(l.children,t,i,r)),u}})}function Nn(e,t,n){return n===void 0&&(n="/"),Co(e,t,n,!1)}function Co(e,t,n,r){let l=typeof t=="string"?Cn(t):t,o=xt(l.pathname||"/",n);if(o==null)return null;let i=Mp(e);ig(i);let a=null,u=gg(o);for(let s=0;a==null&&s{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};u.relativePath.startsWith("/")&&(Q(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let s=$t([r,u.relativePath]),f=n.concat(u);o.children&&o.children.length>0&&(Q(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+s+'".')),Mp(o.children,t,f,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:pg(s,o.index),routesMeta:f})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))l(o,i);else for(let u of Op(o.path))l(o,i,u)}),t}function Op(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,l=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return l?[o,""]:[o];let i=Op(r.join("/")),a=[];return a.push(...i.map(u=>u===""?o:[o,u].join("/"))),l&&a.push(...i),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function ig(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:hg(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const ag=/^:[\w-]+$/,ug=3,sg=2,cg=1,fg=10,dg=-2,Bc=e=>e==="*";function pg(e,t){let n=e.split("/"),r=n.length;return n.some(Bc)&&(r+=dg),t&&(r+=sg),n.filter(l=>!Bc(l)).reduce((l,o)=>l+(ag.test(o)?ug:o===""?cg:fg),r)}function hg(e,t){return e.length===t.length&&e.slice(0,-1).every((r,l)=>r===t[l])?e[e.length-1]-t[t.length-1]:0}function mg(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,l={},o="/",i=[];for(let a=0;a{let{paramName:p,isOptional:v}=f;if(p==="*"){let S=a[c]||"";i=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const w=a[c];return v&&!w?s[p]=void 0:s[p]=(w||"").replace(/%2F/g,"/"),s},{}),pathname:o,pathnameBase:i,pattern:e}}function vg(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Hn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,u)=>(r.push({paramName:a,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),r]}function gg(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xt(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const yg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wg=e=>yg.test(e);function Sg(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:l=""}=typeof e=="string"?Cn(e):e,o;if(n)if(wg(n))o=n;else{if(n.includes("//")){let i=n;n=rs(n),Hn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(i+" -> "+n))}n.startsWith("/")?o=$c(n.substring(1),"/"):o=$c(n,t)}else o=t;return{pathname:o,search:Eg(r),hash:kg(l)}}function $c(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?n.length>1&&n.pop():l!=="."&&n.push(l)}),n.length>1?n.join("/"):"/"}function ra(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function zp(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Si(e,t){let n=zp(e);return t?n.map((r,l)=>l===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function xi(e,t,n,r){r===void 0&&(r=!1);let l;typeof e=="string"?l=Cn(e):(l=ce({},e),Q(!l.pathname||!l.pathname.includes("?"),ra("?","pathname","search",l)),Q(!l.pathname||!l.pathname.includes("#"),ra("#","pathname","hash",l)),Q(!l.search||!l.search.includes("#"),ra("#","search","hash",l)));let o=e===""||l.pathname==="",i=o?"/":l.pathname,a;if(i==null)a=n;else{let c=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),c-=1;l.pathname=p.join("/")}a=c>=0?t[c]:"/"}let u=Sg(l,a),s=i&&i!=="/"&&i.endsWith("/"),f=(o||i===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(s||f)&&(u.pathname+="/"),u}const rs=e=>e.replace(/\/\/+/g,"/"),$t=e=>rs(e.join("/")),xg=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Eg=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kg=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class qo{constructor(t,n,r,l){l===void 0&&(l=!1),this.status=t,this.statusText=n||"",this.internal=l,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Dl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Fp=["post","put","patch","delete"],Cg=new Set(Fp),Rg=["get",...Fp],Pg=new Set(Rg),_g=new Set([301,302,303,307,308]),Lg=new Set([307,308]),la={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tg={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nr={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},ls=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dg=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Ap="remix-router-transitions";function Ng(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Q(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let l;if(e.mapRouteProperties)l=e.mapRouteProperties;else if(e.detectErrorBoundary){let g=e.detectErrorBoundary;l=x=>({hasErrorBoundary:g(x)})}else l=Dg;let o={},i=Jo(e.routes,l,void 0,o),a,u=e.basename||"/",s=e.dataStrategy||Fg,f=e.patchRoutesOnNavigation,c=ce({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),p=null,v=new Set,w=null,S=null,P=null,h=e.hydrationData!=null,d=Nn(i,e.history.location,u),m=!1,E=null;if(d==null&&!f){let g=We(404,{pathname:e.history.location.pathname}),{matches:x,route:k}=qc(i);d=x,E={[k.id]:g}}d&&!e.hydrationData&&Vl(d,i,e.history.location.pathname).active&&(d=null);let R;if(d)if(d.some(g=>g.route.lazy))R=!1;else if(!d.some(g=>g.route.loader))R=!0;else if(c.v7_partialHydration){let g=e.hydrationData?e.hydrationData.loaderData:null,x=e.hydrationData?e.hydrationData.errors:null;if(x){let k=d.findIndex(D=>x[D.route.id]!==void 0);R=d.slice(0,k+1).every(D=>!nu(D.route,g,x))}else R=d.every(k=>!nu(k.route,g,x))}else R=e.hydrationData!=null;else if(R=!1,d=[],c.v7_partialHydration){let g=Vl(null,i,e.history.location.pathname);g.active&&g.matches&&(m=!0,d=g.matches)}let T,y={historyAction:e.history.action,location:e.history.location,matches:d,initialized:R,navigation:la,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||E,fetchers:new Map,blockers:new Map},_=Ee.Pop,I=!1,M,H=!1,Y=new Map,J=null,X=!1,ve=!1,oe=[],de=new Set,L=new Map,U=0,V=-1,re=new Map,le=new Set,dt=new Map,Ge=new Map,Ae=new Set,Ie=new Map,ot=new Map,jl;function uh(){if(p=e.history.listen(g=>{let{action:x,location:k,delta:D}=g;if(jl){jl(),jl=void 0;return}Hn(ot.size===0||D!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let O=Cs({currentLocation:y.location,nextLocation:k,historyAction:x});if(O&&D!=null){let $=new Promise(W=>{jl=W});e.history.go(D*-1),$l(O,{state:"blocked",location:k,proceed(){$l(O,{state:"proceeding",proceed:void 0,reset:void 0,location:k}),$.then(()=>e.history.go(D))},reset(){let W=new Map(y.blockers);W.set(O,nr),Ue({blockers:W})}});return}return Rn(x,k)}),n){Gg(t,Y);let g=()=>Jg(t,Y);t.addEventListener("pagehide",g),J=()=>t.removeEventListener("pagehide",g)}return y.initialized||Rn(Ee.Pop,y.location,{initialHydration:!0}),T}function sh(){p&&p(),J&&J(),v.clear(),M&&M.abort(),y.fetchers.forEach((g,x)=>Bl(x)),y.blockers.forEach((g,x)=>ks(x))}function ch(g){return v.add(g),()=>v.delete(g)}function Ue(g,x){x===void 0&&(x={}),y=ce({},y,g);let k=[],D=[];c.v7_fetcherPersist&&y.fetchers.forEach((O,$)=>{O.state==="idle"&&(Ae.has($)?D.push($):k.push($))}),Ae.forEach(O=>{!y.fetchers.has(O)&&!L.has(O)&&D.push(O)}),[...v].forEach(O=>O(y,{deletedFetchers:D,viewTransitionOpts:x.viewTransitionOpts,flushSync:x.flushSync===!0})),c.v7_fetcherPersist?(k.forEach(O=>y.fetchers.delete(O)),D.forEach(O=>Bl(O))):D.forEach(O=>Ae.delete(O))}function Jn(g,x,k){var D,O;let{flushSync:$}=k===void 0?{}:k,W=y.actionData!=null&&y.navigation.formMethod!=null&&vt(y.navigation.formMethod)&&y.navigation.state==="loading"&&((D=g.state)==null?void 0:D._isRedirect)!==!0,A;x.actionData?Object.keys(x.actionData).length>0?A=x.actionData:A=null:W?A=y.actionData:A=null;let j=x.loaderData?Jc(y.loaderData,x.loaderData,x.matches||[],x.errors):y.loaderData,F=y.blockers;F.size>0&&(F=new Map(F),F.forEach((Z,Le)=>F.set(Le,nr)));let B=I===!0||y.navigation.formMethod!=null&&vt(y.navigation.formMethod)&&((O=g.state)==null?void 0:O._isRedirect)!==!0;a&&(i=a,a=void 0),X||_===Ee.Pop||(_===Ee.Push?e.history.push(g,g.state):_===Ee.Replace&&e.history.replace(g,g.state));let K;if(_===Ee.Pop){let Z=Y.get(y.location.pathname);Z&&Z.has(g.pathname)?K={currentLocation:y.location,nextLocation:g}:Y.has(g.pathname)&&(K={currentLocation:g,nextLocation:y.location})}else if(H){let Z=Y.get(y.location.pathname);Z?Z.add(g.pathname):(Z=new Set([g.pathname]),Y.set(y.location.pathname,Z)),K={currentLocation:y.location,nextLocation:g}}Ue(ce({},x,{actionData:A,loaderData:j,historyAction:_,location:g,initialized:!0,navigation:la,revalidation:"idle",restoreScrollPosition:Ps(g,x.matches||y.matches),preventScrollReset:B,blockers:F}),{viewTransitionOpts:K,flushSync:$===!0}),_=Ee.Pop,I=!1,H=!1,X=!1,ve=!1,oe=[]}async function vs(g,x){if(typeof g=="number"){e.history.go(g);return}let k=tu(y.location,y.matches,u,c.v7_prependBasename,g,c.v7_relativeSplatPath,x==null?void 0:x.fromRouteId,x==null?void 0:x.relative),{path:D,submission:O,error:$}=Vc(c.v7_normalizeFormMethod,!1,k,x),W=y.location,A=Tl(y.location,D,x&&x.state);A=ce({},A,e.history.encodeLocation(A));let j=x&&x.replace!=null?x.replace:void 0,F=Ee.Push;j===!0?F=Ee.Replace:j===!1||O!=null&&vt(O.formMethod)&&O.formAction===y.location.pathname+y.location.search&&(F=Ee.Replace);let B=x&&"preventScrollReset"in x?x.preventScrollReset===!0:void 0,K=(x&&x.flushSync)===!0,Z=Cs({currentLocation:W,nextLocation:A,historyAction:F});if(Z){$l(Z,{state:"blocked",location:A,proceed(){$l(Z,{state:"proceeding",proceed:void 0,reset:void 0,location:A}),vs(g,x)},reset(){let Le=new Map(y.blockers);Le.set(Z,nr),Ue({blockers:Le})}});return}return await Rn(F,A,{submission:O,pendingError:$,preventScrollReset:B,replace:x&&x.replace,enableViewTransition:x&&x.viewTransition,flushSync:K})}function fh(){if(_i(),Ue({revalidation:"loading"}),y.navigation.state!=="submitting"){if(y.navigation.state==="idle"){Rn(y.historyAction,y.location,{startUninterruptedRevalidation:!0});return}Rn(_||y.historyAction,y.navigation.location,{overrideNavigation:y.navigation,enableViewTransition:H===!0})}}async function Rn(g,x,k){M&&M.abort(),M=null,_=g,X=(k&&k.startUninterruptedRevalidation)===!0,xh(y.location,y.matches),I=(k&&k.preventScrollReset)===!0,H=(k&&k.enableViewTransition)===!0;let D=a||i,O=k&&k.overrideNavigation,$=k!=null&&k.initialHydration&&y.matches&&y.matches.length>0&&!m?y.matches:Nn(D,x,u),W=(k&&k.flushSync)===!0;if($&&y.initialized&&!ve&&$g(y.location,x)&&!(k&&k.submission&&vt(k.submission.formMethod))){Jn(x,{matches:$},{flushSync:W});return}let A=Vl($,D,x.pathname);if(A.active&&A.matches&&($=A.matches),!$){let{error:ie,notFoundMatches:ee,route:ge}=Li(x.pathname);Jn(x,{matches:ee,loaderData:{},errors:{[ge.id]:ie}},{flushSync:W});return}M=new AbortController;let j=tr(e.history,x,M.signal,k&&k.submission),F;if(k&&k.pendingError)F=[Mn($).route.id,{type:te.error,error:k.pendingError}];else if(k&&k.submission&&vt(k.submission.formMethod)){let ie=await dh(j,x,k.submission,$,A.active,{replace:k.replace,flushSync:W});if(ie.shortCircuited)return;if(ie.pendingActionResult){let[ee,ge]=ie.pendingActionResult;if(Ze(ge)&&Dl(ge.error)&&ge.error.status===404){M=null,Jn(x,{matches:ie.matches,loaderData:{},errors:{[ee]:ge.error}});return}}$=ie.matches||$,F=ie.pendingActionResult,O=oa(x,k.submission),W=!1,A.active=!1,j=tr(e.history,j.url,j.signal)}let{shortCircuited:B,matches:K,loaderData:Z,errors:Le}=await ph(j,x,$,A.active,O,k&&k.submission,k&&k.fetcherSubmission,k&&k.replace,k&&k.initialHydration===!0,W,F);B||(M=null,Jn(x,ce({matches:K||$},Zc(F),{loaderData:Z,errors:Le})))}async function dh(g,x,k,D,O,$){$===void 0&&($={}),_i();let W=Yg(x,k);if(Ue({navigation:W},{flushSync:$.flushSync===!0}),O){let F=await Wl(D,x.pathname,g.signal);if(F.type==="aborted")return{shortCircuited:!0};if(F.type==="error"){let B=Mn(F.partialMatches).route.id;return{matches:F.partialMatches,pendingActionResult:[B,{type:te.error,error:F.error}]}}else if(F.matches)D=F.matches;else{let{notFoundMatches:B,error:K,route:Z}=Li(x.pathname);return{matches:B,pendingActionResult:[Z.id,{type:te.error,error:K}]}}}let A,j=nl(D,x);if(!j.route.action&&!j.route.lazy)A={type:te.error,error:We(405,{method:g.method,pathname:x.pathname,routeId:j.route.id})};else if(A=(await Ur("action",y,g,[j],D,null))[j.route.id],g.signal.aborted)return{shortCircuited:!0};if(An(A)){let F;return $&&$.replace!=null?F=$.replace:F=Yc(A.response.headers.get("Location"),new URL(g.url),u,e.history)===y.location.pathname+y.location.search,await Pn(g,A,!0,{submission:k,replace:F}),{shortCircuited:!0}}if(un(A))throw We(400,{type:"defer-action"});if(Ze(A)){let F=Mn(D,j.route.id);return($&&$.replace)!==!0&&(_=Ee.Push),{matches:D,pendingActionResult:[F.route.id,A]}}return{matches:D,pendingActionResult:[j.route.id,A]}}async function ph(g,x,k,D,O,$,W,A,j,F,B){let K=O||oa(x,$),Z=$||W||ef(K),Le=!X&&(!c.v7_partialHydration||!j);if(D){if(Le){let ye=gs(B);Ue(ce({navigation:K},ye!==void 0?{actionData:ye}:{}),{flushSync:F})}let b=await Wl(k,x.pathname,g.signal);if(b.type==="aborted")return{shortCircuited:!0};if(b.type==="error"){let ye=Mn(b.partialMatches).route.id;return{matches:b.partialMatches,loaderData:{},errors:{[ye]:b.error}}}else if(b.matches)k=b.matches;else{let{error:ye,notFoundMatches:qn,route:$r}=Li(x.pathname);return{matches:qn,loaderData:{},errors:{[$r.id]:ye}}}}let ie=a||i,[ee,ge]=Hc(e.history,y,k,Z,x,c.v7_partialHydration&&j===!0,c.v7_skipActionErrorRevalidation,ve,oe,de,Ae,dt,le,ie,u,B);if(Ti(b=>!(k&&k.some(ye=>ye.route.id===b))||ee&&ee.some(ye=>ye.route.id===b)),V=++U,ee.length===0&&ge.length===0){let b=xs();return Jn(x,ce({matches:k,loaderData:{},errors:B&&Ze(B[1])?{[B[0]]:B[1].error}:null},Zc(B),b?{fetchers:new Map(y.fetchers)}:{}),{flushSync:F}),{shortCircuited:!0}}if(Le){let b={};if(!D){b.navigation=K;let ye=gs(B);ye!==void 0&&(b.actionData=ye)}ge.length>0&&(b.fetchers=hh(ge)),Ue(b,{flushSync:F})}ge.forEach(b=>{qt(b.key),b.controller&&L.set(b.key,b.controller)});let Zn=()=>ge.forEach(b=>qt(b.key));M&&M.signal.addEventListener("abort",Zn);let{loaderResults:jr,fetcherResults:Ft}=await ys(y,k,ee,ge,g);if(g.signal.aborted)return{shortCircuited:!0};M&&M.signal.removeEventListener("abort",Zn),ge.forEach(b=>L.delete(b.key));let Ct=so(jr);if(Ct)return await Pn(g,Ct.result,!0,{replace:A}),{shortCircuited:!0};if(Ct=so(Ft),Ct)return le.add(Ct.key),await Pn(g,Ct.result,!0,{replace:A}),{shortCircuited:!0};let{loaderData:Di,errors:Br}=Gc(y,k,jr,B,ge,Ft,Ie);Ie.forEach((b,ye)=>{b.subscribe(qn=>{(qn||b.done)&&Ie.delete(ye)})}),c.v7_partialHydration&&j&&y.errors&&(Br=ce({},y.errors,Br));let _n=xs(),Hl=Es(V),Ql=_n||Hl||ge.length>0;return ce({matches:k,loaderData:Di,errors:Br},Ql?{fetchers:new Map(y.fetchers)}:{})}function gs(g){if(g&&!Ze(g[1]))return{[g[0]]:g[1].data};if(y.actionData)return Object.keys(y.actionData).length===0?null:y.actionData}function hh(g){return g.forEach(x=>{let k=y.fetchers.get(x.key),D=Jr(void 0,k?k.data:void 0);y.fetchers.set(x.key,D)}),new Map(y.fetchers)}function mh(g,x,k,D){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");qt(g);let O=(D&&D.flushSync)===!0,$=a||i,W=tu(y.location,y.matches,u,c.v7_prependBasename,k,c.v7_relativeSplatPath,x,D==null?void 0:D.relative),A=Nn($,W,u),j=Vl(A,$,W);if(j.active&&j.matches&&(A=j.matches),!A){zt(g,x,We(404,{pathname:W}),{flushSync:O});return}let{path:F,submission:B,error:K}=Vc(c.v7_normalizeFormMethod,!0,W,D);if(K){zt(g,x,K,{flushSync:O});return}let Z=nl(A,F),Le=(D&&D.preventScrollReset)===!0;if(B&&vt(B.formMethod)){vh(g,x,F,Z,A,j.active,O,Le,B);return}dt.set(g,{routeId:x,path:F}),gh(g,x,F,Z,A,j.active,O,Le,B)}async function vh(g,x,k,D,O,$,W,A,j){_i(),dt.delete(g);function F(xe){if(!xe.route.action&&!xe.route.lazy){let bn=We(405,{method:j.formMethod,pathname:k,routeId:x});return zt(g,x,bn,{flushSync:W}),!0}return!1}if(!$&&F(D))return;let B=y.fetchers.get(g);Zt(g,Xg(j,B),{flushSync:W});let K=new AbortController,Z=tr(e.history,k,K.signal,j);if($){let xe=await Wl(O,new URL(Z.url).pathname,Z.signal,g);if(xe.type==="aborted")return;if(xe.type==="error"){zt(g,x,xe.error,{flushSync:W});return}else if(xe.matches){if(O=xe.matches,D=nl(O,k),F(D))return}else{zt(g,x,We(404,{pathname:k}),{flushSync:W});return}}L.set(g,K);let Le=U,ee=(await Ur("action",y,Z,[D],O,g))[D.route.id];if(Z.signal.aborted){L.get(g)===K&&L.delete(g);return}if(c.v7_fetcherPersist&&Ae.has(g)){if(An(ee)||Ze(ee)){Zt(g,en(void 0));return}}else{if(An(ee))if(L.delete(g),V>Le){Zt(g,en(void 0));return}else return le.add(g),Zt(g,Jr(j)),Pn(Z,ee,!1,{fetcherSubmission:j,preventScrollReset:A});if(Ze(ee)){zt(g,x,ee.error);return}}if(un(ee))throw We(400,{type:"defer-action"});let ge=y.navigation.location||y.location,Zn=tr(e.history,ge,K.signal),jr=a||i,Ft=y.navigation.state!=="idle"?Nn(jr,y.navigation.location,u):y.matches;Q(Ft,"Didn't find any matches after fetcher action");let Ct=++U;re.set(g,Ct);let Di=Jr(j,ee.data);y.fetchers.set(g,Di);let[Br,_n]=Hc(e.history,y,Ft,j,ge,!1,c.v7_skipActionErrorRevalidation,ve,oe,de,Ae,dt,le,jr,u,[D.route.id,ee]);_n.filter(xe=>xe.key!==g).forEach(xe=>{let bn=xe.key,_s=y.fetchers.get(bn),Ch=Jr(void 0,_s?_s.data:void 0);y.fetchers.set(bn,Ch),qt(bn),xe.controller&&L.set(bn,xe.controller)}),Ue({fetchers:new Map(y.fetchers)});let Hl=()=>_n.forEach(xe=>qt(xe.key));K.signal.addEventListener("abort",Hl);let{loaderResults:Ql,fetcherResults:b}=await ys(y,Ft,Br,_n,Zn);if(K.signal.aborted)return;K.signal.removeEventListener("abort",Hl),re.delete(g),L.delete(g),_n.forEach(xe=>L.delete(xe.key));let ye=so(Ql);if(ye)return Pn(Zn,ye.result,!1,{preventScrollReset:A});if(ye=so(b),ye)return le.add(ye.key),Pn(Zn,ye.result,!1,{preventScrollReset:A});let{loaderData:qn,errors:$r}=Gc(y,Ft,Ql,void 0,_n,b,Ie);if(y.fetchers.has(g)){let xe=en(ee.data);y.fetchers.set(g,xe)}Es(Ct),y.navigation.state==="loading"&&Ct>V?(Q(_,"Expected pending action"),M&&M.abort(),Jn(y.navigation.location,{matches:Ft,loaderData:qn,errors:$r,fetchers:new Map(y.fetchers)})):(Ue({errors:$r,loaderData:Jc(y.loaderData,qn,Ft,$r),fetchers:new Map(y.fetchers)}),ve=!1)}async function gh(g,x,k,D,O,$,W,A,j){let F=y.fetchers.get(g);Zt(g,Jr(j,F?F.data:void 0),{flushSync:W});let B=new AbortController,K=tr(e.history,k,B.signal);if($){let ee=await Wl(O,new URL(K.url).pathname,K.signal,g);if(ee.type==="aborted")return;if(ee.type==="error"){zt(g,x,ee.error,{flushSync:W});return}else if(ee.matches)O=ee.matches,D=nl(O,k);else{zt(g,x,We(404,{pathname:k}),{flushSync:W});return}}L.set(g,B);let Z=U,ie=(await Ur("loader",y,K,[D],O,g))[D.route.id];if(un(ie)&&(ie=await os(ie,K.signal,!0)||ie),L.get(g)===B&&L.delete(g),!K.signal.aborted){if(Ae.has(g)){Zt(g,en(void 0));return}if(An(ie))if(V>Z){Zt(g,en(void 0));return}else{le.add(g),await Pn(K,ie,!1,{preventScrollReset:A});return}if(Ze(ie)){zt(g,x,ie.error);return}Q(!un(ie),"Unhandled fetcher deferred data"),Zt(g,en(ie.data))}}async function Pn(g,x,k,D){let{submission:O,fetcherSubmission:$,preventScrollReset:W,replace:A}=D===void 0?{}:D;x.response.headers.has("X-Remix-Revalidate")&&(ve=!0);let j=x.response.headers.get("Location");Q(j,"Expected a Location header on the redirect Response"),j=Yc(j,new URL(g.url),u,e.history);let F=Tl(y.location,j,{_isRedirect:!0});if(n){let ee=!1;if(x.response.headers.has("X-Remix-Reload-Document"))ee=!0;else if(ls.test(j)){const ge=e.history.createURL(j);ee=ge.origin!==t.location.origin||xt(ge.pathname,u)==null}if(ee){A?t.location.replace(j):t.location.assign(j);return}}M=null;let B=A===!0||x.response.headers.has("X-Remix-Replace")?Ee.Replace:Ee.Push,{formMethod:K,formAction:Z,formEncType:Le}=y.navigation;!O&&!$&&K&&Z&&Le&&(O=ef(y.navigation));let ie=O||$;if(Lg.has(x.response.status)&&ie&&vt(ie.formMethod))await Rn(B,F,{submission:ce({},ie,{formAction:j}),preventScrollReset:W||I,enableViewTransition:k?H:void 0});else{let ee=oa(F,O);await Rn(B,F,{overrideNavigation:ee,fetcherSubmission:$,preventScrollReset:W||I,enableViewTransition:k?H:void 0})}}async function Ur(g,x,k,D,O,$){let W,A={};try{W=await Ag(s,g,x,k,D,O,$,o,l)}catch(j){return D.forEach(F=>{A[F.route.id]={type:te.error,error:j}}),A}for(let[j,F]of Object.entries(W))if(Vg(F)){let B=F.result;A[j]={type:te.redirect,response:jg(B,k,j,O,u,c.v7_relativeSplatPath)}}else A[j]=await Ug(F);return A}async function ys(g,x,k,D,O){let $=g.matches,W=Ur("loader",g,O,k,x,null),A=Promise.all(D.map(async B=>{if(B.matches&&B.match&&B.controller){let Z=(await Ur("loader",g,tr(e.history,B.path,B.controller.signal),[B.match],B.matches,B.key))[B.match.route.id];return{[B.key]:Z}}else return Promise.resolve({[B.key]:{type:te.error,error:We(404,{pathname:B.path})}})})),j=await W,F=(await A).reduce((B,K)=>Object.assign(B,K),{});return await Promise.all([Qg(x,j,O.signal,$,g.loaderData),Kg(x,F,D)]),{loaderResults:j,fetcherResults:F}}function _i(){ve=!0,oe.push(...Ti()),dt.forEach((g,x)=>{L.has(x)&&de.add(x),qt(x)})}function Zt(g,x,k){k===void 0&&(k={}),y.fetchers.set(g,x),Ue({fetchers:new Map(y.fetchers)},{flushSync:(k&&k.flushSync)===!0})}function zt(g,x,k,D){D===void 0&&(D={});let O=Mn(y.matches,x);Bl(g),Ue({errors:{[O.route.id]:k},fetchers:new Map(y.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function ws(g){return Ge.set(g,(Ge.get(g)||0)+1),Ae.has(g)&&Ae.delete(g),y.fetchers.get(g)||Tg}function Bl(g){let x=y.fetchers.get(g);L.has(g)&&!(x&&x.state==="loading"&&re.has(g))&&qt(g),dt.delete(g),re.delete(g),le.delete(g),c.v7_fetcherPersist&&Ae.delete(g),de.delete(g),y.fetchers.delete(g)}function yh(g){let x=(Ge.get(g)||0)-1;x<=0?(Ge.delete(g),Ae.add(g),c.v7_fetcherPersist||Bl(g)):Ge.set(g,x),Ue({fetchers:new Map(y.fetchers)})}function qt(g){let x=L.get(g);x&&(x.abort(),L.delete(g))}function Ss(g){for(let x of g){let k=ws(x),D=en(k.data);y.fetchers.set(x,D)}}function xs(){let g=[],x=!1;for(let k of le){let D=y.fetchers.get(k);Q(D,"Expected fetcher: "+k),D.state==="loading"&&(le.delete(k),g.push(k),x=!0)}return Ss(g),x}function Es(g){let x=[];for(let[k,D]of re)if(D0}function wh(g,x){let k=y.blockers.get(g)||nr;return ot.get(g)!==x&&ot.set(g,x),k}function ks(g){y.blockers.delete(g),ot.delete(g)}function $l(g,x){let k=y.blockers.get(g)||nr;Q(k.state==="unblocked"&&x.state==="blocked"||k.state==="blocked"&&x.state==="blocked"||k.state==="blocked"&&x.state==="proceeding"||k.state==="blocked"&&x.state==="unblocked"||k.state==="proceeding"&&x.state==="unblocked","Invalid blocker state transition: "+k.state+" -> "+x.state);let D=new Map(y.blockers);D.set(g,x),Ue({blockers:D})}function Cs(g){let{currentLocation:x,nextLocation:k,historyAction:D}=g;if(ot.size===0)return;ot.size>1&&Hn(!1,"A router only supports one blocker at a time");let O=Array.from(ot.entries()),[$,W]=O[O.length-1],A=y.blockers.get($);if(!(A&&A.state==="proceeding")&&W({currentLocation:x,nextLocation:k,historyAction:D}))return $}function Li(g){let x=We(404,{pathname:g}),k=a||i,{matches:D,route:O}=qc(k);return Ti(),{notFoundMatches:D,route:O,error:x}}function Ti(g){let x=[];return Ie.forEach((k,D)=>{(!g||g(D))&&(k.cancel(),x.push(D),Ie.delete(D))}),x}function Sh(g,x,k){if(w=g,P=x,S=k||null,!h&&y.navigation===la){h=!0;let D=Ps(y.location,y.matches);D!=null&&Ue({restoreScrollPosition:D})}return()=>{w=null,P=null,S=null}}function Rs(g,x){return S&&S(g,x.map(D=>og(D,y.loaderData)))||g.key}function xh(g,x){if(w&&P){let k=Rs(g,x);w[k]=P()}}function Ps(g,x){if(w){let k=Rs(g,x),D=w[k];if(typeof D=="number")return D}return null}function Vl(g,x,k){if(f)if(g){if(Object.keys(g[0].params).length>0)return{active:!0,matches:Co(x,k,u,!0)}}else return{active:!0,matches:Co(x,k,u,!0)||[]};return{active:!1,matches:null}}async function Wl(g,x,k,D){if(!f)return{type:"success",matches:g};let O=g;for(;;){let $=a==null,W=a||i,A=o;try{await f({signal:k,path:x,matches:O,fetcherKey:D,patch:(B,K)=>{k.aborted||Kc(B,K,W,A,l)}})}catch(B){return{type:"error",error:B,partialMatches:O}}finally{$&&!k.aborted&&(i=[...i])}if(k.aborted)return{type:"aborted"};let j=Nn(W,x,u);if(j)return{type:"success",matches:j};let F=Co(W,x,u,!0);if(!F||O.length===F.length&&O.every((B,K)=>B.route.id===F[K].route.id))return{type:"success",matches:null};O=F}}function Eh(g){o={},a=Jo(g,l,void 0,o)}function kh(g,x){let k=a==null;Kc(g,x,a||i,o,l),k&&(i=[...i],Ue({}))}return T={get basename(){return u},get future(){return c},get state(){return y},get routes(){return i},get window(){return t},initialize:uh,subscribe:ch,enableScrollRestoration:Sh,navigate:vs,fetch:mh,revalidate:fh,createHref:g=>e.history.createHref(g),encodeLocation:g=>e.history.encodeLocation(g),getFetcher:ws,deleteFetcher:yh,dispose:sh,getBlocker:wh,deleteBlocker:ks,patchRoutes:kh,_internalFetchControllers:L,_internalActiveDeferreds:Ie,_internalSetRoutes:Eh},T}function Mg(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function tu(e,t,n,r,l,o,i,a){let u,s;if(i){u=[];for(let c of t)if(u.push(c),c.route.id===i){s=c;break}}else u=t,s=t[t.length-1];let f=xi(l||".",Si(u,o),xt(e.pathname,n)||e.pathname,a==="path");if(l==null&&(f.search=e.search,f.hash=e.hash),(l==null||l===""||l===".")&&s){let c=is(f.search);if(s.route.index&&!c)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!s.route.index&&c){let p=new URLSearchParams(f.search),v=p.getAll("index");p.delete("index"),v.filter(S=>S).forEach(S=>p.append("index",S));let w=p.toString();f.search=w?"?"+w:""}}return r&&n!=="/"&&(f.pathname=f.pathname==="/"?n:$t([n,f.pathname])),Qn(f)}function Vc(e,t,n,r){if(!r||!Mg(r))return{path:n};if(r.formMethod&&!Hg(r.formMethod))return{path:n,error:We(405,{method:r.formMethod})};let l=()=>({path:n,error:We(400,{type:"invalid-body"})}),o=r.formMethod||"get",i=e?o.toUpperCase():o.toLowerCase(),a=jp(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!vt(i))return l();let p=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((v,w)=>{let[S,P]=w;return""+v+S+"="+P+` +`},""):String(r.body);return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:p}}}else if(r.formEncType==="application/json"){if(!vt(i))return l();try{let p=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:i,formAction:a,formEncType:r.formEncType,formData:void 0,json:p,text:void 0}}}catch{return l()}}}Q(typeof FormData=="function","FormData is not available in this environment");let u,s;if(r.formData)u=ru(r.formData),s=r.formData;else if(r.body instanceof FormData)u=ru(r.body),s=r.body;else if(r.body instanceof URLSearchParams)u=r.body,s=Xc(u);else if(r.body==null)u=new URLSearchParams,s=new FormData;else try{u=new URLSearchParams(r.body),s=Xc(u)}catch{return l()}let f={formMethod:i,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:s,json:void 0,text:void 0};if(vt(f.formMethod))return{path:n,submission:f};let c=Cn(n);return t&&c.search&&is(c.search)&&u.append("index",""),c.search="?"+u,{path:Qn(c),submission:f}}function Wc(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(l=>l.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Hc(e,t,n,r,l,o,i,a,u,s,f,c,p,v,w,S){let P=S?Ze(S[1])?S[1].error:S[1].data:void 0,h=e.createURL(t.location),d=e.createURL(l),m=n;o&&t.errors?m=Wc(n,Object.keys(t.errors)[0],!0):S&&Ze(S[1])&&(m=Wc(n,S[0]));let E=S?S[1].statusCode:void 0,R=i&&E&&E>=400,T=m.filter((_,I)=>{let{route:M}=_;if(M.lazy)return!0;if(M.loader==null)return!1;if(o)return nu(M,t.loaderData,t.errors);if(Og(t.loaderData,t.matches[I],_)||u.some(J=>J===_.route.id))return!0;let H=t.matches[I],Y=_;return Qc(_,ce({currentUrl:h,currentParams:H.params,nextUrl:d,nextParams:Y.params},r,{actionResult:P,actionStatus:E,defaultShouldRevalidate:R?!1:a||h.pathname+h.search===d.pathname+d.search||h.search!==d.search||Ip(H,Y)}))}),y=[];return c.forEach((_,I)=>{if(o||!n.some(X=>X.route.id===_.routeId)||f.has(I))return;let M=Nn(v,_.path,w);if(!M){y.push({key:I,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let H=t.fetchers.get(I),Y=nl(M,_.path),J=!1;p.has(I)?J=!1:s.has(I)?(s.delete(I),J=!0):H&&H.state!=="idle"&&H.data===void 0?J=a:J=Qc(Y,ce({currentUrl:h,currentParams:t.matches[t.matches.length-1].params,nextUrl:d,nextParams:n[n.length-1].params},r,{actionResult:P,actionStatus:E,defaultShouldRevalidate:R?!1:a})),J&&y.push({key:I,routeId:_.routeId,path:_.path,matches:M,match:Y,controller:new AbortController})}),[T,y]}function nu(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,l=n!=null&&n[e.id]!==void 0;return!r&&l?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!l}function Og(e,t,n){let r=!t||n.route.id!==t.route.id,l=e[n.route.id]===void 0;return r||l}function Ip(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Qc(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Kc(e,t,n,r,l){var o;let i;if(e){let s=r[e];Q(s,"No route found to patch children into: routeId = "+e),s.children||(s.children=[]),i=s.children}else i=n;let a=t.filter(s=>!i.some(f=>Up(s,f))),u=Jo(a,l,[e||"_","patch",String(((o=i)==null?void 0:o.length)||"0")],r);i.push(...u)}function Up(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var l;return(l=t.children)==null?void 0:l.some(o=>Up(n,o))}):!1}async function zg(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let l=n[e.id];Q(l,"No route found in manifest");let o={};for(let i in r){let u=l[i]!==void 0&&i!=="hasErrorBoundary";Hn(!u,'Route "'+l.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!u&&!rg.has(i)&&(o[i]=r[i])}Object.assign(l,o),Object.assign(l,ce({},t(l),{lazy:void 0}))}async function Fg(e){let{matches:t}=e,n=t.filter(l=>l.shouldLoad);return(await Promise.all(n.map(l=>l.resolve()))).reduce((l,o,i)=>Object.assign(l,{[n[i].route.id]:o}),{})}async function Ag(e,t,n,r,l,o,i,a,u,s){let f=o.map(v=>v.route.lazy?zg(v.route,u,a):void 0),c=o.map((v,w)=>{let S=f[w],P=l.some(d=>d.route.id===v.route.id);return ce({},v,{shouldLoad:P,resolve:async d=>(d&&r.method==="GET"&&(v.route.lazy||v.route.loader)&&(P=!0),P?Ig(t,r,v,S,d,s):Promise.resolve({type:te.data,result:void 0}))})}),p=await e({matches:c,request:r,params:o[0].params,fetcherKey:i,context:s});try{await Promise.all(f)}catch{}return p}async function Ig(e,t,n,r,l,o){let i,a,u=s=>{let f,c=new Promise((w,S)=>f=S);a=()=>f(),t.signal.addEventListener("abort",a);let p=w=>typeof s!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):s({request:t,params:n.params,context:o},...w!==void 0?[w]:[]),v=(async()=>{try{return{type:"data",result:await(l?l(S=>p(S)):p())}}catch(w){return{type:"error",result:w}}})();return Promise.race([v,c])};try{let s=n.route[e];if(r)if(s){let f,[c]=await Promise.all([u(s).catch(p=>{f=p}),r]);if(f!==void 0)throw f;i=c}else if(await r,s=n.route[e],s)i=await u(s);else if(e==="action"){let f=new URL(t.url),c=f.pathname+f.search;throw We(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:te.data,result:void 0};else if(s)i=await u(s);else{let f=new URL(t.url),c=f.pathname+f.search;throw We(404,{pathname:c})}Q(i.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(s){return{type:te.error,result:s}}finally{a&&t.signal.removeEventListener("abort",a)}return i}async function Ug(e){let{result:t,type:n}=e;if(Bp(t)){let c;try{let p=t.headers.get("Content-Type");p&&/\bapplication\/json\b/.test(p)?t.body==null?c=null:c=await t.json():c=await t.text()}catch(p){return{type:te.error,error:p}}return n===te.error?{type:te.error,error:new qo(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:te.data,data:c,statusCode:t.status,headers:t.headers}}if(n===te.error){if(bc(t)){var r,l;if(t.data instanceof Error){var o,i;return{type:te.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}}return{type:te.error,error:new qo(((r=t.init)==null?void 0:r.status)||500,void 0,t.data),statusCode:Dl(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:te.error,error:t,statusCode:Dl(t)?t.status:void 0}}if(Wg(t)){var a,u;return{type:te.deferred,deferredData:t,statusCode:(a=t.init)==null?void 0:a.status,headers:((u=t.init)==null?void 0:u.headers)&&new Headers(t.init.headers)}}if(bc(t)){var s,f;return{type:te.data,data:t.data,statusCode:(s=t.init)==null?void 0:s.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}}return{type:te.data,data:t}}function jg(e,t,n,r,l,o){let i=e.headers.get("Location");if(Q(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!ls.test(i)){let a=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=tu(new URL(t.url),a,l,!0,i,o),e.headers.set("Location",i)}return e}function Yc(e,t,n,r){let l=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(ls.test(e)){let o=e,i=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(l.includes(i.protocol))throw new Error("Invalid redirect location");let a=xt(i.pathname,n)!=null;if(i.origin===t.origin&&a)return rs(i.pathname)+i.search+i.hash}try{let o=r.createURL(e);if(l.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function tr(e,t,n,r){let l=e.createURL(jp(t)).toString(),o={signal:n};if(r&&vt(r.formMethod)){let{formMethod:i,formEncType:a}=r;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=ru(r.formData):o.body=r.formData}return new Request(l,o)}function ru(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Xc(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Bg(e,t,n,r,l){let o={},i=null,a,u=!1,s={},f=n&&Ze(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let p=c.route.id,v=t[p];if(Q(!An(v),"Cannot handle redirect results in processLoaderData"),Ze(v)){let w=v.error;f!==void 0&&(w=f,f=void 0),i=i||{};{let S=Mn(e,p);i[S.route.id]==null&&(i[S.route.id]=w)}o[p]=void 0,u||(u=!0,a=Dl(v.error)?v.error.status:500),v.headers&&(s[p]=v.headers)}else un(v)?(r.set(p,v.deferredData),o[p]=v.deferredData.data,v.statusCode!=null&&v.statusCode!==200&&!u&&(a=v.statusCode),v.headers&&(s[p]=v.headers)):(o[p]=v.data,v.statusCode&&v.statusCode!==200&&!u&&(a=v.statusCode),v.headers&&(s[p]=v.headers))}),f!==void 0&&n&&(i={[n[0]]:f},o[n[0]]=void 0),{loaderData:o,errors:i,statusCode:a||200,loaderHeaders:s}}function Gc(e,t,n,r,l,o,i){let{loaderData:a,errors:u}=Bg(t,n,r,i);return l.forEach(s=>{let{key:f,match:c,controller:p}=s,v=o[f];if(Q(v,"Did not find corresponding fetcher result"),!(p&&p.signal.aborted))if(Ze(v)){let w=Mn(e.matches,c==null?void 0:c.route.id);u&&u[w.route.id]||(u=ce({},u,{[w.route.id]:v.error})),e.fetchers.delete(f)}else if(An(v))Q(!1,"Unhandled fetcher revalidation redirect");else if(un(v))Q(!1,"Unhandled fetcher deferred data");else{let w=en(v.data);e.fetchers.set(f,w)}}),{loaderData:a,errors:u}}function Jc(e,t,n,r){let l=ce({},t);for(let o of n){let i=o.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(l[i]=t[i]):e[i]!==void 0&&o.route.loader&&(l[i]=e[i]),r&&r.hasOwnProperty(i))break}return l}function Zc(e){return e?Ze(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Mn(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function qc(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function We(e,t){let{pathname:n,routeId:r,method:l,type:o,message:i}=t===void 0?{}:t,a="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(a="Bad Request",l&&n&&r?u="You made a "+l+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?u="defer() is not supported in actions":o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(a="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",u='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",l&&n&&r?u="You made a "+l.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":l&&(u='Invalid request method "'+l.toUpperCase()+'"')),new qo(e||500,a,new Error(u),!0)}function so(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,l]=t[n];if(An(l))return{key:r,result:l}}}function jp(e){let t=typeof e=="string"?Cn(e):e;return Qn(ce({},t,{hash:""}))}function $g(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Vg(e){return Bp(e.result)&&_g.has(e.result.status)}function un(e){return e.type===te.deferred}function Ze(e){return e.type===te.error}function An(e){return(e&&e.type)===te.redirect}function bc(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Wg(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Bp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Hg(e){return Pg.has(e.toLowerCase())}function vt(e){return Cg.has(e.toLowerCase())}async function Qg(e,t,n,r,l){let o=Object.entries(t);for(let i=0;i(p==null?void 0:p.route.id)===a);if(!s)continue;let f=r.find(p=>p.route.id===s.route.id),c=f!=null&&!Ip(f,s)&&(l&&l[s.route.id])!==void 0;un(u)&&c&&await os(u,n,!1).then(p=>{p&&(t[a]=p)})}}async function Kg(e,t,n){for(let r=0;r(s==null?void 0:s.route.id)===o)&&un(a)&&(Q(i,"Expected an AbortController for revalidating fetcher deferred result"),await os(a,i.signal,!0).then(s=>{s&&(t[l]=s)}))}}async function os(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:te.data,data:e.deferredData.unwrappedData}}catch(l){return{type:te.error,error:l}}return{type:te.data,data:e.deferredData.data}}}function is(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function nl(e,t){let n=typeof t=="string"?Cn(t).search:t.search;if(e[e.length-1].route.index&&is(n||""))return e[e.length-1];let r=zp(e);return r[r.length-1]}function ef(e){let{formMethod:t,formAction:n,formEncType:r,text:l,formData:o,json:i}=e;if(!(!t||!n||!r)){if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:l};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function oa(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Yg(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Jr(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Xg(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function en(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Gg(e,t){try{let n=e.sessionStorage.getItem(Ap);if(n){let r=JSON.parse(n);for(let[l,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(l,new Set(o||[]))}}catch{}}function Jg(e,t){if(t.size>0){let n={};for(let[r,l]of t)n[r]=[...l];try{e.sessionStorage.setItem(Ap,JSON.stringify(n))}catch(r){Hn(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.30.4 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Tr(){return Tr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),C.useCallback(function(s,f){if(f===void 0&&(f={}),!a.current)return;if(typeof s=="number"){r.go(s);return}let c=xi(s,JSON.parse(i),o,f.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:$t([t,c.pathname])),(f.replace?r.replace:r.push)(c,f.state,f)},[t,r,i,o,e])}const Wp=C.createContext(null);function M0(){return C.useContext(Wp)}function bg(e){let t=C.useContext(Mt).outlet;return t&&C.createElement(Wp.Provider,{value:e},t)}function O0(){let{matches:e}=C.useContext(Mt),t=e[e.length-1];return t?t.params:{}}function Ei(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(Gt),{matches:l}=C.useContext(Mt),{pathname:o}=Gn(),i=JSON.stringify(Si(l,r.v7_relativeSplatPath));return C.useMemo(()=>xi(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function ey(e,t,n,r){Fr()||Q(!1);let{navigator:l}=C.useContext(Gt),{matches:o}=C.useContext(Mt),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let u=i?i.pathnameBase:"/";i&&i.route;let s=Gn(),f;f=s;let c=f.pathname||"/",p=c;if(u!=="/"){let S=u.replace(/^\//,"").split("/");p="/"+c.replace(/^\//,"").split("/").slice(S.length).join("/")}let v=Nn(e,{pathname:p});return oy(v&&v.map(S=>Object.assign({},S,{params:Object.assign({},a,S.params),pathname:$t([u,l.encodeLocation?l.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?u:$t([u,l.encodeLocation?l.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),o,n,r)}function ty(){let e=ay(),t=Dl(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:l},n):null,null)}const ny=C.createElement(ty,null);class ry extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Mt.Provider,{value:this.props.routeContext},C.createElement($p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ly(e){let{routeContext:t,match:n,children:r}=e,l=C.useContext(Il);return l&&l.static&&l.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Mt.Provider,{value:t},r)}function oy(e,t,n,r){var l;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=(l=n)==null?void 0:l.errors;if(a!=null){let f=i.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);f>=0||Q(!1),i=i.slice(0,Math.min(i.length,f+1))}let u=!1,s=-1;if(n&&r&&r.v7_partialHydration)for(let f=0;f=0?i=i.slice(0,s+1):i=[i[0]];break}}}return i.reduceRight((f,c,p)=>{let v,w=!1,S=null,P=null;n&&(v=a&&c.route.id?a[c.route.id]:void 0,S=c.route.errorElement||ny,u&&(s<0&&p===0?(cy("route-fallback"),w=!0,P=null):s===p&&(w=!0,P=c.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,p+1)),d=()=>{let m;return v?m=S:w?m=P:c.route.Component?m=C.createElement(c.route.Component,null):c.route.element?m=c.route.element:m=f,C.createElement(ly,{match:c,routeContext:{outlet:f,matches:h,isDataRoute:n!=null},children:m})};return n&&(c.route.ErrorBoundary||c.route.errorElement||p===0)?C.createElement(ry,{location:n.location,revalidation:n.revalidation,component:S,error:v,children:d(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):d()},null)}var Hp=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Hp||{}),Qp=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Qp||{});function Kp(e){let t=C.useContext(Il);return t||Q(!1),t}function Yp(e){let t=C.useContext(as);return t||Q(!1),t}function iy(e){let t=C.useContext(Mt);return t||Q(!1),t}function Xp(e){let t=iy(),n=t.matches[t.matches.length-1];return n.route.id||Q(!1),n.route.id}function ay(){var e;let t=C.useContext($p),n=Yp(),r=Xp();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}let uy=0;function z0(e){let{router:t,basename:n}=Kp(),r=Yp(),[l,o]=C.useState(""),i=C.useCallback(a=>{if(typeof e!="function")return!!e;if(n==="/")return e(a);let{currentLocation:u,nextLocation:s,historyAction:f}=a;return e({currentLocation:Tr({},u,{pathname:xt(u.pathname,n)||u.pathname}),nextLocation:Tr({},s,{pathname:xt(s.pathname,n)||s.pathname}),historyAction:f})},[n,e]);return C.useEffect(()=>{let a=String(++uy);return o(a),()=>t.deleteBlocker(a)},[t]),C.useEffect(()=>{l!==""&&t.getBlocker(l,i)},[t,l,i]),l&&r.blockers.has(l)?r.blockers.get(l):nr}function sy(){let{router:e}=Kp(Hp.UseNavigateStable),t=Xp(Qp.UseNavigateStable),n=C.useRef(!1);return Vp(()=>{n.current=!0}),C.useCallback(function(l,o){o===void 0&&(o={}),n.current&&(typeof l=="number"?e.navigate(l):e.navigate(l,Tr({fromRouteId:t},o)))},[e,t])}const tf={};function cy(e,t,n){tf[e]||(tf[e]=!0)}function fy(e,t){e==null||e.v7_startTransition,(e==null?void 0:e.v7_relativeSplatPath)===void 0&&(!t||t.v7_relativeSplatPath),t&&(t.v7_fetcherPersist,t.v7_normalizeFormMethod,t.v7_partialHydration,t.v7_skipActionErrorRevalidation)}function F0(e){let{to:t,replace:n,state:r,relative:l}=e;Fr()||Q(!1);let{future:o,static:i}=C.useContext(Gt),{matches:a}=C.useContext(Mt),{pathname:u}=Gn(),s=ss(),f=xi(t,Si(a,o.v7_relativeSplatPath),u,l==="path"),c=JSON.stringify(f);return C.useEffect(()=>s(JSON.parse(c),{replace:n,state:r,relative:l}),[s,c,l,n,r]),null}function A0(e){return bg(e.context)}function dy(e){Q(!1)}function py(e){let{basename:t="/",children:n=null,location:r,navigationType:l=Ee.Pop,navigator:o,static:i=!1,future:a}=e;Fr()&&Q(!1);let u=t.replace(/^\/*/,"/"),s=C.useMemo(()=>({basename:u,navigator:o,static:i,future:Tr({v7_relativeSplatPath:!1},a)}),[u,a,o,i]);typeof r=="string"&&(r=Cn(r));let{pathname:f="/",search:c="",hash:p="",state:v=null,key:w="default"}=r,S=C.useMemo(()=>{let P=xt(f,u);return P==null?null:{location:{pathname:P,search:c,hash:p,state:v,key:w},navigationType:l}},[u,f,c,p,v,w,l]);return S==null?null:C.createElement(Gt.Provider,{value:s},C.createElement(us.Provider,{children:n,value:S}))}new Promise(()=>{});function nf(e,t){t===void 0&&(t=[]);let n=[];return C.Children.forEach(e,(r,l)=>{if(!C.isValidElement(r))return;let o=[...t,l];if(r.type===C.Fragment){n.push.apply(n,nf(r.props.children,o));return}r.type!==dy&&Q(!1),!r.props.index||!r.props.children||Q(!1);let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=nf(r.props.children,o)),n.push(i)}),n}function hy(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.30.4 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Dr(){return Dr=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(l=>[n,l]):[[n,r]])},[]))}function gy(e,t){let n=lu(e);return t&&t.forEach((r,l)=>{n.has(l)||t.getAll(l).forEach(o=>{n.append(l,o)})}),n}const yy=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wy=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Sy="6";try{window.__reactRouterVersion=Sy}catch{}function I0(e,t){return Ng({basename:void 0,future:Dr({},void 0,{v7_prependBasename:!0}),history:eg({window:void 0}),hydrationData:xy(),routes:e,mapRouteProperties:hy,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function xy(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Dr({},t,{errors:Ey(t.errors)})),t}function Ey(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,l]of t)if(l&&l.__type==="RouteErrorResponse")n[r]=new qo(l.status,l.statusText,l.data,l.internal===!0);else if(l&&l.__type==="Error"){if(l.__subType){let o=window[l.__subType];if(typeof o=="function")try{let i=new o(l.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(l.message);o.stack="",n[r]=o}}else n[r]=l;return n}const Jp=C.createContext({isTransitioning:!1}),ky=C.createContext(new Map),Cy="startTransition",rf=$h[Cy],Ry="flushSync",lf=bv[Ry];function Py(e){rf?rf(e):e()}function Zr(e){lf?lf(e):e()}class _y{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function U0(e){let{fallbackElement:t,router:n,future:r}=e,[l,o]=C.useState(n.state),[i,a]=C.useState(),[u,s]=C.useState({isTransitioning:!1}),[f,c]=C.useState(),[p,v]=C.useState(),[w,S]=C.useState(),P=C.useRef(new Map),{v7_startTransition:h}=r||{},d=C.useCallback(_=>{h?Py(_):_()},[h]),m=C.useCallback((_,I)=>{let{deletedFetchers:M,flushSync:H,viewTransitionOpts:Y}=I;_.fetchers.forEach((X,ve)=>{X.data!==void 0&&P.current.set(ve,X.data)}),M.forEach(X=>P.current.delete(X));let J=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!Y||J){H?Zr(()=>o(_)):d(()=>o(_));return}if(H){Zr(()=>{p&&(f&&f.resolve(),p.skipTransition()),s({isTransitioning:!0,flushSync:!0,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})});let X=n.window.document.startViewTransition(()=>{Zr(()=>o(_))});X.finished.finally(()=>{Zr(()=>{c(void 0),v(void 0),a(void 0),s({isTransitioning:!1})})}),Zr(()=>v(X));return}p?(f&&f.resolve(),p.skipTransition(),S({state:_,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation})):(a(_),s({isTransitioning:!0,flushSync:!1,currentLocation:Y.currentLocation,nextLocation:Y.nextLocation}))},[n.window,p,f,P,d]);C.useLayoutEffect(()=>n.subscribe(m),[n,m]),C.useEffect(()=>{u.isTransitioning&&!u.flushSync&&c(new _y)},[u]),C.useEffect(()=>{if(f&&i&&n.window){let _=i,I=f.promise,M=n.window.document.startViewTransition(async()=>{d(()=>o(_)),await I});M.finished.finally(()=>{c(void 0),v(void 0),a(void 0),s({isTransitioning:!1})}),v(M)}},[d,i,f,n.window]),C.useEffect(()=>{f&&i&&l.location.key===i.location.key&&f.resolve()},[f,p,l.location,i]),C.useEffect(()=>{!u.isTransitioning&&w&&(a(w.state),s({isTransitioning:!0,flushSync:!1,currentLocation:w.currentLocation,nextLocation:w.nextLocation}),S(void 0))},[u.isTransitioning,w]),C.useEffect(()=>{},[]);let E=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:_=>n.navigate(_),push:(_,I,M)=>n.navigate(_,{state:I,preventScrollReset:M==null?void 0:M.preventScrollReset}),replace:(_,I,M)=>n.navigate(_,{replace:!0,state:I,preventScrollReset:M==null?void 0:M.preventScrollReset})}),[n]),R=n.basename||"/",T=C.useMemo(()=>({router:n,navigator:E,static:!1,basename:R}),[n,E,R]),y=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>fy(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(Il.Provider,{value:T},C.createElement(as.Provider,{value:l},C.createElement(ky.Provider,{value:P.current},C.createElement(Jp.Provider,{value:u},C.createElement(py,{basename:R,location:l.location,navigationType:l.historyAction,navigator:E,future:y},l.initialized||n.future.v7_partialHydration?C.createElement(Ly,{routes:n.routes,future:n.future,state:l}):t))))),null)}const Ly=C.memo(Ty);function Ty(e){let{routes:t,future:n,state:r}=e;return ey(t,void 0,r,n)}const Dy=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ny=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,My=C.forwardRef(function(t,n){let{onClick:r,relative:l,reloadDocument:o,replace:i,state:a,target:u,to:s,preventScrollReset:f,viewTransition:c}=t,p=Gp(t,yy),{basename:v}=C.useContext(Gt),w,S=!1;if(typeof s=="string"&&Ny.test(s)&&(w=s,Dy))try{let m=new URL(window.location.href),E=s.startsWith("//")?new URL(m.protocol+s):new URL(s),R=xt(E.pathname,v);E.origin===m.origin&&R!=null?s=R+E.search+E.hash:S=!0}catch{}let P=Zg(s,{relative:l}),h=zy(s,{replace:i,state:a,target:u,preventScrollReset:f,relative:l,viewTransition:c});function d(m){r&&r(m),m.defaultPrevented||h(m)}return C.createElement("a",Dr({},p,{href:w||P,onClick:S||o?r:d,ref:n,target:u}))}),j0=C.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:l=!1,className:o="",end:i=!1,style:a,to:u,viewTransition:s,children:f}=t,c=Gp(t,wy),p=Ei(u,{relative:c.relative}),v=Gn(),w=C.useContext(as),{navigator:S,basename:P}=C.useContext(Gt),h=w!=null&&Fy(p)&&s===!0,d=S.encodeLocation?S.encodeLocation(p).pathname:p.pathname,m=v.pathname,E=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(m=m.toLowerCase(),E=E?E.toLowerCase():null,d=d.toLowerCase()),E&&P&&(E=xt(E,P)||E);const R=d!=="/"&&d.endsWith("/")?d.length-1:d.length;let T=m===d||!i&&m.startsWith(d)&&m.charAt(R)==="/",y=E!=null&&(E===d||!i&&E.startsWith(d)&&E.charAt(d.length)==="/"),_={isActive:T,isPending:y,isTransitioning:h},I=T?r:void 0,M;typeof o=="function"?M=o(_):M=[o,T?"active":null,y?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let H=typeof a=="function"?a(_):a;return C.createElement(My,Dr({},c,{"aria-current":I,className:M,ref:n,style:H,to:u,viewTransition:s}),typeof f=="function"?f(_):f)});var ou;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ou||(ou={}));var of;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(of||(of={}));function Oy(e){let t=C.useContext(Il);return t||Q(!1),t}function zy(e,t){let{target:n,replace:r,state:l,preventScrollReset:o,relative:i,viewTransition:a}=t===void 0?{}:t,u=ss(),s=Gn(),f=Ei(e,{relative:i});return C.useCallback(c=>{if(vy(c,n)){c.preventDefault();let p=r!==void 0?r:Qn(s)===Qn(f);u(e,{replace:p,state:l,preventScrollReset:o,relative:i,viewTransition:a})}},[s,u,f,r,l,n,e,o,i,a])}function B0(e){let t=C.useRef(lu(e)),n=C.useRef(!1),r=Gn(),l=C.useMemo(()=>gy(r.search,n.current?null:t.current),[r.search]),o=ss(),i=C.useCallback((a,u)=>{const s=lu(typeof a=="function"?a(l):a);n.current=!0,o("?"+s,u)},[o,l]);return[l,i]}function Fy(e,t){t===void 0&&(t={});let n=C.useContext(Jp);n==null&&Q(!1);let{basename:r}=Oy(ou.useViewTransitionState),l=Ei(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=xt(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=xt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Zo(l.pathname,i)!=null||Zo(l.pathname,o)!=null}const Ay=["top","right","bottom","left"],wn=Math.min,qe=Math.max,bo=Math.round,co=Math.floor,Nt=e=>({x:e,y:e}),Iy={left:"right",right:"left",bottom:"top",top:"bottom"};function iu(e,t,n){return qe(e,wn(t,n))}function Kt(e,t){return typeof e=="function"?e(t):e}function Yt(e){return e.split("-")[0]}function Ar(e){return e.split("-")[1]}function cs(e){return e==="x"?"y":"x"}function fs(e){return e==="y"?"height":"width"}function Lt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function ds(e){return cs(Lt(e))}function Uy(e,t,n){n===void 0&&(n=!1);const r=Ar(e),l=ds(e),o=fs(l);let i=l==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=ei(i)),[i,ei(i)]}function jy(e){const t=ei(e);return[au(e),t,au(t)]}function au(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const af=["left","right"],uf=["right","left"],By=["top","bottom"],$y=["bottom","top"];function Vy(e,t,n){switch(e){case"top":case"bottom":return n?t?uf:af:t?af:uf;case"left":case"right":return t?By:$y;default:return[]}}function Wy(e,t,n,r){const l=Ar(e);let o=Vy(Yt(e),n==="start",r);return l&&(o=o.map(i=>i+"-"+l),t&&(o=o.concat(o.map(au)))),o}function ei(e){const t=Yt(e);return Iy[t]+e.slice(t.length)}function Hy(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zp(e){return typeof e!="number"?Hy(e):{top:e,right:e,bottom:e,left:e}}function ti(e){const{x:t,y:n,width:r,height:l}=e;return{width:r,height:l,top:n,left:t,right:t+r,bottom:n+l,x:t,y:n}}function sf(e,t,n){let{reference:r,floating:l}=e;const o=Lt(t),i=ds(t),a=fs(i),u=Yt(t),s=o==="y",f=r.x+r.width/2-l.width/2,c=r.y+r.height/2-l.height/2,p=r[a]/2-l[a]/2;let v;switch(u){case"top":v={x:f,y:r.y-l.height};break;case"bottom":v={x:f,y:r.y+r.height};break;case"right":v={x:r.x+r.width,y:c};break;case"left":v={x:r.x-l.width,y:c};break;default:v={x:r.x,y:r.y}}switch(Ar(t)){case"start":v[i]-=p*(n&&s?-1:1);break;case"end":v[i]+=p*(n&&s?-1:1);break}return v}async function Qy(e,t){var n;t===void 0&&(t={});const{x:r,y:l,platform:o,rects:i,elements:a,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:p=!1,padding:v=0}=Kt(t,e),w=Zp(v),P=a[p?c==="floating"?"reference":"floating":c],h=ti(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(P)))==null||n?P:P.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:s,rootBoundary:f,strategy:u})),d=c==="floating"?{x:r,y:l,width:i.floating.width,height:i.floating.height}:i.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),E=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},R=ti(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:d,offsetParent:m,strategy:u}):d);return{top:(h.top-R.top+w.top)/E.y,bottom:(R.bottom-h.bottom+w.bottom)/E.y,left:(h.left-R.left+w.left)/E.x,right:(R.right-h.right+w.right)/E.x}}const Ky=50,Yy=async(e,t,n)=>{const{placement:r="bottom",strategy:l="absolute",middleware:o=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Qy},u=await(i.isRTL==null?void 0:i.isRTL(t));let s=await i.getElementRects({reference:e,floating:t,strategy:l}),{x:f,y:c}=sf(s,r,u),p=r,v=0;const w={};for(let S=0;S({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:l,rects:o,platform:i,elements:a,middlewareData:u}=t,{element:s,padding:f=0}=Kt(e,t)||{};if(s==null)return{};const c=Zp(f),p={x:n,y:r},v=ds(l),w=fs(v),S=await i.getDimensions(s),P=v==="y",h=P?"top":"left",d=P?"bottom":"right",m=P?"clientHeight":"clientWidth",E=o.reference[w]+o.reference[v]-p[v]-o.floating[w],R=p[v]-o.reference[v],T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s));let y=T?T[m]:0;(!y||!await(i.isElement==null?void 0:i.isElement(T)))&&(y=a.floating[m]||o.floating[w]);const _=E/2-R/2,I=y/2-S[w]/2-1,M=wn(c[h],I),H=wn(c[d],I),Y=M,J=y-S[w]-H,X=y/2-S[w]/2+_,ve=iu(Y,X,J),oe=!u.arrow&&Ar(l)!=null&&X!==ve&&o.reference[w]/2-(XX<=0)){var H,Y;const X=(((H=o.flip)==null?void 0:H.index)||0)+1,ve=y[X];if(ve&&(!(c==="alignment"?d!==Lt(ve):!1)||M.every(L=>Lt(L.placement)===d?L.overflows[0]>0:!0)))return{data:{index:X,overflows:M},reset:{placement:ve}};let oe=(Y=M.filter(de=>de.overflows[0]<=0).sort((de,L)=>de.overflows[1]-L.overflows[1])[0])==null?void 0:Y.placement;if(!oe)switch(v){case"bestFit":{var J;const de=(J=M.filter(L=>{if(T){const U=Lt(L.placement);return U===d||U==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(U=>U>0).reduce((U,V)=>U+V,0)]).sort((L,U)=>L[1]-U[1])[0])==null?void 0:J[0];de&&(oe=de);break}case"initialPlacement":oe=a;break}if(l!==oe)return{reset:{placement:oe}}}return{}}}};function cf(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ff(e){return Ay.some(t=>e[t]>=0)}const Jy=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:l="referenceHidden",...o}=Kt(e,t);switch(l){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=cf(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ff(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),a=cf(i,n.floating);return{data:{escapedOffsets:a,escaped:ff(a)}}}default:return{}}}}},qp=new Set(["left","top"]);async function Zy(e,t){const{placement:n,platform:r,elements:l}=e,o=await(r.isRTL==null?void 0:r.isRTL(l.floating)),i=Yt(n),a=Ar(n),u=Lt(n)==="y",s=qp.has(i)?-1:1,f=o&&u?-1:1,c=Kt(t,e);let{mainAxis:p,crossAxis:v,alignmentAxis:w}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof w=="number"&&(v=a==="end"?w*-1:w),u?{x:v*f,y:p*s}:{x:p*s,y:v*f}}const qy=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:l,y:o,placement:i,middlewareData:a}=t,u=await Zy(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:l+u.x,y:o+u.y,data:{...u,placement:i}}}}},by=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:l,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:u={fn:h=>{let{x:d,y:m}=h;return{x:d,y:m}}},...s}=Kt(e,t),f={x:n,y:r},c=await o.detectOverflow(t,s),p=Lt(Yt(l)),v=cs(p);let w=f[v],S=f[p];if(i){const h=v==="y"?"top":"left",d=v==="y"?"bottom":"right",m=w+c[h],E=w-c[d];w=iu(m,w,E)}if(a){const h=p==="y"?"top":"left",d=p==="y"?"bottom":"right",m=S+c[h],E=S-c[d];S=iu(m,S,E)}const P=u.fn({...t,[v]:w,[p]:S});return{...P,data:{x:P.x-n,y:P.y-r,enabled:{[v]:i,[p]:a}}}}}},e0=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:l,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:s=!0}=Kt(e,t),f={x:n,y:r},c=Lt(l),p=cs(c);let v=f[p],w=f[c];const S=Kt(a,t),P=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(u){const m=p==="y"?"height":"width",E=o.reference[p]-o.floating[m]+P.mainAxis,R=o.reference[p]+o.reference[m]-P.mainAxis;vR&&(v=R)}if(s){var h,d;const m=p==="y"?"width":"height",E=qp.has(Yt(l)),R=o.reference[c]-o.floating[m]+(E&&((h=i.offset)==null?void 0:h[c])||0)+(E?0:P.crossAxis),T=o.reference[c]+o.reference[m]+(E?0:((d=i.offset)==null?void 0:d[c])||0)-(E?P.crossAxis:0);wT&&(w=T)}return{[p]:v,[c]:w}}}},t0=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:l,rects:o,platform:i,elements:a}=t,{apply:u=()=>{},...s}=Kt(e,t),f=await i.detectOverflow(t,s),c=Yt(l),p=Ar(l),v=Lt(l)==="y",{width:w,height:S}=o.floating;let P,h;c==="top"||c==="bottom"?(P=c,h=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(h=c,P=p==="end"?"top":"bottom");const d=S-f.top-f.bottom,m=w-f.left-f.right,E=wn(S-f[P],d),R=wn(w-f[h],m),T=!t.middlewareData.shift;let y=E,_=R;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=m),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(y=d),T&&!p){const M=qe(f.left,0),H=qe(f.right,0),Y=qe(f.top,0),J=qe(f.bottom,0);v?_=w-2*(M!==0||H!==0?M+H:qe(f.left,f.right)):y=S-2*(Y!==0||J!==0?Y+J:qe(f.top,f.bottom))}await u({...t,availableWidth:_,availableHeight:y});const I=await i.getDimensions(a.floating);return w!==I.width||S!==I.height?{reset:{rects:!0}}:{}}}};function ki(){return typeof window<"u"}function Ir(e){return bp(e)?(e.nodeName||"").toLowerCase():"#document"}function tt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ot(e){var t;return(t=(bp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bp(e){return ki()?e instanceof Node||e instanceof tt(e).Node:!1}function Et(e){return ki()?e instanceof Element||e instanceof tt(e).Element:!1}function Jt(e){return ki()?e instanceof HTMLElement||e instanceof tt(e).HTMLElement:!1}function df(e){return!ki()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof tt(e).ShadowRoot}function Ul(e){const{overflow:t,overflowX:n,overflowY:r,display:l}=kt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&l!=="inline"&&l!=="contents"}function n0(e){return/^(table|td|th)$/.test(Ir(e))}function Ci(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const r0=/transform|translate|scale|rotate|perspective|filter/,l0=/paint|layout|strict|content/,Ln=e=>!!e&&e!=="none";let ia;function ps(e){const t=Et(e)?kt(e):e;return Ln(t.transform)||Ln(t.translate)||Ln(t.scale)||Ln(t.rotate)||Ln(t.perspective)||!hs()&&(Ln(t.backdropFilter)||Ln(t.filter))||r0.test(t.willChange||"")||l0.test(t.contain||"")}function o0(e){let t=Sn(e);for(;Jt(t)&&!Nr(t);){if(ps(t))return t;if(Ci(t))return null;t=Sn(t)}return null}function hs(){return ia==null&&(ia=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ia}function Nr(e){return/^(html|body|#document)$/.test(Ir(e))}function kt(e){return tt(e).getComputedStyle(e)}function Ri(e){return Et(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Sn(e){if(Ir(e)==="html")return e;const t=e.assignedSlot||e.parentNode||df(e)&&e.host||Ot(e);return df(t)?t.host:t}function eh(e){const t=Sn(e);return Nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jt(t)&&Ul(t)?t:eh(t)}function Nl(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=eh(e),o=l===((r=e.ownerDocument)==null?void 0:r.body),i=tt(l);if(o){const a=uu(i);return t.concat(i,i.visualViewport||[],Ul(l)?l:[],a&&n?Nl(a):[])}else return t.concat(l,Nl(l,[],n))}function uu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function th(e){const t=kt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const l=Jt(e),o=l?e.offsetWidth:n,i=l?e.offsetHeight:r,a=bo(n)!==o||bo(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function ms(e){return Et(e)?e:e.contextElement}function xr(e){const t=ms(e);if(!Jt(t))return Nt(1);const n=t.getBoundingClientRect(),{width:r,height:l,$:o}=th(t);let i=(o?bo(n.width):n.width)/r,a=(o?bo(n.height):n.height)/l;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const i0=Nt(0);function nh(e){const t=tt(e);return!hs()||!t.visualViewport?i0:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function a0(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==tt(e)?!1:t}function Kn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),o=ms(e);let i=Nt(1);t&&(r?Et(r)&&(i=xr(r)):i=xr(e));const a=a0(o,n,r)?nh(o):Nt(0);let u=(l.left+a.x)/i.x,s=(l.top+a.y)/i.y,f=l.width/i.x,c=l.height/i.y;if(o){const p=tt(o),v=r&&Et(r)?tt(r):r;let w=p,S=uu(w);for(;S&&r&&v!==w;){const P=xr(S),h=S.getBoundingClientRect(),d=kt(S),m=h.left+(S.clientLeft+parseFloat(d.paddingLeft))*P.x,E=h.top+(S.clientTop+parseFloat(d.paddingTop))*P.y;u*=P.x,s*=P.y,f*=P.x,c*=P.y,u+=m,s+=E,w=tt(S),S=uu(w)}}return ti({width:f,height:c,x:u,y:s})}function Pi(e,t){const n=Ri(e).scrollLeft;return t?t.left+n:Kn(Ot(e)).left+n}function rh(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Pi(e,n),l=n.top+t.scrollTop;return{x:r,y:l}}function u0(e){let{elements:t,rect:n,offsetParent:r,strategy:l}=e;const o=l==="fixed",i=Ot(r),a=t?Ci(t.floating):!1;if(r===i||a&&o)return n;let u={scrollLeft:0,scrollTop:0},s=Nt(1);const f=Nt(0),c=Jt(r);if((c||!c&&!o)&&((Ir(r)!=="body"||Ul(i))&&(u=Ri(r)),c)){const v=Kn(r);s=xr(r),f.x=v.x+r.clientLeft,f.y=v.y+r.clientTop}const p=i&&!c&&!o?rh(i,u):Nt(0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+f.x+p.x,y:n.y*s.y-u.scrollTop*s.y+f.y+p.y}}function s0(e){return Array.from(e.getClientRects())}function c0(e){const t=Ot(e),n=Ri(e),r=e.ownerDocument.body,l=qe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=qe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Pi(e);const a=-n.scrollTop;return kt(r).direction==="rtl"&&(i+=qe(t.clientWidth,r.clientWidth)-l),{width:l,height:o,x:i,y:a}}const pf=25;function f0(e,t){const n=tt(e),r=Ot(e),l=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,u=0;if(l){o=l.width,i=l.height;const f=hs();(!f||f&&t==="fixed")&&(a=l.offsetLeft,u=l.offsetTop)}const s=Pi(r);if(s<=0){const f=r.ownerDocument,c=f.body,p=getComputedStyle(c),v=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,w=Math.abs(r.clientWidth-c.clientWidth-v);w<=pf&&(o-=w)}else s<=pf&&(o+=s);return{width:o,height:i,x:a,y:u}}function d0(e,t){const n=Kn(e,!0,t==="fixed"),r=n.top+e.clientTop,l=n.left+e.clientLeft,o=Jt(e)?xr(e):Nt(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,u=l*o.x,s=r*o.y;return{width:i,height:a,x:u,y:s}}function hf(e,t,n){let r;if(t==="viewport")r=f0(e,n);else if(t==="document")r=c0(Ot(e));else if(Et(t))r=d0(t,n);else{const l=nh(e);r={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return ti(r)}function lh(e,t){const n=Sn(e);return n===t||!Et(n)||Nr(n)?!1:kt(n).position==="fixed"||lh(n,t)}function p0(e,t){const n=t.get(e);if(n)return n;let r=Nl(e,[],!1).filter(a=>Et(a)&&Ir(a)!=="body"),l=null;const o=kt(e).position==="fixed";let i=o?Sn(e):e;for(;Et(i)&&!Nr(i);){const a=kt(i),u=ps(i);!u&&a.position==="fixed"&&(l=null),(o?!u&&!l:!u&&a.position==="static"&&!!l&&(l.position==="absolute"||l.position==="fixed")||Ul(i)&&!u&&lh(e,i))?r=r.filter(f=>f!==i):l=a,i=Sn(i)}return t.set(e,r),r}function h0(e){let{element:t,boundary:n,rootBoundary:r,strategy:l}=e;const i=[...n==="clippingAncestors"?Ci(t)?[]:p0(t,this._c):[].concat(n),r],a=hf(t,i[0],l);let u=a.top,s=a.right,f=a.bottom,c=a.left;for(let p=1;p{i(!1,1e-7)},1e3)}y===1&&!ih(s,e.getBoundingClientRect())&&i(),E=!1}try{n=new IntersectionObserver(R,{...m,root:l.ownerDocument})}catch{n=new IntersectionObserver(R,m)}n.observe(e)}return i(!0),o}function $0(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:l=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,s=ms(e),f=l||o?[...s?Nl(s):[],...t?Nl(t):[]]:[];f.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),o&&h.addEventListener("resize",n)});const c=s&&a?S0(s,n):null;let p=-1,v=null;i&&(v=new ResizeObserver(h=>{let[d]=h;d&&d.target===s&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var m;(m=v)==null||m.observe(t)})),n()}),s&&!u&&v.observe(s),t&&v.observe(t));let w,S=u?Kn(e):null;u&&P();function P(){const h=Kn(e);S&&!ih(S,h)&&n(),S=h,w=requestAnimationFrame(P)}return n(),()=>{var h;f.forEach(d=>{l&&d.removeEventListener("scroll",n),o&&d.removeEventListener("resize",n)}),c==null||c(),(h=v)==null||h.disconnect(),v=null,u&&cancelAnimationFrame(w)}}const x0=qy,E0=by,k0=Gy,C0=t0,R0=Jy,vf=Xy,P0=e0,_0=(e,t,n)=>{const r=new Map,l={platform:w0,...n},o={...l.platform,_c:r};return Yy(e,t,{...l,platform:o})};var L0=typeof document<"u",T0=function(){},Ro=L0?C.useLayoutEffect:T0;function ni(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ni(e[r],t[r]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,l[r]))return!1;for(r=n;r--!==0;){const o=l[r];if(!(o==="_owner"&&e.$$typeof)&&!ni(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ah(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gf(e,t){const n=ah(e);return Math.round(t*n)/n}function ua(e){const t=C.useRef(e);return Ro(()=>{t.current=e}),t}function V0(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:l,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:u,open:s}=e,[f,c]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,v]=C.useState(r);ni(p,r)||v(r);const[w,S]=C.useState(null),[P,h]=C.useState(null),d=C.useCallback(L=>{L!==T.current&&(T.current=L,S(L))},[]),m=C.useCallback(L=>{L!==y.current&&(y.current=L,h(L))},[]),E=o||w,R=i||P,T=C.useRef(null),y=C.useRef(null),_=C.useRef(f),I=u!=null,M=ua(u),H=ua(l),Y=ua(s),J=C.useCallback(()=>{if(!T.current||!y.current)return;const L={placement:t,strategy:n,middleware:p};H.current&&(L.platform=H.current),_0(T.current,y.current,L).then(U=>{const V={...U,isPositioned:Y.current!==!1};X.current&&!ni(_.current,V)&&(_.current=V,wi.flushSync(()=>{c(V)}))})},[p,t,n,H,Y]);Ro(()=>{s===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,c(L=>({...L,isPositioned:!1})))},[s]);const X=C.useRef(!1);Ro(()=>(X.current=!0,()=>{X.current=!1}),[]),Ro(()=>{if(E&&(T.current=E),R&&(y.current=R),E&&R){if(M.current)return M.current(E,R,J);J()}},[E,R,J,M,I]);const ve=C.useMemo(()=>({reference:T,floating:y,setReference:d,setFloating:m}),[d,m]),oe=C.useMemo(()=>({reference:E,floating:R}),[E,R]),de=C.useMemo(()=>{const L={position:n,left:0,top:0};if(!oe.floating)return L;const U=gf(oe.floating,f.x),V=gf(oe.floating,f.y);return a?{...L,transform:"translate("+U+"px, "+V+"px)",...ah(oe.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:V}},[n,a,oe.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:J,refs:ve,elements:oe,floatingStyles:de}),[f,J,ve,oe,de])}const D0=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:l}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vf({element:r.current,padding:l}).fn(n):{}:r?vf({element:r,padding:l}).fn(n):{}}}},W0=(e,t)=>{const n=x0(e);return{name:n.name,fn:n.fn,options:[e,t]}},H0=(e,t)=>{const n=E0(e);return{name:n.name,fn:n.fn,options:[e,t]}},Q0=(e,t)=>({fn:P0(e).fn,options:[e,t]}),K0=(e,t)=>{const n=k0(e);return{name:n.name,fn:n.fn,options:[e,t]}},Y0=(e,t)=>{const n=C0(e);return{name:n.name,fn:n.fn,options:[e,t]}},X0=(e,t)=>{const n=R0(e);return{name:n.name,fn:n.fn,options:[e,t]}},G0=(e,t)=>{const n=D0(e);return{name:n.name,fn:n.fn,options:[e,t]}};export{wf as A,My as L,j0 as N,A0 as O,$h as R,wi as a,Y0 as b,G0 as c,$0 as d,ss as e,K0 as f,Gn as g,X0 as h,B0 as i,N0 as j,Bh as k,Q0 as l,qv as m,I0 as n,W0 as o,nf as p,U0 as q,C as r,H0 as s,dy as t,V0 as u,F0 as v,Ns as w,M0 as x,O0 as y,z0 as z}; diff --git a/embed_static/static/spa/assets/textarea-CwI-oiTC.js b/embed_static/static/spa/assets/textarea-Dcf0-FNg.js similarity index 73% rename from embed_static/static/spa/assets/textarea-CwI-oiTC.js rename to embed_static/static/spa/assets/textarea-Dcf0-FNg.js index c1a3744..7d2d8fc 100644 --- a/embed_static/static/spa/assets/textarea-CwI-oiTC.js +++ b/embed_static/static/spa/assets/textarea-Dcf0-FNg.js @@ -1 +1 @@ -import{r as s,j as a}from"./react-vendor-1fwFMt02.js";import{f as t}from"./index-CucHNnyZ.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; +import{r as s,j as a}from"./react-vendor-BdyZmpPe.js";import{c as t}from"./index-Cp7Ff9NP.js";const i=s.forwardRef(({className:e,...r},o)=>a.jsx("textarea",{className:t("flex min-h-[60px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as T}; diff --git a/embed_static/static/spa/assets/ui-vendor-B26O8baZ.js b/embed_static/static/spa/assets/ui-vendor-B26O8baZ.js new file mode 100644 index 0000000..9fd0611 --- /dev/null +++ b/embed_static/static/spa/assets/ui-vendor-B26O8baZ.js @@ -0,0 +1,456 @@ +import{r as c,j as d,R as at,a as Vt,u as to,o as no,s as ro,f as oo,b as ao,c as co,h as so,d as io,l as uo}from"./react-vendor-BdyZmpPe.js";/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nt=e=>{const t=fo(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Ke={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const po=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ho=c.createContext({}),vo=()=>c.useContext(ho),mo=c.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},p)=>{const{size:l=24,strokeWidth:f=2,absoluteStrokeWidth:u=!1,color:h="currentColor",className:g=""}=vo()??{},y=r??u?Number(n??f)*24/Number(t??l):n??f;return c.createElement("svg",{ref:p,...Ke,width:t??l??Ke.width,height:t??l??Ke.height,stroke:e??h,strokeWidth:y,className:Kt("lucide",g,o),...!a&&!po(s)&&{"aria-hidden":"true"},...s},[...i.map(([v,m])=>c.createElement(v,m)),...Array.isArray(a)?a:[a]])});/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const w=(e,t)=>{const n=c.forwardRef(({className:r,...o},a)=>c.createElement(mo,{ref:a,iconNode:t,className:Kt(`lucide-${lo(Nt(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Nt(e),n};/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yo=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],yu=w("arrow-left",yo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const go=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],gu=w("arrow-right",go);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wo=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],wu=w("bold",wo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xo=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],xu=w("book-open",xo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mo=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],Mu=w("briefcase",Mo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bo=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],bu=w("camera",bo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Co=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Cu=w("check",Co);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _o=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_u=w("chevron-right",_o);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Eo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Eu=w("circle-question-mark",Eo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ko=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ku=w("circle",ko);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const So=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Su=w("clock",So);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ro=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Ru=w("code-xml",Ro);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const No=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],Nu=w("code",No);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ao=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Au=w("coffee",Ao);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Po=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],Pu=w("cpu",Po);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Do=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],Du=w("database",Do);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Io=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],Iu=w("file-code",Io);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const To=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Tu=w("file-text",To);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oo=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Ou=w("flame",Oo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jo=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],ju=w("folder-kanban",jo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $o=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],$u=w("folder",$o);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lo=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],Lu=w("gamepad-2",Lo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fo=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],Fu=w("git-compare",Fo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],zu=w("globe",zo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bo=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],Bu=w("graduation-cap",Bo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wo=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Wu=w("heart",Wo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uo=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],Uu=w("history",Uo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Go=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Gu=w("house",Go);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ho=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Hu=w("image",Ho);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vo=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],Vu=w("italic",Vo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ko=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],Ku=w("layout-dashboard",Ko);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qo=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],qu=w("layout-grid",qo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yo=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Yu=w("lightbulb",Yo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xo=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Xu=w("link",Xo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zo=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Zu=w("list-ordered",Zo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qo=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Qu=w("list",Qo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jo=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ju=w("loader-circle",Jo);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ea=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],el=w("lock-keyhole",ea);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ta=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],tl=w("lock-open",ta);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const na=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],nl=w("lock",na);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ra=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],rl=w("log-out",ra);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oa=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],ol=w("map-pin",oa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aa=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],al=w("maximize-2",aa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ca=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],cl=w("megaphone",ca);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sa=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],sl=w("message-circle",sa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ia=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],il=w("message-square",ia);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ua=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],ul=w("minimize-2",ua);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const la=[["path",{d:"M5 12h14",key:"1ays0h"}]],ll=w("minus",la);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const da=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],dl=w("moon",da);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fa=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],fl=w("music",fa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pa=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],pl=w("palette",pa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ha=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],hl=w("pen-line",ha);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const va=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],vl=w("pencil",va);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ma=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],ml=w("pin",ma);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ya=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],yl=w("plus",ya);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ga=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],gl=w("quote",ga);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wa=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],wl=w("search",wa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xa=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],xl=w("send",xa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ma=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ml=w("server",Ma);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ba=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],bl=w("settings",ba);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ca=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Cl=w("shield",Ca);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _a=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],_l=w("shopping-bag",_a);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ea=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],El=w("sliders-horizontal",Ea);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ka=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],kl=w("star",ka);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sa=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],Sl=w("strikethrough",Sa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ra=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Rl=w("sun",Ra);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Na=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Nl=w("tag",Na);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Aa=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],Al=w("thumbs-up",Aa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pa=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Pl=w("underline",Pa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Da=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Dl=w("upload",Da);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ia=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Il=w("users",Ia);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ta=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Tl=w("wrench",Ta);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oa=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ol=w("x",Oa);/** + * @license lucide-react v1.18.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ja=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],jl=w("zap",ja);function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function At(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ct(...e){return t=>{let n=!1;const r=e.map(o=>{const a=At(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o{const{children:i,...s}=a,p=c.useMemo(()=>s,Object.values(s));return d.jsx(n.Provider,{value:p,children:i})};r.displayName=e+"Provider";function o(a){const i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function J(e,t=[]){let n=[];function r(a,i){const s=c.createContext(i);s.displayName=a+"Context";const p=n.length;n=[...n,i];const l=u=>{var x;const{scope:h,children:g,...y}=u,v=((x=h==null?void 0:h[e])==null?void 0:x[p])||s,m=c.useMemo(()=>y,Object.values(y));return d.jsx(v.Provider,{value:m,children:g})};l.displayName=a+"Provider";function f(u,h){var v;const g=((v=h==null?void 0:h[e])==null?void 0:v[p])||s,y=c.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[l,f]}const o=()=>{const a=n.map(i=>c.createContext(i));return function(s){const p=(s==null?void 0:s[e])||a;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:p}}),[s,p])}};return o.scopeName=e,[r,La(o,...t)]}function La(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((s,{useScope:p,scopeName:l})=>{const u=p(a)[`__scope${l}`];return{...s,...u}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var q=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Fa=at[" useInsertionEffect ".trim().toString()]||q;function ze({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=za({defaultProp:t,onChange:n}),s=e!==void 0,p=s?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const u=f.current;u!==s&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=c.useCallback(f=>{var u;if(s){const h=Ba(f)?f(e):f;h!==e&&((u=i.current)==null||u.call(i,h))}else a(f)},[s,e,a,i]);return[p,l]}function za({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return Fa(()=>{a.current=t},[t]),c.useEffect(()=>{var i;o.current!==n&&((i=a.current)==null||i.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Ba(e){return typeof e=="function"}function he(e){const t=c.forwardRef((n,r)=>{let{children:o,...a}=n,i=null,s=!1;const p=[];Pt(o)&&typeof Re=="function"&&(o=Re(o._payload)),c.Children.forEach(o,h=>{var g;if(Va(h)){s=!0;const y=h;let v="child"in y.props?y.props.child:y.props.children;Pt(v)&&typeof Re=="function"&&(v=Re(v._payload)),i=Ua(y,v),p.push((g=i==null?void 0:i.props)==null?void 0:g.children)}else p.push(h)}),i?i=c.cloneElement(i,void 0,p):!s&&c.Children.count(o)===1&&c.isValidElement(o)&&(i=o);const l=i?Ha(i):void 0,f=P(r,l);if(!i){if(o||o===0)throw new Error(s?Xa(e):Ya(e));return o}const u=Ga(a,i.props??{});return i.type!==c.Fragment&&(u.ref=r?f:l),c.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}var $l=he("Slot"),qt=Symbol.for("radix.slottable");function Wa(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}var Ua=(e,t)=>{if("child"in e.props){const n=e.props.child;return c.isValidElement(n)?c.cloneElement(n,void 0,e.props.children(n.props.children)):null}return c.isValidElement(t)?t:null};function Ga(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const p=a(...s);return o(...s),p}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function Ha(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Va(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qt}var Ka=Symbol.for("react.lazy");function Pt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ka&&"_payload"in e&&qa(e._payload)}function qa(e){return typeof e=="object"&&e!==null&&"then"in e}var Ya=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Xa=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Re=at[" use ".trim().toString()],Za=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],A=Za.reduce((e,t)=>{const n=he(`Primitive.${t}`),r=c.forwardRef((o,a)=>{const{asChild:i,...s}=o,p=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(p,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yt(e,t){e&&Vt.flushSync(()=>e.dispatchEvent(t))}function Xt(e){const t=e+"CollectionProvider",[n,r]=J(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:m,children:x}=v,b=c.useRef(null),M=c.useRef(new Map).current;return d.jsx(o,{scope:m,itemMap:M,collectionRef:b,children:x})};i.displayName=t;const s=e+"CollectionSlot",p=he(s),l=c.forwardRef((v,m)=>{const{scope:x,children:b}=v,M=a(s,x),C=P(m,M.collectionRef);return d.jsx(p,{ref:C,children:b})});l.displayName=s;const f=e+"CollectionItemSlot",u="data-radix-collection-item",h=he(f),g=c.forwardRef((v,m)=>{const{scope:x,children:b,...M}=v,C=c.useRef(null),S=P(m,C),R=a(f,x);return c.useEffect(()=>(R.itemMap.set(C,{ref:C,...M}),()=>void R.itemMap.delete(C))),d.jsx(h,{[u]:"",ref:S,children:b})});g.displayName=f;function y(v){const m=a(e+"CollectionConsumer",v);return c.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const M=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,E)=>M.indexOf(R.ref.current)-M.indexOf(E.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:l,ItemSlot:g},y,r]}var Qa=c.createContext(void 0);function Zt(e){const t=c.useContext(Qa);return e||t||"ltr"}function Y(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ja(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ec="DismissableLayer",tt="dismissableLayer.update",tc="dismissableLayer.pointerDownOutside",nc="dismissableLayer.focusOutside",Dt,Qt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),st=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...p}=e,l=c.useContext(Qt),[f,u]=c.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=c.useState({}),y=P(t,E=>u(E)),v=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(m),b=f?v.indexOf(f):-1,M=l.layersWithOutsidePointerEventsDisabled.size>0,C=b>=x,S=ac(E=>{const N=E.target,I=[...l.branches].some(T=>T.contains(N));!C||I||(o==null||o(E),i==null||i(E),E.defaultPrevented||s==null||s())},h),R=cc(E=>{const N=E.target;[...l.branches].some(T=>T.contains(N))||(a==null||a(E),i==null||i(E),E.defaultPrevented||s==null||s())},h);return Ja(E=>{b===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&s&&(E.preventDefault(),s()))},h),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Dt=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),It(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Dt))}},[f,h,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),It())},[f,l]),c.useEffect(()=>{const E=()=>g({});return document.addEventListener(tt,E),()=>document.removeEventListener(tt,E)},[]),d.jsx(A.div,{...p,ref:y,style:{pointerEvents:M?C?"auto":"none":void 0,...e.style},onFocusCapture:k(e.onFocusCapture,R.onFocusCapture),onBlurCapture:k(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,S.onPointerDownCapture)})});st.displayName=ec;var rc="DismissableLayerBranch",oc=c.forwardRef((e,t)=>{const n=c.useContext(Qt),r=c.useRef(null),o=P(t,r);return c.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(A.div,{...e,ref:o})});oc.displayName=rc;function ac(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let p=function(){Jt(tc,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function cc(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=c.useRef(!1);return c.useEffect(()=>{const o=a=>{a.target&&!r.current&&Jt(nc,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function It(){const e=new CustomEvent(tt);document.dispatchEvent(e)}function Jt(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Yt(o,a):o.dispatchEvent(a)}var Ne=0,H=null;function en(){c.useEffect(()=>{H||(H={start:Tt(),end:Tt()});const{start:e,end:t}=H;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ne++,()=>{Ne===1&&(H==null||H.start.remove(),H==null||H.end.remove(),H=null),Ne=Math.max(0,Ne-1)}},[])}function Tt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qe="focusScope.autoFocusOnMount",Ye="focusScope.autoFocusOnUnmount",Ot={bubbles:!1,cancelable:!0},sc="FocusScope",it=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,p]=c.useState(null),l=Y(o),f=Y(a),u=c.useRef(null),h=P(t,v=>p(v)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let v=function(M){if(g.paused||!s)return;const C=M.target;s.contains(C)?u.current=C:Q(u.current,{select:!0})},m=function(M){if(g.paused||!s)return;const C=M.relatedTarget;C!==null&&(s.contains(C)||Q(u.current,{select:!0}))},x=function(M){if(document.activeElement===document.body)for(const S of M)S.removedNodes.length>0&&Q(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const b=new MutationObserver(x);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,g.paused]),c.useEffect(()=>{if(s){$t.add(g);const v=document.activeElement;if(!s.contains(v)){const x=new CustomEvent(qe,Ot);s.addEventListener(qe,l),s.dispatchEvent(x),x.defaultPrevented||(ic(pc(tn(s)),{select:!0}),document.activeElement===v&&Q(s))}return()=>{s.removeEventListener(qe,l),setTimeout(()=>{const x=new CustomEvent(Ye,Ot);s.addEventListener(Ye,f),s.dispatchEvent(x),x.defaultPrevented||Q(v??document.body,{select:!0}),s.removeEventListener(Ye,f),$t.remove(g)},0)}}},[s,l,f,g]);const y=c.useCallback(v=>{if(!n&&!r||g.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,x=document.activeElement;if(m&&x){const b=v.currentTarget,[M,C]=uc(b);M&&C?!v.shiftKey&&x===C?(v.preventDefault(),n&&Q(M,{select:!0})):v.shiftKey&&x===M&&(v.preventDefault(),n&&Q(C,{select:!0})):x===b&&v.preventDefault()}},[n,r,g.paused]);return d.jsx(A.div,{tabIndex:-1,...i,ref:h,onKeyDown:y})});it.displayName=sc;function ic(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function uc(e){const t=tn(e),n=jt(t,e),r=jt(t.reverse(),e);return[n,r]}function tn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jt(e,t){for(const n of e)if(!lc(n,{upTo:t}))return n}function lc(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function dc(e){return e instanceof HTMLInputElement&&"select"in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&dc(e)&&t&&e.select()}}var $t=fc();function fc(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Lt(e,t),e.unshift(t)},remove(t){var n;e=Lt(e,t),(n=e[0])==null||n.resume()}}}function Lt(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function pc(e){return e.filter(t=>t.tagName!=="A")}var hc=at[" useId ".trim().toString()]||(()=>{}),vc=0;function de(e){const[t,n]=c.useState(hc());return q(()=>{n(r=>r??String(vc++))},[e]),t?`radix-${t}`:""}var mc="Arrow",nn=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return d.jsx(A.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});nn.displayName=mc;var yc=nn;function rn(e){const[t,n]=c.useState(void 0);return q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const p=a.borderBoxSize,l=Array.isArray(p)?p[0]:p;i=l.inlineSize,s=l.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ut="Popper",[on,an]=J(ut),[gc,cn]=on(ut),sn=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null),[a,i]=c.useState(void 0);return d.jsx(gc,{scope:t,anchor:r,onAnchorChange:o,placementState:a,setPlacementState:i,children:n})};sn.displayName=ut;var un="PopperAnchor",ln=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=cn(un,n),i=c.useRef(null),s=a.onAnchorChange,p=c.useCallback(y=>{i.current=y,y&&s(y)},[s]),l=P(t,p),f=c.useRef(null);c.useEffect(()=>{if(!r)return;const y=f.current;f.current=r.current,y!==f.current&&s(f.current)});const u=a.placementState&&dt(a.placementState),h=u==null?void 0:u[0],g=u==null?void 0:u[1];return r?null:d.jsx(A.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...o,ref:l})});ln.displayName=un;var lt="PopperContent",[wc,xc]=on(lt),dn=c.forwardRef((e,t)=>{var ye,B,ge,Et,kt,St;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:p=!0,collisionBoundary:l,collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=e,m=cn(lt,n),[x,b]=c.useState(null),M=P(t,we=>b(we)),[C,S]=c.useState(null),R=rn(C),E=(R==null?void 0:R.width)??0,N=(R==null?void 0:R.height)??0,I=r+(a!=="center"?"-"+a:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=l?Array.isArray(l)?l:[l]:void 0,G=D!==void 0&&D.length>0,K={padding:T,boundary:D==null?void 0:D.filter(bc),altBoundary:G},{refs:ae,floatingStyles:ce,placement:$,isPositioned:se,middlewareData:L}=to({strategy:"fixed",placement:I,whileElementsMounted:(...we)=>io(...we,{animationFrame:g==="always"}),elements:{reference:m.anchor},middleware:[no({mainAxis:o+N,alignmentAxis:i}),p&&ro({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?uo():void 0,...K}),p&&oo({...K}),ao({...K,apply:({elements:we,rects:Rt,availableWidth:Zr,availableHeight:Qr})=>{const{width:Jr,height:eo}=Rt.reference,Se=we.floating.style;Se.setProperty("--radix-popper-available-width",`${Zr}px`),Se.setProperty("--radix-popper-available-height",`${Qr}px`),Se.setProperty("--radix-popper-anchor-width",`${Jr}px`),Se.setProperty("--radix-popper-anchor-height",`${eo}px`)}}),C&&co({element:C,padding:s}),Cc({arrowWidth:E,arrowHeight:N}),h&&so({strategy:"referenceHidden",...K})]}),_=m.setPlacementState;q(()=>(_($),()=>{_(void 0)}),[$,_]);const[O,F]=dt($),z=Y(y);q(()=>{se&&(z==null||z())},[se,z]);const ve=(ye=L.arrow)==null?void 0:ye.x,me=(B=L.arrow)==null?void 0:B.y,ke=((ge=L.arrow)==null?void 0:ge.centerOffset)!==0,[te,Z]=c.useState();return q(()=>{x&&Z(window.getComputedStyle(x).zIndex)},[x]),d.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:se?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(Et=L.transformOrigin)==null?void 0:Et.x,(kt=L.transformOrigin)==null?void 0:kt.y].join(" "),...((St=L.hide)==null?void 0:St.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(wc,{scope:n,placedSide:O,placedAlign:F,onArrowChange:S,arrowX:ve,arrowY:me,shouldHideArrow:ke,children:d.jsx(A.div,{"data-side":O,"data-align":F,...v,ref:M,style:{...v.style,animation:se?void 0:"none"}})})})});dn.displayName=lt;var fn="PopperArrow",Mc={top:"bottom",right:"left",bottom:"top",left:"right"},pn=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=xc(fn,r),i=Mc[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(yc,{...o,ref:n,style:{...o.style,display:"block"}})})});pn.displayName=fn;function bc(e){return e!==null}var Cc=e=>({name:"transformOrigin",options:e,fn(t){var m,x,b;const{placement:n,rects:r,middlewareData:o}=t,i=((m=o.arrow)==null?void 0:m.centerOffset)!==0,s=i?0:e.arrowWidth,p=i?0:e.arrowHeight,[l,f]=dt(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(((x=o.arrow)==null?void 0:x.x)??0)+s/2,g=(((b=o.arrow)==null?void 0:b.y)??0)+p/2;let y="",v="";return l==="bottom"?(y=i?u:`${h}px`,v=`${-p}px`):l==="top"?(y=i?u:`${h}px`,v=`${r.floating.height+p}px`):l==="right"?(y=`${-p}px`,v=i?u:`${g}px`):l==="left"&&(y=`${r.floating.width+p}px`,v=i?u:`${g}px`),{data:{x:y,y:v}}}});function dt(e){const[t,n="center"]=e.split("-");return[t,n]}var _c=sn,Ec=ln,kc=dn,Sc=pn,Rc="Portal",ft=c.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=c.useState(!1);q(()=>a(!0),[]);const i=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?Vt.createPortal(d.jsx(A.div,{...r,ref:t}),i):null});ft.displayName=Rc;function Nc(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var ee=e=>{const{present:t,children:n}=e,r=Ac(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=Pc(r.ref,Dc(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};ee.displayName="Presence";function Ac(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,p]=Nc(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Ae(r.current);a.current=s==="mounted"?l:"none"},[s]),q(()=>{const l=r.current,f=o.current;if(f!==e){const h=a.current,g=Ae(l);e?p("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?p("UNMOUNT"):p(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),q(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,u=g=>{const v=Ae(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&v&&(p("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(a.current=Ae(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ft(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pc(...e){const t=c.useRef(e);return t.current=e,c.useCallback(n=>{const r=t.current;let o=!1;const a=r.map(i=>{const s=Ft(i,n);return!o&&typeof s=="function"&&(o=!0),s});if(o)return()=>{for(let i=0;id.jsx(nt.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(nt.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Lc,{...e,ref:t})})}));mn.displayName=Ce;var Lc=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:p,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=e,h=c.useRef(null),g=P(t,h),y=Zt(a),[v,m]=ze({prop:i,defaultProp:s??null,onChange:p,caller:Ce}),[x,b]=c.useState(!1),M=Y(l),C=hn(n),S=c.useRef(!1),[R,E]=c.useState(0);return c.useEffect(()=>{const N=h.current;if(N)return N.addEventListener(Xe,M),()=>N.removeEventListener(Xe,M)},[M]),d.jsx(jc,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:c.useCallback(N=>m(N),[m]),onItemShiftTab:c.useCallback(()=>b(!0),[]),onFocusableItemAdd:c.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:c.useCallback(()=>E(N=>N-1),[]),children:d.jsx(A.div,{tabIndex:x||R===0?-1:0,"data-orientation":r,...u,ref:g,style:{outline:"none",...e.style},onMouseDown:k(e.onMouseDown,()=>{S.current=!0}),onFocus:k(e.onFocus,N=>{const I=!S.current;if(N.target===N.currentTarget&&I&&!x){const T=new CustomEvent(Xe,Ic);if(N.currentTarget.dispatchEvent(T),!T.defaultPrevented){const D=C().filter($=>$.focusable),G=D.find($=>$.active),K=D.find($=>$.id===v),ce=[G,K,...D].filter(Boolean).map($=>$.ref.current);wn(ce,f)}}S.current=!1}),onBlur:k(e.onBlur,()=>b(!1))})})}),yn="RovingFocusGroupItem",gn=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,p=de(),l=a||p,f=$c(yn,n),u=f.currentTabStopId===l,h=hn(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:v}=f;return c.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),d.jsx(nt.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(A.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:k(e.onMouseDown,m=>{r?f.onItemFocus(l):m.preventDefault()}),onFocus:k(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:k(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){f.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const x=Bc(m,f.orientation,f.dir);if(x!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let M=h().filter(C=>C.focusable).map(C=>C.ref.current);if(x==="last")M.reverse();else if(x==="prev"||x==="next"){x==="prev"&&M.reverse();const C=M.indexOf(m.currentTarget);M=f.loop?Wc(M,C+1):M.slice(C+1)}setTimeout(()=>wn(M))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:v!=null}):i})})});gn.displayName=yn;var Fc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function zc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Bc(e,t,n){const r=zc(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Fc[r]}function wn(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Uc=mn,Gc=gn,Hc=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ie=new WeakMap,Pe=new WeakMap,De={},Ze=0,xn=function(e){return e&&(e.host||xn(e.parentNode))},Vc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Kc=function(e,t,n,r){var o=Vc(t,Array.isArray(e)?e:[e]);De[n]||(De[n]=new WeakMap);var a=De[n],i=[],s=new Set,p=new Set(o),l=function(u){!u||s.has(u)||(s.add(u),l(u.parentNode))};o.forEach(l);var f=function(u){!u||p.has(u)||Array.prototype.forEach.call(u.children,function(h){if(s.has(h))f(h);else try{var g=h.getAttribute(r),y=g!==null&&g!=="false",v=(ie.get(h)||0)+1,m=(a.get(h)||0)+1;ie.set(h,v),a.set(h,m),i.push(h),v===1&&y&&Pe.set(h,!0),m===1&&h.setAttribute(n,"true"),y||h.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",h,x)}})};return f(t),s.clear(),Ze++,function(){i.forEach(function(u){var h=ie.get(u)-1,g=a.get(u)-1;ie.set(u,h),a.set(u,g),h||(Pe.has(u)||u.removeAttribute(r),Pe.delete(u)),g||u.removeAttribute(n)}),Ze--,Ze||(ie=new WeakMap,ie=new WeakMap,Pe=new WeakMap,De={})}},Mn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Hc(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Kc(r,o,n,"aria-hidden")):function(){return null}},V=function(){return V=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return ls;var t=ds(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ps=En(),fe="data-scroll-locked",hs=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),` + .`.concat(Yc,` { + overflow: hidden `).concat(r,`; + padding-right: `).concat(s,"px ").concat(r,`; + } + body[`).concat(fe,`] { + overflow: hidden `).concat(r,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` + padding-left: `.concat(o,`px; + padding-top: `).concat(a,`px; + padding-right: `).concat(i,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(s,"px ").concat(r,`; + `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` + } + + .`).concat(Oe,` { + right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(je,` { + margin-right: `).concat(s,"px ").concat(r,`; + } + + .`).concat(Oe," .").concat(Oe,` { + right: 0 `).concat(r,`; + } + + .`).concat(je," .").concat(je,` { + margin-right: 0 `).concat(r,`; + } + + body[`).concat(fe,`] { + `).concat(Xc,": ").concat(s,`px; + } +`)},Bt=function(){var e=parseInt(document.body.getAttribute(fe)||"0",10);return isFinite(e)?e:0},vs=function(){c.useEffect(function(){return document.body.setAttribute(fe,(Bt()+1).toString()),function(){var e=Bt()-1;e<=0?document.body.removeAttribute(fe):document.body.setAttribute(fe,e.toString())}},[])},ms=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;vs();var a=c.useMemo(function(){return fs(o)},[o]);return c.createElement(ps,{styles:hs(a,!t,o,n?"":"!important")})},rt=!1;if(typeof window<"u")try{var Ie=Object.defineProperty({},"passive",{get:function(){return rt=!0,!0}});window.addEventListener("test",Ie,Ie),window.removeEventListener("test",Ie,Ie)}catch{rt=!1}var ue=rt?{passive:!1}:!1,ys=function(e){return e.tagName==="TEXTAREA"},kn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ys(e)&&n[t]==="visible")},gs=function(e){return kn(e,"overflowY")},ws=function(e){return kn(e,"overflowX")},Wt=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Sn(e,r);if(o){var a=Rn(e,r),i=a[1],s=a[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},xs=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ms=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Sn=function(e,t){return e==="v"?gs(t):ws(t)},Rn=function(e,t){return e==="v"?xs(t):Ms(t)},bs=function(e,t){return e==="h"&&t==="rtl"?-1:1},Cs=function(e,t,n,r,o){var a=bs(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,p=t.contains(s),l=!1,f=i>0,u=0,h=0;do{if(!s)break;var g=Rn(e,s),y=g[0],v=g[1],m=g[2],x=v-m-a*y;(y||x)&&Sn(e,s)&&(u+=x,h+=y);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!p&&s!==document.body||p&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(h)<1)&&(l=!0),l},Te=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ut=function(e){return[e.deltaX,e.deltaY]},Gt=function(e){return e&&"current"in e?e.current:e},_s=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Es=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},ks=0,le=[];function Ss(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(ks++)[0],a=c.useState(En)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=qc([e.lockRef.current],(e.shards||[]).map(Gt),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var x=Te(v),b=n.current,M="deltaX"in v?v.deltaX:b[0]-x[0],C="deltaY"in v?v.deltaY:b[1]-x[1],S,R=v.target,E=Math.abs(M)>Math.abs(C)?"h":"v";if("touches"in v&&E==="h"&&R.type==="range")return!1;var N=window.getSelection(),I=N&&N.anchorNode,T=I?I===R||I.contains(R):!1;if(T)return!1;var D=Wt(E,R);if(!D)return!0;if(D?S=E:(S=E==="v"?"h":"v",D=Wt(E,R)),!D)return!1;if(!r.current&&"changedTouches"in v&&(M||C)&&(r.current=S),!S)return!0;var G=r.current||S;return Cs(G,m,v,G==="h"?M:C)},[]),p=c.useCallback(function(v){var m=v;if(!(!le.length||le[le.length-1]!==a)){var x="deltaY"in m?Ut(m):Te(m),b=t.current.filter(function(S){return S.name===m.type&&(S.target===m.target||m.target===S.shadowParent)&&_s(S.delta,x)})[0];if(b&&b.should){m.cancelable&&m.preventDefault();return}if(!b){var M=(i.current.shards||[]).map(Gt).filter(Boolean).filter(function(S){return S.contains(m.target)}),C=M.length>0?s(m,M[0]):!i.current.noIsolation;C&&m.cancelable&&m.preventDefault()}}},[]),l=c.useCallback(function(v,m,x,b){var M={name:v,delta:m,target:x,should:b,shadowParent:Rs(x)};t.current.push(M),setTimeout(function(){t.current=t.current.filter(function(C){return C!==M})},1)},[]),f=c.useCallback(function(v){n.current=Te(v),r.current=void 0},[]),u=c.useCallback(function(v){l(v.type,Ut(v),v.target,s(v,e.lockRef.current))},[]),h=c.useCallback(function(v){l(v.type,Te(v),v.target,s(v,e.lockRef.current))},[]);c.useEffect(function(){return le.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",p,ue),document.addEventListener("touchmove",p,ue),document.addEventListener("touchstart",f,ue),function(){le=le.filter(function(v){return v!==a}),document.removeEventListener("wheel",p,ue),document.removeEventListener("touchmove",p,ue),document.removeEventListener("touchstart",f,ue)}},[]);var g=e.removeScrollBar,y=e.inert;return c.createElement(c.Fragment,null,y?c.createElement(a,{styles:Es(o)}):null,g?c.createElement(ms,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Rs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ns=rs(_n,Ss);var pt=c.forwardRef(function(e,t){return c.createElement(Be,V({},e,{ref:t,sideCar:Ns}))});pt.classNames=Be.classNames;var ot=["Enter"," "],As=["ArrowDown","PageUp","Home"],Nn=["ArrowUp","PageDown","End"],Ps=[...As,...Nn],Ds={ltr:[...ot,"ArrowRight"],rtl:[...ot,"ArrowLeft"]},Is={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_e="Menu",[Me,Ts,Os]=Xt(_e),[re,An]=J(_e,[Os,an,vn]),We=an(),Pn=vn(),[js,oe]=re(_e),[$s,Ee]=re(_e),Dn=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=We(t),[p,l]=c.useState(null),f=c.useRef(!1),u=Y(a),h=Zt(o);return c.useEffect(()=>{const g=()=>{f.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>f.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),d.jsx(_c,{...s,children:d.jsx(js,{scope:t,open:n,onOpenChange:u,content:p,onContentChange:l,children:d.jsx($s,{scope:t,onClose:c.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};Dn.displayName=_e;var Ls="MenuAnchor",ht=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=We(n);return d.jsx(Ec,{...o,...r,ref:t})});ht.displayName=Ls;var vt="MenuPortal",[Fs,In]=re(vt,{forceMount:void 0}),Tn=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=oe(vt,t);return d.jsx(Fs,{scope:t,forceMount:n,children:d.jsx(ee,{present:n||a.open,children:d.jsx(ft,{asChild:!0,container:o,children:r})})})};Tn.displayName=vt;var W="MenuContent",[zs,mt]=re(W),On=c.forwardRef((e,t)=>{const n=In(W,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=oe(W,e.__scopeMenu),i=Ee(W,e.__scopeMenu);return d.jsx(Me.Provider,{scope:e.__scopeMenu,children:d.jsx(ee,{present:r||a.open,children:d.jsx(Me.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(Bs,{...o,ref:t}):d.jsx(Ws,{...o,ref:t})})})})}),Bs=c.forwardRef((e,t)=>{const n=oe(W,e.__scopeMenu),r=c.useRef(null),o=P(t,r);return c.useEffect(()=>{const a=r.current;if(a)return Mn(a)},[]),d.jsx(yt,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:k(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ws=c.forwardRef((e,t)=>{const n=oe(W,e.__scopeMenu);return d.jsx(yt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Us=he("MenuContent.ScrollLock"),yt=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:p,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:g,disableOutsideScroll:y,...v}=e,m=oe(W,n),x=Ee(W,n),b=We(n),M=Pn(n),C=Ts(n),[S,R]=c.useState(null),E=c.useRef(null),N=P(t,E,m.onContentChange),I=c.useRef(0),T=c.useRef(""),D=c.useRef(0),G=c.useRef(null),K=c.useRef("right"),ae=c.useRef(0),ce=y?pt:c.Fragment,$=y?{as:Us,allowPinchZoom:!0}:void 0,se=_=>{var Z,ye;const O=T.current+_,F=C().filter(B=>!B.disabled),z=document.activeElement,ve=(Z=F.find(B=>B.ref.current===z))==null?void 0:Z.textValue,me=F.map(B=>B.textValue),ke=ti(me,O,ve),te=(ye=F.find(B=>B.textValue===ke))==null?void 0:ye.ref.current;(function B(ge){T.current=ge,window.clearTimeout(I.current),ge!==""&&(I.current=window.setTimeout(()=>B(""),1e3))})(O),te&&setTimeout(()=>te.focus())};c.useEffect(()=>()=>window.clearTimeout(I.current),[]),en();const L=c.useCallback(_=>{var F,z;return K.current===((F=G.current)==null?void 0:F.side)&&ri(_,(z=G.current)==null?void 0:z.area)},[]);return d.jsx(zs,{scope:n,searchRef:T,onItemEnter:c.useCallback(_=>{L(_)&&_.preventDefault()},[L]),onItemLeave:c.useCallback(_=>{var O;L(_)||((O=E.current)==null||O.focus(),R(null))},[L]),onTriggerLeave:c.useCallback(_=>{L(_)&&_.preventDefault()},[L]),pointerGraceTimerRef:D,onPointerGraceIntentChange:c.useCallback(_=>{G.current=_},[]),children:d.jsx(ce,{...$,children:d.jsx(it,{asChild:!0,trapped:o,onMountAutoFocus:k(a,_=>{var O;_.preventDefault(),(O=E.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(st,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:g,children:d.jsx(Uc,{asChild:!0,...M,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:R,onEntryFocus:k(p,_=>{x.isUsingKeyboardRef.current||_.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(kc,{role:"menu","aria-orientation":"vertical","data-state":Zn(m.open),"data-radix-menu-content":"",dir:x.dir,...b,...v,ref:N,style:{outline:"none",...v.style},onKeyDown:k(v.onKeyDown,_=>{const F=_.target.closest("[data-radix-menu-content]")===_.currentTarget,z=_.ctrlKey||_.altKey||_.metaKey,ve=_.key.length===1;F&&(_.key==="Tab"&&_.preventDefault(),!z&&ve&&se(_.key));const me=E.current;if(_.target!==me||!Ps.includes(_.key))return;_.preventDefault();const te=C().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);Nn.includes(_.key)&&te.reverse(),Js(te)}),onBlur:k(e.onBlur,_=>{_.currentTarget.contains(_.target)||(window.clearTimeout(I.current),T.current="")}),onPointerMove:k(e.onPointerMove,be(_=>{const O=_.target,F=ae.current!==_.clientX;if(_.currentTarget.contains(O)&&F){const z=_.clientX>ae.current?"right":"left";K.current=z,ae.current=_.clientX}}))})})})})})})});On.displayName=W;var Gs="MenuGroup",gt=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{role:"group",...r,ref:t})});gt.displayName=Gs;var Hs="MenuLabel",jn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{...r,ref:t})});jn.displayName=Hs;var $e="MenuItem",Ht="menu.itemSelect",Ue=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=c.useRef(null),i=Ee($e,e.__scopeMenu),s=mt($e,e.__scopeMenu),p=P(t,a),l=c.useRef(!1),f=()=>{const u=a.current;if(!n&&u){const h=new CustomEvent(Ht,{bubbles:!0,cancelable:!0});u.addEventListener(Ht,g=>r==null?void 0:r(g),{once:!0}),Yt(u,h),h.defaultPrevented?l.current=!1:i.onClose()}};return d.jsx($n,{...o,ref:p,disabled:n,onClick:k(e.onClick,f),onPointerDown:u=>{var h;(h=e.onPointerDown)==null||h.call(e,u),l.current=!0},onPointerUp:k(e.onPointerUp,u=>{var h;l.current||(h=u.currentTarget)==null||h.click()}),onKeyDown:k(e.onKeyDown,u=>{const h=s.searchRef.current!=="";n||h&&u.key===" "||ot.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});Ue.displayName=$e;var $n=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=mt($e,n),s=Pn(n),p=c.useRef(null),l=P(t,p),[f,u]=c.useState(!1),[h,g]=c.useState("");return c.useEffect(()=>{const y=p.current;y&&g((y.textContent??"").trim())},[a.children]),d.jsx(Me.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:d.jsx(Gc,{asChild:!0,...s,focusable:!r,children:d.jsx(A.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:k(e.onPointerMove,be(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:k(e.onPointerLeave,be(y=>i.onItemLeave(y))),onFocus:k(e.onFocus,()=>u(!0)),onBlur:k(e.onBlur,()=>u(!1))})})})}),Vs="MenuCheckboxItem",Ln=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(Un,{scope:e.__scopeMenu,checked:n,children:d.jsx(Ue,{role:"menuitemcheckbox","aria-checked":Le(n)?"mixed":n,...o,ref:t,"data-state":xt(n),onSelect:k(o.onSelect,()=>r==null?void 0:r(Le(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ln.displayName=Vs;var Fn="MenuRadioGroup",[Ks,qs]=re(Fn,{value:void 0,onValueChange:()=>{}}),zn=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=Y(r);return d.jsx(Ks,{scope:e.__scopeMenu,value:n,onValueChange:a,children:d.jsx(gt,{...o,ref:t})})});zn.displayName=Fn;var Bn="MenuRadioItem",Wn=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=qs(Bn,e.__scopeMenu),a=n===o.value;return d.jsx(Un,{scope:e.__scopeMenu,checked:a,children:d.jsx(Ue,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":xt(a),onSelect:k(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Wn.displayName=Bn;var wt="MenuItemIndicator",[Un,Ys]=re(wt,{checked:!1}),Gn=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=Ys(wt,n);return d.jsx(ee,{present:r||Le(a.checked)||a.checked===!0,children:d.jsx(A.span,{...o,ref:t,"data-state":xt(a.checked)})})});Gn.displayName=wt;var Xs="MenuSeparator",Hn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Hn.displayName=Xs;var Zs="MenuArrow",Vn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=We(n);return d.jsx(Sc,{...o,...r,ref:t})});Vn.displayName=Zs;var Qs="MenuSub",[Ll,Kn]=re(Qs),xe="MenuSubTrigger",qn=c.forwardRef((e,t)=>{const n=oe(xe,e.__scopeMenu),r=Ee(xe,e.__scopeMenu),o=Kn(xe,e.__scopeMenu),a=mt(xe,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:p}=a,l={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),p(null)}},[s,p]),d.jsx(ht,{asChild:!0,...l,children:d.jsx($n,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?o.contentId:void 0,"data-state":Zn(n.open),...e,ref:ct(t,o.onTriggerChange),onClick:u=>{var h;(h=e.onClick)==null||h.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:k(e.onPointerMove,be(u=>{a.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:k(e.onPointerLeave,be(u=>{var g,y;f();const h=(g=n.content)==null?void 0:g.getBoundingClientRect();if(h){const v=(y=n.content)==null?void 0:y.dataset.side,m=v==="right",x=m?-5:5,b=h[m?"left":"right"],M=h[m?"right":"left"];a.onPointerGraceIntentChange({area:[{x:u.clientX+x,y:u.clientY},{x:b,y:h.top},{x:M,y:h.top},{x:M,y:h.bottom},{x:b,y:h.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(u),u.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:k(e.onKeyDown,u=>{var g;const h=a.searchRef.current!=="";e.disabled||h&&u.key===" "||Ds[r.dir].includes(u.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),u.preventDefault())})})})});qn.displayName=xe;var Yn="MenuSubContent",Xn=c.forwardRef((e,t)=>{const n=In(W,e.__scopeMenu),{forceMount:r=n.forceMount,align:o="start",...a}=e,i=oe(W,e.__scopeMenu),s=Ee(W,e.__scopeMenu),p=Kn(Yn,e.__scopeMenu),l=c.useRef(null),f=P(t,l);return d.jsx(Me.Provider,{scope:e.__scopeMenu,children:d.jsx(ee,{present:r||i.open,children:d.jsx(Me.Slot,{scope:e.__scopeMenu,children:d.jsx(yt,{id:p.contentId,"aria-labelledby":p.triggerId,...a,ref:f,align:o,side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:k(e.onFocusOutside,u=>{u.target!==p.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:k(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:k(e.onKeyDown,u=>{var y;const h=u.currentTarget.contains(u.target),g=Is[s.dir].includes(u.key);h&&g&&(i.onOpenChange(!1),(y=p.trigger)==null||y.focus(),u.preventDefault())})})})})})});Xn.displayName=Yn;function Zn(e){return e?"open":"closed"}function Le(e){return e==="indeterminate"}function xt(e){return Le(e)?"indeterminate":e?"checked":"unchecked"}function Js(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ei(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ti(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=ei(e,Math.max(a,0));o.length===1&&(i=i.filter(l=>l!==n));const p=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return p!==n?p:void 0}function ni(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;ar!=h>r&&n<(u-l)*(r-f)/(h-f)+l&&(o=!o)}return o}function ri(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return ni(n,t)}function be(e){return t=>t.pointerType==="mouse"?e(t):void 0}var oi=Dn,ai=ht,ci=Tn,si=On,ii=gt,ui=jn,li=Ue,di=Ln,fi=zn,pi=Wn,hi=Gn,vi=Hn,mi=Vn,yi=qn,gi=Xn,Ge="DropdownMenu",[wi]=J(Ge,[An]),j=An(),[xi,Qn]=wi(Ge),Jn=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,p=j(t),l=c.useRef(null),[f,u]=ze({prop:o,defaultProp:a??!1,onChange:i,caller:Ge});return d.jsx(xi,{scope:t,triggerId:de(),triggerRef:l,contentId:de(),open:f,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(h=>!h),[u]),modal:s,children:d.jsx(oi,{...p,open:f,onOpenChange:u,dir:r,modal:s,children:n})})};Jn.displayName=Ge;var er="DropdownMenuTrigger",tr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=Qn(er,n),i=j(n);return d.jsx(ai,{asChild:!0,...i,children:d.jsx(A.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ct(t,a.triggerRef),onPointerDown:k(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:k(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});tr.displayName=er;var Mi="DropdownMenuPortal",nr=e=>{const{__scopeDropdownMenu:t,...n}=e,r=j(t);return d.jsx(ci,{...r,...n})};nr.displayName=Mi;var rr="DropdownMenuContent",or=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Qn(rr,n),a=j(n),i=c.useRef(!1);return d.jsx(si,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:k(e.onCloseAutoFocus,s=>{var p;i.current||(p=o.triggerRef.current)==null||p.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:k(e.onInteractOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,f=p.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});or.displayName=rr;var bi="DropdownMenuGroup",Ci=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(ii,{...o,...r,ref:t})});Ci.displayName=bi;var _i="DropdownMenuLabel",ar=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(ui,{...o,...r,ref:t})});ar.displayName=_i;var Ei="DropdownMenuItem",cr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(li,{...o,...r,ref:t})});cr.displayName=Ei;var ki="DropdownMenuCheckboxItem",sr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(di,{...o,...r,ref:t})});sr.displayName=ki;var Si="DropdownMenuRadioGroup",Ri=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(fi,{...o,...r,ref:t})});Ri.displayName=Si;var Ni="DropdownMenuRadioItem",ir=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(pi,{...o,...r,ref:t})});ir.displayName=Ni;var Ai="DropdownMenuItemIndicator",ur=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(hi,{...o,...r,ref:t})});ur.displayName=Ai;var Pi="DropdownMenuSeparator",lr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(vi,{...o,...r,ref:t})});lr.displayName=Pi;var Di="DropdownMenuArrow",Ii=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(mi,{...o,...r,ref:t})});Ii.displayName=Di;var Ti="DropdownMenuSubTrigger",dr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(yi,{...o,...r,ref:t})});dr.displayName=Ti;var Oi="DropdownMenuSubContent",fr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(gi,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fr.displayName=Oi;var Fl=Jn,zl=tr,Bl=nr,Wl=or,Ul=ar,Gl=cr,Hl=sr,Vl=ir,Kl=ur,ql=lr,Yl=dr,Xl=fr;function ji(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var He="Switch",[$i]=J(He),[Li,Mt]=$i(He);function Fi(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:o,disabled:a,form:i,name:s,onCheckedChange:p,required:l,value:f="on",internal_do_not_use_render:u}=e,[h,g]=ze({prop:n,defaultProp:o??!1,onChange:p,caller:He}),[y,v]=c.useState(null),[m,x]=c.useState(null),b=c.useRef(!1),M=y?!!i||!!y.closest("form"):!0,C={checked:h,setChecked:g,disabled:a,control:y,setControl:v,name:s,form:i,value:f,hasConsumerStoppedPropagationRef:b,required:l,defaultChecked:o,isFormControl:M,bubbleInput:m,setBubbleInput:x};return d.jsx(Li,{scope:t,...C,children:Wi(u)?u(C):r})}var pr="SwitchTrigger",hr=c.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{const{value:o,disabled:a,checked:i,required:s,setControl:p,setChecked:l,hasConsumerStoppedPropagationRef:f,isFormControl:u,bubbleInput:h}=Mt(pr,e),g=P(r,p);return d.jsx(A.button,{type:"button",role:"switch","aria-checked":i,"aria-required":s,"data-state":gr(i),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:g,onClick:k(t,y=>{l(v=>!v),h&&u&&(f.current=y.isPropagationStopped(),f.current||y.stopPropagation())})})});hr.displayName=pr;var zi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:p,onCheckedChange:l,form:f,...u}=e;return d.jsx(Fi,{__scopeSwitch:n,checked:o,defaultChecked:a,disabled:s,required:i,onCheckedChange:l,name:r,form:f,value:p,internal_do_not_use_render:({isFormControl:h})=>d.jsxs(d.Fragment,{children:[d.jsx(hr,{...u,ref:t,__scopeSwitch:n}),h&&d.jsx(yr,{__scopeSwitch:n})]})})});zi.displayName=He;var vr="SwitchThumb",Bi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Mt(vr,n);return d.jsx(A.span,{"data-state":gr(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Bi.displayName=vr;var mr="SwitchBubbleInput",yr=c.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:i,required:s,disabled:p,name:l,value:f,form:u,bubbleInput:h,setBubbleInput:g}=Mt(mr,e),y=P(n,g),v=ji(a),m=rn(r);c.useEffect(()=>{const b=h;if(!b)return;const M=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(M,"checked").set,R=!o.current;if(v!==a&&S){const E=new Event("click",{bubbles:R});S.call(b,a),b.dispatchEvent(E)}},[h,v,a,o]);const x=c.useRef(a);return d.jsx(A.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??x.current,required:s,disabled:p,name:l,value:f,form:u,...t,tabIndex:-1,ref:y,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});yr.displayName=mr;function Wi(e){return typeof e=="function"}function gr(e){return e?"checked":"unchecked"}var Ui="Label",wr=c.forwardRef((e,t)=>d.jsx(A.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wr.displayName=Ui;var Zl=wr,Ve="Dialog",[xr,Mr]=J(Ve),[Gi,U]=xr(Ve),br=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=c.useRef(null),p=c.useRef(null),[l,f]=ze({prop:r,defaultProp:o??!1,onChange:a,caller:Ve});return d.jsx(Gi,{scope:t,triggerRef:s,contentRef:p,contentId:de(),titleId:de(),descriptionId:de(),open:l,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(u=>!u),[f]),modal:i,children:n})};br.displayName=Ve;var Cr="DialogTrigger",_r=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=U(Cr,n),a=P(t,o.triggerRef);return d.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":_t(o.open),...r,ref:a,onClick:k(e.onClick,o.onOpenToggle)})});_r.displayName=Cr;var bt="DialogPortal",[Hi,Er]=xr(bt,{forceMount:void 0}),kr=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=U(bt,t);return d.jsx(Hi,{scope:t,forceMount:n,children:c.Children.map(r,i=>d.jsx(ee,{present:n||a.open,children:d.jsx(ft,{asChild:!0,container:o,children:i})}))})};kr.displayName=bt;var Fe="DialogOverlay",Sr=c.forwardRef((e,t)=>{const n=Er(Fe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=U(Fe,e.__scopeDialog);return a.modal?d.jsx(ee,{present:r||a.open,children:d.jsx(Ki,{...o,ref:t})}):null});Sr.displayName=Fe;var Vi=he("DialogOverlay.RemoveScroll"),Ki=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=U(Fe,n);return d.jsx(pt,{as:Vi,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(A.div,{"data-state":_t(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ne="DialogContent",Rr=c.forwardRef((e,t)=>{const n=Er(ne,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=U(ne,e.__scopeDialog);return d.jsx(ee,{present:r||a.open,children:a.modal?d.jsx(qi,{...o,ref:t}):d.jsx(Yi,{...o,ref:t})})});Rr.displayName=ne;var qi=c.forwardRef((e,t)=>{const n=U(ne,e.__scopeDialog),r=c.useRef(null),o=P(t,n.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return Mn(a)},[]),d.jsx(Nr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:k(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&a.preventDefault()}),onFocusOutside:k(e.onFocusOutside,a=>a.preventDefault())})}),Yi=c.forwardRef((e,t)=>{const n=U(ne,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return d.jsx(Nr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var p,l;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Nr=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=U(ne,n),p=c.useRef(null),l=P(t,p);return en(),d.jsxs(d.Fragment,{children:[d.jsx(it,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(st,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":_t(s.open),...i,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Zi,{titleId:s.titleId}),d.jsx(Ji,{contentRef:p,descriptionId:s.descriptionId})]})]})}),Ct="DialogTitle",Ar=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=U(Ct,n);return d.jsx(A.h2,{id:o.titleId,...r,ref:t})});Ar.displayName=Ct;var Pr="DialogDescription",Dr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=U(Pr,n);return d.jsx(A.p,{id:o.descriptionId,...r,ref:t})});Dr.displayName=Pr;var Ir="DialogClose",Tr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=U(Ir,n);return d.jsx(A.button,{type:"button",...r,ref:t,onClick:k(e.onClick,()=>o.onOpenChange(!1))})});Tr.displayName=Ir;function _t(e){return e?"open":"closed"}var Or="DialogTitleWarning",[Xi,jr]=$a(Or,{contentName:ne,titleName:Ct,docsSlug:"dialog"}),Zi=({titleId:e})=>{const t=jr(Or),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Qi="DialogDescriptionWarning",Ji=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jr(Qi).contentName}}.`;return c.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},eu=br,tu=_r,nu=kr,ru=Sr,ou=Rr,au=Ar,cu=Dr,$r=Tr,Lr="AlertDialog",[su]=J(Lr,[Mr]),X=Mr(),Fr=e=>{const{__scopeAlertDialog:t,...n}=e,r=X(t);return d.jsx(eu,{...r,...n,modal:!0})};Fr.displayName=Lr;var iu="AlertDialogTrigger",zr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(tu,{...o,...r,ref:t})});zr.displayName=iu;var uu="AlertDialogPortal",Br=e=>{const{__scopeAlertDialog:t,...n}=e,r=X(t);return d.jsx(nu,{...r,...n})};Br.displayName=uu;var lu="AlertDialogOverlay",Wr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(ru,{...o,...r,ref:t})});Wr.displayName=lu;var pe="AlertDialogContent",[du,fu]=su(pe),pu=Wa("AlertDialogContent"),Ur=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,a=X(n),i=c.useRef(null),s=P(t,i),p=c.useRef(null);return d.jsx(Xi,{contentName:pe,titleName:Gr,docsSlug:"alert-dialog",children:d.jsx(du,{scope:n,cancelRef:p,children:d.jsxs(ou,{role:"alertdialog",...a,...o,ref:s,onOpenAutoFocus:k(o.onOpenAutoFocus,l=>{var f;l.preventDefault(),(f=p.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[d.jsx(pu,{children:r}),d.jsx(vu,{contentRef:i})]})})})});Ur.displayName=pe;var Gr="AlertDialogTitle",Hr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(au,{...o,...r,ref:t})});Hr.displayName=Gr;var Vr="AlertDialogDescription",Kr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(cu,{...o,...r,ref:t})});Kr.displayName=Vr;var hu="AlertDialogAction",qr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx($r,{...o,...r,ref:t})});qr.displayName=hu;var Yr="AlertDialogCancel",Xr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=fu(Yr,n),a=X(n),i=P(t,o);return d.jsx($r,{...a,...r,ref:i})});Xr.displayName=Yr;var vu=({contentRef:e})=>{const t=`\`${pe}\` requires a description for the component to be accessible for screen reader users. + +You can add a description to the \`${pe}\` by passing a \`${Vr}\` component as a child, which also benefits sighted users by adding visible context to the dialog. + +Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${pe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. + +For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return c.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Ql=Fr,Jl=zr,ed=Br,td=Wr,nd=Ur,rd=qr,od=Xr,ad=Hr,cd=Kr;export{Al as $,Gu as A,xu as B,_u as C,Ku as D,wl as E,Ou as F,Lu as G,Wu as H,Gl as I,yl as J,dl as K,Ul as L,sl as M,Rl as N,Ju as O,Bl as P,yu as Q,Vl as R,Yl as S,zl as T,Il as U,ju as V,Tl as W,Tu as X,bl as Y,jl as Z,$l as _,Xl as a,qu as a0,Ol as a1,zi as a2,Bi as a3,xl as a4,Uu as a5,Fu as a6,gu as a7,ul as a8,al as a9,cu as aA,ru as aB,tl as aC,Ql as aD,Jl as aE,ed as aF,nd as aG,ad as aH,cd as aI,od as aJ,rd as aK,td as aL,El as aM,Cl as aN,Ml as aO,Du as aP,nl as aa,vl as ab,ml as ac,el as ad,rl as ae,wu as af,Vu as ag,Pl as ah,Sl as ai,ll as aj,gl as ak,Qu as al,Zu as am,Nu as an,Xu as ao,Hu as ap,Iu as aq,hl as ar,Nl as as,Dl as at,Zl as au,eu as av,nu as aw,ou as ax,$r as ay,au as az,Wl as b,Hl as c,Kl as d,Cu as e,ku as f,ql as g,Fl as h,Su as i,Ru as j,Au as k,Eu as l,il as m,Yu as n,pl as o,fl as p,bu as q,zu as r,Mu as s,Bu as t,_l as u,ol as v,cl as w,kl as x,$u as y,Pu as z}; diff --git a/embed_static/static/spa/assets/ui-vendor-Gb6mai95.js b/embed_static/static/spa/assets/ui-vendor-Gb6mai95.js deleted file mode 100644 index d20f3b8..0000000 --- a/embed_static/static/spa/assets/ui-vendor-Gb6mai95.js +++ /dev/null @@ -1,356 +0,0 @@ -import{r as c,j as d,R as at,a as Ht,u as to,o as no,s as ro,f as oo,b as ao,c as co,h as so,d as io,l as uo}from"./react-vendor-1fwFMt02.js";/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lo=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fo=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pt=e=>{const t=fo(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var Ve={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const po=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},ho=c.createContext({}),vo=()=>c.useContext(ho),mo=c.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},p)=>{const{size:l=24,strokeWidth:f=2,absoluteStrokeWidth:u=!1,color:h="currentColor",className:y=""}=vo()??{},g=r??u?Number(n??f)*24/Number(t??l):n??f;return c.createElement("svg",{ref:p,...Ve,width:t??l??Ve.width,height:t??l??Ve.height,stroke:e??h,strokeWidth:g,className:Vt("lucide",y,o),...!a&&!po(s)&&{"aria-hidden":"true"},...s},[...i.map(([v,m])=>c.createElement(v,m)),...Array.isArray(a)?a:[a]])});/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const C=(e,t)=>{const n=c.forwardRef(({className:r,...o},a)=>c.createElement(mo,{ref:a,iconNode:t,className:Vt(`lucide-${lo(Pt(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pt(e),n};/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const go=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Zi=C("arrow-left",go);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yo=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Qi=C("arrow-right",yo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wo=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Ji=C("bold",wo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xo=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],eu=C("camera",xo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Co=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],tu=C("check",Co);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bo=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nu=C("chevron-right",bo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Eo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ru=C("circle",Eo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mo=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],ou=C("clock",Mo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const _o=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],au=C("code",_o);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const So=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],cu=C("database",So);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ro=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],su=C("file-code",Ro);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ko=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],iu=C("file-text",ko);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Po=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],uu=C("flame",Po);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ao=[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]],lu=C("folder-kanban",Ao);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const No=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],du=C("git-compare",No);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Do=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],fu=C("history",Do);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Io=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],pu=C("house",Io);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const To=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],hu=C("image",To);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oo=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],vu=C("italic",Oo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jo=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],mu=C("layout-dashboard",jo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lo=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],gu=C("link",Lo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $o=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],yu=C("list-ordered",$o);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fo=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],wu=C("list",Fo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Wo=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xu=C("loader-circle",Wo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bo=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],Cu=C("lock-keyhole",Bo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uo=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],bu=C("lock-open",Uo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zo=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Eu=C("lock",zo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Go=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Mu=C("log-out",Go);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ko=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],_u=C("maximize-2",Ko);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ho=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],Su=C("message-circle",Ho);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Vo=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ru=C("message-square",Vo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qo=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],ku=C("minimize-2",qo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Yo=[["path",{d:"M5 12h14",key:"1ays0h"}]],Pu=C("minus",Yo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xo=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Au=C("moon",Xo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zo=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],Nu=C("pen-line",Zo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Qo=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Du=C("pencil",Qo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jo=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],Iu=C("pin",Jo);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ea=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Tu=C("plus",ea);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ta=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],Ou=C("quote",ta);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const na=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ju=C("search",na);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ra=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Lu=C("send",ra);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const oa=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],$u=C("server",oa);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const aa=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Fu=C("settings",aa);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ca=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Wu=C("shield",ca);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sa=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Bu=C("sliders-horizontal",sa);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ia=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Uu=C("star",ia);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ua=[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],zu=C("strikethrough",ua);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const la=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Gu=C("sun",la);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const da=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Ku=C("tag",da);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fa=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],Hu=C("thumbs-up",fa);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pa=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],Vu=C("underline",pa);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ha=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],qu=C("upload",ha);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const va=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Yu=C("users",va);/** - * @license lucide-react v1.18.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ma=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xu=C("x",ma);function S(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function At(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ct(...e){return t=>{let n=!1;const r=e.map(o=>{const a=At(o,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let o=0;o{const{children:i,...s}=a,p=c.useMemo(()=>s,Object.values(s));return d.jsx(n.Provider,{value:p,children:i})};r.displayName=e+"Provider";function o(a){const i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[r,o]}function J(e,t=[]){let n=[];function r(a,i){const s=c.createContext(i);s.displayName=a+"Context";const p=n.length;n=[...n,i];const l=u=>{var w;const{scope:h,children:y,...g}=u,v=((w=h==null?void 0:h[e])==null?void 0:w[p])||s,m=c.useMemo(()=>g,Object.values(g));return d.jsx(v.Provider,{value:m,children:y})};l.displayName=a+"Provider";function f(u,h){var v;const y=((v=h==null?void 0:h[e])==null?void 0:v[p])||s,g=c.useContext(y);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[l,f]}const o=()=>{const a=n.map(i=>c.createContext(i));return function(s){const p=(s==null?void 0:s[e])||a;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:p}}),[s,p])}};return o.scopeName=e,[r,ya(o,...t)]}function ya(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((s,{useScope:p,scopeName:l})=>{const u=p(a)[`__scope${l}`];return{...s,...u}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var q=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},wa=at[" useInsertionEffect ".trim().toString()]||q;function We({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,a,i]=xa({defaultProp:t,onChange:n}),s=e!==void 0,p=s?e:o;{const f=c.useRef(e!==void 0);c.useEffect(()=>{const u=f.current;u!==s&&console.warn(`${r} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=s},[s,r])}const l=c.useCallback(f=>{var u;if(s){const h=Ca(f)?f(e):f;h!==e&&((u=i.current)==null||u.call(i,h))}else a(f)},[s,e,a,i]);return[p,l]}function xa({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),a=c.useRef(t);return wa(()=>{a.current=t},[t]),c.useEffect(()=>{var i;o.current!==n&&((i=a.current)==null||i.call(a,n),o.current=n)},[n,o]),[n,r,a]}function Ca(e){return typeof e=="function"}function he(e){const t=c.forwardRef((n,r)=>{let{children:o,...a}=n,i=null,s=!1;const p=[];Nt(o)&&typeof ke=="function"&&(o=ke(o._payload)),c.Children.forEach(o,h=>{var y;if(Sa(h)){s=!0;const g=h;let v="child"in g.props?g.props.child:g.props.children;Nt(v)&&typeof ke=="function"&&(v=ke(v._payload)),i=Ea(g,v),p.push((y=i==null?void 0:i.props)==null?void 0:y.children)}else p.push(h)}),i?i=c.cloneElement(i,void 0,p):!s&&c.Children.count(o)===1&&c.isValidElement(o)&&(i=o);const l=i?_a(i):void 0,f=N(r,l);if(!i){if(o||o===0)throw new Error(s?Aa(e):Pa(e));return o}const u=Ma(a,i.props??{});return i.type!==c.Fragment&&(u.ref=r?f:l),c.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}var Zu=he("Slot"),qt=Symbol.for("radix.slottable");function ba(e){const t=n=>"child"in n?n.children(n.child):n.children;return t.displayName=`${e}.Slottable`,t.__radixId=qt,t}var Ea=(e,t)=>{if("child"in e.props){const n=e.props.child;return c.isValidElement(n)?c.cloneElement(n,void 0,e.props.children(n.props.children)):null}return c.isValidElement(t)?t:null};function Ma(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{const p=a(...s);return o(...s),p}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}function _a(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Sa(e){return c.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qt}var Ra=Symbol.for("react.lazy");function Nt(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Ra&&"_payload"in e&&ka(e._payload)}function ka(e){return typeof e=="object"&&e!==null&&"then"in e}var Pa=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Aa=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,ke=at[" use ".trim().toString()],Na=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],A=Na.reduce((e,t)=>{const n=he(`Primitive.${t}`),r=c.forwardRef((o,a)=>{const{asChild:i,...s}=o,p=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(p,{...s,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Yt(e,t){e&&Ht.flushSync(()=>e.dispatchEvent(t))}function Xt(e){const t=e+"CollectionProvider",[n,r]=J(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:m,children:w}=v,b=c.useRef(null),x=c.useRef(new Map).current;return d.jsx(o,{scope:m,itemMap:x,collectionRef:b,children:w})};i.displayName=t;const s=e+"CollectionSlot",p=he(s),l=c.forwardRef((v,m)=>{const{scope:w,children:b}=v,x=a(s,w),E=N(m,x.collectionRef);return d.jsx(p,{ref:E,children:b})});l.displayName=s;const f=e+"CollectionItemSlot",u="data-radix-collection-item",h=he(f),y=c.forwardRef((v,m)=>{const{scope:w,children:b,...x}=v,E=c.useRef(null),R=N(m,E),k=a(f,w);return c.useEffect(()=>(k.itemMap.set(E,{ref:E,...x}),()=>void k.itemMap.delete(E))),d.jsx(h,{[u]:"",ref:R,children:b})});y.displayName=f;function g(v){const m=a(e+"CollectionConsumer",v);return c.useCallback(()=>{const b=m.collectionRef.current;if(!b)return[];const x=Array.from(b.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((k,_)=>x.indexOf(k.ref.current)-x.indexOf(_.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:i,Slot:l,ItemSlot:y},g,r]}var Da=c.createContext(void 0);function Zt(e){const t=c.useContext(Da);return e||t||"ltr"}function Y(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ia(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ta="DismissableLayer",tt="dismissableLayer.update",Oa="dismissableLayer.pointerDownOutside",ja="dismissableLayer.focusOutside",Dt,Qt=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),st=c.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...p}=e,l=c.useContext(Qt),[f,u]=c.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=c.useState({}),g=N(t,_=>u(_)),v=Array.from(l.layers),[m]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(m),b=f?v.indexOf(f):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,E=b>=w,R=Fa(_=>{const P=_.target,I=[...l.branches].some(T=>T.contains(P));!E||I||(o==null||o(_),i==null||i(_),_.defaultPrevented||s==null||s())},h),k=Wa(_=>{const P=_.target;[...l.branches].some(T=>T.contains(P))||(a==null||a(_),i==null||i(_),_.defaultPrevented||s==null||s())},h);return Ia(_=>{b===l.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&s&&(_.preventDefault(),s()))},h),c.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Dt=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),It(),()=>{n&&(l.layersWithOutsidePointerEventsDisabled.delete(f),l.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=Dt))}},[f,h,n,l]),c.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),It())},[f,l]),c.useEffect(()=>{const _=()=>y({});return document.addEventListener(tt,_),()=>document.removeEventListener(tt,_)},[]),d.jsx(A.div,{...p,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,k.onFocusCapture),onBlurCapture:S(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,R.onPointerDownCapture)})});st.displayName=Ta;var La="DismissableLayerBranch",$a=c.forwardRef((e,t)=>{const n=c.useContext(Qt),r=c.useRef(null),o=N(t,r);return c.useEffect(()=>{const a=r.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),d.jsx(A.div,{...e,ref:o})});$a.displayName=La;function Fa(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let p=function(){Jt(Oa,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=p,t.addEventListener("click",o.current,{once:!0})):p()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Wa(e,t=globalThis==null?void 0:globalThis.document){const n=Y(e),r=c.useRef(!1);return c.useEffect(()=>{const o=a=>{a.target&&!r.current&&Jt(ja,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function It(){const e=new CustomEvent(tt);document.dispatchEvent(e)}function Jt(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Yt(o,a):o.dispatchEvent(a)}var Pe=0,K=null;function en(){c.useEffect(()=>{K||(K={start:Tt(),end:Tt()});const{start:e,end:t}=K;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Pe++,()=>{Pe===1&&(K==null||K.start.remove(),K==null||K.end.remove(),K=null),Pe=Math.max(0,Pe-1)}},[])}function Tt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qe="focusScope.autoFocusOnMount",Ye="focusScope.autoFocusOnUnmount",Ot={bubbles:!1,cancelable:!0},Ba="FocusScope",it=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,p]=c.useState(null),l=Y(o),f=Y(a),u=c.useRef(null),h=N(t,v=>p(v)),y=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let v=function(x){if(y.paused||!s)return;const E=x.target;s.contains(E)?u.current=E:Q(u.current,{select:!0})},m=function(x){if(y.paused||!s)return;const E=x.relatedTarget;E!==null&&(s.contains(E)||Q(u.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const R of x)R.removedNodes.length>0&&Q(s)};document.addEventListener("focusin",v),document.addEventListener("focusout",m);const b=new MutationObserver(w);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),b.disconnect()}}},[r,s,y.paused]),c.useEffect(()=>{if(s){Lt.add(y);const v=document.activeElement;if(!s.contains(v)){const w=new CustomEvent(qe,Ot);s.addEventListener(qe,l),s.dispatchEvent(w),w.defaultPrevented||(Ua(Va(tn(s)),{select:!0}),document.activeElement===v&&Q(s))}return()=>{s.removeEventListener(qe,l),setTimeout(()=>{const w=new CustomEvent(Ye,Ot);s.addEventListener(Ye,f),s.dispatchEvent(w),w.defaultPrevented||Q(v??document.body,{select:!0}),s.removeEventListener(Ye,f),Lt.remove(y)},0)}}},[s,l,f,y]);const g=c.useCallback(v=>{if(!n&&!r||y.paused)return;const m=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(m&&w){const b=v.currentTarget,[x,E]=za(b);x&&E?!v.shiftKey&&w===E?(v.preventDefault(),n&&Q(x,{select:!0})):v.shiftKey&&w===x&&(v.preventDefault(),n&&Q(E,{select:!0})):w===b&&v.preventDefault()}},[n,r,y.paused]);return d.jsx(A.div,{tabIndex:-1,...i,ref:h,onKeyDown:g})});it.displayName=Ba;function Ua(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Q(r,{select:t}),document.activeElement!==n)return}function za(e){const t=tn(e),n=jt(t,e),r=jt(t.reverse(),e);return[n,r]}function tn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function jt(e,t){for(const n of e)if(!Ga(n,{upTo:t}))return n}function Ga(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ka(e){return e instanceof HTMLInputElement&&"select"in e}function Q(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ka(e)&&t&&e.select()}}var Lt=Ha();function Ha(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=$t(e,t),e.unshift(t)},remove(t){var n;e=$t(e,t),(n=e[0])==null||n.resume()}}}function $t(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Va(e){return e.filter(t=>t.tagName!=="A")}var qa=at[" useId ".trim().toString()]||(()=>{}),Ya=0;function de(e){const[t,n]=c.useState(qa());return q(()=>{n(r=>r??String(Ya++))},[e]),t?`radix-${t}`:""}var Xa="Arrow",nn=c.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return d.jsx(A.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});nn.displayName=Xa;var Za=nn;function rn(e){const[t,n]=c.useState(void 0);return q(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const p=a.borderBoxSize,l=Array.isArray(p)?p[0]:p;i=l.inlineSize,s=l.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ut="Popper",[on,an]=J(ut),[Qa,cn]=on(ut),sn=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null),[a,i]=c.useState(void 0);return d.jsx(Qa,{scope:t,anchor:r,onAnchorChange:o,placementState:a,setPlacementState:i,children:n})};sn.displayName=ut;var un="PopperAnchor",ln=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=cn(un,n),i=c.useRef(null),s=a.onAnchorChange,p=c.useCallback(g=>{i.current=g,g&&s(g)},[s]),l=N(t,p),f=c.useRef(null);c.useEffect(()=>{if(!r)return;const g=f.current;f.current=r.current,g!==f.current&&s(f.current)});const u=a.placementState&&dt(a.placementState),h=u==null?void 0:u[0],y=u==null?void 0:u[1];return r?null:d.jsx(A.div,{"data-radix-popper-side":h,"data-radix-popper-align":y,...o,ref:l})});ln.displayName=un;var lt="PopperContent",[Ja,ec]=on(lt),dn=c.forwardRef((e,t)=>{var ge,B,ye,_t,St,Rt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:p=!0,collisionBoundary:l,collisionPadding:f=0,sticky:u="partial",hideWhenDetached:h=!1,updatePositionStrategy:y="optimized",onPlaced:g,...v}=e,m=cn(lt,n),[w,b]=c.useState(null),x=N(t,we=>b(we)),[E,R]=c.useState(null),k=rn(E),_=(k==null?void 0:k.width)??0,P=(k==null?void 0:k.height)??0,I=r+(a!=="center"?"-"+a:""),T=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=l?Array.isArray(l)?l:[l]:void 0,G=D!==void 0&&D.length>0,V={padding:T,boundary:D==null?void 0:D.filter(nc),altBoundary:G},{refs:ae,floatingStyles:ce,placement:L,isPositioned:se,middlewareData:$}=to({strategy:"fixed",placement:I,whileElementsMounted:(...we)=>io(...we,{animationFrame:y==="always"}),elements:{reference:m.anchor},middleware:[no({mainAxis:o+P,alignmentAxis:i}),p&&ro({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?uo():void 0,...V}),p&&oo({...V}),ao({...V,apply:({elements:we,rects:kt,availableWidth:Zr,availableHeight:Qr})=>{const{width:Jr,height:eo}=kt.reference,Re=we.floating.style;Re.setProperty("--radix-popper-available-width",`${Zr}px`),Re.setProperty("--radix-popper-available-height",`${Qr}px`),Re.setProperty("--radix-popper-anchor-width",`${Jr}px`),Re.setProperty("--radix-popper-anchor-height",`${eo}px`)}}),E&&co({element:E,padding:s}),rc({arrowWidth:_,arrowHeight:P}),h&&so({strategy:"referenceHidden",...V})]}),M=m.setPlacementState;q(()=>(M(L),()=>{M(void 0)}),[L,M]);const[O,F]=dt(L),W=Y(g);q(()=>{se&&(W==null||W())},[se,W]);const ve=(ge=$.arrow)==null?void 0:ge.x,me=(B=$.arrow)==null?void 0:B.y,Se=((ye=$.arrow)==null?void 0:ye.centerOffset)!==0,[te,Z]=c.useState();return q(()=>{w&&Z(window.getComputedStyle(w).zIndex)},[w]),d.jsx("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:se?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(_t=$.transformOrigin)==null?void 0:_t.x,(St=$.transformOrigin)==null?void 0:St.y].join(" "),...((Rt=$.hide)==null?void 0:Rt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(Ja,{scope:n,placedSide:O,placedAlign:F,onArrowChange:R,arrowX:ve,arrowY:me,shouldHideArrow:Se,children:d.jsx(A.div,{"data-side":O,"data-align":F,...v,ref:x,style:{...v.style,animation:se?void 0:"none"}})})})});dn.displayName=lt;var fn="PopperArrow",tc={top:"bottom",right:"left",bottom:"top",left:"right"},pn=c.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,a=ec(fn,r),i=tc[a.placedSide];return d.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:d.jsx(Za,{...o,ref:n,style:{...o.style,display:"block"}})})});pn.displayName=fn;function nc(e){return e!==null}var rc=e=>({name:"transformOrigin",options:e,fn(t){var m,w,b;const{placement:n,rects:r,middlewareData:o}=t,i=((m=o.arrow)==null?void 0:m.centerOffset)!==0,s=i?0:e.arrowWidth,p=i?0:e.arrowHeight,[l,f]=dt(n),u={start:"0%",center:"50%",end:"100%"}[f],h=(((w=o.arrow)==null?void 0:w.x)??0)+s/2,y=(((b=o.arrow)==null?void 0:b.y)??0)+p/2;let g="",v="";return l==="bottom"?(g=i?u:`${h}px`,v=`${-p}px`):l==="top"?(g=i?u:`${h}px`,v=`${r.floating.height+p}px`):l==="right"?(g=`${-p}px`,v=i?u:`${y}px`):l==="left"&&(g=`${r.floating.width+p}px`,v=i?u:`${y}px`),{data:{x:g,y:v}}}});function dt(e){const[t,n="center"]=e.split("-");return[t,n]}var oc=sn,ac=ln,cc=dn,sc=pn,ic="Portal",ft=c.forwardRef((e,t)=>{var s;const{container:n,...r}=e,[o,a]=c.useState(!1);q(()=>a(!0),[]);const i=n||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?Ht.createPortal(d.jsx(A.div,{...r,ref:t}),i):null});ft.displayName=ic;function uc(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var ee=e=>{const{present:t,children:n}=e,r=lc(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=dc(r.ref,fc(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};ee.displayName="Presence";function lc(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,p]=uc(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=Ae(r.current);a.current=s==="mounted"?l:"none"},[s]),q(()=>{const l=r.current,f=o.current;if(f!==e){const h=a.current,y=Ae(l);e?p("MOUNT"):y==="none"||(l==null?void 0:l.display)==="none"?p("UNMOUNT"):p(f&&h!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,p]),q(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,u=y=>{const v=Ae(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&v&&(p("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=y=>{y.target===t&&(a.current=Ae(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ft(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function dc(...e){const t=c.useRef(e);return t.current=e,c.useCallback(n=>{const r=t.current;let o=!1;const a=r.map(i=>{const s=Ft(i,n);return!o&&typeof s=="function"&&(o=!0),s});if(o)return()=>{for(let i=0;id.jsx(nt.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(nt.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(yc,{...e,ref:t})})}));mn.displayName=Ee;var yc=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:p,onEntryFocus:l,preventScrollOnEntryFocus:f=!1,...u}=e,h=c.useRef(null),y=N(t,h),g=Zt(a),[v,m]=We({prop:i,defaultProp:s??null,onChange:p,caller:Ee}),[w,b]=c.useState(!1),x=Y(l),E=hn(n),R=c.useRef(!1),[k,_]=c.useState(0);return c.useEffect(()=>{const P=h.current;if(P)return P.addEventListener(Xe,x),()=>P.removeEventListener(Xe,x)},[x]),d.jsx(mc,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:v,onItemFocus:c.useCallback(P=>m(P),[m]),onItemShiftTab:c.useCallback(()=>b(!0),[]),onFocusableItemAdd:c.useCallback(()=>_(P=>P+1),[]),onFocusableItemRemove:c.useCallback(()=>_(P=>P-1),[]),children:d.jsx(A.div,{tabIndex:w||k===0?-1:0,"data-orientation":r,...u,ref:y,style:{outline:"none",...e.style},onMouseDown:S(e.onMouseDown,()=>{R.current=!0}),onFocus:S(e.onFocus,P=>{const I=!R.current;if(P.target===P.currentTarget&&I&&!w){const T=new CustomEvent(Xe,pc);if(P.currentTarget.dispatchEvent(T),!T.defaultPrevented){const D=E().filter(L=>L.focusable),G=D.find(L=>L.active),V=D.find(L=>L.id===v),ce=[G,V,...D].filter(Boolean).map(L=>L.ref.current);wn(ce,f)}}R.current=!1}),onBlur:S(e.onBlur,()=>b(!1))})})}),gn="RovingFocusGroupItem",yn=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...s}=e,p=de(),l=a||p,f=gc(gn,n),u=f.currentTabStopId===l,h=hn(n),{onFocusableItemAdd:y,onFocusableItemRemove:g,currentTabStopId:v}=f;return c.useEffect(()=>{if(r)return y(),()=>g()},[r,y,g]),d.jsx(nt.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:d.jsx(A.span,{tabIndex:u?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:S(e.onMouseDown,m=>{r?f.onItemFocus(l):m.preventDefault()}),onFocus:S(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:S(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){f.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=Cc(m,f.orientation,f.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=h().filter(E=>E.focusable).map(E=>E.ref.current);if(w==="last")x.reverse();else if(w==="prev"||w==="next"){w==="prev"&&x.reverse();const E=x.indexOf(m.currentTarget);x=f.loop?bc(x,E+1):x.slice(E+1)}setTimeout(()=>wn(x))}}),children:typeof i=="function"?i({isCurrentTabStop:u,hasTabStop:v!=null}):i})})});yn.displayName=gn;var wc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Cc(e,t,n){const r=xc(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wc[r]}function wn(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ec=mn,Mc=yn,_c=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ie=new WeakMap,Ne=new WeakMap,De={},Ze=0,xn=function(e){return e&&(e.host||xn(e.parentNode))},Sc=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Rc=function(e,t,n,r){var o=Sc(t,Array.isArray(e)?e:[e]);De[n]||(De[n]=new WeakMap);var a=De[n],i=[],s=new Set,p=new Set(o),l=function(u){!u||s.has(u)||(s.add(u),l(u.parentNode))};o.forEach(l);var f=function(u){!u||p.has(u)||Array.prototype.forEach.call(u.children,function(h){if(s.has(h))f(h);else try{var y=h.getAttribute(r),g=y!==null&&y!=="false",v=(ie.get(h)||0)+1,m=(a.get(h)||0)+1;ie.set(h,v),a.set(h,m),i.push(h),v===1&&g&&Ne.set(h,!0),m===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return f(t),s.clear(),Ze++,function(){i.forEach(function(u){var h=ie.get(u)-1,y=a.get(u)-1;ie.set(u,h),a.set(u,y),h||(Ne.has(u)||u.removeAttribute(r),Ne.delete(u)),y||u.removeAttribute(n)}),Ze--,Ze||(ie=new WeakMap,ie=new WeakMap,Ne=new WeakMap,De={})}},Cn=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=_c(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Rc(r,o,n,"aria-hidden")):function(){return null}},H=function(){return H=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return Gc;var t=Kc(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vc=_n(),fe="data-scroll-locked",qc=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Pc,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(s,"px ").concat(r,`; - } - body[`).concat(fe,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(a,`px; - padding-right: `).concat(i,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(s,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Oe,` { - right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(je,` { - margin-right: `).concat(s,"px ").concat(r,`; - } - - .`).concat(Oe," .").concat(Oe,` { - right: 0 `).concat(r,`; - } - - .`).concat(je," .").concat(je,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(fe,`] { - `).concat(Ac,": ").concat(s,`px; - } -`)},Bt=function(){var e=parseInt(document.body.getAttribute(fe)||"0",10);return isFinite(e)?e:0},Yc=function(){c.useEffect(function(){return document.body.setAttribute(fe,(Bt()+1).toString()),function(){var e=Bt()-1;e<=0?document.body.removeAttribute(fe):document.body.setAttribute(fe,e.toString())}},[])},Xc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Yc();var a=c.useMemo(function(){return Hc(o)},[o]);return c.createElement(Vc,{styles:qc(a,!t,o,n?"":"!important")})},rt=!1;if(typeof window<"u")try{var Ie=Object.defineProperty({},"passive",{get:function(){return rt=!0,!0}});window.addEventListener("test",Ie,Ie),window.removeEventListener("test",Ie,Ie)}catch{rt=!1}var ue=rt?{passive:!1}:!1,Zc=function(e){return e.tagName==="TEXTAREA"},Sn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zc(e)&&n[t]==="visible")},Qc=function(e){return Sn(e,"overflowY")},Jc=function(e){return Sn(e,"overflowX")},Ut=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Rn(e,r);if(o){var a=kn(e,r),i=a[1],s=a[2];if(i>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},es=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ts=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Rn=function(e,t){return e==="v"?Qc(t):Jc(t)},kn=function(e,t){return e==="v"?es(t):ts(t)},ns=function(e,t){return e==="h"&&t==="rtl"?-1:1},rs=function(e,t,n,r,o){var a=ns(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,p=t.contains(s),l=!1,f=i>0,u=0,h=0;do{if(!s)break;var y=kn(e,s),g=y[0],v=y[1],m=y[2],w=v-m-a*g;(g||w)&&Rn(e,s)&&(u+=w,h+=g);var b=s.parentNode;s=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!p&&s!==document.body||p&&(t.contains(s)||t===s));return(f&&Math.abs(u)<1||!f&&Math.abs(h)<1)&&(l=!0),l},Te=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zt=function(e){return[e.deltaX,e.deltaY]},Gt=function(e){return e&&"current"in e?e.current:e},os=function(e,t){return e[0]===t[0]&&e[1]===t[1]},as=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},cs=0,le=[];function ss(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),o=c.useState(cs++)[0],a=c.useState(_n)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=kc([e.lockRef.current],(e.shards||[]).map(Gt),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var w=Te(v),b=n.current,x="deltaX"in v?v.deltaX:b[0]-w[0],E="deltaY"in v?v.deltaY:b[1]-w[1],R,k=v.target,_=Math.abs(x)>Math.abs(E)?"h":"v";if("touches"in v&&_==="h"&&k.type==="range")return!1;var P=window.getSelection(),I=P&&P.anchorNode,T=I?I===k||I.contains(k):!1;if(T)return!1;var D=Ut(_,k);if(!D)return!0;if(D?R=_:(R=_==="v"?"h":"v",D=Ut(_,k)),!D)return!1;if(!r.current&&"changedTouches"in v&&(x||E)&&(r.current=R),!R)return!0;var G=r.current||R;return rs(G,m,v,G==="h"?x:E)},[]),p=c.useCallback(function(v){var m=v;if(!(!le.length||le[le.length-1]!==a)){var w="deltaY"in m?zt(m):Te(m),b=t.current.filter(function(R){return R.name===m.type&&(R.target===m.target||m.target===R.shadowParent)&&os(R.delta,w)})[0];if(b&&b.should){m.cancelable&&m.preventDefault();return}if(!b){var x=(i.current.shards||[]).map(Gt).filter(Boolean).filter(function(R){return R.contains(m.target)}),E=x.length>0?s(m,x[0]):!i.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),l=c.useCallback(function(v,m,w,b){var x={name:v,delta:m,target:w,should:b,shadowParent:is(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(E){return E!==x})},1)},[]),f=c.useCallback(function(v){n.current=Te(v),r.current=void 0},[]),u=c.useCallback(function(v){l(v.type,zt(v),v.target,s(v,e.lockRef.current))},[]),h=c.useCallback(function(v){l(v.type,Te(v),v.target,s(v,e.lockRef.current))},[]);c.useEffect(function(){return le.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:h}),document.addEventListener("wheel",p,ue),document.addEventListener("touchmove",p,ue),document.addEventListener("touchstart",f,ue),function(){le=le.filter(function(v){return v!==a}),document.removeEventListener("wheel",p,ue),document.removeEventListener("touchmove",p,ue),document.removeEventListener("touchstart",f,ue)}},[]);var y=e.removeScrollBar,g=e.inert;return c.createElement(c.Fragment,null,g?c.createElement(a,{styles:as(o)}):null,y?c.createElement(Xc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function is(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const us=Lc(Mn,ss);var pt=c.forwardRef(function(e,t){return c.createElement(Be,H({},e,{ref:t,sideCar:us}))});pt.classNames=Be.classNames;var ot=["Enter"," "],ls=["ArrowDown","PageUp","Home"],Pn=["ArrowUp","PageDown","End"],ds=[...ls,...Pn],fs={ltr:[...ot,"ArrowRight"],rtl:[...ot,"ArrowLeft"]},ps={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Me="Menu",[Ce,hs,vs]=Xt(Me),[re,An]=J(Me,[vs,an,vn]),Ue=an(),Nn=vn(),[ms,oe]=re(Me),[gs,_e]=re(Me),Dn=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=Ue(t),[p,l]=c.useState(null),f=c.useRef(!1),u=Y(a),h=Zt(o);return c.useEffect(()=>{const y=()=>{f.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>f.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),d.jsx(oc,{...s,children:d.jsx(ms,{scope:t,open:n,onOpenChange:u,content:p,onContentChange:l,children:d.jsx(gs,{scope:t,onClose:c.useCallback(()=>u(!1),[u]),isUsingKeyboardRef:f,dir:h,modal:i,children:r})})})};Dn.displayName=Me;var ys="MenuAnchor",ht=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ue(n);return d.jsx(ac,{...o,...r,ref:t})});ht.displayName=ys;var vt="MenuPortal",[ws,In]=re(vt,{forceMount:void 0}),Tn=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=oe(vt,t);return d.jsx(ws,{scope:t,forceMount:n,children:d.jsx(ee,{present:n||a.open,children:d.jsx(ft,{asChild:!0,container:o,children:r})})})};Tn.displayName=vt;var U="MenuContent",[xs,mt]=re(U),On=c.forwardRef((e,t)=>{const n=In(U,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=oe(U,e.__scopeMenu),i=_e(U,e.__scopeMenu);return d.jsx(Ce.Provider,{scope:e.__scopeMenu,children:d.jsx(ee,{present:r||a.open,children:d.jsx(Ce.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(Cs,{...o,ref:t}):d.jsx(bs,{...o,ref:t})})})})}),Cs=c.forwardRef((e,t)=>{const n=oe(U,e.__scopeMenu),r=c.useRef(null),o=N(t,r);return c.useEffect(()=>{const a=r.current;if(a)return Cn(a)},[]),d.jsx(gt,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),bs=c.forwardRef((e,t)=>{const n=oe(U,e.__scopeMenu);return d.jsx(gt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Es=he("MenuContent.ScrollLock"),gt=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:p,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:y,disableOutsideScroll:g,...v}=e,m=oe(U,n),w=_e(U,n),b=Ue(n),x=Nn(n),E=hs(n),[R,k]=c.useState(null),_=c.useRef(null),P=N(t,_,m.onContentChange),I=c.useRef(0),T=c.useRef(""),D=c.useRef(0),G=c.useRef(null),V=c.useRef("right"),ae=c.useRef(0),ce=g?pt:c.Fragment,L=g?{as:Es,allowPinchZoom:!0}:void 0,se=M=>{var Z,ge;const O=T.current+M,F=E().filter(B=>!B.disabled),W=document.activeElement,ve=(Z=F.find(B=>B.ref.current===W))==null?void 0:Z.textValue,me=F.map(B=>B.textValue),Se=Os(me,O,ve),te=(ge=F.find(B=>B.textValue===Se))==null?void 0:ge.ref.current;(function B(ye){T.current=ye,window.clearTimeout(I.current),ye!==""&&(I.current=window.setTimeout(()=>B(""),1e3))})(O),te&&setTimeout(()=>te.focus())};c.useEffect(()=>()=>window.clearTimeout(I.current),[]),en();const $=c.useCallback(M=>{var F,W;return V.current===((F=G.current)==null?void 0:F.side)&&Ls(M,(W=G.current)==null?void 0:W.area)},[]);return d.jsx(xs,{scope:n,searchRef:T,onItemEnter:c.useCallback(M=>{$(M)&&M.preventDefault()},[$]),onItemLeave:c.useCallback(M=>{var O;$(M)||((O=_.current)==null||O.focus(),k(null))},[$]),onTriggerLeave:c.useCallback(M=>{$(M)&&M.preventDefault()},[$]),pointerGraceTimerRef:D,onPointerGraceIntentChange:c.useCallback(M=>{G.current=M},[]),children:d.jsx(ce,{...L,children:d.jsx(it,{asChild:!0,trapped:o,onMountAutoFocus:S(a,M=>{var O;M.preventDefault(),(O=_.current)==null||O.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(st,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:f,onFocusOutside:u,onInteractOutside:h,onDismiss:y,children:d.jsx(Ec,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:R,onCurrentTabStopIdChange:k,onEntryFocus:S(p,M=>{w.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(cc,{role:"menu","aria-orientation":"vertical","data-state":Zn(m.open),"data-radix-menu-content":"",dir:w.dir,...b,...v,ref:P,style:{outline:"none",...v.style},onKeyDown:S(v.onKeyDown,M=>{const F=M.target.closest("[data-radix-menu-content]")===M.currentTarget,W=M.ctrlKey||M.altKey||M.metaKey,ve=M.key.length===1;F&&(M.key==="Tab"&&M.preventDefault(),!W&&ve&&se(M.key));const me=_.current;if(M.target!==me||!ds.includes(M.key))return;M.preventDefault();const te=E().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);Pn.includes(M.key)&&te.reverse(),Is(te)}),onBlur:S(e.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(I.current),T.current="")}),onPointerMove:S(e.onPointerMove,be(M=>{const O=M.target,F=ae.current!==M.clientX;if(M.currentTarget.contains(O)&&F){const W=M.clientX>ae.current?"right":"left";V.current=W,ae.current=M.clientX}}))})})})})})})});On.displayName=U;var Ms="MenuGroup",yt=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{role:"group",...r,ref:t})});yt.displayName=Ms;var _s="MenuLabel",jn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{...r,ref:t})});jn.displayName=_s;var Le="MenuItem",Kt="menu.itemSelect",ze=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=c.useRef(null),i=_e(Le,e.__scopeMenu),s=mt(Le,e.__scopeMenu),p=N(t,a),l=c.useRef(!1),f=()=>{const u=a.current;if(!n&&u){const h=new CustomEvent(Kt,{bubbles:!0,cancelable:!0});u.addEventListener(Kt,y=>r==null?void 0:r(y),{once:!0}),Yt(u,h),h.defaultPrevented?l.current=!1:i.onClose()}};return d.jsx(Ln,{...o,ref:p,disabled:n,onClick:S(e.onClick,f),onPointerDown:u=>{var h;(h=e.onPointerDown)==null||h.call(e,u),l.current=!0},onPointerUp:S(e.onPointerUp,u=>{var h;l.current||(h=u.currentTarget)==null||h.click()}),onKeyDown:S(e.onKeyDown,u=>{const h=s.searchRef.current!=="";n||h&&u.key===" "||ot.includes(u.key)&&(u.currentTarget.click(),u.preventDefault())})})});ze.displayName=Le;var Ln=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=mt(Le,n),s=Nn(n),p=c.useRef(null),l=N(t,p),[f,u]=c.useState(!1),[h,y]=c.useState("");return c.useEffect(()=>{const g=p.current;g&&y((g.textContent??"").trim())},[a.children]),d.jsx(Ce.ItemSlot,{scope:n,disabled:r,textValue:o??h,children:d.jsx(Mc,{asChild:!0,...s,focusable:!r,children:d.jsx(A.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...a,ref:l,onPointerMove:S(e.onPointerMove,be(g=>{r?i.onItemLeave(g):(i.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,be(g=>i.onItemLeave(g))),onFocus:S(e.onFocus,()=>u(!0)),onBlur:S(e.onBlur,()=>u(!1))})})})}),Ss="MenuCheckboxItem",$n=c.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return d.jsx(zn,{scope:e.__scopeMenu,checked:n,children:d.jsx(ze,{role:"menuitemcheckbox","aria-checked":$e(n)?"mixed":n,...o,ref:t,"data-state":xt(n),onSelect:S(o.onSelect,()=>r==null?void 0:r($e(n)?!0:!n),{checkForDefaultPrevented:!1})})})});$n.displayName=Ss;var Fn="MenuRadioGroup",[Rs,ks]=re(Fn,{value:void 0,onValueChange:()=>{}}),Wn=c.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,a=Y(r);return d.jsx(Rs,{scope:e.__scopeMenu,value:n,onValueChange:a,children:d.jsx(yt,{...o,ref:t})})});Wn.displayName=Fn;var Bn="MenuRadioItem",Un=c.forwardRef((e,t)=>{const{value:n,...r}=e,o=ks(Bn,e.__scopeMenu),a=n===o.value;return d.jsx(zn,{scope:e.__scopeMenu,checked:a,children:d.jsx(ze,{role:"menuitemradio","aria-checked":a,...r,ref:t,"data-state":xt(a),onSelect:S(r.onSelect,()=>{var i;return(i=o.onValueChange)==null?void 0:i.call(o,n)},{checkForDefaultPrevented:!1})})})});Un.displayName=Bn;var wt="MenuItemIndicator",[zn,Ps]=re(wt,{checked:!1}),Gn=c.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,a=Ps(wt,n);return d.jsx(ee,{present:r||$e(a.checked)||a.checked===!0,children:d.jsx(A.span,{...o,ref:t,"data-state":xt(a.checked)})})});Gn.displayName=wt;var As="MenuSeparator",Kn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx(A.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});Kn.displayName=As;var Ns="MenuArrow",Hn=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ue(n);return d.jsx(sc,{...o,...r,ref:t})});Hn.displayName=Ns;var Ds="MenuSub",[Qu,Vn]=re(Ds),xe="MenuSubTrigger",qn=c.forwardRef((e,t)=>{const n=oe(xe,e.__scopeMenu),r=_e(xe,e.__scopeMenu),o=Vn(xe,e.__scopeMenu),a=mt(xe,e.__scopeMenu),i=c.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:p}=a,l={__scopeMenu:e.__scopeMenu},f=c.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return c.useEffect(()=>f,[f]),c.useEffect(()=>{const u=s.current;return()=>{window.clearTimeout(u),p(null)}},[s,p]),d.jsx(ht,{asChild:!0,...l,children:d.jsx(Ln,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":n.open?o.contentId:void 0,"data-state":Zn(n.open),...e,ref:ct(t,o.onTriggerChange),onClick:u=>{var h;(h=e.onClick)==null||h.call(e,u),!(e.disabled||u.defaultPrevented)&&(u.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,be(u=>{a.onItemEnter(u),!u.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(a.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:S(e.onPointerLeave,be(u=>{var y,g;f();const h=(y=n.content)==null?void 0:y.getBoundingClientRect();if(h){const v=(g=n.content)==null?void 0:g.dataset.side,m=v==="right",w=m?-5:5,b=h[m?"left":"right"],x=h[m?"right":"left"];a.onPointerGraceIntentChange({area:[{x:u.clientX+w,y:u.clientY},{x:b,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:b,y:h.bottom}],side:v}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(u),u.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,u=>{var y;const h=a.searchRef.current!=="";e.disabled||h&&u.key===" "||fs[r.dir].includes(u.key)&&(n.onOpenChange(!0),(y=n.content)==null||y.focus(),u.preventDefault())})})})});qn.displayName=xe;var Yn="MenuSubContent",Xn=c.forwardRef((e,t)=>{const n=In(U,e.__scopeMenu),{forceMount:r=n.forceMount,align:o="start",...a}=e,i=oe(U,e.__scopeMenu),s=_e(U,e.__scopeMenu),p=Vn(Yn,e.__scopeMenu),l=c.useRef(null),f=N(t,l);return d.jsx(Ce.Provider,{scope:e.__scopeMenu,children:d.jsx(ee,{present:r||i.open,children:d.jsx(Ce.Slot,{scope:e.__scopeMenu,children:d.jsx(gt,{id:p.contentId,"aria-labelledby":p.triggerId,...a,ref:f,align:o,side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var h;s.isUsingKeyboardRef.current&&((h=l.current)==null||h.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:S(e.onFocusOutside,u=>{u.target!==p.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:S(e.onKeyDown,u=>{var g;const h=u.currentTarget.contains(u.target),y=ps[s.dir].includes(u.key);h&&y&&(i.onOpenChange(!1),(g=p.trigger)==null||g.focus(),u.preventDefault())})})})})})});Xn.displayName=Yn;function Zn(e){return e?"open":"closed"}function $e(e){return e==="indeterminate"}function xt(e){return $e(e)?"indeterminate":e?"checked":"unchecked"}function Is(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ts(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Os(e,t,n){const o=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Ts(e,Math.max(a,0));o.length===1&&(i=i.filter(l=>l!==n));const p=i.find(l=>l.toLowerCase().startsWith(o.toLowerCase()));return p!==n?p:void 0}function js(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;ar!=h>r&&n<(u-l)*(r-f)/(h-f)+l&&(o=!o)}return o}function Ls(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return js(n,t)}function be(e){return t=>t.pointerType==="mouse"?e(t):void 0}var $s=Dn,Fs=ht,Ws=Tn,Bs=On,Us=yt,zs=jn,Gs=ze,Ks=$n,Hs=Wn,Vs=Un,qs=Gn,Ys=Kn,Xs=Hn,Zs=qn,Qs=Xn,Ge="DropdownMenu",[Js]=J(Ge,[An]),j=An(),[ei,Qn]=Js(Ge),Jn=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,p=j(t),l=c.useRef(null),[f,u]=We({prop:o,defaultProp:a??!1,onChange:i,caller:Ge});return d.jsx(ei,{scope:t,triggerId:de(),triggerRef:l,contentId:de(),open:f,onOpenChange:u,onOpenToggle:c.useCallback(()=>u(h=>!h),[u]),modal:s,children:d.jsx($s,{...p,open:f,onOpenChange:u,dir:r,modal:s,children:n})})};Jn.displayName=Ge;var er="DropdownMenuTrigger",tr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=Qn(er,n),i=j(n);return d.jsx(Fs,{asChild:!0,...i,children:d.jsx(A.button,{type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:ct(t,a.triggerRef),onPointerDown:S(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:S(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})})});tr.displayName=er;var ti="DropdownMenuPortal",nr=e=>{const{__scopeDropdownMenu:t,...n}=e,r=j(t);return d.jsx(Ws,{...r,...n})};nr.displayName=ti;var rr="DropdownMenuContent",or=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Qn(rr,n),a=j(n),i=c.useRef(!1);return d.jsx(Bs,{id:o.contentId,"aria-labelledby":o.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,s=>{var p;i.current||(p=o.triggerRef.current)==null||p.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:S(e.onInteractOutside,s=>{const p=s.detail.originalEvent,l=p.button===0&&p.ctrlKey===!0,f=p.button===2||l;(!o.modal||f)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});or.displayName=rr;var ni="DropdownMenuGroup",ri=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Us,{...o,...r,ref:t})});ri.displayName=ni;var oi="DropdownMenuLabel",ar=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(zs,{...o,...r,ref:t})});ar.displayName=oi;var ai="DropdownMenuItem",cr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Gs,{...o,...r,ref:t})});cr.displayName=ai;var ci="DropdownMenuCheckboxItem",sr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Ks,{...o,...r,ref:t})});sr.displayName=ci;var si="DropdownMenuRadioGroup",ii=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Hs,{...o,...r,ref:t})});ii.displayName=si;var ui="DropdownMenuRadioItem",ir=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Vs,{...o,...r,ref:t})});ir.displayName=ui;var li="DropdownMenuItemIndicator",ur=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(qs,{...o,...r,ref:t})});ur.displayName=li;var di="DropdownMenuSeparator",lr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Ys,{...o,...r,ref:t})});lr.displayName=di;var fi="DropdownMenuArrow",pi=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Xs,{...o,...r,ref:t})});pi.displayName=fi;var hi="DropdownMenuSubTrigger",dr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Zs,{...o,...r,ref:t})});dr.displayName=hi;var vi="DropdownMenuSubContent",fr=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=j(n);return d.jsx(Qs,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});fr.displayName=vi;var Ju=Jn,el=tr,tl=nr,nl=or,rl=ar,ol=cr,al=sr,cl=ir,sl=ur,il=lr,ul=dr,ll=fr;function mi(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ke="Switch",[gi]=J(Ke),[yi,Ct]=gi(Ke);function wi(e){const{__scopeSwitch:t,checked:n,children:r,defaultChecked:o,disabled:a,form:i,name:s,onCheckedChange:p,required:l,value:f="on",internal_do_not_use_render:u}=e,[h,y]=We({prop:n,defaultProp:o??!1,onChange:p,caller:Ke}),[g,v]=c.useState(null),[m,w]=c.useState(null),b=c.useRef(!1),x=g?!!i||!!g.closest("form"):!0,E={checked:h,setChecked:y,disabled:a,control:g,setControl:v,name:s,form:i,value:f,hasConsumerStoppedPropagationRef:b,required:l,defaultChecked:o,isFormControl:x,bubbleInput:m,setBubbleInput:w};return d.jsx(yi,{scope:t,...E,children:bi(u)?u(E):r})}var pr="SwitchTrigger",hr=c.forwardRef(({__scopeSwitch:e,onClick:t,...n},r)=>{const{value:o,disabled:a,checked:i,required:s,setControl:p,setChecked:l,hasConsumerStoppedPropagationRef:f,isFormControl:u,bubbleInput:h}=Ct(pr,e),y=N(r,p);return d.jsx(A.button,{type:"button",role:"switch","aria-checked":i,"aria-required":s,"data-state":yr(i),"data-disabled":a?"":void 0,disabled:a,value:o,...n,ref:y,onClick:S(t,g=>{l(v=>!v),h&&u&&(f.current=g.isPropagationStopped(),f.current||g.stopPropagation())})})});hr.displayName=pr;var xi=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:p,onCheckedChange:l,form:f,...u}=e;return d.jsx(wi,{__scopeSwitch:n,checked:o,defaultChecked:a,disabled:s,required:i,onCheckedChange:l,name:r,form:f,value:p,internal_do_not_use_render:({isFormControl:h})=>d.jsxs(d.Fragment,{children:[d.jsx(hr,{...u,ref:t,__scopeSwitch:n}),h&&d.jsx(gr,{__scopeSwitch:n})]})})});xi.displayName=Ke;var vr="SwitchThumb",Ci=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Ct(vr,n);return d.jsx(A.span,{"data-state":yr(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});Ci.displayName=vr;var mr="SwitchBubbleInput",gr=c.forwardRef(({__scopeSwitch:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:a,defaultChecked:i,required:s,disabled:p,name:l,value:f,form:u,bubbleInput:h,setBubbleInput:y}=Ct(mr,e),g=N(n,y),v=mi(a),m=rn(r);c.useEffect(()=>{const b=h;if(!b)return;const x=window.HTMLInputElement.prototype,R=Object.getOwnPropertyDescriptor(x,"checked").set,k=!o.current;if(v!==a&&R){const _=new Event("click",{bubbles:k});R.call(b,a),b.dispatchEvent(_)}},[h,v,a,o]);const w=c.useRef(a);return d.jsx(A.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??w.current,required:s,disabled:p,name:l,value:f,form:u,...t,tabIndex:-1,ref:g,style:{...t.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});gr.displayName=mr;function bi(e){return typeof e=="function"}function yr(e){return e?"checked":"unchecked"}var Ei="Label",wr=c.forwardRef((e,t)=>d.jsx(A.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));wr.displayName=Ei;var dl=wr,He="Dialog",[xr,Cr]=J(He),[Mi,z]=xr(He),br=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:a,modal:i=!0}=e,s=c.useRef(null),p=c.useRef(null),[l,f]=We({prop:r,defaultProp:o??!1,onChange:a,caller:He});return d.jsx(Mi,{scope:t,triggerRef:s,contentRef:p,contentId:de(),titleId:de(),descriptionId:de(),open:l,onOpenChange:f,onOpenToggle:c.useCallback(()=>f(u=>!u),[f]),modal:i,children:n})};br.displayName=He;var Er="DialogTrigger",Mr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Er,n),a=N(t,o.triggerRef);return d.jsx(A.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":Mt(o.open),...r,ref:a,onClick:S(e.onClick,o.onOpenToggle)})});Mr.displayName=Er;var bt="DialogPortal",[_i,_r]=xr(bt,{forceMount:void 0}),Sr=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,a=z(bt,t);return d.jsx(_i,{scope:t,forceMount:n,children:c.Children.map(r,i=>d.jsx(ee,{present:n||a.open,children:d.jsx(ft,{asChild:!0,container:o,children:i})}))})};Sr.displayName=bt;var Fe="DialogOverlay",Rr=c.forwardRef((e,t)=>{const n=_r(Fe,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=z(Fe,e.__scopeDialog);return a.modal?d.jsx(ee,{present:r||a.open,children:d.jsx(Ri,{...o,ref:t})}):null});Rr.displayName=Fe;var Si=he("DialogOverlay.RemoveScroll"),Ri=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Fe,n);return d.jsx(pt,{as:Si,allowPinchZoom:!0,shards:[o.contentRef],children:d.jsx(A.div,{"data-state":Mt(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ne="DialogContent",kr=c.forwardRef((e,t)=>{const n=_r(ne,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=z(ne,e.__scopeDialog);return d.jsx(ee,{present:r||a.open,children:a.modal?d.jsx(ki,{...o,ref:t}):d.jsx(Pi,{...o,ref:t})})});kr.displayName=ne;var ki=c.forwardRef((e,t)=>{const n=z(ne,e.__scopeDialog),r=c.useRef(null),o=N(t,n.contentRef,r);return c.useEffect(()=>{const a=r.current;if(a)return Cn(a)},[]),d.jsx(Pr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:S(e.onCloseAutoFocus,a=>{var i;a.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:S(e.onPointerDownOutside,a=>{const i=a.detail.originalEvent,s=i.button===0&&i.ctrlKey===!0;(i.button===2||s)&&a.preventDefault()}),onFocusOutside:S(e.onFocusOutside,a=>a.preventDefault())})}),Pi=c.forwardRef((e,t)=>{const n=z(ne,e.__scopeDialog),r=c.useRef(!1),o=c.useRef(!1);return d.jsx(Pr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var i,s;(i=e.onCloseAutoFocus)==null||i.call(e,a),a.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),a.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:a=>{var p,l;(p=e.onInteractOutside)==null||p.call(e,a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const i=a.target;((l=n.triggerRef.current)==null?void 0:l.contains(i))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&o.current&&a.preventDefault()}})}),Pr=c.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:a,...i}=e,s=z(ne,n),p=c.useRef(null),l=N(t,p);return en(),d.jsxs(d.Fragment,{children:[d.jsx(it,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:a,children:d.jsx(st,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Mt(s.open),...i,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(Ni,{titleId:s.titleId}),d.jsx(Ii,{contentRef:p,descriptionId:s.descriptionId})]})]})}),Et="DialogTitle",Ar=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Et,n);return d.jsx(A.h2,{id:o.titleId,...r,ref:t})});Ar.displayName=Et;var Nr="DialogDescription",Dr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Nr,n);return d.jsx(A.p,{id:o.descriptionId,...r,ref:t})});Dr.displayName=Nr;var Ir="DialogClose",Tr=c.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=z(Ir,n);return d.jsx(A.button,{type:"button",...r,ref:t,onClick:S(e.onClick,()=>o.onOpenChange(!1))})});Tr.displayName=Ir;function Mt(e){return e?"open":"closed"}var Or="DialogTitleWarning",[Ai,jr]=ga(Or,{contentName:ne,titleName:Et,docsSlug:"dialog"}),Ni=({titleId:e})=>{const t=jr(Or),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return c.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Di="DialogDescriptionWarning",Ii=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jr(Di).contentName}}.`;return c.useEffect(()=>{var a;const o=(a=e.current)==null?void 0:a.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ti=br,Oi=Mr,ji=Sr,Li=Rr,$i=kr,Fi=Ar,Wi=Dr,Lr=Tr,$r="AlertDialog",[Bi]=J($r,[Cr]),X=Cr(),Fr=e=>{const{__scopeAlertDialog:t,...n}=e,r=X(t);return d.jsx(Ti,{...r,...n,modal:!0})};Fr.displayName=$r;var Ui="AlertDialogTrigger",Wr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(Oi,{...o,...r,ref:t})});Wr.displayName=Ui;var zi="AlertDialogPortal",Br=e=>{const{__scopeAlertDialog:t,...n}=e,r=X(t);return d.jsx(ji,{...r,...n})};Br.displayName=zi;var Gi="AlertDialogOverlay",Ur=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(Li,{...o,...r,ref:t})});Ur.displayName=Gi;var pe="AlertDialogContent",[Ki,Hi]=Bi(pe),Vi=ba("AlertDialogContent"),zr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,a=X(n),i=c.useRef(null),s=N(t,i),p=c.useRef(null);return d.jsx(Ai,{contentName:pe,titleName:Gr,docsSlug:"alert-dialog",children:d.jsx(Ki,{scope:n,cancelRef:p,children:d.jsxs($i,{role:"alertdialog",...a,...o,ref:s,onOpenAutoFocus:S(o.onOpenAutoFocus,l=>{var f;l.preventDefault(),(f=p.current)==null||f.focus({preventScroll:!0})}),onPointerDownOutside:l=>l.preventDefault(),onInteractOutside:l=>l.preventDefault(),children:[d.jsx(Vi,{children:r}),d.jsx(Yi,{contentRef:i})]})})})});zr.displayName=pe;var Gr="AlertDialogTitle",Kr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(Fi,{...o,...r,ref:t})});Kr.displayName=Gr;var Hr="AlertDialogDescription",Vr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(Wi,{...o,...r,ref:t})});Vr.displayName=Hr;var qi="AlertDialogAction",qr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=X(n);return d.jsx(Lr,{...o,...r,ref:t})});qr.displayName=qi;var Yr="AlertDialogCancel",Xr=c.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=Hi(Yr,n),a=X(n),i=N(t,o);return d.jsx(Lr,{...a,...r,ref:i})});Xr.displayName=Yr;var Yi=({contentRef:e})=>{const t=`\`${pe}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${pe}\` by passing a \`${Hr}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${pe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return c.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},fl=Fr,pl=Wr,hl=Br,vl=Ur,ml=zr,gl=qr,yl=Xr,wl=Kr,xl=Vr;export{Ou as $,Zi as A,ku as B,nu as C,_u as D,Eu as E,uu as F,du as G,pu as H,ol as I,Hu as J,Du as K,rl as L,Su as M,Iu as N,Cu as O,tl as P,Mu as Q,cl as R,ul as S,el as T,Yu as U,Ji as V,vu as W,Xu as X,Vu as Y,zu as Z,Pu as _,ll as a,wu as a0,yu as a1,au as a2,gu as a3,hu as a4,su as a5,Nu as a6,Ku as a7,qu as a8,eu as a9,dl as aa,Ti as ab,ji as ac,$i as ad,Lr as ae,Fi as af,Wi as ag,Li as ah,bu as ai,fl as aj,pl as ak,hl as al,ml as am,wl as an,xl as ao,yl as ap,gl as aq,vl as ar,Bu as as,Wu as at,$u as au,cu as av,nl as b,al as c,sl as d,tu as e,ru as f,il as g,Ju as h,ou as i,Uu as j,mu as k,ju as l,Tu as m,Au as n,Gu as o,xu as p,lu as q,iu as r,Ru as s,Fu as t,Zu as u,xi as v,Ci as w,Lu as x,fu as y,Qi as z}; diff --git a/embed_static/static/spa/assets/virtual-vendor-DDSEW9eW.js b/embed_static/static/spa/assets/virtual-vendor-rtLkLCpN.js similarity index 99% rename from embed_static/static/spa/assets/virtual-vendor-DDSEW9eW.js rename to embed_static/static/spa/assets/virtual-vendor-rtLkLCpN.js index 18ee78d..9af1fe4 100644 --- a/embed_static/static/spa/assets/virtual-vendor-DDSEW9eW.js +++ b/embed_static/static/spa/assets/virtual-vendor-rtLkLCpN.js @@ -1 +1 @@ -import{r as y,a as k}from"./react-vendor-1fwFMt02.js";function W(r,u,t){const e=new Array(r);return new Proxy(e,{get(s,i,o){if(typeof i=="string"){const n=i.charCodeAt(0);if(n>=48&&n<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&le[c]!==h))&&(e=n,s=u(...n),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return o.updateDeps=n=>{e=n},o}function A(r,u){if(r===void 0)throw new Error("Unexpected undefined");return r}const D=(r,u)=>Math.abs(r-u)<1.01,L=(r,u,t)=>{let e;return function(...s){r.clearTimeout(e),e=r.setTimeout(()=>u.apply(this,s),t)}};let I;const w=()=>{if(I!==void 0)return I;if(typeof navigator>"u")return I=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return I=!0;const r=navigator.maxTouchPoints;return I=navigator.platform==="MacIntel"&&r!==void 0&&r>0},R=r=>{const{offsetWidth:u,offsetHeight:t}=r;return{width:u,height:t}},j=r=>r,V=r=>{const u=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1)-u+1,s=new Array(e);for(let i=0;i{const t=r.scrollElement;if(!t)return;const e=r.targetWindow;if(!e)return;const s=o=>{const{width:n,height:l}=o;u({width:Math.round(n),height:Math.round(l)})};if(s(R(t)),!e.ResizeObserver)return()=>{};const i=new e.ResizeObserver(o=>{const n=()=>{const l=o[0];if(l!=null&&l.borderBoxSize){const h=l.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(R(t))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},_={passive:!0},P=typeof window>"u"?!0:"onscrollend"in window,N=(r,u,t)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const i=r.options.useScrollendEvent&&P;let o=0;const n=i?null:L(s,()=>u(o,!1),r.options.isScrollingResetDelay),l=f=>()=>{o=t(e),n==null||n(),u(o,f)},h=l(!0),c=l(!1);return e.addEventListener("scroll",h,_),i&&e.addEventListener("scrollend",c,_),()=>{e.removeEventListener("scroll",h),i&&e.removeEventListener("scrollend",c)}},B=(r,u)=>N(r,u,t=>{const{horizontal:e,isRtl:s}=r.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),H=(r,u,t)=>{if(t.options.useCachedMeasurements){const e=t.indexFromElement(r),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(u!=null&&u.borderBoxSize){const e=u.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!u){const e=t.indexFromElement(r),s=t.options.getItemKey(e),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return r[t.options.horizontal?"offsetWidth":"offsetHeight"]},J=(r,{adjustments:u=0,behavior:t},e)=>{var s,i;(i=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[e.options.horizontal?"left":"top"]:r+u,behavior:t})},$=J;class q{constructor(u){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null;const e=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const o=()=>{const n=i.target,l=this.indexFromElement(n);if(!n.isConnected){this.observer.unobserve(n);for(const[h,c]of this.elementsCache)if(c===n){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(n,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=e())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=e())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=e())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var e,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:j,rangeExtractor:V,onChange:()=>{},measureElement:H,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const a in t){const g=t[a];g!==void 0&&(i[a]=g)}const o=this.options;let n=null,l=null,h=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const a=o.count,g=i.count,d=this.getMeasurements(),S=a>0?((e=d[0])==null?void 0:e.key)??o.getItemKey(0):null,v=a>0?((s=d[a-1])==null?void 0:s.key)??o.getItemKey(a-1):null;if(g!==a||a>0&&g>0&&(i.getItemKey(0)!==S||i.getItemKey(g-1)!==v)){h=!0;const m=a>0?this.getVirtualItemForOffset(this.getScrollOffset())??d[0]:null;m&&(n=[m.key,this.getScrollOffset()-m.start]);const E=i.followOnAppend===!0?"auto":i.followOnAppend||null;E&&g>a&&this.isAtEnd(o.scrollEndThreshold)&&(a===0||i.getItemKey(g-1)!==v)&&(l=E)}}this.options=i,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,f=0;if(n&&this.scrollOffset!==null){const[a,g]=n,d=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let p=0;for(;p{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=x(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset(){this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!w()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,_),i.addEventListener("touchend",n,_),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,o,n,l]=s;i!==null&&!n&&(w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,e)=>{const s=new Map,i=new Map;for(let o=e-1;o>=0;o--){const n=t[o];if(s.has(n.lane))continue;const l=i.get(n.lane);if(l==null||n.end>l.end?i.set(n.lane,n):n.endo.end===n.end?o.index-n.index:o.end-n.end)[0]:void 0},this.getMeasurementOptions=x(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,e,s,i,o,n,l)=>(this.prevLanes!==void 0&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=x(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:l},h)=>{const c=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const d of this.laneAssignments.keys())d>=t&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),n===1){const d=this.options.gap,S=t*2;let v=this._flatMeasurements;if(!v||v.length0&&m.set(v.subarray(0,f*2)),v=m,this._flatMeasurements=v}let p;if(f===0)p=e+s;else{const m=f-1;p=v[m*2]+v[m*2+1]+d}for(let m=f;m1){p=v;const O=g[p],C=O!==void 0?a[O]:void 0;b=C?C.end+this.options.gap:e+s}else{const O=this.options.lanes===1?a[d-1]:this.getFurthestMeasurement(a,d);b=O?O.end+this.options.gap:e+s,p=O?O.lane:d%this.options.lanes,this.options.lanes>1&&m&&this.laneAssignments.set(d,p)}const E=c.get(S),z=typeof E=="number"?E:this.options.estimateSize(d),M=b+z;a[d]={index:d,start:b,size:z,end:M,key:S,lane:p},g[p]=d}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=x(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,i)=>this.range=t.length>0&&e>0?U({measurements:t,outerSize:e,scrollOffset:s,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=x(()=>{let t=null,e=null;const s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,i,o)=>i===null||o===null?[]:t({startIndex:i,endIndex:o,overscan:e,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-i),n=Math.min(this.options.count-1,s+i);return t>=o&&t<=n}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,n)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(n))});return}const e=this.indexFromElement(t),s=this.options.getItemKey(e),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,i;if(t<0||t>=this.options.count)return;let o,n,l;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)l=this.options.getItemKey(t),n=h[t*2],o=h[t*2+1];else{const a=this.measurementsCache[t];if(!a)return;l=a.key,n=a.start,o=a.size}const c=this.itemSizeCache.get(l)??o,f=e-c;if(f!==0){const a=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=a?this.getTotalSize():0,d=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:l,start:n,size:o,end:n+o,lane:0},f,this):n[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{const s=[];for(let i=0,o=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements();if(e.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,o=F(0,e.length-1,i?n=>s[n*2]:n=>A(e[n]).start,t);return A(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+i?"end":"start"),e==="center"?t+=(s-i)/2:e==="end"&&(t-=i);const n=this.getMaxScrollOffset();return Math.max(Math.min(n,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=i+this.options.scrollPaddingStart)e="start";else return[i,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];const n=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{const i=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,e);if(!i)return;const[o,n]=i,l=this.now();this.scrollState={index:t,align:n,behavior:s,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const e=this.getMeasurements();let s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=e.length-1,o=this._flatMeasurements;o!=null?s=o[i*2]+o[i*2+1]:s=((t=e[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=e.length-1;for(;o>=0&&i.some(n=>n===null);){const n=e[o];i[n.lane]===null&&(i[n.lane]=n.end),o--}s=Math.max(...i.filter(n=>n!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const e=this.getMeasurements();for(const s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(u)}applyScrollAdjustment(u,t){u!==0&&(w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=u:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=u,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,i=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&D(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const n=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&l>n;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const F=(r,u,t,e)=>{for(;r<=u;){const s=(r+u)/2|0,i=t(s);if(ie)u=s-1;else return s}return r>0?r-1:0};function U({measurements:r,outerSize:u,scrollOffset:t,lanes:e,flat:s}){const i=r.length-1,o=s?c=>s[c*2]:c=>r[c].start,n=s?c=>s[c*2]+s[c*2+1]:c=>r[c].end;if(r.length<=e)return{startIndex:0,endIndex:i};let l=F(0,i,o,t),h=l;if(e===1)for(;h1){const c=Array(e).fill(0);for(;ha=0&&f.some(a=>a>=t);){const a=r[l];f[a.lane]=a.start,l--}l=Math.max(0,l-l%e),h=Math.min(i,h+(e-1-h%e))}return{startIndex:l,endIndex:h}}const T=typeof document<"u"?y.useLayoutEffect:y.useEffect;function X({useFlushSync:r=!0,directDomUpdates:u=!1,directDomUpdatesMode:t="transform",...e}){const s=y.useReducer(h=>h+1,0)[1],i=y.useRef({enabled:u,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=u,i.current.mode=t;const o=h=>{const c=i.current;if(!c.enabled)return;const f=h.getTotalSize();if(c.container&&f!==c.lastSize){c.lastSize=f;const p=h.options.horizontal?"width":"height";c.container.style[p]=`${f}px`}const a=!!h.options.horizontal,g=c.mode==="transform",d=a?"left":"top",S=h.options.scrollMargin,v=h.getVirtualItems();for(const p of v){const b=p.start-S,m=h.elementsCache.get(p.key);m&&c.lastPositions.get(m)!==b&&(c.lastPositions.set(m,b),g?m.style.transform=a?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:m.style[d]=`${b}px`)}},n={...e,onChange:(h,c)=>{var f;const a=i.current;let g=!0;if(a.enabled){o(h);const d=h.range,S=a.prevRange;g=!S||S.isScrolling!==h.isScrolling||S.startIndex!==(d==null?void 0:d.startIndex)||S.endIndex!==(d==null?void 0:d.endIndex),g&&(a.prevRange=d?{startIndex:d.startIndex,endIndex:d.endIndex,isScrolling:h.isScrolling}:null)}g&&(r&&c?k.flushSync(s):s()),(f=e.onChange)==null||f.call(e,h,c)}},[l]=y.useState(()=>{const h=new q(n);return Object.assign(h,{containerRef:c=>{const f=i.current;if(f.container=c,f.lastSize=null,c&&f.enabled){const a=h.getTotalSize();f.lastSize=a;const g=h.options.horizontal?"width":"height";c.style[g]=`${a}px`}}})});return l.setOptions(n),T(()=>l._didMount(),[]),T(()=>l._willUpdate()),T(()=>{o(l)}),l}function Q(r){return X({observeElementRect:K,observeElementOffset:B,scrollToFn:$,...r})}export{Q as u}; +import{r as y,a as k}from"./react-vendor-BdyZmpPe.js";function W(r,u,t){const e=new Array(r);return new Proxy(e,{get(s,i,o){if(typeof i=="string"){const n=i.charCodeAt(0);if(n>=48&&n<=57){const l=+i;if(Number.isInteger(l)&&l>=0&&le[c]!==h))&&(e=n,s=u(...n),t!=null&&t.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1),s}return o.updateDeps=n=>{e=n},o}function A(r,u){if(r===void 0)throw new Error("Unexpected undefined");return r}const D=(r,u)=>Math.abs(r-u)<1.01,L=(r,u,t)=>{let e;return function(...s){r.clearTimeout(e),e=r.setTimeout(()=>u.apply(this,s),t)}};let I;const w=()=>{if(I!==void 0)return I;if(typeof navigator>"u")return I=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return I=!0;const r=navigator.maxTouchPoints;return I=navigator.platform==="MacIntel"&&r!==void 0&&r>0},R=r=>{const{offsetWidth:u,offsetHeight:t}=r;return{width:u,height:t}},j=r=>r,V=r=>{const u=Math.max(r.startIndex-r.overscan,0),e=Math.min(r.endIndex+r.overscan,r.count-1)-u+1,s=new Array(e);for(let i=0;i{const t=r.scrollElement;if(!t)return;const e=r.targetWindow;if(!e)return;const s=o=>{const{width:n,height:l}=o;u({width:Math.round(n),height:Math.round(l)})};if(s(R(t)),!e.ResizeObserver)return()=>{};const i=new e.ResizeObserver(o=>{const n=()=>{const l=o[0];if(l!=null&&l.borderBoxSize){const h=l.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(R(t))};r.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(n):n()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},_={passive:!0},P=typeof window>"u"?!0:"onscrollend"in window,N=(r,u,t)=>{const e=r.scrollElement;if(!e)return;const s=r.targetWindow;if(!s)return;const i=r.options.useScrollendEvent&&P;let o=0;const n=i?null:L(s,()=>u(o,!1),r.options.isScrollingResetDelay),l=f=>()=>{o=t(e),n==null||n(),u(o,f)},h=l(!0),c=l(!1);return e.addEventListener("scroll",h,_),i&&e.addEventListener("scrollend",c,_),()=>{e.removeEventListener("scroll",h),i&&e.removeEventListener("scrollend",c)}},B=(r,u)=>N(r,u,t=>{const{horizontal:e,isRtl:s}=r.options;return e?t.scrollLeft*(s&&-1||1):t.scrollTop}),H=(r,u,t)=>{if(t.options.useCachedMeasurements){const e=t.indexFromElement(r),s=t.options.getItemKey(e);return t.itemSizeCache.get(s)??t.options.estimateSize(e)}if(u!=null&&u.borderBoxSize){const e=u.borderBoxSize[0];if(e)return Math.round(e[t.options.horizontal?"inlineSize":"blockSize"])}if(!u){const e=t.indexFromElement(r),s=t.options.getItemKey(e),i=t.itemSizeCache.get(s);if(i!==void 0)return i}return r[t.options.horizontal?"offsetWidth":"offsetHeight"]},J=(r,{adjustments:u=0,behavior:t},e)=>{var s,i;(i=(s=e.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[e.options.horizontal?"left":"top"]:r+u,behavior:t})},$=J;class q{constructor(u){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,e,s;return((s=(e=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:e.now)==null?void 0:s.call(e))??Date.now()},this.observer=(()=>{let t=null;const e=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const o=()=>{const n=i.target,l=this.indexFromElement(n);if(!n.isConnected){this.observer.unobserve(n);for(const[h,c]of this.elementsCache)if(c===n){this.elementsCache.delete(h);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(n,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=e())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=e())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=e())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{var e,s;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:j,rangeExtractor:V,onChange:()=>{},measureElement:H,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const a in t){const g=t[a];g!==void 0&&(i[a]=g)}const o=this.options;let n=null,l=null,h=!1;if(o!==void 0&&o.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const a=o.count,g=i.count,d=this.getMeasurements(),S=a>0?((e=d[0])==null?void 0:e.key)??o.getItemKey(0):null,v=a>0?((s=d[a-1])==null?void 0:s.key)??o.getItemKey(a-1):null;if(g!==a||a>0&&g>0&&(i.getItemKey(0)!==S||i.getItemKey(g-1)!==v)){h=!0;const m=a>0?this.getVirtualItemForOffset(this.getScrollOffset())??d[0]:null;m&&(n=[m.key,this.getScrollOffset()-m.start]);const E=i.followOnAppend===!0?"auto":i.followOnAppend||null;E&&g>a&&this.isAtEnd(o.scrollEndThreshold)&&(a===0||i.getItemKey(g-1)!==v)&&(l=E)}}this.options=i,h&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,f=0;if(n&&this.scrollOffset!==null){const[a,g]=n,d=this.getMeasurements(),{count:S,getItemKey:v}=this.options;let p=0;for(;p{var e,s;(s=(e=this.options).onChange)==null||s.call(e,this,t)},this.maybeNotify=x(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,o)=>{this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset(){this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!w()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",o,_),i.addEventListener("touchend",n,_),this.unsubs.push(()=>{i.removeEventListener("touchstart",o),i.removeEventListener("touchend",n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){const[i,o,n,l]=s;i!==null&&!n&&(w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),n&&this.scrollToEnd({behavior:n})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),e=this.getMaxScrollOffset();if(t<0||t>e)return;const s=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=s,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,e)=>{const s=new Map,i=new Map;for(let o=e-1;o>=0;o--){const n=t[o];if(s.has(n.lane))continue;const l=i.get(n.lane);if(l==null||n.end>l.end?i.set(n.lane,n):n.endo.end===n.end?o.index-n.index:o.end-n.end)[0]:void 0},this.getMeasurementOptions=x(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,e,s,i,o,n,l)=>(this.prevLanes!==void 0&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMin=null,{count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=x(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:e,scrollMargin:s,getItemKey:i,enabled:o,lanes:n,laneAssignmentMode:l},h)=>{const c=this.itemSizeCache;if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const d of this.laneAssignments.keys())d>=t&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),n===1){const d=this.options.gap,S=t*2;let v=this._flatMeasurements;if(!v||v.length0&&m.set(v.subarray(0,f*2)),v=m,this._flatMeasurements=v}let p;if(f===0)p=e+s;else{const m=f-1;p=v[m*2]+v[m*2+1]+d}for(let m=f;m1){p=v;const O=g[p],C=O!==void 0?a[O]:void 0;b=C?C.end+this.options.gap:e+s}else{const O=this.options.lanes===1?a[d-1]:this.getFurthestMeasurement(a,d);b=O?O.end+this.options.gap:e+s,p=O?O.lane:d%this.options.lanes,this.options.lanes>1&&m&&this.laneAssignments.set(d,p)}const E=c.get(S),z=typeof E=="number"?E:this.options.estimateSize(d),M=b+z;a[d]={index:d,start:b,size:z,end:M,key:S,lane:p},g[p]=d}return this.measurementsCache=a,a},{key:!1,debug:()=>this.options.debug}),this.calculateRange=x(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,e,s,i)=>this.range=t.length>0&&e>0?U({measurements:t,outerSize:e,scrollOffset:s,lanes:i,flat:i===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=x(()=>{let t=null,e=null;const s=this.calculateRange();return s&&(t=s.startIndex,e=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,e]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,e]},(t,e,s,i,o)=>i===null||o===null?[]:t({startIndex:i,endIndex:o,overscan:e,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const e=this.options.indexAttribute,s=t.getAttribute(e);return s?parseInt(s,10):(console.warn(`Missing attribute name '${e}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var e;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const s=this.scrollState.index??((e=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:e.index);if(s!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,s-i),n=Math.min(this.options.count-1,s+i);return t>=o&&t<=n}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((o,n)=>{o.isConnected||(this.observer.unobserve(o),this.elementsCache.delete(n))});return}const e=this.indexFromElement(t),s=this.options.getItemKey(e),i=this.elementsCache.get(s);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(s,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(e)&&this.resizeItem(e,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,e)=>{var s,i;if(t<0||t>=this.options.count)return;let o,n,l;const h=this._flatMeasurements;if(this.options.lanes===1&&h!==null)l=this.options.getItemKey(t),n=h[t*2],o=h[t*2+1];else{const a=this.measurementsCache[t];if(!a)return;l=a.key,n=a.start,o=a.size}const c=this.itemSizeCache.get(l)??o,f=e-c;if(f!==0){const a=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=a?this.getTotalSize():0,d=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:l,start:n,size:o,end:n+o,lane:0},f,this):n[this.getVirtualIndexes(),this.getMeasurements()],(t,e)=>{const s=[];for(let i=0,o=t.length;ithis.options.debug}),this.getVirtualItemForOffset=t=>{const e=this.getMeasurements();if(e.length===0)return;const s=this._flatMeasurements,i=this.options.lanes===1&&s!=null,o=F(0,e.length-1,i?n=>s[n*2]:n=>A(e[n]).start,t);return A(e[o])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,e,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),o=this.getScrollOffset();e==="auto"&&(e=t>=o+i?"end":"start"),e==="center"?t+=(s-i)/2:e==="end"&&(t-=i);const n=this.getMaxScrollOffset();return Math.max(Math.min(n,t),0)},this.getOffsetForIndex=(t,e="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getSize(),i=this.getScrollOffset(),o=this.measurementsCache[t];if(!o)return;if(e==="auto")if(o.end>=i+s-this.options.scrollPaddingEnd)e="end";else if(o.start<=i+this.options.scrollPaddingStart)e="start";else return[i,e];if(e==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),e];const n=e==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,e,o.size),e]},this.scrollToOffset=(t,{align:e="start",behavior:s="auto"}={})=>{const i=this.getOffsetForAlignment(t,e),o=this.now();this.scrollState={index:null,align:e,behavior:s,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:e="auto",behavior:s="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,e);if(!i)return;const[o,n]=i,l=this.now();this.scrollState={index:t,align:n,behavior:s,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:e="auto"}={})=>{const s=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:e,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:e}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const e=this.getMeasurements();let s;if(e.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){const i=e.length-1,o=this._flatMeasurements;o!=null?s=o[i*2]+o[i*2+1]:s=((t=e[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let o=e.length-1;for(;o>=0&&i.some(n=>n===null);){const n=e[o];i[n.lane]===null&&(i[n.lane]=n.end),o--}s=Math.max(...i.filter(n=>n!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const e=this.getMeasurements();for(const s of e)s&&this.itemSizeCache.has(s.key)&&t.push({index:s.index,key:s.key,start:s.start,size:s.size,end:s.end,lane:s.lane});return t},this._scrollToOffset=(t,{adjustments:e,behavior:s})=>{this._intendedScrollOffset=t+(e??0),this.options.scrollToFn(t,{behavior:s,adjustments:e},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(u)}applyScrollAdjustment(u,t){u!==0&&(w()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=u:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=u,behavior:t}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const e=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,s=e?e[0]:this.scrollState.lastTargetOffset,i=1,o=s!==this.scrollState.lastTargetOffset;if(!o&&D(s,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==s&&this._scrollToOffset(s,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,o){const n=this.getSize()||600,l=Math.abs(s-this.getScrollOffset()),h=this.scrollState.behavior==="smooth"&&l>n;this.scrollState.lastTargetOffset=s,h||(this.scrollState.behavior="auto"),this._scrollToOffset(s,{adjustments:void 0,behavior:h?"smooth":"auto"})}this.scheduleScrollReconcile()}}const F=(r,u,t,e)=>{for(;r<=u;){const s=(r+u)/2|0,i=t(s);if(ie)u=s-1;else return s}return r>0?r-1:0};function U({measurements:r,outerSize:u,scrollOffset:t,lanes:e,flat:s}){const i=r.length-1,o=s?c=>s[c*2]:c=>r[c].start,n=s?c=>s[c*2]+s[c*2+1]:c=>r[c].end;if(r.length<=e)return{startIndex:0,endIndex:i};let l=F(0,i,o,t),h=l;if(e===1)for(;h1){const c=Array(e).fill(0);for(;ha=0&&f.some(a=>a>=t);){const a=r[l];f[a.lane]=a.start,l--}l=Math.max(0,l-l%e),h=Math.min(i,h+(e-1-h%e))}return{startIndex:l,endIndex:h}}const T=typeof document<"u"?y.useLayoutEffect:y.useEffect;function X({useFlushSync:r=!0,directDomUpdates:u=!1,directDomUpdatesMode:t="transform",...e}){const s=y.useReducer(h=>h+1,0)[1],i=y.useRef({enabled:u,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=u,i.current.mode=t;const o=h=>{const c=i.current;if(!c.enabled)return;const f=h.getTotalSize();if(c.container&&f!==c.lastSize){c.lastSize=f;const p=h.options.horizontal?"width":"height";c.container.style[p]=`${f}px`}const a=!!h.options.horizontal,g=c.mode==="transform",d=a?"left":"top",S=h.options.scrollMargin,v=h.getVirtualItems();for(const p of v){const b=p.start-S,m=h.elementsCache.get(p.key);m&&c.lastPositions.get(m)!==b&&(c.lastPositions.set(m,b),g?m.style.transform=a?`translate3d(${b}px, 0, 0)`:`translate3d(0, ${b}px, 0)`:m.style[d]=`${b}px`)}},n={...e,onChange:(h,c)=>{var f;const a=i.current;let g=!0;if(a.enabled){o(h);const d=h.range,S=a.prevRange;g=!S||S.isScrolling!==h.isScrolling||S.startIndex!==(d==null?void 0:d.startIndex)||S.endIndex!==(d==null?void 0:d.endIndex),g&&(a.prevRange=d?{startIndex:d.startIndex,endIndex:d.endIndex,isScrolling:h.isScrolling}:null)}g&&(r&&c?k.flushSync(s):s()),(f=e.onChange)==null||f.call(e,h,c)}},[l]=y.useState(()=>{const h=new q(n);return Object.assign(h,{containerRef:c=>{const f=i.current;if(f.container=c,f.lastSize=null,c&&f.enabled){const a=h.getTotalSize();f.lastSize=a;const g=h.options.horizontal?"width":"height";c.style[g]=`${a}px`}}})});return l.setOptions(n),T(()=>l._didMount(),[]),T(()=>l._willUpdate()),T(()=>{o(l)}),l}function Q(r){return X({observeElementRect:K,observeElementOffset:B,scrollToFn:$,...r})}export{Q as u}; diff --git a/embed_static/static/spa/index.html b/embed_static/static/spa/index.html index c04e47b..43c57b0 100644 --- a/embed_static/static/spa/index.html +++ b/embed_static/static/spa/index.html @@ -27,10 +27,10 @@ document.documentElement.style.colorScheme = theme; })(); - - - - + + + +
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 84ef07c..8142628 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,5 +1,11 @@ import { lazy, Suspense } from 'react'; -import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'; +import { + createBrowserRouter, + createRoutesFromElements, + RouterProvider, + Route, + Navigate, +} from 'react-router-dom'; import './styles/global.css'; import { AuthProvider } from './hooks/useAuth'; import { ThemeProvider } from './hooks/useTheme'; @@ -23,35 +29,39 @@ const AdminCommentsPage = lazy(() => import('./pages/admin/AdminCommentsPage')); const AdminUsersPage = lazy(() => import('./pages/admin/AdminUsersPage')); const AdminSettingsPage = lazy(() => import('./pages/admin/AdminSettingsPage')); +const router = createBrowserRouter( + createRoutesFromElements( + <> + }>} /> + }>} /> + } /> + }> + } /> + }>} /> + }>} /> + }>} /> + }>} /> + }>} /> + }>} /> + + }> + } /> + } /> + } /> + } /> + } /> + } /> + + , + ), +); + export default function App() { return ( - - - }>} /> - }>} /> - } /> - }> - } /> - }>} /> - }>} /> - }>} /> - }>} /> - }>} /> - }>} /> - - }> - } /> - } /> - } /> - } /> - } /> - } /> - - - + diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index ac85542..951b74e 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -43,9 +43,9 @@ export const api = { online: () => request('/api/online'), presence: () => request>('/api/presence', { method: 'POST' }), favorites: () => request<{ favorites: unknown[]; total: number }>('/api/favorites'), - createBoard: (body: { name: string; description: string; sort_order: number }) => + createBoard: (body: { name: string; description: string; sort_order: number; icon?: string; color_index?: number }) => request<{ board: Board }>('/api/admin/boards', { method: 'POST', body: JSON.stringify(body) }), - updateBoard: (id: number, body: { name: string; description: string; sort_order: number }) => + updateBoard: (id: number, body: { name: string; description: string; sort_order: number; icon?: string; color_index?: number }) => request<{ board: Board }>(`/api/admin/boards/${id}`, { method: 'PUT', body: JSON.stringify(body) }), deleteBoard: (id: number) => request(`/api/admin/boards/${id}`, { method: 'DELETE' }), // 管理后台 API diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts index b55fb44..33c106e 100644 --- a/frontend/src/api/types.ts +++ b/frontend/src/api/types.ts @@ -12,6 +12,8 @@ export interface Board { id: number; name: string; description: string; + icon?: string; + color_index?: number; sort_order: number; post_count?: number; } diff --git a/frontend/src/components/BoardAppearancePicker.tsx b/frontend/src/components/BoardAppearancePicker.tsx new file mode 100644 index 0000000..53a14bb --- /dev/null +++ b/frontend/src/components/BoardAppearancePicker.tsx @@ -0,0 +1,93 @@ +import { cn } from '@/lib/utils'; +import { + BOARD_ICON_OPTIONS, + BOARD_PALETTE_SIZE, + getBoardIcon, + getBoardThemeIndex, +} from '../utils/boardTheme'; +import type { Board } from '../api/types'; + +interface IconPickerProps { + value: string; + onChange: (key: string) => void; + board: Pick; +} + +interface ColorPickerProps { + value: number; + onChange: (index: number) => void; + boardId: number; +} + +/** 板块图标选择器 */ +export function BoardIconPicker({ value, onChange, board }: IconPickerProps) { + const previewBoard = { id: board.id, icon: value || undefined, color_index: board.color_index }; + const PreviewIcon = getBoardIcon(previewBoard); + const themeIdx = getBoardThemeIndex(previewBoard); + + return ( +
+
+ + + + 预览 +
+
+ + {BOARD_ICON_OPTIONS.map(({ key, label, Icon }) => ( + + ))} +
+
+ ); +} + +/** 板块色标选择器(-1 为自动) */ +export function BoardColorPicker({ value, onChange, boardId }: ColorPickerProps) { + return ( +
+ + {Array.from({ length: BOARD_PALETTE_SIZE }, (_, i) => ( +
+ ); +} diff --git a/frontend/src/components/BoardBadge.tsx b/frontend/src/components/BoardBadge.tsx new file mode 100644 index 0000000..73c1430 --- /dev/null +++ b/frontend/src/components/BoardBadge.tsx @@ -0,0 +1,18 @@ +import { cn } from '@/lib/utils'; +import { getBoardThemeIndex } from '../utils/boardTheme'; +import type { Board } from '../api/types'; + +interface Props { + board: Pick; + className?: string; +} + +/** 按板块配置或 id 映射不同色标的 Badge */ +export default function BoardBadge({ board, className }: Props) { + const idx = getBoardThemeIndex(board); + return ( + + {board.name} + + ); +} diff --git a/frontend/src/components/BoardIconDisplay.tsx b/frontend/src/components/BoardIconDisplay.tsx new file mode 100644 index 0000000..f08f09f --- /dev/null +++ b/frontend/src/components/BoardIconDisplay.tsx @@ -0,0 +1,14 @@ +import { getBoardIcon } from '../utils/boardTheme'; +import type { Board } from '../api/types'; + +/** 渲染板块 Lucide 图标 */ +export default function BoardIconDisplay({ + board, + className, +}: { + board: Pick; + className?: string; +}) { + const Icon = getBoardIcon(board); + return ; +} diff --git a/frontend/src/components/FeedHeader.tsx b/frontend/src/components/FeedHeader.tsx index ded9113..0249ffc 100644 --- a/frontend/src/components/FeedHeader.tsx +++ b/frontend/src/components/FeedHeader.tsx @@ -1,3 +1,4 @@ +import { Users, FileText, LayoutGrid } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import type { Board, ForumStats } from '../api/types'; @@ -24,13 +25,20 @@ export default function FeedHeader({ boardId, keyword, boards, stats, postTotal

{title}

{!keyword && stats && ( - - 会员 {stats.users} - · - 帖子 {stats.posts} - · - 板块 {stats.boards} - +
+ + + 会员 {stats.users} + + + + 帖子 {stats.posts} + + + + 板块 {stats.boards} + +
)}
{keyword && ( diff --git a/frontend/src/components/PostListItem.tsx b/frontend/src/components/PostListItem.tsx index 41dcf82..1b3180f 100644 --- a/frontend/src/components/PostListItem.tsx +++ b/frontend/src/components/PostListItem.tsx @@ -1,4 +1,5 @@ -import { Badge } from '@/components/ui/badge'; +import { MessageCircle, ThumbsUp } from 'lucide-react'; +import BoardBadge from '@/components/BoardBadge'; import PinnedIcon from '@/components/PinnedIcon'; import type { PostItem } from '../api/types'; import type { FeedSort } from './FeedSortBar'; @@ -17,6 +18,8 @@ export default function PostListItem({ post, sort = 'latest', onClick }: Props) ? `${formatTime(post.last_reply_at)} 回复` : '暂无回复') : formatTime(post.created_at); + const commentCount = post.comment_count ?? 0; + const likeCount = post.like_count ?? 0; return (
@@ -29,14 +32,20 @@ export default function PostListItem({ post, sort = 'latest', onClick }: Props) {post.title}
- {post.board && {post.board.name}} + {post.board && } {post.user?.nickname || '匿名'} {timeLabel}
- 💬 {post.comment_count ?? 0} - 👍 {post.like_count ?? 0} + + + {commentCount} + + + + {likeCount} +
); diff --git a/frontend/src/components/PostListSkeleton.tsx b/frontend/src/components/PostListSkeleton.tsx new file mode 100644 index 0000000..715f817 --- /dev/null +++ b/frontend/src/components/PostListSkeleton.tsx @@ -0,0 +1,30 @@ +import { Skeleton } from '@/components/ui/skeleton'; + +interface Props { + count?: number; +} + +/** 帖子列表加载骨架屏 */ +export default function PostListSkeleton({ count = 8 }: Props) { + return ( +
+ {Array.from({ length: count }, (_, i) => ( +
+ +
+ +
+ + + +
+
+
+ + +
+
+ ))} +
+ ); +} diff --git a/frontend/src/components/RightPanel.tsx b/frontend/src/components/RightPanel.tsx index a914c1c..aeb6052 100644 --- a/frontend/src/components/RightPanel.tsx +++ b/frontend/src/components/RightPanel.tsx @@ -1,3 +1,4 @@ +import { Flame, Megaphone, Users } from 'lucide-react'; import type { PostItem, Notification, OnlineStats } from '../api/types'; interface Props { @@ -7,45 +8,61 @@ interface Props { onPostClick: (id: number) => void; } +function hotRankClass(index: number): string { + if (index === 0) return 'widget-rank widget-rank--1'; + if (index === 1) return 'widget-rank widget-rank--2'; + if (index === 2) return 'widget-rank widget-rank--3'; + return 'widget-rank'; +} + export default function RightPanel({ hot, notifications, online, onPostClick }: Props) { const hotList = hot?.slice(0, 8) ?? []; const noticeList = notifications?.slice(0, 6) ?? []; const members = online?.users ?? []; return ( - <> +
-
🔥 热门帖子
+
+ + 热门帖子 +
{hotList.length === 0 ? ( -
暂无数据
+
暂无数据
) : hotList.map((item, i) => (
onPostClick(item.id)}> - {i + 1} - {item.title} + {i + 1} + {item.title}
))}
-
📢 最新动态
+
+ + 最新动态 +
{noticeList.length === 0 ? ( -
暂无动态
+
暂无动态
) : noticeList.map(item => ( -
onPostClick(item.id)}> - {item.title} - {item.created_at} +
onPostClick(item.id)}> + {item.title} + {item.created_at}
))}
-
👀 当前浏览 {online?.count ?? '—'} 人
+
+ + 当前浏览 {online?.count ?? '—'} 人 +
-
+
会员 {online?.members ?? 0} · 游客 {online?.guests ?? 0}
@@ -57,7 +74,7 @@ export default function RightPanel({ hot, notifications, online, onPostClick }: ))} {members.length === 0 && ( - 暂无会员在线 + 暂无会员在线 )}
@@ -71,6 +88,6 @@ export default function RightPanel({ hot, notifications, online, onPostClick }:

- +
); } diff --git a/frontend/src/components/Sidebar.tsx b/frontend/src/components/Sidebar.tsx index 5317794..d70de58 100644 --- a/frontend/src/components/Sidebar.tsx +++ b/frontend/src/components/Sidebar.tsx @@ -7,6 +7,8 @@ import { useAuth } from '../hooks/useAuth'; import { cn } from '@/lib/utils'; import { buildHomeUrl, parseFeedSort } from './FeedSortBar'; import { navigateFeed } from '../utils/feedCache'; +import BoardIconDisplay from './BoardIconDisplay'; +import { getBoardThemeIndex } from '../utils/boardTheme'; // 内容页不参与左侧栏高亮(非 feed 浏览上下文) const NEUTRAL_SIDEBAR_PREFIXES = ['/post/', '/profile']; @@ -60,18 +62,34 @@ export default function Sidebar({ boards, activeBoard, onSelectBoard }: Props) { {boards.length > 0 && ( <> -
板块
+
板块
)} diff --git a/frontend/src/components/UnsavedChangesDialog.tsx b/frontend/src/components/UnsavedChangesDialog.tsx new file mode 100644 index 0000000..abded52 --- /dev/null +++ b/frontend/src/components/UnsavedChangesDialog.tsx @@ -0,0 +1,45 @@ +import { Button } from '@/components/ui/button'; +import { + AlertDialog, + AlertDialogCancel, + AlertDialogContent, + AlertDialogDescription, + AlertDialogFooter, + AlertDialogHeader, + AlertDialogTitle, +} from '@/components/ui/alert-dialog'; + +interface Props { + open: boolean; + onStay: () => void; + onLeave: () => void; + /** 编辑已有帖子时为 true */ + isEdit?: boolean; +} + +export default function UnsavedChangesDialog({ open, onStay, onLeave, isEdit = false }: Props) { + return ( + + + + 放弃未保存的修改? + + {isEdit + ? '你对这篇文章的修改尚未保存,离开后将无法恢复。' + : '你正在撰写的内容尚未发布,离开后将无法恢复。'} + + + + 继续编辑 + + + + + ); +} diff --git a/frontend/src/components/VirtualPostList.tsx b/frontend/src/components/VirtualPostList.tsx index 66169e0..c5c4da2 100644 --- a/frontend/src/components/VirtualPostList.tsx +++ b/frontend/src/components/VirtualPostList.tsx @@ -1,8 +1,8 @@ import { useRef, useEffect, useLayoutEffect } from 'react'; import { useVirtualizer } from '@tanstack/react-virtual'; -import { Spinner } from '@/components/ui/spinner'; import { Button } from '@/components/ui/button'; import PostListItem from './PostListItem'; +import PostListSkeleton from './PostListSkeleton'; import type { PostItem } from '../api/types'; import type { FeedSort } from './FeedSortBar'; @@ -50,6 +50,8 @@ export default function VirtualPostList({ const showHistoryPrompt = hasMore && !canAutoLoad && !loading; const showEnd = !hasMore && posts.length > 0 && !loading; + const isInitialLoad = loading && posts.length === 0; + const isLoadingMore = loading && posts.length > 0; useLayoutEffect(() => { if (resetScrollKey <= 0) return; @@ -88,42 +90,44 @@ export default function VirtualPostList({ return (
-
- {virtualizer.getVirtualItems().map(vi => { - const post = posts[vi.index]; - return ( -
- onSelect(post.id)} /> + {isInitialLoad ? ( + + ) : ( + <> +
+ {virtualizer.getVirtualItems().map(vi => { + const post = posts[vi.index]; + return ( +
+ onSelect(post.id)} /> +
+ ); + })} +
+ {isLoadingMore && } + {showHistoryPrompt && ( +
+

+ 已显示 {posts.length} / {postTotal} 条 +

+
- ); - })} -
- {loading && ( -
- -
- )} - {showHistoryPrompt && ( -
-

- 已显示 {posts.length} / {postTotal} 条 -

- -
- )} - {showEnd && ( -
— 已加载全部 —
+ )} + {showEnd && ( +
— 已加载全部 —
+ )} + )}
); diff --git a/frontend/src/components/ui/skeleton.tsx b/frontend/src/components/ui/skeleton.tsx new file mode 100644 index 0000000..a0a4d86 --- /dev/null +++ b/frontend/src/components/ui/skeleton.tsx @@ -0,0 +1,7 @@ +import { cn } from '@/lib/utils'; + +function Skeleton({ className, ...props }: React.HTMLAttributes) { + return
; +} + +export { Skeleton }; diff --git a/frontend/src/hooks/useUnsavedChangesGuard.ts b/frontend/src/hooks/useUnsavedChangesGuard.ts new file mode 100644 index 0000000..5731440 --- /dev/null +++ b/frontend/src/hooks/useUnsavedChangesGuard.ts @@ -0,0 +1,79 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; +import { useBlocker } from 'react-router-dom'; + +interface Options { + /** 是否存在未保存的修改 */ + isDirty: boolean; +} + +/** + * 拦截页面内导航与关闭标签页,在存在未保存修改时提示用户确认。 + */ +export function useUnsavedChangesGuard({ isDirty }: Options) { + const [dialogOpen, setDialogOpen] = useState(false); + const pendingLeaveRef = useRef<(() => void) | null>(null); + /** 同步标记,避免 setState 未及时生效导致 useBlocker 二次拦截 */ + const allowNavigationRef = useRef(false); + + const shouldBlock = isDirty && !allowNavigationRef.current; + const blocker = useBlocker(() => isDirty && !allowNavigationRef.current); + + useEffect(() => { + if (blocker.state === 'blocked') { + setDialogOpen(true); + } + }, [blocker.state]); + + useEffect(() => { + if (!shouldBlock) return; + const onBeforeUnload = (e: BeforeUnloadEvent) => { + e.preventDefault(); + e.returnValue = ''; + }; + window.addEventListener('beforeunload', onBeforeUnload); + return () => window.removeEventListener('beforeunload', onBeforeUnload); + }, [shouldBlock]); + + const stayOnPage = useCallback(() => { + setDialogOpen(false); + pendingLeaveRef.current = null; + if (blocker.state === 'blocked') { + blocker.reset?.(); + } + }, [blocker]); + + const discardAndLeave = useCallback(() => { + setDialogOpen(false); + allowNavigationRef.current = true; + if (blocker.state === 'blocked') { + blocker.proceed?.(); + return; + } + const action = pendingLeaveRef.current; + pendingLeaveRef.current = null; + action?.(); + }, [blocker]); + + /** 主动发起离开(如点击返回按钮) */ + const requestLeave = useCallback((action: () => void) => { + if (!shouldBlock) { + action(); + return; + } + pendingLeaveRef.current = action; + setDialogOpen(true); + }, [shouldBlock]); + + /** 保存成功后调用,允许后续导航不再拦截 */ + const markSaved = useCallback(() => { + allowNavigationRef.current = true; + }, []); + + return { + dialogOpen, + stayOnPage, + discardAndLeave, + requestLeave, + markSaved, + }; +} diff --git a/frontend/src/layouts/MainLayout.tsx b/frontend/src/layouts/MainLayout.tsx index 77b8b77..c20f3f0 100644 --- a/frontend/src/layouts/MainLayout.tsx +++ b/frontend/src/layouts/MainLayout.tsx @@ -20,6 +20,8 @@ import { useForumLimits } from '../hooks/useForumLimits'; import { buildHomeUrl, parseFeedSort } from '../components/FeedSortBar'; import { navigateFeed } from '../utils/feedCache'; import { notify } from '@/lib/notify'; +import { cn } from '@/lib/utils'; +import { getBoardThemeIndex } from '../utils/boardTheme'; export default function MainLayout() { const { user, loading: authLoading, logout } = useAuth(); @@ -221,13 +223,21 @@ export default function MainLayout() { className={`board-chip ${mobileActiveBoard === 0 ? 'active' : ''}`} onClick={() => { setBoardId(0); navigateFeed(nav, buildHomeUrl(0, feedSort)); }} >全部 - {boards.map(b => ( - { setBoardId(b.id); navigateFeed(nav, buildHomeUrl(b.id, feedSort)); }} - >{b.name} - ))} + {boards.map(b => { + const themeIdx = getBoardThemeIndex(b); + const isActive = mobileActiveBoard === b.id; + return ( + { setBoardId(b.id); navigateFeed(nav, buildHomeUrl(b.id, feedSort)); }} + >{b.name} + ); + })}
)} }> diff --git a/frontend/src/pages/BoardsManagePage.tsx b/frontend/src/pages/BoardsManagePage.tsx index 7fa516a..fb5c9d9 100644 --- a/frontend/src/pages/BoardsManagePage.tsx +++ b/frontend/src/pages/BoardsManagePage.tsx @@ -1,5 +1,4 @@ import { useState, useEffect } from 'react'; -import { useNavigate } from 'react-router-dom'; import { useForm } from 'react-hook-form'; import { zodResolver } from '@hookform/resolvers/zod'; import { z } from 'zod'; @@ -24,20 +23,25 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, } from '@/components/ui/form'; import { notify } from '@/lib/notify'; +import { cn } from '@/lib/utils'; import { api } from '../api/client'; import { useAdminGuard } from '../layouts/AdminLayout'; import type { Board } from '../api/types'; +import { BoardColorPicker, BoardIconPicker } from '../components/BoardAppearancePicker'; +import BoardIconDisplay from '../components/BoardIconDisplay'; +import { getBoardThemeIndex } from '../utils/boardTheme'; const boardSchema = z.object({ name: z.string().min(1, '请输入名称').max(64), description: z.string().max(500).optional(), sort_order: z.coerce.number().min(0), + icon: z.string().max(64).optional(), + color_index: z.coerce.number().min(-1).max(7), }); type BoardFormValues = z.infer; export default function BoardsManagePage() { - const nav = useNavigate(); const { ready } = useAdminGuard(); const [boards, setBoards] = useState([]); const [loading, setLoading] = useState(true); @@ -47,9 +51,12 @@ export default function BoardsManagePage() { const form = useForm({ resolver: zodResolver(boardSchema), - defaultValues: { name: '', description: '', sort_order: 1 }, + defaultValues: { name: '', description: '', sort_order: 1, icon: '', color_index: -1 }, }); + const watchColorIndex = form.watch('color_index'); + const editingPreviewId = editing?.id ?? boards.length + 1; + const load = () => { setLoading(true); api.boards() @@ -64,7 +71,7 @@ export default function BoardsManagePage() { const openCreate = () => { setEditing(null); - form.reset({ name: '', description: '', sort_order: boards.length + 1 }); + form.reset({ name: '', description: '', sort_order: boards.length + 1, icon: '', color_index: -1 }); setModalOpen(true); }; @@ -74,6 +81,8 @@ export default function BoardsManagePage() { name: board.name, description: board.description ?? '', sort_order: board.sort_order, + icon: board.icon ?? '', + color_index: board.color_index ?? -1, }); setModalOpen(true); }; @@ -81,11 +90,18 @@ export default function BoardsManagePage() { const handleSubmit = async (values: BoardFormValues) => { setSubmitting(true); try { + const body = { + name: values.name, + description: values.description ?? '', + sort_order: values.sort_order, + icon: values.icon ?? '', + color_index: values.color_index ?? -1, + }; if (editing) { - await api.updateBoard(editing.id, values); + await api.updateBoard(editing.id, body); notify.success('板块已更新'); } else { - await api.createBoard(values); + await api.createBoard(body); notify.success('板块已创建'); } setModalOpen(false); @@ -119,7 +135,7 @@ export default function BoardsManagePage() {

板块管理

-

创建、编辑或删除论坛板块,用户发帖前需先有板块

+

创建、编辑或删除论坛板块;可为每个板块自定义图标与色标

- ))} + ); + })} {boards.length === 0 && ( @@ -192,7 +217,7 @@ export default function BoardsManagePage() {
- + {editing ? '编辑板块' : '新建板块'} @@ -224,6 +249,40 @@ export default function BoardsManagePage() { )} /> + ( + + 板块图标 + + + + + + )} + /> + ( + + 色标颜色 + + + + + + )} + /> (null); useEffect(() => { if (authLoading) return; @@ -50,10 +60,17 @@ export default function ComposePage() { nav(`/post/${editId}`); return; } - setBoardId(String(post.board_id)); + const loadedBoardId = String(post.board_id); + setBoardId(loadedBoardId); setTitle(post.title); setTags(post.tags ?? ''); setContent(post.content ?? ''); + setBaseline({ + title: post.title, + tags: post.tags ?? '', + content: post.content ?? '', + boardId: loadedBoardId, + }); }) .catch((e: unknown) => { notify.error(e instanceof Error ? e.message : '加载帖子失败'); @@ -66,12 +83,37 @@ export default function ComposePage() { api.boards().then(d => { const list = d.boards ?? []; setBoards(list); + const initialBoardId = defaultBoard || (list.length > 0 ? String(list[0].id) : ''); if (!defaultBoard && list.length > 0) { - setBoardId(String(list[0].id)); + setBoardId(initialBoardId); } + setBaseline({ + title: '', + tags: '', + content: '', + boardId: initialBoardId, + }); }).catch(() => {}); }, [user, authLoading, nav, defaultBoard, isEdit, editId]); + const isDirty = useMemo(() => { + if (!baseline) return false; + return ( + title !== baseline.title + || tags !== baseline.tags + || content !== baseline.content + || (!isEdit && boardId !== baseline.boardId) + ); + }, [baseline, title, tags, content, boardId, isEdit]); + + const { + dialogOpen, + stayOnPage, + discardAndLeave, + requestLeave, + markSaved, + } = useUnsavedChangesGuard({ isDirty }); + if (authLoading) { return (
@@ -127,10 +169,12 @@ export default function ComposePage() { if (isEdit) { await api.updatePost(editId!, payload); notify.success('帖子已更新'); + markSaved(); nav(`/post/${editId}`); } else { const res = await api.createPost({ board_id: boardId, ...payload }); notify.success('发帖成功'); + markSaved(); nav(`/post/${res.post_id}`); } } catch (e: unknown) { @@ -146,7 +190,11 @@ export default function ComposePage() {
- @@ -215,6 +263,12 @@ export default function ComposePage() { />
+
); } diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index fae01de..8b1cfe7 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -183,19 +183,20 @@ export default function HomePage() { return (
-
- - {showSortBar && ( - - )} -
- +
+ + {showSortBar && ( + + )} +
+ { scrollTopRef.current = top; }} onScrollRestored={() => setRestoreScrollTop(null)} /> +
); } diff --git a/frontend/src/pages/PostDetailPage.tsx b/frontend/src/pages/PostDetailPage.tsx index 507fda2..3482ad8 100644 --- a/frontend/src/pages/PostDetailPage.tsx +++ b/frontend/src/pages/PostDetailPage.tsx @@ -4,6 +4,7 @@ import { ArrowLeft, ThumbsUp, Star, Pencil, Pin, History, Lock } from 'lucide-re import PinnedIcon from '@/components/PinnedIcon'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; +import BoardBadge from '@/components/BoardBadge'; import { Spinner } from '@/components/ui/spinner'; import { notify } from '@/lib/notify'; import { api } from '../api/client'; @@ -214,7 +215,7 @@ export default function PostDetailPage() { 返回 {post.board && ( - {post.board.name} + )} diff --git a/frontend/src/styles/global.css b/frontend/src/styles/global.css index 6fe9a5e..260c51e 100644 --- a/frontend/src/styles/global.css +++ b/frontend/src/styles/global.css @@ -87,6 +87,23 @@ --j13-bg-block-accent: #f0faf5; --j13-shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.04); --j13-shadow-card: 0 2px 8px rgba(15, 23, 42, 0.05); + /* 板块色标(8 色槽,按 board id 取模) */ + --board-0-color: #18a058; + --board-0-bg: rgba(24, 160, 88, 0.1); + --board-1-color: #3498db; + --board-1-bg: rgba(52, 152, 219, 0.1); + --board-2-color: #9b59b6; + --board-2-bg: rgba(155, 89, 182, 0.1); + --board-3-color: #e67e22; + --board-3-bg: rgba(230, 126, 34, 0.1); + --board-4-color: #e74c3c; + --board-4-bg: rgba(231, 76, 60, 0.1); + --board-5-color: #1abc9c; + --board-5-bg: rgba(26, 188, 156, 0.1); + --board-6-color: #6366f1; + --board-6-bg: rgba(99, 102, 241, 0.1); + --board-7-color: #f59e0b; + --board-7-bg: rgba(245, 158, 11, 0.12); } .dark { @@ -104,6 +121,28 @@ --j13-bg-block-accent: rgba(35, 195, 107, 0.06); --j13-shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.2); --j13-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.28); + --board-0-color: #23c36b; + --board-0-bg: rgba(35, 195, 107, 0.14); + --board-1-color: #5dade2; + --board-1-bg: rgba(93, 173, 226, 0.14); + --board-2-color: #bb86fc; + --board-2-bg: rgba(187, 134, 252, 0.14); + --board-3-color: #f0a050; + --board-3-bg: rgba(240, 160, 80, 0.14); + --board-4-color: #ff7b72; + --board-4-bg: rgba(255, 123, 114, 0.14); + --board-5-color: #3dd6b5; + --board-5-bg: rgba(61, 214, 181, 0.14); + --board-6-color: #818cf8; + --board-6-bg: rgba(129, 140, 248, 0.14); + --board-7-color: #fbbf24; + --board-7-bg: rgba(251, 191, 36, 0.14); +} + +.dark .app-shell { + background: + radial-gradient(ellipse 70% 45% at 50% -10%, rgba(35, 195, 107, 0.08), transparent 70%), + var(--j13-bg-page); } * { box-sizing: border-box; } @@ -141,7 +180,9 @@ a:hover { text-decoration: underline; } display: flex; flex-direction: column; overflow: hidden; - background: var(--j13-bg-page); + background: + radial-gradient(ellipse 70% 45% at 50% -10%, rgba(24, 160, 88, 0.07), transparent 70%), + var(--j13-bg-page); } /* 顶栏 + 主体共用同一宽度容器,顶满高度、直角外框 */ @@ -483,6 +524,36 @@ a:hover { text-decoration: underline; } font-size: 12px; } +.sidebar-nav-item--board .sidebar-board-icon { + opacity: 0.88; +} + +.sidebar-nav-item--board.active .sidebar-board-icon { + opacity: 1; +} + +.sidebar-nav-item--board.active.sidebar-nav-item--board-0 { background: var(--board-0-bg); color: var(--board-0-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-1 { background: var(--board-1-bg); color: var(--board-1-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-2 { background: var(--board-2-bg); color: var(--board-2-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-3 { background: var(--board-3-bg); color: var(--board-3-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-4 { background: var(--board-4-bg); color: var(--board-4-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-5 { background: var(--board-5-bg); color: var(--board-5-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-6 { background: var(--board-6-bg); color: var(--board-6-color); } +.sidebar-nav-item--board.active.sidebar-nav-item--board-7 { background: var(--board-7-bg); color: var(--board-7-color); } + +.sidebar-board-icon--0 { color: var(--board-0-color); } +.sidebar-board-icon--1 { color: var(--board-1-color); } +.sidebar-board-icon--2 { color: var(--board-2-color); } +.sidebar-board-icon--3 { color: var(--board-3-color); } +.sidebar-board-icon--4 { color: var(--board-4-color); } +.sidebar-board-icon--5 { color: var(--board-5-color); } +.sidebar-board-icon--6 { color: var(--board-6-color); } +.sidebar-board-icon--7 { color: var(--board-7-color); } + +.sidebar-section--boards { + margin-top: 8px; +} + .sidebar-actions { padding: 12px; border-top: 1px solid var(--j13-border); @@ -496,6 +567,7 @@ a:hover { text-decoration: underline; } display: flex; flex-direction: column; overflow: hidden; + background: var(--j13-bg-workspace); } /* 主内容 + 右栏:与左栏同色,整块平铺 */ @@ -516,7 +588,15 @@ a:hover { text-decoration: underline; } padding: 0; display: flex; flex-direction: column; - background: var(--j13-bg-surface); + background: var(--j13-bg-workspace); +} + +.aside-panel-inner { + display: flex; + flex-direction: column; + gap: 10px; + padding: 12px; + flex: 1; } @media (max-width: 1100px) { .aside-panel { display: none; } } @@ -540,6 +620,19 @@ a:hover { text-decoration: underline; } flex-direction: column; scrollbar-width: none; -ms-overflow-style: none; + padding: 12px; +} + +.feed-panel { + flex: 1; + min-height: 0; + display: flex; + flex-direction: column; + border: 1px solid var(--j13-border-light); + border-radius: 12px; + background: var(--j13-bg-block); + box-shadow: var(--j13-shadow-card); + overflow: hidden; } .page-wrap::-webkit-scrollbar { @@ -597,6 +690,13 @@ a:hover { text-decoration: underline; } overflow: hidden; } +.feed-panel .content-surface { + background: transparent; + border: none; + border-radius: 0; + box-shadow: none; +} + .section-card { background: var(--j13-bg-block); border: 1px solid var(--j13-border-light); @@ -618,6 +718,19 @@ a:hover { text-decoration: underline; } flex-shrink: 0; border-bottom: 1px solid var(--j13-border-light); background: var(--j13-bg-block); + position: relative; +} + +.feed-top::after { + content: ''; + position: absolute; + left: 16px; + right: 16px; + bottom: 0; + height: 1px; + background: linear-gradient(90deg, var(--j13-green) 0%, transparent 55%); + opacity: 0.35; + pointer-events: none; } @media (min-width: 900px) { @@ -675,6 +788,37 @@ a:hover { text-decoration: underline; } text-overflow: ellipsis; } +.feed-head__stats { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 6px; +} + +.feed-stat-chip { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 2px 8px; + border-radius: 999px; + font-size: 11px; + color: var(--color-text-3); + background: var(--j13-bg-block-muted); + white-space: nowrap; +} + +.feed-stat-chip svg { + width: 12px; + height: 12px; + color: var(--j13-green); + opacity: 0.85; +} + +.feed-stat-chip strong { + color: var(--j13-green); + font-weight: 600; +} + .feed-head__meta strong { color: var(--j13-green); font-weight: 600; @@ -783,6 +927,15 @@ a:hover { text-decoration: underline; } font-weight: 600; } +.board-chip.active.board-chip--0 { background: var(--board-0-bg); color: var(--board-0-color); } +.board-chip.active.board-chip--1 { background: var(--board-1-bg); color: var(--board-1-color); } +.board-chip.active.board-chip--2 { background: var(--board-2-bg); color: var(--board-2-color); } +.board-chip.active.board-chip--3 { background: var(--board-3-bg); color: var(--board-3-color); } +.board-chip.active.board-chip--4 { background: var(--board-4-bg); color: var(--board-4-color); } +.board-chip.active.board-chip--5 { background: var(--board-5-bg); color: var(--board-5-color); } +.board-chip.active.board-chip--6 { background: var(--board-6-bg); color: var(--board-6-color); } +.board-chip.active.board-chip--7 { background: var(--board-7-bg); color: var(--board-7-color); } + .board-grid { display: flex; flex-wrap: wrap; @@ -845,11 +998,22 @@ a:hover { text-decoration: underline; } padding: 8px 12px 6px; } - .feed-head__meta { display: none; } + .feed-head__meta, + .feed-head__stats { display: none; } .feed-toolbar { padding: 0 12px 8px; } + + .page-wrap { + padding: 0; + } + + .feed-panel { + border: none; + border-radius: 0; + box-shadow: none; + } } .board-grid-empty { @@ -951,10 +1115,34 @@ a:hover { text-decoration: underline; } padding: 12px 20px; border-bottom: 1px solid var(--j13-border-light); cursor: pointer; - transition: background 0.15s; + transition: background 0.15s, box-shadow 0.15s; + position: relative; } -.post-row:hover { background: var(--j13-bg-block-muted); } +.post-row::before { + content: ''; + position: absolute; + left: 0; + top: 8px; + bottom: 8px; + width: 3px; + border-radius: 0 3px 3px 0; + background: var(--j13-green); + opacity: 0; + transition: opacity 0.15s; +} + +.post-row:hover { + background: var(--j13-bg-block-accent); +} + +.post-row:hover::before { + opacity: 1; +} + +.post-row:hover .post-title { + color: var(--j13-green); +} .post-avatar { width: 36px; @@ -969,11 +1157,26 @@ a:hover { text-decoration: underline; } justify-content: center; flex-shrink: 0; overflow: hidden; + box-shadow: 0 0 0 2px var(--j13-bg-block), 0 0 0 3px var(--j13-border); + transition: box-shadow 0.15s; +} + +.post-row:hover .post-avatar { + box-shadow: 0 0 0 2px var(--j13-bg-block), 0 0 0 3px var(--j13-green); } .post-avatar img { width: 100%; height: 100%; object-fit: cover; } .post-body { flex: 1; min-width: 0; } -.post-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; } +.post-title { + font-size: 14px; + font-weight: 500; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-bottom: 4px; + color: var(--color-text-1); + transition: color 0.15s; +} .post-pinned-icon { display: inline-block; vertical-align: -0.15em; @@ -981,8 +1184,266 @@ a:hover { text-decoration: underline; } color: #e53935; stroke-width: 1.5; } -.post-meta { font-size: 12px; color: var(--color-text-3); display: flex; flex-wrap: wrap; gap: 8px; } -.post-stats { display: flex; gap: 12px; font-size: 12px; color: var(--color-text-3); flex-shrink: 0; padding-top: 4px; } +.post-meta { font-size: 12px; color: var(--color-text-3); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } +.post-stats { + display: flex; + gap: 8px; + flex-shrink: 0; + padding-top: 2px; +} + +.post-stat { + display: inline-flex; + align-items: center; + gap: 4px; + padding: 3px 8px; + border-radius: 999px; + font-size: 11px; + color: var(--color-text-3); + background: var(--j13-bg-block-muted); + transition: background 0.15s, color 0.15s; +} + +.post-stat svg { + width: 12px; + height: 12px; + flex-shrink: 0; +} + +.post-row:hover .post-stat { + background: var(--j13-green-bg); + color: var(--j13-green); +} + +.post-stat--zero { + opacity: 0.55; +} + +/* 板块色标 Badge */ +.board-badge { + display: inline-flex; + align-items: center; + padding: 1px 7px; + border-radius: 4px; + font-size: 11px; + font-weight: 600; + line-height: 1.5; + white-space: nowrap; +} + +.board-badge--0 { background: var(--board-0-bg); color: var(--board-0-color); } +.board-badge--1 { background: var(--board-1-bg); color: var(--board-1-color); } +.board-badge--2 { background: var(--board-2-bg); color: var(--board-2-color); } +.board-badge--3 { background: var(--board-3-bg); color: var(--board-3-color); } +.board-badge--4 { background: var(--board-4-bg); color: var(--board-4-color); } +.board-badge--5 { background: var(--board-5-bg); color: var(--board-5-color); } +.board-badge--6 { background: var(--board-6-bg); color: var(--board-6-color); } +.board-badge--7 { background: var(--board-7-bg); color: var(--board-7-color); } + +/* 板块管理:图标 / 色标选择器 */ +.board-manage-dialog { + max-width: 520px; +} + +.board-appearance-picker__preview { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 10px; +} + +.board-appearance-picker__preview-icon { + width: 36px; + height: 36px; + border-radius: 8px; + display: inline-flex; + align-items: center; + justify-content: center; + background: var(--j13-bg-block-muted); +} + +.board-appearance-picker__preview-icon svg { + width: 20px; + height: 20px; +} + +.board-appearance-picker__preview-hint { + font-size: 12px; + color: var(--color-text-3); +} + +.board-icon-grid { + display: grid; + grid-template-columns: repeat(8, 1fr); + gap: 6px; +} + +.board-icon-option { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + aspect-ratio: 1; + border: 1px solid var(--j13-border-light); + border-radius: 8px; + background: var(--j13-bg-block); + color: var(--color-text-2); + cursor: pointer; + transition: border-color 0.15s, background 0.15s, color 0.15s; +} + +.board-icon-option svg { + width: 18px; + height: 18px; +} + +.board-icon-option:hover { + border-color: var(--j13-green); + background: var(--j13-bg-block-muted); +} + +.board-icon-option--active { + border-color: var(--j13-green); + background: var(--j13-green-bg); + color: var(--j13-green); +} + +.board-icon-option__auto { + font-size: 12px; + font-weight: 700; + color: var(--color-text-3); +} + +.board-color-grid { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +.board-color-option { + width: 28px; + height: 28px; + border-radius: 50%; + border: 2px solid transparent; + cursor: pointer; + flex-shrink: 0; + transition: transform 0.12s, box-shadow 0.12s; +} + +.board-color-option:hover { + transform: scale(1.08); +} + +.board-color-option--active { + box-shadow: 0 0 0 2px var(--j13-bg-block), 0 0 0 3px var(--j13-green); +} + +.board-color-option--auto { + display: inline-flex; + align-items: center; + justify-content: center; + background: var(--j13-bg-block-muted); + font-size: 11px; + font-weight: 700; + color: var(--color-text-3); +} + +.board-color-option--0 { background: var(--board-0-color); } +.board-color-option--1 { background: var(--board-1-color); } +.board-color-option--2 { background: var(--board-2-color); } +.board-color-option--3 { background: var(--board-3-color); } +.board-color-option--4 { background: var(--board-4-color); } +.board-color-option--5 { background: var(--board-5-color); } +.board-color-option--6 { background: var(--board-6-color); } +.board-color-option--7 { background: var(--board-7-color); } + +.board-table-icon { + display: inline-flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border-radius: 8px; + background: var(--j13-bg-block-muted); +} + +.board-table-icon svg { + width: 18px; + height: 18px; +} + +/* 帖子列表骨架屏 */ +@keyframes skeleton-shimmer { + 0% { background-position: 200% 0; } + 100% { background-position: -200% 0; } +} + +.skeleton { + background: linear-gradient( + 90deg, + var(--j13-bg-block-muted) 0%, + var(--j13-bg-block) 45%, + var(--j13-bg-block-muted) 90% + ); + background-size: 200% 100%; + animation: skeleton-shimmer 1.5s ease-in-out infinite; + border-radius: 6px; +} + +.post-row--skeleton { + pointer-events: none; + cursor: default; +} + +.post-row--skeleton::before { + display: none; +} + +.post-row--skeleton:hover { + background: transparent; +} + +.skeleton--avatar { + width: 36px; + height: 36px; + border-radius: 50%; + flex-shrink: 0; +} + +.skeleton--title { + height: 14px; + margin-bottom: 8px; + max-width: 100%; +} + +.skeleton-meta-row { + display: flex; + align-items: center; + gap: 8px; +} + +.skeleton--badge { + width: 52px; + height: 18px; + border-radius: 4px; + flex-shrink: 0; +} + +.skeleton--meta { + height: 12px; + width: 56px; + flex-shrink: 0; +} + +.skeleton--meta-short { + width: 72px; +} + +.skeleton--stat { + width: 36px; + height: 22px; + border-radius: 999px; +} .empty-state { text-align: center; padding: 60px 24px; color: var(--color-text-3); } @@ -2492,26 +2953,43 @@ a.waline-comment-author:hover { color: var(--j13-green); } } .widget-card { - background: transparent; - border: none; - border-radius: 0; - box-shadow: none; + background: var(--j13-bg-block); + border: 1px solid var(--j13-border-light); + border-radius: 10px; + box-shadow: var(--j13-shadow-soft); margin-bottom: 0; overflow: hidden; - border-bottom: 1px solid var(--j13-border-light); flex-shrink: 0; } .widget-card-head { - padding: 12px 16px 8px; + display: flex; + align-items: center; + gap: 6px; + padding: 10px 14px 8px; font-size: 13px; font-weight: 600; - border-bottom: none; - background: transparent; + border-bottom: 1px solid var(--j13-border-light); + background: var(--j13-bg-block-muted); color: var(--color-text-2); } -.widget-card-body { padding: 0 16px 14px; } +.widget-card-icon { + width: 15px; + height: 15px; + flex-shrink: 0; +} + +.widget-card-icon--hot { color: #e74c3c; } +.widget-card-icon--notice { color: #3498db; } +.widget-card-icon--online { color: var(--j13-green); } + +.widget-head-count { + color: var(--j13-green); + font-weight: 700; +} + +.widget-card-body { padding: 6px 14px 12px; } .widget-card--about { flex: 1; @@ -2545,17 +3023,85 @@ a.waline-comment-author:hover { color: var(--j13-green); } } .widget-item { - padding: 6px 0; + padding: 7px 0; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--j13-border-light); display: flex; align-items: center; - gap: 6px; + gap: 8px; + border-radius: 4px; + transition: background 0.12s, color 0.12s; } .widget-item:last-child { border-bottom: none; } -.widget-item:hover { color: var(--j13-green); } + +.widget-item:hover { + color: var(--j13-green); + background: var(--j13-bg-block-accent); + padding-left: 6px; + padding-right: 6px; + margin-left: -6px; + margin-right: -6px; +} + +.widget-item-title { + flex: 1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.widget-item-time { + font-size: 11px; + color: var(--color-text-4); + flex-shrink: 0; +} + +.widget-rank { + min-width: 20px; + height: 20px; + display: inline-flex; + align-items: center; + justify-content: center; + border-radius: 4px; + font-size: 11px; + font-weight: 700; + color: var(--color-text-3); + background: var(--j13-bg-block-muted); + flex-shrink: 0; +} + +.widget-rank--1 { + color: #fff; + background: linear-gradient(135deg, #e74c3c, #c0392b); +} + +.widget-rank--2 { + color: #fff; + background: linear-gradient(135deg, #e67e22, #d35400); +} + +.widget-rank--3 { + color: #fff; + background: linear-gradient(135deg, #f1c40f, #e67e22); +} + +.widget-empty { + font-size: 13px; + color: var(--color-text-3); + padding: 8px 0; +} + +.widget-empty--inline { + padding: 0; +} + +.widget-online-meta { + font-size: 12px; + color: var(--color-text-3); + margin-bottom: 8px; +} .widget-online-list { display: flex; diff --git a/frontend/src/utils/boardTheme.ts b/frontend/src/utils/boardTheme.ts new file mode 100644 index 0000000..4197480 --- /dev/null +++ b/frontend/src/utils/boardTheme.ts @@ -0,0 +1,71 @@ +import { + Code2, Coffee, HelpCircle, MessageSquare, Lightbulb, + BookOpen, Gamepad2, Palette, Music, Camera, Heart, Zap, + Globe, Users, Briefcase, GraduationCap, ShoppingBag, MapPin, + Megaphone, Flame, Star, Folder, Wrench, Cpu, type LucideIcon, +} from 'lucide-react'; +import type { Board } from '../api/types'; + +/** 板块主题色槽位数(与 global.css 中 board-badge--N 对应) */ +export const BOARD_PALETTE_SIZE = 8; + +/** 可选板块图标(key 须与后端 AllowedBoardIcons 一致) */ +export const BOARD_ICON_OPTIONS: { key: string; label: string; Icon: LucideIcon }[] = [ + { key: 'code-2', label: '代码', Icon: Code2 }, + { key: 'coffee', label: '咖啡', Icon: Coffee }, + { key: 'help-circle', label: '问答', Icon: HelpCircle }, + { key: 'message-square', label: '讨论', Icon: MessageSquare }, + { key: 'lightbulb', label: '灵感', Icon: Lightbulb }, + { key: 'book-open', label: '阅读', Icon: BookOpen }, + { key: 'gamepad-2', label: '游戏', Icon: Gamepad2 }, + { key: 'palette', label: '设计', Icon: Palette }, + { key: 'music', label: '音乐', Icon: Music }, + { key: 'camera', label: '摄影', Icon: Camera }, + { key: 'heart', label: '生活', Icon: Heart }, + { key: 'zap', label: '快讯', Icon: Zap }, + { key: 'globe', label: '综合', Icon: Globe }, + { key: 'users', label: '社区', Icon: Users }, + { key: 'briefcase', label: '职场', Icon: Briefcase }, + { key: 'graduation-cap', label: '学习', Icon: GraduationCap }, + { key: 'shopping-bag', label: '交易', Icon: ShoppingBag }, + { key: 'map-pin', label: '本地', Icon: MapPin }, + { key: 'megaphone', label: '公告', Icon: Megaphone }, + { key: 'flame', label: '热门', Icon: Flame }, + { key: 'star', label: '精华', Icon: Star }, + { key: 'folder', label: '资源', Icon: Folder }, + { key: 'wrench', label: '工具', Icon: Wrench }, + { key: 'cpu', label: '硬件', Icon: Cpu }, +]; + +const ICON_MAP = Object.fromEntries( + BOARD_ICON_OPTIONS.map(o => [o.key, o.Icon]), +) as Record; + +const DEFAULT_ICONS: LucideIcon[] = [ + Code2, Coffee, HelpCircle, MessageSquare, + Lightbulb, BookOpen, Gamepad2, Palette, +]; + +export type BoardVisual = Pick; + +/** 按板块 id / color_index 取稳定色槽索引 */ +export function getBoardThemeIndex(board: BoardVisual | number): number { + if (typeof board === 'object' && board.color_index != null && board.color_index >= 0) { + return board.color_index % BOARD_PALETTE_SIZE; + } + const id = typeof board === 'number' ? board : board.id; + return ((id % BOARD_PALETTE_SIZE) + BOARD_PALETTE_SIZE) % BOARD_PALETTE_SIZE; +} + +/** 解析板块图标:优先使用后台配置,否则按 id 回退 */ +export function getBoardIcon(board: BoardVisual | number): LucideIcon { + if (typeof board === 'object' && board.icon && ICON_MAP[board.icon]) { + return ICON_MAP[board.icon]; + } + return DEFAULT_ICONS[getBoardThemeIndex(board)]; +} + +export function getBoardIconOption(key: string | undefined) { + if (!key) return undefined; + return BOARD_ICON_OPTIONS.find(o => o.key === key); +} diff --git a/handler/admin.go b/handler/admin.go index 609f1af..85c2dc9 100644 --- a/handler/admin.go +++ b/handler/admin.go @@ -114,7 +114,8 @@ func calcTotalPages(total int64, size int) int { func (h *Handlers) AdminAPICreateBoard(c *gin.Context) { sortOrder, _ := strconv.Atoi(c.PostForm("sort_order")) - board, err := h.Board.Create(c.PostForm("name"), c.PostForm("description"), sortOrder) + colorIndex, _ := strconv.Atoi(c.PostForm("color_index")) + board, err := h.Board.Create(c.PostForm("name"), c.PostForm("description"), c.PostForm("icon"), colorIndex, sortOrder) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return @@ -125,7 +126,8 @@ func (h *Handlers) AdminAPICreateBoard(c *gin.Context) { func (h *Handlers) AdminAPIUpdateBoard(c *gin.Context) { id, _ := strconv.ParseUint(c.Param("id"), 10, 64) sortOrder, _ := strconv.Atoi(c.PostForm("sort_order")) - if err := h.Board.Update(uint(id), c.PostForm("name"), c.PostForm("description"), sortOrder); err != nil { + colorIndex, _ := strconv.Atoi(c.PostForm("color_index")) + if err := h.Board.Update(uint(id), c.PostForm("name"), c.PostForm("description"), c.PostForm("icon"), colorIndex, sortOrder); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } diff --git a/handler/api.go b/handler/api.go index 04d05c7..a4cfeeb 100644 --- a/handler/api.go +++ b/handler/api.go @@ -64,13 +64,15 @@ func (h *Handlers) APIAdminCreateBoard(c *gin.Context) { var req struct { Name string `json:"name" binding:"required"` Description string `json:"description"` + Icon string `json:"icon"` + ColorIndex int `json:"color_index"` SortOrder int `json:"sort_order"` } if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "参数错误"}) return } - board, err := h.Board.Create(req.Name, req.Description, req.SortOrder) + board, err := h.Board.Create(req.Name, req.Description, req.Icon, req.ColorIndex, req.SortOrder) if err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return @@ -84,13 +86,15 @@ func (h *Handlers) APIAdminUpdateBoard(c *gin.Context) { var req struct { Name string `json:"name" binding:"required"` Description string `json:"description"` + Icon string `json:"icon"` + ColorIndex int `json:"color_index"` SortOrder int `json:"sort_order"` } if err := c.ShouldBindJSON(&req); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": "参数错误"}) return } - if err := h.Board.Update(uint(id), req.Name, req.Description, req.SortOrder); err != nil { + if err := h.Board.Update(uint(id), req.Name, req.Description, req.Icon, req.ColorIndex, req.SortOrder); err != nil { c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()}) return } diff --git a/model/models.go b/model/models.go index c960957..fbe23a2 100644 --- a/model/models.go +++ b/model/models.go @@ -34,6 +34,8 @@ type Board struct { ID uint `gorm:"primaryKey" json:"id"` Name string `gorm:"size:64;not null" json:"name"` Description string `gorm:"size:512" json:"description"` + Icon string `gorm:"size:64;default:''" json:"icon"` + ColorIndex int `gorm:"default:-1" json:"color_index"` // -1 表示按 id 自动取色 SortOrder int `gorm:"default:0" json:"sort_order"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` diff --git a/service/board.go b/service/board.go index 0358ab2..cd9302c 100644 --- a/service/board.go +++ b/service/board.go @@ -45,14 +45,24 @@ func (s *BoardService) GetByID(id uint) (*model.Board, error) { return &board, nil } -func (s *BoardService) Create(name, desc string, sortOrder int) (*model.Board, error) { - board := &model.Board{Name: name, Description: desc, SortOrder: sortOrder} +func (s *BoardService) Create(name, desc, icon string, colorIndex, sortOrder int) (*model.Board, error) { + board := &model.Board{ + Name: name, + Description: desc, + Icon: NormalizeBoardIcon(icon), + ColorIndex: NormalizeBoardColorIndex(colorIndex), + SortOrder: sortOrder, + } return board, model.DB.Create(board).Error } -func (s *BoardService) Update(id uint, name, desc string, sortOrder int) error { +func (s *BoardService) Update(id uint, name, desc, icon string, colorIndex, sortOrder int) error { return model.DB.Model(&model.Board{}).Where("id = ?", id).Updates(map[string]interface{}{ - "name": name, "description": desc, "sort_order": sortOrder, + "name": name, + "description": desc, + "icon": NormalizeBoardIcon(icon), + "color_index": NormalizeBoardColorIndex(colorIndex), + "sort_order": sortOrder, }).Error } diff --git a/service/board_icon.go b/service/board_icon.go new file mode 100644 index 0000000..5256918 --- /dev/null +++ b/service/board_icon.go @@ -0,0 +1,36 @@ +package service + +import "strings" + +// AllowedBoardIcons 与前端 BOARD_ICON_OPTIONS 的 key 保持一致 +var AllowedBoardIcons = map[string]struct{}{ + "code-2": {}, "coffee": {}, "help-circle": {}, "message-square": {}, + "lightbulb": {}, "book-open": {}, "gamepad-2": {}, "palette": {}, + "music": {}, "camera": {}, "heart": {}, "zap": {}, + "globe": {}, "users": {}, "briefcase": {}, "graduation-cap": {}, + "shopping-bag": {}, "map-pin": {}, "megaphone": {}, "flame": {}, + "star": {}, "folder": {}, "wrench": {}, "cpu": {}, +} + +// NormalizeBoardIcon 校验并规范化板块图标 key,非法或空则返回空串 +func NormalizeBoardIcon(icon string) string { + icon = strings.TrimSpace(strings.ToLower(icon)) + if icon == "" { + return "" + } + if _, ok := AllowedBoardIcons[icon]; !ok { + return "" + } + return icon +} + +// NormalizeBoardColorIndex -1 表示自动;0–7 为有效色槽 +func NormalizeBoardColorIndex(colorIndex int) int { + if colorIndex < 0 { + return -1 + } + if colorIndex > 7 { + return colorIndex % 8 + } + return colorIndex +}