@compill/admin 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +44 -0
- package/index.js +248 -0
- package/index.mjs +42211 -0
- package/index.umd.js +248 -0
- package/lib/SectionTitle.d.ts +3 -0
- package/lib/breadcrumbs/BreadCrumbs.d.ts +9 -0
- package/lib/buttons/DialogButton.d.ts +7 -0
- package/lib/buttons/IconButton.d.ts +5 -0
- package/lib/buttons/InvalidateButton.d.ts +7 -0
- package/lib/buttons/NavigateButton.d.ts +5 -0
- package/lib/buttons/PublishButton.d.ts +10 -0
- package/lib/buttons/UpdateButton.d.ts +3 -0
- package/lib/buttons/ViewButton.d.ts +6 -0
- package/lib/cells/OrderCell.d.ts +12 -0
- package/lib/json/DetailsView.d.ts +6 -0
- package/lib/json/EditItemView.d.ts +3 -0
- package/lib/json/MultiQueryWrapper.d.ts +6 -0
- package/lib/json/QueryWrapper.d.ts +7 -0
- package/lib/json/ScreenRenderer.d.ts +7 -0
- package/lib/json/ScreenTopBar.d.ts +15 -0
- package/lib/json/TabbedView.d.ts +4 -0
- package/lib/json/dialog/DialogRenderer.d.ts +12 -0
- package/lib/json/dialog/ItemDeleteDialog.d.ts +11 -0
- package/lib/json/dialog/ItemEditDialog.d.ts +32 -0
- package/lib/json/dialog/MultiQueryWrapperDialog.d.ts +8 -0
- package/lib/json/dialog/QueryWrapperDialog.d.ts +14 -0
- package/lib/json/table/TableRowActionsView.d.ts +12 -0
- package/lib/json/table/TableRowPublishPostButton.d.ts +9 -0
- package/lib/json/table/TableView.d.ts +4 -0
- package/lib/json/table/TableViewContext.d.ts +16 -0
- package/lib/json/table/useTableProps.d.ts +3 -0
- package/lib/json/types/DetailsView.d.ts +51 -0
- package/lib/json/types/EditItemDialog.d.ts +4 -0
- package/lib/json/types/MultiQueryWrapper.d.ts +18 -0
- package/lib/json/types/MultiQueryWrapperDialog.d.ts +13 -0
- package/lib/json/types/QueryWrapper.d.ts +27 -0
- package/lib/json/types/QueryWrapperDialog.d.ts +22 -0
- package/lib/json/types/ScreenConfig.d.ts +8 -0
- package/lib/json/types/TabbedView.d.ts +23 -0
- package/lib/json/types/TableView.d.ts +77 -0
- package/lib/modal/AttachDialog.d.ts +31 -0
- package/lib/modal/FormActionDialog.d.ts +23 -0
- package/lib/modal/ItemEditDialog.d.ts +33 -0
- package/lib/page/PageContainer.d.ts +3 -0
- package/lib/page/PageContentEditor.d.ts +5 -0
- package/lib/page/PageMain.d.ts +3 -0
- package/lib/page/PageQueryStateContainer.d.ts +12 -0
- package/lib/page/PageSectionTitle.d.ts +3 -0
- package/lib/page/PageSidebar.d.ts +3 -0
- package/lib/page/PageSidebarSection.d.ts +5 -0
- package/lib/page/PageStateContainer.d.ts +7 -0
- package/lib/page/PageSubSectionTitle.d.ts +3 -0
- package/lib/page/PageTitle.d.ts +3 -0
- package/lib/page/PageTopBar.d.ts +13 -0
- package/lib/status/StatusBadge.d.ts +5 -0
- package/lib/table/TableContainer.d.ts +3 -0
- package/lib/table/TableCreateButton.d.ts +3 -0
- package/lib/table/TableFilterButton.d.ts +3 -0
- package/lib/table/TableRowActionBar.d.ts +11 -0
- package/lib/table/TableRowDeleteButton.d.ts +3 -0
- package/lib/table/TableRowEditButton.d.ts +3 -0
- package/lib/table/TableRowNavigateButton.d.ts +5 -0
- package/lib/table/TableRowPublishPostButton.d.ts +9 -0
- package/lib/table/TableRowViewButton.d.ts +5 -0
- package/lib/table/TableTopBar.d.ts +8 -0
- package/package.json +13 -0
package/index.umd.js
ADDED
@@ -0,0 +1,248 @@
|
|
1
|
+
(function(Oe,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("@soperio/jsx-runtime"),require("@valerya/ui"),require("react/jsx-runtime"),require("react"),require("@tanstack/react-query"),require("react-router-dom"),require("@soperio/react"),require("formik"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","@soperio/jsx-runtime","@valerya/ui","react/jsx-runtime","react","@tanstack/react-query","react-router-dom","@soperio/react","formik","react-dom"],v):(Oe=typeof globalThis<"u"?globalThis:Oe||self,v(Oe.admin={},Oe.jsxRuntime,Oe.ui,Oe.require$$2$1,Oe.React,Oe.reactQuery,Oe.reactRouterDom,Oe.react$1,Oe.formik,Oe.require$$3))})(this,function(Oe,v,N,Ti,T,ur,wn,Be,Je,Lo){"use strict";var hV=Object.defineProperty;var pV=(Oe,v,N)=>v in Oe?hV(Oe,v,{enumerable:!0,configurable:!0,writable:!0,value:N}):Oe[v]=N;var cr=(Oe,v,N)=>(pV(Oe,typeof v!="symbol"?v+"":v,N),N);function J_(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Kr=J_(T);function X_({children:t,...e}){return v.jsx("h2",{textSize:"xl",fontWeight:"600",textColor:"slate-800",...e,children:t})}var Y_="M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3M12,17L17,12H14V8H10V12H7L12,17Z",Q_="M19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21M12,7L7,12H10V16H14V12H17L12,7Z",ou="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",Z_="M18.41,7.41L17,6L11,12L17,18L18.41,16.59L13.83,12L18.41,7.41M12.41,7.41L11,6L5,12L11,18L12.41,16.59L7.83,12L12.41,7.41Z",ex="M5.59,7.41L7,6L13,12L7,18L5.59,16.59L10.17,12L5.59,7.41M11.59,7.41L13,6L19,12L13,18L11.59,16.59L16.17,12L11.59,7.41Z",tx="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",nx="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",rx="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",$g="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",ox="M12,10A2,2 0 0,0 10,12C10,13.11 10.9,14 12,14C13.11,14 14,13.11 14,12A2,2 0 0,0 12,10Z",Vg="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",jg="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z",ix="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z",sx="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",ax="M6 12.45V9.64C7.47 10.47 9.61 11 12 11S16.53 10.47 18 9.64V12.03C18.17 12 18.33 12 18.5 12C19 12 19.5 12.07 20 12.18V7C20 4.79 16.42 3 12 3S4 4.79 4 7V17C4 19.21 7.59 21 12 21C12.17 21 12.33 21 12.5 21C12.24 20.37 12.09 19.7 12.03 19L12 19C8.13 19 6 17.5 6 17V14.77C7.61 15.55 9.72 16 12 16C12.17 16 12.34 16 12.5 16C12.85 15.18 13.34 14.46 13.95 13.86C13.32 13.95 12.67 14 12 14C9.58 14 7.3 13.4 6 12.45M12 5C15.87 5 18 6.5 18 7S15.87 9 12 9 6 7.5 6 7 8.13 5 12 5M18 18.5L19.77 16.73C19.32 16.28 18.69 16 18 16C16.62 16 15.5 17.12 15.5 18.5S16.62 21 18 21C18.82 21 19.54 20.61 20 20H21.71C21.12 21.47 19.68 22.5 18 22.5C15.79 22.5 14 20.71 14 18.5S15.79 14.5 18 14.5C19.11 14.5 20.11 14.95 20.83 15.67L22 14.5V18.5H18Z",iu="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",su="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",lx="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z",cx="M14,12V19.88C14.04,20.18 13.94,20.5 13.71,20.71C13.32,21.1 12.69,21.1 12.3,20.71L10.29,18.7C10.06,18.47 9.96,18.16 10,17.87V12H9.97L4.21,4.62C3.87,4.19 3.95,3.56 4.38,3.22C4.57,3.08 4.78,3 5,3V3H19V3C19.22,3 19.43,3.08 19.62,3.22C20.05,3.56 20.13,4.19 19.79,4.62L14.03,12H14Z",ux="M16.5,12C19,12 21,14 21,16.5C21,17.38 20.75,18.21 20.31,18.9L23.39,22L22,23.39L18.88,20.32C18.19,20.75 17.37,21 16.5,21C14,21 12,19 12,16.5C12,14 14,12 16.5,12M16.5,14A2.5,2.5 0 0,0 14,16.5A2.5,2.5 0 0,0 16.5,19A2.5,2.5 0 0,0 19,16.5A2.5,2.5 0 0,0 16.5,14M9,4L11,6H19A2,2 0 0,1 21,8V11.81C19.83,10.69 18.25,10 16.5,10A6.5,6.5 0 0,0 10,16.5C10,17.79 10.37,19 11,20H3C1.89,20 1,19.1 1,18V6C1,4.89 1.89,4 3,4H9Z",dx="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z",fx="M4,17L6.75,14.25L6.72,14.23C6.14,13.64 6.14,12.69 6.72,12.11L11.46,7.37L15.7,11.61L10.96,16.35C10.39,16.93 9.46,16.93 8.87,16.37L8.24,17H4M15.91,2.91C16.5,2.33 17.45,2.33 18.03,2.91L20.16,5.03C20.74,5.62 20.74,6.57 20.16,7.16L16.86,10.45L12.62,6.21L15.91,2.91Z",hx="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z",zg="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6Z",Ug="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M22,20V22H14.5V20H22Z",qg="M20.06,18C20,17.83 19.91,17.54 19.86,17.11C19.19,17.81 18.38,18.16 17.45,18.16C16.62,18.16 15.93,17.92 15.4,17.45C14.87,17 14.6,16.39 14.6,15.66C14.6,14.78 14.93,14.1 15.6,13.61C16.27,13.12 17.21,12.88 18.43,12.88H19.83V12.24C19.83,11.75 19.68,11.36 19.38,11.07C19.08,10.78 18.63,10.64 18.05,10.64C17.53,10.64 17.1,10.76 16.75,11C16.4,11.25 16.23,11.54 16.23,11.89H14.77C14.77,11.46 14.92,11.05 15.22,10.65C15.5,10.25 15.93,9.94 16.44,9.71C16.95,9.5 17.5,9.36 18.13,9.36C19.11,9.36 19.87,9.6 20.42,10.09C20.97,10.58 21.26,11.25 21.28,12.11V16C21.28,16.8 21.38,17.42 21.58,17.88V18H20.06M17.66,16.88C18.11,16.88 18.54,16.77 18.95,16.56C19.35,16.35 19.65,16.07 19.83,15.73V14.16H18.7C16.93,14.16 16.04,14.63 16.04,15.57C16.04,16 16.19,16.3 16.5,16.53C16.8,16.76 17.18,16.88 17.66,16.88M5.46,13.71H9.53L7.5,8.29L5.46,13.71M6.64,6H8.36L13.07,18H11.14L10.17,15.43H4.82L3.86,18H1.93L6.64,6M2,20H13V22H2V20Z",Wg="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",Kg="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z",Gg="M10,7L8,11H11V17H5V11L7,7H10M18,7L16,11H19V17H13V11L15,7H18Z",px="M3,14H21V12H3M5,4V7H10V10H14V7H19V4M10,19H14V16H10V19Z",gx="M9.6,14L12,7.7L14.4,14M11,5L5.5,19H7.7L8.8,16H15L16.1,19H18.3L13,5H11Z",mx="M5,21H19V19H5V21M12,17A6,6 0 0,0 18,11V3H15.5V11A3.5,3.5 0 0,1 12,14.5A3.5,3.5 0 0,1 8.5,11V3H6V11A6,6 0 0,0 12,17Z",yx="M10,19H13V22H10V19M12,2C17.35,2.22 19.68,7.62 16.5,11.67C15.67,12.67 14.33,13.33 13.67,14.17C13,15 13,16 13,17H10C10,15.33 10,13.92 10.67,12.92C11.33,11.92 12.67,11.33 13.5,10.67C15.92,8.43 15.32,5.26 12,5A3,3 0 0,0 9,8H6A6,6 0 0,1 12,2Z",vx="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",bx="M21 17.2L6.8 3H19C20.1 3 21 3.9 21 5V17.2M20.7 22L19.7 21H5C3.9 21 3 20.1 3 19V4.3L2 3.3L3.3 2L22 20.7L20.7 22M16.8 18L12.9 14.1L11 16.5L8.5 13.5L5 18H16.8Z",wx="M19,19H5V5H19M19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M13.96,12.29L11.21,15.83L9.25,13.47L6.5,17H17.5L13.96,12.29Z",Sx="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z",au="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",Jg="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Cx="M20 14H14V20H10V14H4V10H10V4H14V10H20V14Z",Ex="M3 3V21H21V3H3M18 18H6V17H18V18M18 16H6V15H18V16M18 12H6V6H18V12Z",Xg="M5,4V6H19V4H5M5,14H9V20H15V14H19L12,7L5,14Z",Yg="M20.8 22.7L15 16.9V20H9V14H5L8.6 10.4L1.1 3L2.4 1.7L22.1 21.4L20.8 22.7M19 6V4H7.2L9.2 6H19M17.2 14H19L12 7L11.1 7.9L17.2 14Z",Qg="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",_x="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z",xx="M12,15.4V6.1L13.71,10.13L18.09,10.5L14.77,13.39L15.76,17.67M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",Ax="M12,15.39L8.24,17.66L9.23,13.38L5.91,10.5L10.29,10.13L12,6.09L13.71,10.13L18.09,10.5L14.77,13.38L15.76,17.66M22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.45,13.97L5.82,21L12,17.27L18.18,21L16.54,13.97L22,9.24Z",Zg="M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z",Ox="M16,15H9V13H16V15M19,11H9V9H19V11M19,7H9V5H19V7M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3M21,1A2,2 0 0,1 23,3V17C23,18.11 22.11,19 21,19H7A2,2 0 0,1 5,17V3C5,1.89 5.89,1 7,1H21M7,3V17H21V3H7Z",em="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",Tx="M10,15L15.19,12L10,9V15M21.56,7.17C21.69,7.64 21.78,8.27 21.84,9.07C21.91,9.87 21.94,10.56 21.94,11.16L22,12C22,14.19 21.84,15.8 21.56,16.83C21.31,17.73 20.73,18.31 19.83,18.56C19.36,18.69 18.5,18.78 17.18,18.84C15.88,18.91 14.69,18.94 13.59,18.94L12,19C7.81,19 5.2,18.84 4.17,18.56C3.27,18.31 2.69,17.73 2.44,16.83C2.31,16.36 2.22,15.73 2.16,14.93C2.09,14.13 2.06,13.44 2.06,12.84L2,12C2,9.81 2.16,8.2 2.44,7.17C2.69,6.27 3.27,5.69 4.17,5.44C4.64,5.31 5.5,5.22 6.82,5.16C8.12,5.09 9.31,5.06 10.41,5.06L12,5C16.19,5 18.8,5.16 19.83,5.44C20.73,5.69 21.31,6.27 21.56,7.17Z";function tm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function kx(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})}),n}var lu={exports:{}},Nt={};Nt._=Nt._interop_require_default=Mx;function Mx(t){return t&&t.__esModule?t:{default:t}}var Gs={exports:{}},cu={},nm;function Js(){return nm||(nm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}});function n(s){const a={};return s.forEach((l,c)=>{typeof a[c]>"u"?a[c]=l:Array.isArray(a[c])?a[c].push(l):a[c]=[a[c],l]}),a}function r(s){return typeof s=="string"||typeof s=="number"&&!isNaN(s)||typeof s=="boolean"?String(s):""}function o(s){const a=new URLSearchParams;return Object.entries(s).forEach(l=>{let[c,u]=l;Array.isArray(u)?u.forEach(d=>a.append(c,r(d))):a.set(c,r(u))}),a}function i(s){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return l.forEach(u=>{Array.from(u.keys()).forEach(d=>s.delete(d)),u.forEach((d,h)=>s.append(h,d))}),s}}(cu)),cu}var uu={},Xs={},rm;function ki(){if(rm)return Xs;rm=1;function t(n){if(typeof WeakMap!="function")return null;var r=new WeakMap,o=new WeakMap;return(t=function(i){return i?o:r})(n)}Xs._=Xs._interop_require_wildcard=e;function e(n,r){if(!r&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var o=t(r);if(o&&o.has(n))return o.get(n);var i={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in n)if(a!=="default"&&Object.prototype.hasOwnProperty.call(n,a)){var l=s?Object.getOwnPropertyDescriptor(n,a):null;l&&(l.get||l.set)?Object.defineProperty(i,a,l):i[a]=n[a]}return i.default=n,o&&o.set(n,i),i}return Xs}var om;function du(){return om||(om=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{formatUrl:function(){return i},formatWithValidation:function(){return a},urlObjectKeys:function(){return s}});const r=ki()._(Js()),o=/https?|ftp|gopher|file/;function i(l){let{auth:c,hostname:u}=l,d=l.protocol||"",h=l.pathname||"",f=l.hash||"",p=l.query||"",g=!1;c=c?encodeURIComponent(c).replace(/%3A/i,":")+"@":"",l.host?g=c+l.host:u&&(g=c+(~u.indexOf(":")?"["+u+"]":u),l.port&&(g+=":"+l.port)),p&&typeof p=="object"&&(p=String(r.urlQueryToSearchParams(p)));let m=l.search||p&&"?"+p||"";return d&&!d.endsWith(":")&&(d+=":"),l.slashes||(!d||o.test(d))&&g!==!1?(g="//"+(g||""),h&&h[0]!=="/"&&(h="/"+h)):g||(g=""),f&&f[0]!=="#"&&(f="#"+f),m&&m[0]!=="?"&&(m="?"+m),h=h.replace(/[?#]/g,encodeURIComponent),m=m.replace("#","%23"),""+d+g+h+m+f}const s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function a(l){return process.env.NODE_ENV==="development"&&l!==null&&typeof l=="object"&&Object.keys(l).forEach(c=>{s.includes(c)||console.warn("Unknown key passed via urlObject into url.format: "+c)}),i(l)}}(uu)),uu}var fu={},im;function sm(){return im||(im=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return e}});function e(n,r){const o={};return Object.keys(n).forEach(i=>{r.includes(i)||(o[i]=n[i])}),o}}(fu)),fu}var hu={},am;function Do(){return am||(am=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(b,S){for(var E in S)Object.defineProperty(b,E,{enumerable:!0,get:S[E]})}e(t,{DecodeError:function(){return p},MiddlewareNotFoundError:function(){return C},MissingStaticPage:function(){return y},NormalizeError:function(){return g},PageNotFoundError:function(){return m},SP:function(){return h},ST:function(){return f},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return l},getLocationOrigin:function(){return s},getURL:function(){return a},isAbsoluteUrl:function(){return i},isResSent:function(){return c},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return u},stringifyError:function(){return w}});const n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(b){let S=!1,E;return function(){for(var x=arguments.length,_=new Array(x),A=0;A<x;A++)_[A]=arguments[A];return S||(S=!0,E=b(..._)),E}}const o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=b=>o.test(b);function s(){const{protocol:b,hostname:S,port:E}=window.location;return b+"//"+S+(E?":"+E:"")}function a(){const{href:b}=window.location,S=s();return b.substring(S.length)}function l(b){return typeof b=="string"?b:b.displayName||b.name||"Unknown"}function c(b){return b.finished||b.headersSent}function u(b){const S=b.split("?");return S[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(S[1]?"?"+S.slice(1).join("?"):"")}async function d(b,S){if(process.env.NODE_ENV!=="production"){var E;if((E=b.prototype)!=null&&E.getInitialProps){const A='"'+l(b)+'.getInitialProps()" is defined as an instance method - visit https://nextjs.org/docs/messages/get-initial-props-as-an-instance-method for more information.';throw new Error(A)}}const x=S.res||S.ctx&&S.ctx.res;if(!b.getInitialProps)return S.ctx&&S.Component?{pageProps:await d(S.Component,S.ctx)}:{};const _=await b.getInitialProps(S);if(x&&c(x))return _;if(!_){const A='"'+l(b)+'.getInitialProps()" should resolve to an object. But found "'+_+'" instead.';throw new Error(A)}return process.env.NODE_ENV!=="production"&&Object.keys(_).length===0&&!S.ctx&&console.warn(""+l(b)+" returned an empty object from `getInitialProps`. This de-optimizes and prevents automatic static optimization. https://nextjs.org/docs/messages/empty-object-getInitialProps"),_}const h=typeof performance<"u",f=h&&["mark","measure","getEntriesByName"].every(b=>typeof performance[b]=="function");class p extends Error{}class g extends Error{}class m extends Error{constructor(S){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+S}}class y extends Error{constructor(S,E){super(),this.message="Failed to load static file for page: "+S+" "+E}}class C extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function w(b){return JSON.stringify({message:b.message,stack:b.stack})}}(hu)),hu}var Ys={exports:{}},pu={},lm;function Mi(){return lm||(lm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\/$/,"")||"/"}}(pu)),pu}var gu={},cm;function Ro(){return cm||(cm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return e}});function e(n){const r=n.indexOf("#"),o=n.indexOf("?"),i=o>-1&&(r<0||o<r);return i||r>-1?{pathname:n.substring(0,i?o:r),query:i?n.substring(o,r>-1?r:void 0):"",hash:r>-1?n.slice(r):""}:{pathname:n,query:"",hash:""}}}(gu)),gu}var um;function Qs(){return um||(um=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return o}});const n=Mi(),r=Ro(),o=i=>{if(!i.startsWith("/")||process.env.__NEXT_MANUAL_TRAILING_SLASH)return i;const{pathname:s,query:a,hash:l}=(0,r.parsePath)(i);return process.env.__NEXT_TRAILING_SLASH?/\.[^/]+\/?$/.test(s)?""+(0,n.removeTrailingSlash)(s)+a+l:s.endsWith("/")?""+s+a+l:s+"/"+a+l:""+(0,n.removeTrailingSlash)(s)+a+l};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ys,Ys.exports)),Ys.exports}var mu={},Zs={exports:{}},yu={},dm;function ea(){return dm||(dm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return n}});const e=Ro();function n(r,o){if(typeof r!="string")return!1;const{pathname:i}=(0,e.parsePath)(r);return i===o||i.startsWith(o+"/")}}(yu)),yu}var fm;function vu(){return fm||(fm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"hasBasePath",{enumerable:!0,get:function(){return o}});const n=ea(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return(0,n.pathHasPrefix)(i,r)}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Zs,Zs.exports)),Zs.exports}var hm;function bu(){return hm||(hm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return r}});const e=Do(),n=vu();function r(o){if(!(0,e.isAbsoluteUrl)(o))return!0;try{const i=(0,e.getLocationOrigin)(),s=new URL(o,i);return s.origin===i&&(0,n.hasBasePath)(s.pathname)}catch{return!1}}}(mu)),mu}var wu={},Su={},pm;function Px(){return pm||(pm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class e{insert(o){this._insert(o.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(o){o===void 0&&(o="/");const i=[...this.children.keys()].sort();this.slugName!==null&&i.splice(i.indexOf("[]"),1),this.restSlugName!==null&&i.splice(i.indexOf("[...]"),1),this.optionalRestSlugName!==null&&i.splice(i.indexOf("[[...]]"),1);const s=i.map(a=>this.children.get(a)._smoosh(""+o+a+"/")).reduce((a,l)=>[...a,...l],[]);if(this.slugName!==null&&s.push(...this.children.get("[]")._smoosh(o+"["+this.slugName+"]/")),!this.placeholder){const a=o==="/"?"/":o.slice(0,-1);if(this.optionalRestSlugName!=null)throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("'+a+'" and "'+a+"[[..."+this.optionalRestSlugName+']]").');s.unshift(a)}return this.restSlugName!==null&&s.push(...this.children.get("[...]")._smoosh(o+"[..."+this.restSlugName+"]/")),this.optionalRestSlugName!==null&&s.push(...this.children.get("[[...]]")._smoosh(o+"[[..."+this.optionalRestSlugName+"]]/")),s}_insert(o,i,s){if(o.length===0){this.placeholder=!1;return}if(s)throw new Error("Catch-all must be the last part of the URL.");let a=o[0];if(a.startsWith("[")&&a.endsWith("]")){let u=function(d,h){if(d!==null&&d!==h)throw new Error("You cannot use different slug names for the same dynamic path ('"+d+"' !== '"+h+"').");i.forEach(f=>{if(f===h)throw new Error('You cannot have the same slug name "'+h+'" repeat within a single dynamic path');if(f.replace(/\W/g,"")===a.replace(/\W/g,""))throw new Error('You cannot have the slug names "'+f+'" and "'+h+'" differ only by non-word symbols within a single dynamic path')}),i.push(h)},l=a.slice(1,-1),c=!1;if(l.startsWith("[")&&l.endsWith("]")&&(l=l.slice(1,-1),c=!0),l.startsWith("...")&&(l=l.substring(3),s=!0),l.startsWith("[")||l.endsWith("]"))throw new Error("Segment names may not start or end with extra brackets ('"+l+"').");if(l.startsWith("."))throw new Error("Segment names may not start with erroneous periods ('"+l+"').");if(s)if(c){if(this.restSlugName!=null)throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+o[0]+'" ).');u(this.optionalRestSlugName,l),this.optionalRestSlugName=l,a="[[...]]"}else{if(this.optionalRestSlugName!=null)throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+o[0]+'").');u(this.restSlugName,l),this.restSlugName=l,a="[...]"}else{if(c)throw new Error('Optional route parameters are not yet supported ("'+o[0]+'").');u(this.slugName,l),this.slugName=l,a="[]"}}this.children.has(a)||this.children.set(a,new e),this.children.get(a)._insert(o.slice(1),i,s)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(r){const o=new e;return r.forEach(i=>o.insert(i)),o.smoosh()}}(Su)),Su}var Cu={},Eu={},_u={},xu={},gm;function Ix(){return gm||(gm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return e}});function e(n){return n.startsWith("/")?n:"/"+n}}(xu)),xu}var Au={},mm;function Lx(){return mm||(mm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});function n(i){return i[0]==="("&&i.endsWith(")")}const r="__PAGE__",o="__DEFAULT__"}(Au)),Au}var ym;function Dx(){return ym||(ym=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{normalizeAppPath:function(){return o},normalizeRscURL:function(){return i}});const n=Ix(),r=Lx();function o(s){return(0,n.ensureLeadingSlash)(s.split("/").reduce((a,l,c,u)=>!l||(0,r.isGroupSegment)(l)||l[0]==="@"||(l==="page"||l==="route")&&c===u.length-1?a:a+"/"+l,""))}function i(s){return s.replace(/\.rsc($|\?)/,"$1")}}(_u)),_u}var vm;function Ou(){return vm||(vm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,a){for(var l in a)Object.defineProperty(s,l,{enumerable:!0,get:a[l]})}e(t,{INTERCEPTION_ROUTE_MARKERS:function(){return r},extractInterceptionRouteInformation:function(){return i},isInterceptionRouteAppPath:function(){return o}});const n=Dx(),r=["(..)(..)","(.)","(..)","(...)"];function o(s){return s.split("/").find(a=>r.find(l=>a.startsWith(l)))!==void 0}function i(s){let a,l,c;for(const u of s.split("/"))if(l=r.find(d=>u.startsWith(d)),l){[a,c]=s.split(l,2);break}if(!a||!l||!c)throw new Error(`Invalid interception route: ${s}. Must be in the format /<intercepting route>/(..|...|..)(..)/<intercepted route>`);switch(a=(0,n.normalizeAppPath)(a),l){case"(.)":a==="/"?c=`/${c}`:c=a+"/"+c;break;case"(..)":if(a==="/")throw new Error(`Invalid interception route: ${s}. Cannot use (..) marker at the root level, use (.) instead.`);c=a.split("/").slice(0,-1).concat(c).join("/");break;case"(...)":c="/"+c;break;case"(..)(..)":const u=a.split("/");if(u.length<=2)throw new Error(`Invalid interception route: ${s}. Cannot use (..)(..) marker at the root level or one level up.`);c=u.slice(0,-2).concat(c).join("/");break;default:throw new Error("Invariant: unexpected marker")}return{interceptingRoute:a,interceptedRoute:c}}}(Eu)),Eu}var bm;function wm(){return bm||(bm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return r}});const e=Ou(),n=/\/\[[^/]+?\](?=\/|$)/;function r(o){return(0,e.isInterceptionRouteAppPath)(o)&&(o=(0,e.extractInterceptionRouteInformation)(o).interceptedRoute),n.test(o)}}(Cu)),Cu}var Sm;function Cm(){return Sm||(Sm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return r.isDynamicRoute}});const n=Px(),r=wm()}(wu)),wu}var Tu={},ku={},Em;function _m(){return Em||(Em=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return n}});const e=Do();function n(r){let{re:o,groups:i}=r;return s=>{const a=o.exec(s);if(!a)return!1;const l=u=>{try{return decodeURIComponent(u)}catch{throw new e.DecodeError("failed to decode param")}},c={};return Object.keys(i).forEach(u=>{const d=i[u],h=a[d.pos];h!==void 0&&(c[u]=~h.indexOf("/")?h.split("/").map(f=>l(f)):d.repeat?[l(h)]:l(h))}),c}}}(ku)),ku}var Mu={},Pu={},xm;function Am(){return xm||(xm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return r}});const e=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function r(o){return e.test(o)?o.replace(n,"\\$&"):o}}(Pu)),Pu}var Om;function Tm(){return Om||(Om=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(g,m){for(var y in m)Object.defineProperty(g,y,{enumerable:!0,get:m[y]})}e(t,{getNamedMiddlewareRegex:function(){return p},getNamedRouteRegex:function(){return f},getRouteRegex:function(){return c},parseParameter:function(){return a}});const n=Ou(),r=Am(),o=Mi(),i="nxtP",s="nxtI";function a(g){const m=g.startsWith("[")&&g.endsWith("]");m&&(g=g.slice(1,-1));const y=g.startsWith("...");return y&&(g=g.slice(3)),{key:g,repeat:y,optional:m}}function l(g){const m=(0,o.removeTrailingSlash)(g).slice(1).split("/"),y={};let C=1;return{parameterizedRoute:m.map(w=>{const b=n.INTERCEPTION_ROUTE_MARKERS.find(E=>w.startsWith(E)),S=w.match(/\[((?:\[.*\])|.+)\]/);if(b&&S){const{key:E,optional:x,repeat:_}=a(S[1]);return y[E]={pos:C++,repeat:_,optional:x},"/"+(0,r.escapeStringRegexp)(b)+"([^/]+?)"}else if(S){const{key:E,repeat:x,optional:_}=a(S[1]);return y[E]={pos:C++,repeat:x,optional:_},x?_?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}else return"/"+(0,r.escapeStringRegexp)(w)}).join(""),groups:y}}function c(g){const{parameterizedRoute:m,groups:y}=l(g);return{re:new RegExp("^"+m+"(?:/)?$"),groups:y}}function u(){let g=0;return()=>{let m="",y=++g;for(;y>0;)m+=String.fromCharCode(97+(y-1)%26),y=Math.floor((y-1)/26);return m}}function d(g){let{interceptionMarker:m,getSafeRouteKey:y,segment:C,routeKeys:w,keyPrefix:b}=g;const{key:S,optional:E,repeat:x}=a(C);let _=S.replace(/\W/g,"");b&&(_=""+b+_);let A=!1;(_.length===0||_.length>30)&&(A=!0),isNaN(parseInt(_.slice(0,1)))||(A=!0),A&&(_=y()),b?w[_]=""+b+S:w[_]=S;const O=m?(0,r.escapeStringRegexp)(m):"";return x?E?"(?:/"+O+"(?<"+_+">.+?))?":"/"+O+"(?<"+_+">.+?)":"/"+O+"(?<"+_+">[^/]+?)"}function h(g,m){const y=(0,o.removeTrailingSlash)(g).slice(1).split("/"),C=u(),w={};return{namedParameterizedRoute:y.map(b=>{const S=n.INTERCEPTION_ROUTE_MARKERS.some(x=>b.startsWith(x)),E=b.match(/\[((?:\[.*\])|.+)\]/);if(S&&E){const[x]=b.split(E[0]);return d({getSafeRouteKey:C,interceptionMarker:x,segment:E[1],routeKeys:w,keyPrefix:m?s:void 0})}else return E?d({getSafeRouteKey:C,segment:E[1],routeKeys:w,keyPrefix:m?i:void 0}):"/"+(0,r.escapeStringRegexp)(b)}).join(""),routeKeys:w}}function f(g,m){const y=h(g,m);return{...c(g),namedRegex:"^"+y.namedParameterizedRoute+"(?:/)?$",routeKeys:y.routeKeys}}function p(g,m){const{parameterizedRoute:y}=l(g),{catchAll:C=!0}=m;if(y==="/")return{namedRegex:"^/"+(C?".*":"")+"$"};const{namedParameterizedRoute:w}=h(g,!1);let b=C?"(?:(/.*)?)":"";return{namedRegex:"^"+w+b+"$"}}}(Mu)),Mu}var km;function Mm(){return km||(km=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return r}});const e=_m(),n=Tm();function r(o,i,s){let a="";const l=(0,n.getRouteRegex)(o),c=l.groups,u=(i!==o?(0,e.getRouteMatcher)(l)(i):"")||s;a=o;const d=Object.keys(c);return d.every(h=>{let f=u[h]||"";const{repeat:p,optional:g}=c[h];let m="["+(p?"...":"")+h+"]";return g&&(m=(f?"":"/")+"["+m+"]"),p&&!Array.isArray(f)&&(f=[f]),(g||h in u)&&(a=a.replace(m,p?f.map(y=>encodeURIComponent(y)).join("/"):encodeURIComponent(f))||"/")})||(a=""),{params:d,result:a}}}(Tu)),Tu}var Pm;function Im(){return Pm||(Pm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"resolveHref",{enumerable:!0,get:function(){return u}});const n=Js(),r=du(),o=sm(),i=Do(),s=Qs(),a=bu(),l=Cm(),c=Mm();function u(d,h,f){let p,g=typeof h=="string"?h:(0,r.formatWithValidation)(h);const m=g.match(/^[a-zA-Z]{1,}:\/\//),y=m?g.slice(m[0].length):g;if((y.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+g+"' passed to next/router in page: '"+d.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");const w=(0,i.normalizeRepeatedSlashes)(y);g=(m?m[0]:"")+w}if(!(0,a.isLocalURL)(g))return f?[g]:g;try{p=new URL(g.startsWith("#")?d.asPath:d.pathname,"http://n")}catch{p=new URL("/","http://n")}try{const w=new URL(g,p);w.pathname=(0,s.normalizePathTrailingSlash)(w.pathname);let b="";if((0,l.isDynamicRoute)(w.pathname)&&w.searchParams&&f){const E=(0,n.searchParamsToUrlQuery)(w.searchParams),{result:x,params:_}=(0,c.interpolateAs)(w.pathname,w.pathname,E);x&&(b=(0,r.formatWithValidation)({pathname:x,hash:w.hash,query:(0,o.omit)(E,_)}))}const S=w.origin===p.origin?w.href.slice(w.origin.length):w.href;return f?[S,b||S]:S}catch{return f?[g]:g}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Gs,Gs.exports)),Gs.exports}var ta={exports:{}},Iu={},Lu={},Lm;function Du(){return Lm||(Lm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return n}});const e=Ro();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:i,query:s,hash:a}=(0,e.parsePath)(r);return""+o+i+s+a}}(Lu)),Lu}var Dm;function Rm(){return Dm||(Dm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return r}});const e=Du(),n=ea();function r(o,i,s,a){if(!i||i===s)return o;const l=o.toLowerCase();return!a&&((0,n.pathHasPrefix)(l,"/api")||(0,n.pathHasPrefix)(l,"/"+i.toLowerCase()))?o:(0,e.addPathPrefix)(o,"/"+i)}}(Iu)),Iu}var Nm;function Fm(){return Nm||(Nm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addLocale",{enumerable:!0,get:function(){return r}});const n=Qs(),r=function(o){for(var i=arguments.length,s=new Array(i>1?i-1:0),a=1;a<i;a++)s[a-1]=arguments[a];return process.env.__NEXT_I18N_SUPPORT?(0,n.normalizePathTrailingSlash)(Rm().addLocale(o,...s)):o};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ta,ta.exports)),ta.exports}var Ru={},Hm;function Nu(){return Hm||(Hm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});const r=Nt._(T).default.createContext(null);process.env.NODE_ENV!=="production"&&(r.displayName="RouterContext")}(Ru)),Ru}var Fu={},Bm;function Rx(){return Bm||(Bm=1,function(t){"use client";Object.defineProperty(t,"__esModule",{value:!0});function e(c,u){for(var d in u)Object.defineProperty(c,d,{enumerable:!0,get:u[d]})}e(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return s},LayoutRouterContext:function(){return i},MissingSlotContext:function(){return l},TemplateContext:function(){return a}});const r=Nt._(T),o=r.default.createContext(null),i=r.default.createContext(null),s=r.default.createContext(null),a=r.default.createContext(null);process.env.NODE_ENV!=="production"&&(o.displayName="AppRouterContext",i.displayName="LayoutRouterContext",s.displayName="GlobalLayoutRouterContext",a.displayName="TemplateContext");const l=r.default.createContext(new Set)}(Fu)),Fu}var na={exports:{}},ra={exports:{}},$m;function Hu(){return $m||($m=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}n(e,{cancelIdleCallback:function(){return o},requestIdleCallback:function(){return r}});const r=typeof self<"u"&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(i){let s=Date.now();return self.setTimeout(function(){i({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-s))}})},1)},o=typeof self<"u"&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(i){return clearTimeout(i)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ra,ra.exports)),ra.exports}var Vm;function Nx(){return Vm||(Vm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"useIntersection",{enumerable:!0,get:function(){return c}});const n=T,r=Hu(),o=typeof IntersectionObserver=="function",i=new Map,s=[];function a(u){const d={root:u.root||null,margin:u.rootMargin||""},h=s.find(m=>m.root===d.root&&m.margin===d.margin);let f;if(h&&(f=i.get(h),f))return f;const p=new Map,g=new IntersectionObserver(m=>{m.forEach(y=>{const C=p.get(y.target),w=y.isIntersecting||y.intersectionRatio>0;C&&w&&C(w)})},u);return f={id:d,observer:g,elements:p},s.push(d),i.set(d,f),f}function l(u,d,h){const{id:f,observer:p,elements:g}=a(h);return g.set(u,d),p.observe(u),function(){if(g.delete(u),p.unobserve(u),g.size===0){p.disconnect(),i.delete(f);const y=s.findIndex(C=>C.root===f.root&&C.margin===f.margin);y>-1&&s.splice(y,1)}}}function c(u){let{rootRef:d,rootMargin:h,disabled:f}=u;const p=f||!o,[g,m]=(0,n.useState)(!1),y=(0,n.useRef)(null),C=(0,n.useCallback)(b=>{y.current=b},[]);(0,n.useEffect)(()=>{if(o){if(p||g)return;const b=y.current;if(b&&b.tagName)return l(b,E=>E&&m(E),{root:d==null?void 0:d.current,rootMargin:h})}else if(!g){const b=(0,r.requestIdleCallback)(()=>m(!0));return()=>(0,r.cancelIdleCallback)(b)}},[p,h,d,g,y.current]);const w=(0,n.useCallback)(()=>{m(!1)},[]);return[C,g,w]}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(na,na.exports)),na.exports}var oa={exports:{}},ia={exports:{}},Bu={},jm;function sa(){return jm||(jm=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizeLocalePath",{enumerable:!0,get:function(){return e}});function e(n,r){let o;const i=n.split("/");return(r||[]).some(s=>i[1]&&i[1].toLowerCase()===s.toLowerCase()?(o=s,i.splice(1,1),n=i.join("/")||"/",!0):!1),{pathname:n,detectedLocale:o}}}(Bu)),Bu}var zm;function Fx(){return zm||(zm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"normalizeLocalePath",{enumerable:!0,get:function(){return n}});const n=(r,o)=>process.env.__NEXT_I18N_SUPPORT?sa().normalizeLocalePath(r,o):{pathname:r,detectedLocale:void 0};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ia,ia.exports)),ia.exports}var aa={exports:{}},$u={},Um;function Hx(){return Um||(Um=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"detectDomainLocale",{enumerable:!0,get:function(){return e}});function e(n,r,o){if(n){o&&(o=o.toLowerCase());for(const a of n){var i,s;const l=(i=a.domain)==null?void 0:i.split(":",1)[0].toLowerCase();if(r===l||o===a.defaultLocale.toLowerCase()||(s=a.locales)!=null&&s.some(c=>c.toLowerCase()===o))return a}}}}($u)),$u}var qm;function Wm(){return qm||(qm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"detectDomainLocale",{enumerable:!0,get:function(){return n}});const n=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];if(process.env.__NEXT_I18N_SUPPORT)return Hx().detectDomainLocale(...o)};(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(aa,aa.exports)),aa.exports}var Km;function Bx(){return Km||(Km=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getDomainLocale",{enumerable:!0,get:function(){return o}});const n=Qs(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i,s,a,l){if(process.env.__NEXT_I18N_SUPPORT){const c=Fx().normalizeLocalePath,u=Wm().detectDomainLocale,d=s||c(i,a).detectedLocale,h=u(l,void 0,d);if(h){const f="http"+(h.http?"":"s")+"://",p=d===h.defaultLocale?"":"/"+d;return""+f+h.domain+(0,n.normalizePathTrailingSlash)(""+r+p+i)}return!1}else return!1}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(oa,oa.exports)),oa.exports}var la={exports:{}},Gm;function Jm(){return Gm||(Gm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"addBasePath",{enumerable:!0,get:function(){return i}});const n=Du(),r=Qs(),o=process.env.__NEXT_ROUTER_BASEPATH||"";function i(s,a){return(0,r.normalizePathTrailingSlash)(process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!a?s:(0,n.addPathPrefix)(s,o))}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(la,la.exports)),la.exports}var ca={exports:{}},Xm;function $x(){return Xm||(Xm=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(f,p){for(var g in p)Object.defineProperty(f,g,{enumerable:!0,get:p[g]})}n(e,{ACTION_FAST_REFRESH:function(){return l},ACTION_NAVIGATE:function(){return o},ACTION_PREFETCH:function(){return a},ACTION_REFRESH:function(){return r},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return c},ACTION_SERVER_PATCH:function(){return s},PrefetchCacheEntryStatus:function(){return d},PrefetchKind:function(){return u},isThenable:function(){return h}});const r="refresh",o="navigate",i="restore",s="server-patch",a="prefetch",l="fast-refresh",c="server-action";var u;(function(f){f.AUTO="auto",f.FULL="full",f.TEMPORARY="temporary"})(u||(u={}));var d;(function(f){f.fresh="fresh",f.reusable="reusable",f.expired="expired",f.stale="stale"})(d||(d={}));function h(f){return f&&(typeof f=="object"||typeof f=="function")&&typeof f.then=="function"}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ca,ca.exports)),ca.exports}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return E}});const n=Nt,r=Ti,o=n._(T),i=Im(),s=bu(),a=du(),l=Do(),c=Fm(),u=Nu(),d=Rx(),h=Nx(),f=Bx(),p=Jm(),g=$x(),m=new Set;function y(x,_,A,O,k,M){if(typeof window>"u"||!M&&!(0,s.isLocalURL)(_))return;if(!O.bypassPrefetchedCheck){const P=typeof O.locale<"u"?O.locale:"locale"in x?x.locale:void 0,F=_+"%"+A+"%"+P;if(m.has(F))return;m.add(F)}(async()=>M?x.prefetch(_,k):x.prefetch(_,A,O))().catch(P=>{if(process.env.NODE_ENV!=="production")throw P})}function C(x){const A=x.currentTarget.getAttribute("target");return A&&A!=="_self"||x.metaKey||x.ctrlKey||x.shiftKey||x.altKey||x.nativeEvent&&x.nativeEvent.which===2}function w(x,_,A,O,k,M,I,P,F){const{nodeName:z}=x.currentTarget;if(z.toUpperCase()==="A"&&(C(x)||!F&&!(0,s.isLocalURL)(A)))return;x.preventDefault();const J=()=>{const K=I??!0;"beforePopState"in _?_[k?"replace":"push"](A,O,{shallow:M,locale:P,scroll:K}):_[k?"replace":"push"](O||A,{scroll:K})};F?o.default.startTransition(J):J()}function b(x){return typeof x=="string"?x:(0,a.formatUrl)(x)}const E=o.default.forwardRef(function(_,A){let O;const{href:k,as:M,children:I,prefetch:P=null,passHref:F,replace:z,shallow:$,scroll:J,locale:K,onClick:R,onMouseEnter:Q,onTouchStart:se,legacyBehavior:ie=!1,...de}=_;O=I,ie&&(typeof O=="string"||typeof O=="number")&&(O=(0,r.jsx)("a",{children:O}));const ue=o.default.useContext(u.RouterContext),pe=o.default.useContext(d.AppRouterContext),D=ue??pe,ce=!ue,ye=P!==!1,be=P===null?g.PrefetchKind.AUTO:g.PrefetchKind.FULL;if(process.env.NODE_ENV!=="production"){let Z=function(te){return new Error("Failed prop type: The prop `"+te.key+"` expects a "+te.expected+" in `<Link>`, but got `"+te.actual+"` instead."+(typeof window<"u"?`
|
2
|
+
Open your browser's console to view the Component stack trace.`:""))};Object.keys({href:!0}).forEach(te=>{if(te==="href"&&(_[te]==null||typeof _[te]!="string"&&typeof _[te]!="object"))throw Z({key:te,expected:"`string` or `object`",actual:_[te]===null?"null":typeof _[te]})}),Object.keys({as:!0,replace:!0,scroll:!0,shallow:!0,passHref:!0,prefetch:!0,locale:!0,onClick:!0,onMouseEnter:!0,onTouchStart:!0,legacyBehavior:!0}).forEach(te=>{const fe=typeof _[te];if(te==="as"){if(_[te]&&fe!=="string"&&fe!=="object")throw Z({key:te,expected:"`string` or `object`",actual:fe})}else if(te==="locale"){if(_[te]&&fe!=="string")throw Z({key:te,expected:"`string`",actual:fe})}else if(te==="onClick"||te==="onMouseEnter"||te==="onTouchStart"){if(_[te]&&fe!=="function")throw Z({key:te,expected:"`function`",actual:fe})}else if((te==="replace"||te==="scroll"||te==="shallow"||te==="passHref"||te==="prefetch"||te==="legacyBehavior")&&_[te]!=null&&fe!=="boolean")throw Z({key:te,expected:"`boolean`",actual:fe})});const j=o.default.useRef(!1);_.prefetch&&!j.current&&!ce&&(j.current=!0,console.warn("Next.js auto-prefetches automatically based on viewport. The prefetch attribute is no longer needed. More: https://nextjs.org/docs/messages/prefetch-true-deprecated"))}if(process.env.NODE_ENV!=="production"&&ce&&!M){let Z;if(typeof k=="string"?Z=k:typeof k=="object"&&typeof k.pathname=="string"&&(Z=k.pathname),Z&&Z.split("/").some(U=>U.startsWith("[")&&U.endsWith("]")))throw new Error("Dynamic href `"+Z+"` found in <Link> while using the `/app` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href")}const{href:H,as:L}=o.default.useMemo(()=>{if(!ue){const U=b(k);return{href:U,as:M?b(M):U}}const[Z,Se]=(0,i.resolveHref)(ue,k,!0);return{href:Z,as:M?(0,i.resolveHref)(ue,M):Se||Z}},[ue,k,M]),He=o.default.useRef(H),G=o.default.useRef(L);let ne;if(ie)if(process.env.NODE_ENV==="development"){R&&console.warn('"onClick" was passed to <Link> with `href` of `'+k+'` but "legacyBehavior" was set. The legacy behavior requires onClick be set on the child of next/link'),Q&&console.warn('"onMouseEnter" was passed to <Link> with `href` of `'+k+'` but "legacyBehavior" was set. The legacy behavior requires onMouseEnter be set on the child of next/link');try{ne=o.default.Children.only(O)}catch{throw O?new Error("Multiple children were passed to <Link> with `href` of `"+k+"` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children"+(typeof window<"u"?`
|
3
|
+
Open your browser's console to view the Component stack trace.`:"")):new Error("No children were passed to <Link> with `href` of `"+k+"` but one child is required https://nextjs.org/docs/messages/link-no-children")}}else ne=o.default.Children.only(O);else if(process.env.NODE_ENV==="development"&&(O==null?void 0:O.type)==="a")throw new Error(`Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.
|
4
|
+
Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor`);const X=ie?ne&&typeof ne=="object"&&ne.ref:A,[W,V,ee]=(0,h.useIntersection)({rootMargin:"200px"}),Ce=o.default.useCallback(Z=>{(G.current!==L||He.current!==H)&&(ee(),G.current=L,He.current=H),W(Z),X&&(typeof X=="function"?X(Z):typeof X=="object"&&(X.current=Z))},[L,X,H,ee,W]);o.default.useEffect(()=>{process.env.NODE_ENV==="production"&&D&&(!V||!ye||y(D,H,L,{locale:K},{kind:be},ce))},[L,H,V,K,ye,ue==null?void 0:ue.locale,D,ce,be]);const we={ref:Ce,onClick(Z){if(process.env.NODE_ENV!=="production"&&!Z)throw new Error('Component rendered inside next/link has to pass click event to "onClick" prop.');!ie&&typeof R=="function"&&R(Z),ie&&ne.props&&typeof ne.props.onClick=="function"&&ne.props.onClick(Z),D&&(Z.defaultPrevented||w(Z,D,H,L,z,$,J,K,ce))},onMouseEnter(Z){!ie&&typeof Q=="function"&&Q(Z),ie&&ne.props&&typeof ne.props.onMouseEnter=="function"&&ne.props.onMouseEnter(Z),D&&((!ye||process.env.NODE_ENV==="development")&&ce||y(D,H,L,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))},onTouchStart:process.env.__NEXT_LINK_NO_TOUCH_START?void 0:function(Se){!ie&&typeof se=="function"&&se(Se),ie&&ne.props&&typeof ne.props.onTouchStart=="function"&&ne.props.onTouchStart(Se),D&&(!ye&&ce||y(D,H,L,{locale:K,priority:!0,bypassPrefetchedCheck:!0},{kind:be},ce))}};if((0,l.isAbsoluteUrl)(L))we.href=L;else if(!ie||F||ne.type==="a"&&!("href"in ne.props)){const Z=typeof K<"u"?K:ue==null?void 0:ue.locale,Se=(ue==null?void 0:ue.isLocaleDomain)&&(0,f.getDomainLocale)(L,Z,ue==null?void 0:ue.locales,ue==null?void 0:ue.domainLocales);we.href=Se||(0,p.addBasePath)((0,c.addLocale)(L,Z,ue==null?void 0:ue.defaultLocale))}return ie?o.default.cloneElement(ne,we):(0,r.jsx)("a",{...de,...we,children:O})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(lu,lu.exports);var Vx=lu.exports,jx=Vx;const zx=tm(jx);function Vu({breadcrumbs:t,...e}){return v.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",trait:"typo.h5",...e,children:t.map((n,r)=>v.jsx(Ux,{breadcrumb:n,showSeparator:r>0},r))})}function Ux({breadcrumb:t,showSeparator:e}){return v.jsxs(v.Fragment,{children:[e&&v.jsx(N.Icon,{path:ox,mx:"1"}),v.jsx(zx,{href:`/${t.path??"#"}`,children:v.jsx("span",{hover_textDecoration:t.path?"underline":void 0,cursor:t.path?"pointer":void 0,children:t.label})})]})}function ua({buildDialog:t,...e}){const[n,r]=T.useState(!1),o=T.useCallback(s=>{s==null||s.preventDefault(),s==null||s.stopPropagation(),r(!0)},[r]),i=T.useCallback(()=>{r(!1)},[r]);return v.jsxs(v.Fragment,{children:[v.jsx(N.Button,{onClick:o,...e}),n&&t(i)]})}function qx({icon:t,...e}){return v.jsx(N.Button,{variant:"glass",w:"10",h:"10",rounded:"full",...e,children:v.jsx(N.Icon,{path:t})})}class Wx{constructor(e,n,...r){cr(this,"path");cr(this,"queryKey");cr(this,"axios");cr(this,"getRequest",(e,n)=>this.axios.get(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));cr(this,"postRequest",(e,n)=>this.axios.post(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));cr(this,"putRequest",(e,n)=>this.axios.put(`${this.path?"/"+this.path:""}${e?"/"+e:""}`,n).then(r=>r.data.data));cr(this,"deleteRequest",e=>this.axios.delete(`${this.path?"/"+this.path:""}${e?"/"+e:""}`).then(n=>n.data.data));if(this.axios=e,this.path=n,this.queryKey=[n],r&&r.length>0){const o=n.split(".");this.queryKey=[o[0]],r&&r.length>0&&r[0]&&this.queryKey.push(`${r[0]}`);for(let i=1;i<o.length;i++)this.queryKey.push(o[i]),r.length>i&&r[i]&&this.queryKey.push(`${r[i]}`);this.path=this.queryKey.join("/")}}}function No(t,e){const n=ur.useQueryClient(),r=e?t.concat([`${e}`]):t;return T.useCallback(()=>r?n.invalidateQueries(r):null,[r,n])}function Fo(t,e,n,r){const o=(e??[]).concat([n?typeof n=="number"?`${n}`:n:void 0]);return ur.useMutation(o,t,r)}function ju(t,e,n,r){const o=No(e,n),i=n?e.concat(`${n}`):e;return ur.useMutation(i,t,{onSuccess:()=>o(),...r})}function Gr(t,e,n){const r=No(e);return ur.useMutation(e,t,{onSuccess:()=>r(),...n})}function Ym(t,e){return function(n){return e?t(e):t()}}function Sn(t,e,n,r){const o=n?t.concat([typeof n=="number"?`${n}`:n]):t;return ur.useQuery(o,Ym(e,n),{retry:0,networkMode:"always",retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,...r})}function Qm(t){const e=ur.useQueries({queries:t.map(i=>({queryKey:i.queryParam?i.queryKey.concat([typeof i.queryParam=="number"?`${i.queryParam}`:i.queryParam]):i.queryKey,queryFn:Ym(i.queryFn,i.queryParam),retry:0,retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1,...i.queryOptions}))}),n=e.findIndex(i=>i.isFetching===!0)!=-1,r=e.findIndex(i=>i.isError===!0)!=-1;return{data:e.map(i=>i.data),isFetching:n,isError:r}}function Zm(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Zm(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function dr(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Zm(t))&&(r&&(r+=" "),r+=e);return r}const Pi=t=>typeof t=="number"&&!isNaN(t),Jr=t=>typeof t=="string",jt=t=>typeof t=="function",da=t=>Jr(t)||jt(t)?t:null,zu=t=>T.isValidElement(t)||Jr(t)||jt(t)||Pi(t);function Kx(t,e,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=t;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(e,n)})})}function fa(t){let{enter:e,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=t;return function(s){let{children:a,position:l,preventExitTransition:c,done:u,nodeRef:d,isIn:h}=s;const f=r?`${e}--${l}`:e,p=r?`${n}--${l}`:n,g=T.useRef(0);return T.useLayoutEffect(()=>{const m=d.current,y=f.split(" "),C=w=>{w.target===d.current&&(m.dispatchEvent(new Event("d")),m.removeEventListener("animationend",C),m.removeEventListener("animationcancel",C),g.current===0&&w.type!=="animationcancel"&&m.classList.remove(...y))};m.classList.add(...y),m.addEventListener("animationend",C),m.addEventListener("animationcancel",C)},[]),T.useEffect(()=>{const m=d.current,y=()=>{m.removeEventListener("animationend",y),o?Kx(m,u,i):u()};h||(c?y():(g.current=1,m.className+=` ${p}`,m.addEventListener("animationend",y)))},[h]),T.createElement(T.Fragment,null,a)}}function ey(t,e){return t!=null?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:e}:{}}const rn={list:new Map,emitQueue:new Map,on(t,e){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(e),this},off(t,e){if(e){const n=this.list.get(t).filter(r=>r!==e);return this.list.set(t,n),this}return this.list.delete(t),this},cancelEmit(t){const e=this.emitQueue.get(t);return e&&(e.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(e=>{const n=setTimeout(()=>{e(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(n)})}},ha=t=>{let{theme:e,type:n,...r}=t;return T.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Uu={info:function(t){return T.createElement(ha,{...t},T.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return T.createElement(ha,{...t},T.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return T.createElement(ha,{...t},T.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return T.createElement(ha,{...t},T.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return T.createElement("div",{className:"Toastify__spinner"})}};function Gx(t){const[,e]=T.useReducer(f=>f+1,0),[n,r]=T.useState([]),o=T.useRef(null),i=T.useRef(new Map).current,s=f=>n.indexOf(f)!==-1,a=T.useRef({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:s,getToast:f=>i.get(f)}).current;function l(f){let{containerId:p}=f;const{limit:g}=a.props;!g||p&&a.containerId!==p||(a.count-=a.queue.length,a.queue=[])}function c(f){r(p=>f==null?[]:p.filter(g=>g!==f))}function u(){const{toastContent:f,toastProps:p,staleId:g}=a.queue.shift();h(f,p,g)}function d(f,p){let{delay:g,staleId:m,...y}=p;if(!zu(f)||function(M){return!o.current||a.props.enableMultiContainer&&M.containerId!==a.props.containerId||i.has(M.toastId)&&M.updateId==null}(y))return;const{toastId:C,updateId:w,data:b}=y,{props:S}=a,E=()=>c(C),x=w==null;x&&a.count++;const _={...S,style:S.toastStyle,key:a.toastKey++,...Object.fromEntries(Object.entries(y).filter(M=>{let[I,P]=M;return P!=null})),toastId:C,updateId:w,data:b,closeToast:E,isIn:!1,className:da(y.className||S.toastClassName),bodyClassName:da(y.bodyClassName||S.bodyClassName),progressClassName:da(y.progressClassName||S.progressClassName),autoClose:!y.isLoading&&(A=y.autoClose,O=S.autoClose,A===!1||Pi(A)&&A>0?A:O),deleteToast(){const M=ey(i.get(C),"removed");i.delete(C),rn.emit(4,M);const I=a.queue.length;if(a.count=C==null?a.count-a.displayedToast:a.count-1,a.count<0&&(a.count=0),I>0){const P=C==null?a.props.limit:1;if(I===1||P===1)a.displayedToast++,u();else{const F=P>I?I:P;a.displayedToast=F;for(let z=0;z<F;z++)u()}}else e()}};var A,O;_.iconOut=function(M){let{theme:I,type:P,isLoading:F,icon:z}=M,$=null;const J={theme:I,type:P};return z===!1||(jt(z)?$=z(J):T.isValidElement(z)?$=T.cloneElement(z,J):Jr(z)||Pi(z)?$=z:F?$=Uu.spinner():(K=>K in Uu)(P)&&($=Uu[P](J))),$}(_),jt(y.onOpen)&&(_.onOpen=y.onOpen),jt(y.onClose)&&(_.onClose=y.onClose),_.closeButton=S.closeButton,y.closeButton===!1||zu(y.closeButton)?_.closeButton=y.closeButton:y.closeButton===!0&&(_.closeButton=!zu(S.closeButton)||S.closeButton);let k=f;T.isValidElement(f)&&!Jr(f.type)?k=T.cloneElement(f,{closeToast:E,toastProps:_,data:b}):jt(f)&&(k=f({closeToast:E,toastProps:_,data:b})),S.limit&&S.limit>0&&a.count>S.limit&&x?a.queue.push({toastContent:k,toastProps:_,staleId:m}):Pi(g)?setTimeout(()=>{h(k,_,m)},g):h(k,_,m)}function h(f,p,g){const{toastId:m}=p;g&&i.delete(g);const y={content:f,props:p};i.set(m,y),r(C=>[...C,m].filter(w=>w!==g)),rn.emit(4,ey(y,y.props.updateId==null?"added":"updated"))}return T.useEffect(()=>(a.containerId=t.containerId,rn.cancelEmit(3).on(0,d).on(1,f=>o.current&&c(f)).on(5,l).emit(2,a),()=>{i.clear(),rn.emit(3,a)}),[]),T.useEffect(()=>{a.props=t,a.isToastActive=s,a.displayedToast=n.length}),{getToastToRender:function(f){const p=new Map,g=Array.from(i.values());return t.newestOnTop&&g.reverse(),g.forEach(m=>{const{position:y}=m.props;p.has(y)||p.set(y,[]),p.get(y).push(m)}),Array.from(p,m=>f(m[0],m[1]))},containerRef:o,isToastActive:s}}function ty(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function ny(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function Jx(t){const[e,n]=T.useState(!1),[r,o]=T.useState(!1),i=T.useRef(null),s=T.useRef({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,a=T.useRef(t),{autoClose:l,pauseOnHover:c,closeToast:u,onClick:d,closeOnClick:h}=t;function f(b){if(t.draggable){b.nativeEvent.type==="touchstart"&&b.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",y),document.addEventListener("mouseup",C),document.addEventListener("touchmove",y),document.addEventListener("touchend",C);const S=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=S.getBoundingClientRect(),S.style.transition="",s.x=ty(b.nativeEvent),s.y=ny(b.nativeEvent),t.draggableDirection==="x"?(s.start=s.x,s.removalDistance=S.offsetWidth*(t.draggablePercent/100)):(s.start=s.y,s.removalDistance=S.offsetHeight*(t.draggablePercent===80?1.5*t.draggablePercent:t.draggablePercent/100))}}function p(b){if(s.boundingRect){const{top:S,bottom:E,left:x,right:_}=s.boundingRect;b.nativeEvent.type!=="touchend"&&t.pauseOnHover&&s.x>=x&&s.x<=_&&s.y>=S&&s.y<=E?m():g()}}function g(){n(!0)}function m(){n(!1)}function y(b){const S=i.current;s.canDrag&&S&&(s.didMove=!0,e&&m(),s.x=ty(b),s.y=ny(b),s.delta=t.draggableDirection==="x"?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),S.style.transform=`translate${t.draggableDirection}(${s.delta}px)`,S.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function C(){document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",C),document.removeEventListener("touchmove",y),document.removeEventListener("touchend",C);const b=i.current;if(s.canDrag&&s.didMove&&b){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return o(!0),void t.closeToast();b.style.transition="transform 0.2s, opacity 0.2s",b.style.transform=`translate${t.draggableDirection}(0)`,b.style.opacity="1"}}T.useEffect(()=>{a.current=t}),T.useEffect(()=>(i.current&&i.current.addEventListener("d",g,{once:!0}),jt(t.onOpen)&&t.onOpen(T.isValidElement(t.children)&&t.children.props),()=>{const b=a.current;jt(b.onClose)&&b.onClose(T.isValidElement(b.children)&&b.children.props)}),[]),T.useEffect(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||m(),window.addEventListener("focus",g),window.addEventListener("blur",m)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",g),window.removeEventListener("blur",m))}),[t.pauseOnFocusLoss]);const w={onMouseDown:f,onTouchStart:f,onMouseUp:p,onTouchEnd:p};return l&&c&&(w.onMouseEnter=m,w.onMouseLeave=g),h&&(w.onClick=b=>{d&&d(b),s.canCloseOnClick&&u()}),{playToast:g,pauseToast:m,isRunning:e,preventExitTransition:r,toastRef:i,eventHandlers:w}}function ry(t){let{closeToast:e,theme:n,ariaLabel:r="close"}=t;return T.createElement("button",{className:`Toastify__close-button Toastify__close-button--${n}`,type:"button",onClick:o=>{o.stopPropagation(),e(o)},"aria-label":r},T.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},T.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function Xx(t){let{delay:e,isRunning:n,closeToast:r,type:o="default",hide:i,className:s,style:a,controlledProgress:l,progress:c,rtl:u,isIn:d,theme:h}=t;const f=i||l&&c===0,p={...a,animationDuration:`${e}ms`,animationPlayState:n?"running":"paused",opacity:f?0:1};l&&(p.transform=`scaleX(${c})`);const g=dr("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),m=jt(s)?s({rtl:u,type:o,defaultClassName:g}):dr(g,s);return T.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:m,style:p,[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{d&&r()}})}const Yx=t=>{const{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:o}=Jx(t),{closeButton:i,children:s,autoClose:a,onClick:l,type:c,hideProgressBar:u,closeToast:d,transition:h,position:f,className:p,style:g,bodyClassName:m,bodyStyle:y,progressClassName:C,progressStyle:w,updateId:b,role:S,progress:E,rtl:x,toastId:_,deleteToast:A,isIn:O,isLoading:k,iconOut:M,closeOnClick:I,theme:P}=t,F=dr("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${c}`,{"Toastify__toast--rtl":x},{"Toastify__toast--close-on-click":I}),z=jt(p)?p({rtl:x,position:f,type:c,defaultClassName:F}):dr(F,p),$=!!E||!a,J={closeToast:d,type:c,theme:P};let K=null;return i===!1||(K=jt(i)?i(J):T.isValidElement(i)?T.cloneElement(i,J):ry(J)),T.createElement(h,{isIn:O,done:A,position:f,preventExitTransition:n,nodeRef:r},T.createElement("div",{id:_,onClick:l,className:z,...o,style:g,ref:r},T.createElement("div",{...O&&{role:S},className:jt(m)?m({type:c}):dr("Toastify__toast-body",m),style:y},M!=null&&T.createElement("div",{className:dr("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!k})},M),T.createElement("div",null,s)),K,T.createElement(Xx,{...b&&!$?{key:`pb-${b}`}:{},rtl:x,theme:P,delay:a,isRunning:e,isIn:O,closeToast:d,hide:u,type:c,style:w,className:C,controlledProgress:$,progress:E||0})))},pa=function(t,e){return e===void 0&&(e=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}},Qx=fa(pa("bounce",!0));fa(pa("slide",!0)),fa(pa("zoom")),fa(pa("flip"));const oy=T.forwardRef((t,e)=>{const{getToastToRender:n,containerRef:r,isToastActive:o}=Gx(t),{className:i,style:s,rtl:a,containerId:l}=t;function c(u){const d=dr("Toastify__toast-container",`Toastify__toast-container--${u}`,{"Toastify__toast-container--rtl":a});return jt(i)?i({position:u,rtl:a,defaultClassName:d}):dr(d,da(i))}return T.useEffect(()=>{e&&(e.current=r.current)},[]),T.createElement("div",{ref:r,className:"Toastify",id:l},n((u,d)=>{const h=d.length?{...s}:{...s,pointerEvents:"none"};return T.createElement("div",{className:c(u),style:h,key:`container-${u}`},d.map((f,p)=>{let{content:g,props:m}=f;return T.createElement(Yx,{...m,isIn:o(m.toastId),style:{...m.style,"--nth":p+1,"--len":d.length},key:`toast-${m.key}`},g)}))}))});oy.displayName="ToastContainer",oy.defaultProps={position:"top-right",transition:Qx,autoClose:5e3,closeButton:ry,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let qu,Xr=new Map,Ii=[],Zx=1;function iy(){return""+Zx++}function eA(t){return t&&(Jr(t.toastId)||Pi(t.toastId))?t.toastId:iy()}function Li(t,e){return Xr.size>0?rn.emit(0,t,e):Ii.push({content:t,options:e}),e.toastId}function ga(t,e){return{...e,type:e&&e.type||t,toastId:eA(e)}}function ma(t){return(e,n)=>Li(e,ga(t,n))}function De(t,e){return Li(t,ga("default",e))}De.loading=(t,e)=>Li(t,ga("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e})),De.promise=function(t,e,n){let r,{pending:o,error:i,success:s}=e;o&&(r=Jr(o)?De.loading(o,n):De.loading(o.render,{...n,...o}));const a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,d,h)=>{if(d==null)return void De.dismiss(r);const f={type:u,...a,...n,data:h},p=Jr(d)?{render:d}:d;return r?De.update(r,{...f,...p}):De(p.render,{...f,...p}),h},c=jt(t)?t():t;return c.then(u=>l("success",s,u)).catch(u=>l("error",i,u)),c},De.success=ma("success"),De.info=ma("info"),De.error=ma("error"),De.warning=ma("warning"),De.warn=De.warning,De.dark=(t,e)=>Li(t,ga("default",{theme:"dark",...e})),De.dismiss=t=>{Xr.size>0?rn.emit(1,t):Ii=Ii.filter(e=>t!=null&&e.options.toastId!==t)},De.clearWaitingQueue=function(t){return t===void 0&&(t={}),rn.emit(5,t)},De.isActive=t=>{let e=!1;return Xr.forEach(n=>{n.isToastActive&&n.isToastActive(t)&&(e=!0)}),e},De.update=function(t,e){e===void 0&&(e={}),setTimeout(()=>{const n=function(r,o){let{containerId:i}=o;const s=Xr.get(i||qu);return s&&s.getToast(r)}(t,e);if(n){const{props:r,content:o}=n,i={delay:100,...r,...e,toastId:e.toastId||t,updateId:iy()};i.toastId!==t&&(i.staleId=t);const s=i.render||o;delete i.render,Li(s,i)}},0)},De.done=t=>{De.update(t,{progress:1})},De.onChange=t=>(rn.on(4,t),()=>{rn.off(4,t)}),De.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},De.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},rn.on(2,t=>{qu=t.containerId||t,Xr.set(qu,t),Ii.forEach(e=>{rn.emit(0,e.content,e.options)}),Ii=[]}).on(3,t=>{Xr.delete(t.containerId||t),Xr.size===0&&rn.off(0).off(1).off(5)});const tA={showSuccessMsg:!0,showErrorMsg:!0,successMsg:void 0,errorMsg:void 0,onSuccess:void 0,onError:void 0,processInput:void 0};function ya(t,e){const n={...tA,...e??{}};return T.useCallback(o=>(t.reset(),t.mutateAsync(Wu(n.processInput,o)??o).then(i=>{var s;return n.showSuccessMsg&&n.successMsg&&De.success(Wu(n.successMsg,i,o)),(s=n.onSuccess)==null||s.call(n,i),i}).catch(i=>{var s;n.showErrorMsg&&De.error(Wu(n.errorMsg,i,o)??"Oops, something went wrong :("),(s=n.onError)==null||s.call(n,i)})),[t,e])}function nA(t){return typeof t=="function"}function Wu(t,...e){return nA(t)?t(...e):t}function sy(t,e){return function(){return t.apply(e,arguments)}}const{toString:rA}=Object.prototype,{getPrototypeOf:Ku}=Object,va=(t=>e=>{const n=rA.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Cn=t=>(t=t.toLowerCase(),e=>va(e)===t),ba=t=>e=>typeof e===t,{isArray:Ho}=Array,Di=ba("undefined");function oA(t){return t!==null&&!Di(t)&&t.constructor!==null&&!Di(t.constructor)&&on(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ay=Cn("ArrayBuffer");function iA(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ay(t.buffer),e}const sA=ba("string"),on=ba("function"),ly=ba("number"),wa=t=>t!==null&&typeof t=="object",aA=t=>t===!0||t===!1,Sa=t=>{if(va(t)!=="object")return!1;const e=Ku(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},lA=Cn("Date"),cA=Cn("File"),uA=Cn("Blob"),dA=Cn("FileList"),fA=t=>wa(t)&&on(t.pipe),hA=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||on(t.append)&&((e=va(t))==="formdata"||e==="object"&&on(t.toString)&&t.toString()==="[object FormData]"))},pA=Cn("URLSearchParams"),gA=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ri(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),Ho(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let a;for(r=0;r<s;r++)a=i[r],e.call(null,t[a],a,t)}}function cy(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const uy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,dy=t=>!Di(t)&&t!==uy;function Gu(){const{caseless:t}=dy(this)&&this||{},e={},n=(r,o)=>{const i=t&&cy(e,o)||o;Sa(e[i])&&Sa(r)?e[i]=Gu(e[i],r):Sa(r)?e[i]=Gu({},r):Ho(r)?e[i]=r.slice():e[i]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Ri(arguments[r],n);return e}const mA=(t,e,n,{allOwnKeys:r}={})=>(Ri(e,(o,i)=>{n&&on(o)?t[i]=sy(o,n):t[i]=o},{allOwnKeys:r}),t),yA=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),vA=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},bA=(t,e,n,r)=>{let o,i,s;const a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],(!r||r(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Ku(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},wA=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},SA=t=>{if(!t)return null;if(Ho(t))return t;let e=t.length;if(!ly(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},CA=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ku(Uint8Array)),EA=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const i=o.value;e.call(t,i[0],i[1])}},_A=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},xA=Cn("HTMLFormElement"),AA=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),fy=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),OA=Cn("RegExp"),hy=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Ri(n,(o,i)=>{let s;(s=e(o,i,t))!==!1&&(r[i]=s||o)}),Object.defineProperties(t,r)},TA=t=>{hy(t,(e,n)=>{if(on(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(on(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},kA=(t,e)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Ho(t)?r(t):r(String(t).split(e)),n},MA=()=>{},PA=(t,e)=>(t=+t,Number.isFinite(t)?t:e),Ju="abcdefghijklmnopqrstuvwxyz",py="0123456789",gy={DIGIT:py,ALPHA:Ju,ALPHA_DIGIT:Ju+Ju.toUpperCase()+py},IA=(t=16,e=gy.ALPHA_DIGIT)=>{let n="";const{length:r}=e;for(;t--;)n+=e[Math.random()*r|0];return n};function LA(t){return!!(t&&on(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const DA=t=>{const e=new Array(10),n=(r,o)=>{if(wa(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const i=Ho(r)?[]:{};return Ri(r,(s,a)=>{const l=n(s,o+1);!Di(l)&&(i[a]=l)}),e[o]=void 0,i}}return r};return n(t,0)},RA=Cn("AsyncFunction"),oe={isArray:Ho,isArrayBuffer:ay,isBuffer:oA,isFormData:hA,isArrayBufferView:iA,isString:sA,isNumber:ly,isBoolean:aA,isObject:wa,isPlainObject:Sa,isUndefined:Di,isDate:lA,isFile:cA,isBlob:uA,isRegExp:OA,isFunction:on,isStream:fA,isURLSearchParams:pA,isTypedArray:CA,isFileList:dA,forEach:Ri,merge:Gu,extend:mA,trim:gA,stripBOM:yA,inherits:vA,toFlatObject:bA,kindOf:va,kindOfTest:Cn,endsWith:wA,toArray:SA,forEachEntry:EA,matchAll:_A,isHTMLForm:xA,hasOwnProperty:fy,hasOwnProp:fy,reduceDescriptors:hy,freezeMethods:TA,toObjectSet:kA,toCamelCase:AA,noop:MA,toFiniteNumber:PA,findKey:cy,global:uy,isContextDefined:dy,ALPHABET:gy,generateString:IA,isSpecCompliantForm:LA,toJSONObject:DA,isAsyncFn:RA,isThenable:t=>t&&(wa(t)||on(t))&&on(t.then)&&on(t.catch)};function $e(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}oe.inherits($e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:oe.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const my=$e.prototype,yy={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{yy[t]={value:t}}),Object.defineProperties($e,yy),Object.defineProperty(my,"isAxiosError",{value:!0}),$e.from=(t,e,n,r,o,i)=>{const s=Object.create(my);return oe.toFlatObject(t,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),$e.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const NA=null;function Xu(t){return oe.isPlainObject(t)||oe.isArray(t)}function vy(t){return oe.endsWith(t,"[]")?t.slice(0,-2):t}function by(t,e,n){return t?t.concat(e).map(function(o,i){return o=vy(o),!n&&i?"["+o+"]":o}).join(n?".":""):e}function FA(t){return oe.isArray(t)&&!t.some(Xu)}const HA=oe.toFlatObject(oe,{},null,function(e){return/^is[A-Z]/.test(e)});function Ca(t,e,n){if(!oe.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=oe.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,m){return!oe.isUndefined(m[g])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&oe.isSpecCompliantForm(e);if(!oe.isFunction(o))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(oe.isDate(p))return p.toISOString();if(!l&&oe.isBlob(p))throw new $e("Blob is not supported. Use a Buffer instead.");return oe.isArrayBuffer(p)||oe.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,g,m){let y=p;if(p&&!m&&typeof p=="object"){if(oe.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(oe.isArray(p)&&FA(p)||(oe.isFileList(p)||oe.endsWith(g,"[]"))&&(y=oe.toArray(p)))return g=vy(g),y.forEach(function(w,b){!(oe.isUndefined(w)||w===null)&&e.append(s===!0?by([g],b,i):s===null?g:g+"[]",c(w))}),!1}return Xu(p)?!0:(e.append(by(m,g,i),c(p)),!1)}const d=[],h=Object.assign(HA,{defaultVisitor:u,convertValue:c,isVisitable:Xu});function f(p,g){if(!oe.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(p),oe.forEach(p,function(y,C){(!(oe.isUndefined(y)||y===null)&&o.call(e,y,oe.isString(C)?C.trim():C,g,h))===!0&&f(y,g?g.concat(C):[C])}),d.pop()}}if(!oe.isObject(t))throw new TypeError("data must be an object");return f(t),e}function wy(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function Yu(t,e){this._pairs=[],t&&Ca(t,this,e)}const Sy=Yu.prototype;Sy.append=function(e,n){this._pairs.push([e,n])},Sy.toString=function(e){const n=e?function(r){return e.call(this,r,wy)}:wy;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function BA(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Cy(t,e,n){if(!e)return t;const r=n&&n.encode||BA,o=n&&n.serialize;let i;if(o?i=o(e,n):i=oe.isURLSearchParams(e)?e.toString():new Yu(e,n).toString(r),i){const s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class Ey{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){oe.forEach(this.handlers,function(r){r!==null&&e(r)})}}const _y={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$A={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Yu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xy=typeof window<"u"&&typeof document<"u",VA=(t=>xy&&["ReactNative","NativeScript","NS"].indexOf(t)<0)(typeof navigator<"u"&&navigator.product),jA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",En={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xy,hasStandardBrowserEnv:VA,hasStandardBrowserWebWorkerEnv:jA},Symbol.toStringTag,{value:"Module"})),...$A};function zA(t,e){return Ca(t,new En.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return En.isNode&&oe.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},e))}function UA(t){return oe.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function qA(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],e[i]=t[i];return e}function Ay(t){function e(n,r,o,i){let s=n[i++];if(s==="__proto__")return!0;const a=Number.isFinite(+s),l=i>=n.length;return s=!s&&oe.isArray(o)?o.length:s,l?(oe.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!oe.isObject(o[s]))&&(o[s]=[]),e(n,r,o[s],i)&&oe.isArray(o[s])&&(o[s]=qA(o[s])),!a)}if(oe.isFormData(t)&&oe.isFunction(t.entries)){const n={};return oe.forEachEntry(t,(r,o)=>{e(UA(r),o,n,0)}),n}return null}function WA(t,e,n){if(oe.isString(t))try{return(e||JSON.parse)(t),oe.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const Qu={transitional:_y,adapter:["xhr","http"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=oe.isObject(e);if(i&&oe.isHTMLForm(e)&&(e=new FormData(e)),oe.isFormData(e))return o?JSON.stringify(Ay(e)):e;if(oe.isArrayBuffer(e)||oe.isBuffer(e)||oe.isStream(e)||oe.isFile(e)||oe.isBlob(e))return e;if(oe.isArrayBufferView(e))return e.buffer;if(oe.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return zA(e,this.formSerializer).toString();if((a=oe.isFileList(e))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ca(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),WA(e)):e}],transformResponse:[function(e){const n=this.transitional||Qu.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(e&&oe.isString(e)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(a){if(s)throw a.name==="SyntaxError"?$e.from(a,$e.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:En.classes.FormData,Blob:En.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};oe.forEach(["delete","get","head","post","put","patch"],t=>{Qu.headers[t]={}});const Zu=Qu,KA=oe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),GA=t=>{const e={};let n,r,o;return t&&t.split(`
|
5
|
+
`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||e[n]&&KA[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Oy=Symbol("internals");function Ni(t){return t&&String(t).trim().toLowerCase()}function Ea(t){return t===!1||t==null?t:oe.isArray(t)?t.map(Ea):String(t)}function JA(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const XA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ed(t,e,n,r,o){if(oe.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!oe.isString(e)){if(oe.isString(r))return e.indexOf(r)!==-1;if(oe.isRegExp(r))return r.test(e)}}function YA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function QA(t,e){const n=oe.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,i,s){return this[r].call(this,e,o,i,s)},configurable:!0})})}class _a{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function i(a,l,c){const u=Ni(l);if(!u)throw new Error("header name must be a non-empty string");const d=oe.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=Ea(a))}const s=(a,l)=>oe.forEach(a,(c,u)=>i(c,u,l));return oe.isPlainObject(e)||e instanceof this.constructor?s(e,n):oe.isString(e)&&(e=e.trim())&&!XA(e)?s(GA(e),n):e!=null&&i(n,e,r),this}get(e,n){if(e=Ni(e),e){const r=oe.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return JA(o);if(oe.isFunction(n))return n.call(this,o,r);if(oe.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Ni(e),e){const r=oe.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||ed(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function i(s){if(s=Ni(s),s){const a=oe.findKey(r,s);a&&(!n||ed(r,r[a],a,n))&&(delete r[a],o=!0)}}return oe.isArray(e)?e.forEach(i):i(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!e||ed(this,this[i],i,e,!0))&&(delete this[i],o=!0)}return o}normalize(e){const n=this,r={};return oe.forEach(this,(o,i)=>{const s=oe.findKey(r,i);if(s){n[s]=Ea(o),delete n[i];return}const a=e?YA(i):String(i).trim();a!==i&&delete n[i],n[a]=Ea(o),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return oe.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&oe.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
|
6
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Oy]=this[Oy]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Ni(s);r[a]||(QA(o,s),r[a]=!0)}return oe.isArray(e)?e.forEach(i):i(e),this}}_a.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),oe.reduceDescriptors(_a.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}}),oe.freezeMethods(_a);const jn=_a;function td(t,e){const n=this||Zu,r=e||n,o=jn.from(r.headers);let i=r.data;return oe.forEach(t,function(a){i=a.call(n,i,o.normalize(),e?e.status:void 0)}),o.normalize(),i}function Ty(t){return!!(t&&t.__CANCEL__)}function Fi(t,e,n){$e.call(this,t??"canceled",$e.ERR_CANCELED,e,n),this.name="CanceledError"}oe.inherits(Fi,$e,{__CANCEL__:!0});function ZA(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new $e("Request failed with status code "+n.status,[$e.ERR_BAD_REQUEST,$e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const eO=En.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];oe.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),oe.isString(r)&&s.push("path="+r),oe.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function tO(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function nO(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ky(t,e){return t&&!tO(e)?nO(t,e):e}const rO=En.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return e&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const a=oe.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function oO(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function iO(t,e){t=t||10;const n=new Array(t),r=new Array(t);let o=0,i=0,s;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[i];s||(s=c),n[o]=l,r[o]=c;let d=i,h=0;for(;d!==o;)h+=n[d++],d=d%t;if(o=(o+1)%t,o===i&&(i=(i+1)%t),c-s<e)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function My(t,e){let n=0;const r=iO(50,250);return o=>{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,l=r(a),c=i<=s;n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-i)/l:void 0,event:o};u[e?"download":"upload"]=!0,t(u)}}const nd={http:NA,xhr:typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(n,r){let o=t.data;const i=jn.from(t.headers).normalize();let{responseType:s,withXSRFToken:a}=t,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let u;if(oe.isFormData(o)){if(En.hasStandardBrowserEnv||En.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((u=i.getContentType())!==!1){const[g,...m]=u?u.split(";").map(y=>y.trim()).filter(Boolean):[];i.setContentType([g||"multipart/form-data",...m].join("; "))}}let d=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";i.set("Authorization","Basic "+btoa(g+":"+m))}const h=ky(t.baseURL,t.url);d.open(t.method.toUpperCase(),Cy(h,t.params,t.paramsSerializer),!0),d.timeout=t.timeout;function f(){if(!d)return;const g=jn.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),y={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:g,config:t,request:d};ZA(function(w){n(w),c()},function(w){r(w),c()},y),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new $e("Request aborted",$e.ECONNABORTED,t,d)),d=null)},d.onerror=function(){r(new $e("Network Error",$e.ERR_NETWORK,t,d)),d=null},d.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const y=t.transitional||_y;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),r(new $e(m,y.clarifyTimeoutError?$e.ETIMEDOUT:$e.ECONNABORTED,t,d)),d=null},En.hasStandardBrowserEnv&&(a&&oe.isFunction(a)&&(a=a(t)),a||a!==!1&&rO(h))){const g=t.xsrfHeaderName&&t.xsrfCookieName&&eO.read(t.xsrfCookieName);g&&i.set(t.xsrfHeaderName,g)}o===void 0&&i.setContentType(null),"setRequestHeader"in d&&oe.forEach(i.toJSON(),function(m,y){d.setRequestHeader(y,m)}),oe.isUndefined(t.withCredentials)||(d.withCredentials=!!t.withCredentials),s&&s!=="json"&&(d.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&d.addEventListener("progress",My(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",My(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=g=>{d&&(r(!g||g.type?new Fi(null,t,d):g),d.abort(),d=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=oO(h);if(p&&En.protocols.indexOf(p)===-1){r(new $e("Unsupported protocol "+p+":",$e.ERR_BAD_REQUEST,t));return}d.send(o||null)})}};oe.forEach(nd,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Py=t=>`- ${t}`,sO=t=>oe.isFunction(t)||t===null||t===!1,Iy={getAdapter:t=>{t=oe.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;i<e;i++){n=t[i];let s;if(r=n,!sO(n)&&(r=nd[(s=String(n)).toLowerCase()],r===void 0))throw new $e(`Unknown adapter '${s}'`);if(r)break;o[s||"#"+i]=r}if(!r){const i=Object.entries(o).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=e?i.length>1?`since :
|
7
|
+
`+i.map(Py).join(`
|
8
|
+
`):" "+Py(i[0]):"as no adapter specified";throw new $e("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:nd};function rd(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Fi(null,t)}function Ly(t){return rd(t),t.headers=jn.from(t.headers),t.data=td.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Iy.getAdapter(t.adapter||Zu.adapter)(t).then(function(r){return rd(t),r.data=td.call(t,t.transformResponse,r),r.headers=jn.from(r.headers),r},function(r){return Ty(r)||(rd(t),r&&r.response&&(r.response.data=td.call(t,t.transformResponse,r.response),r.response.headers=jn.from(r.response.headers))),Promise.reject(r)})}const Dy=t=>t instanceof jn?t.toJSON():t;function Bo(t,e){e=e||{};const n={};function r(c,u,d){return oe.isPlainObject(c)&&oe.isPlainObject(u)?oe.merge.call({caseless:d},c,u):oe.isPlainObject(u)?oe.merge({},u):oe.isArray(u)?u.slice():u}function o(c,u,d){if(oe.isUndefined(u)){if(!oe.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function i(c,u){if(!oe.isUndefined(u))return r(void 0,u)}function s(c,u){if(oe.isUndefined(u)){if(!oe.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in t)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>o(Dy(c),Dy(u),!0)};return oe.forEach(Object.keys(Object.assign({},t,e)),function(u){const d=l[u]||o,h=d(t[u],e[u],u);oe.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Ry="1.6.7",od={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{od[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Ny={};od.transitional=function(e,n,r){function o(i,s){return"[Axios v"+Ry+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new $e(o(s," has been removed"+(n?" in "+n:"")),$e.ERR_DEPRECATED);return n&&!Ny[s]&&(Ny[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function aO(t,e,n){if(typeof t!="object")throw new $e("options must be an object",$e.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const a=t[i],l=a===void 0||s(a,i,t);if(l!==!0)throw new $e("option "+i+" must be "+l,$e.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new $e("Unknown option "+i,$e.ERR_BAD_OPTION)}}const id={assertOptions:aO,validators:od},fr=id.validators;class xa{constructor(e){this.defaults=e,this.interceptors={request:new Ey,response:new Ey}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
9
|
+
`+i):r.stack=i}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=Bo(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&id.assertOptions(r,{silentJSONParsing:fr.transitional(fr.boolean),forcedJSONParsing:fr.transitional(fr.boolean),clarifyTimeoutError:fr.transitional(fr.boolean)},!1),o!=null&&(oe.isFunction(o)?n.paramsSerializer={serialize:o}:id.assertOptions(o,{encode:fr.function,serialize:fr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&oe.merge(i.common,i[n.method]);i&&oe.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=jn.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,d=0,h;if(!l){const p=[Ly.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(m){g.call(this,m);break}}try{u=Ly.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Bo(this.defaults,e);const n=ky(e.baseURL,e.url);return Cy(n,e.params,e.paramsSerializer)}}oe.forEach(["delete","get","head","options"],function(e){xa.prototype[e]=function(n,r){return this.request(Bo(r||{},{method:e,url:n,data:(r||{}).data}))}}),oe.forEach(["post","put","patch"],function(e){function n(r){return function(i,s,a){return this.request(Bo(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}xa.prototype[e]=n(),xa.prototype[e+"Form"]=n(!0)});const Aa=xa;class sd{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},e(function(i,s,a){r.reason||(r.reason=new Fi(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new sd(function(o){e=o}),cancel:e}}}const lO=sd;function cO(t){return function(n){return t.apply(null,n)}}function uO(t){return oe.isObject(t)&&t.isAxiosError===!0}const ad={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ad).forEach(([t,e])=>{ad[e]=t});const dO=ad;function Fy(t){const e=new Aa(t),n=sy(Aa.prototype.request,e);return oe.extend(n,Aa.prototype,e,{allOwnKeys:!0}),oe.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Fy(Bo(t,o))},n}const ft=Fy(Zu);ft.Axios=Aa,ft.CanceledError=Fi,ft.CancelToken=lO,ft.isCancel=Ty,ft.VERSION=Ry,ft.toFormData=Ca,ft.AxiosError=$e,ft.Cancel=ft.CanceledError,ft.all=function(e){return Promise.all(e)},ft.spread=cO,ft.isAxiosError=uO,ft.mergeConfig=Bo,ft.AxiosHeaders=jn,ft.formToJSON=t=>Ay(oe.isHTMLForm(t)?new FormData(t):t),ft.getAdapter=Iy.getAdapter,ft.HttpStatusCode=dO,ft.default=ft;const Hy={adminApiURL:"",nextAPIURL:"",invalidateToken:""};class By extends Wx{constructor(n){console.warn("AdminAPI: nextAPIURL is not set. Please set it in the AdminApiProvider."),console.warn("AdminAPI: invalidateToken is not set. Please set it in the AdminApiProvider.");const r=ft.create({baseURL:Hy.nextAPIURL,headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest","Invalidate-Token":Hy.invalidateToken},withCredentials:!0});super(r,"api/invalidate");cr(this,"pathOrPermalink");this.pathOrPermalink=n,this.invalidate=this.invalidate.bind(this)}invalidate(){let n=this.pathOrPermalink;if(n.startsWith("https://")){const r=n.substring(8);n=r.substring(r.indexOf("/"))}if(n.startsWith("http://")){const r=n.substring(7);n=r.substring(r.indexOf("/"))}return n.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{path:n})}invalidateCustomPath(n){let r=n;if(n.startsWith("https://")){const o=n.substring(8);r=o.substring(o.indexOf("/"))}if(n.startsWith("http://")){const o=n.substring(7);r=o.substring(o.indexOf("/"))}return r.startsWith("/")||console.warn("Invalidate: string does not start with /: ",n,"original parameter:",this.pathOrPermalink),this.postRequest(void 0,{_path:r})}}const fO={new:t=>new By(t),custom:()=>new By("")};function ld({pathOrPermalink:t,...e}){const n=fO.new(t),r=Fo(n.invalidate,n.queryKey),o=ya(r,{successMsg:"Page successfully invalidated"});return v.jsx(N.Button,{scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",title:"Regenerate",disabled:r.isLoading,onClick:o,...e,children:v.jsx(N.Icon,{path:ax})})}function hO({path:t,...e}){const n=wn.useNavigate(),r=T.useCallback(()=>{n(t)},[n,t]);return v.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...e,children:v.jsx(N.Icon,{path:Ex})})}function $y({status:t,queryId:e,api:n,...r}){const o=t=="draft",i=ju(o?n.publish:n.unpublish,n.queryKey,e,{networkMode:"always"}),s=T.useCallback(()=>{i.reset(),i.mutateAsync(e).then(()=>De.success(o?"Published!":"Unpublished!")).catch(a=>De.error(`Error: ${a}`))},[i,e]);return v.jsxs(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",px:"4",disabled:i.isLoading,onClick:s,dflex:!0,alignItems:"center",gap:"3",...r,children:[v.jsx(N.Icon,{path:o?su:lx}),o?"Publish":"Switch to draft"]})}function pO({children:t,...e}){return v.jsx("div",{dflex:!0,flexCol:!0,gap:"3",w:"full",...e,children:t})}function hr({label:t,touched:e,error:n,customFeedbackLabel:r,showCorrectFeedback:o}){const i=e&&n!=null&&n!=="",s=o&&e&&!n&&o&&t!=null&&t!=="",a=N.usePrevious(n);return v.jsxs(v.Fragment,{children:[i&&v.jsxs("div",{mt:"2",children:[v.jsx("div",{className:"is-invalid"})," ",v.jsxs("div",{textColor:"#ff0000",textSize:"sm",fontWeight:"500",children:[n,!n&&`${a}`]})]}),o&&t&&v.jsx(v.Fragment,{children:s&&v.jsxs("div",{mt:"2",children:[v.jsx("div",{className:"is-valid"})," ",v.jsxs("div",{className:"valid-feedback m-0",textSize:"sm",fontWeight:"500",children:[t," was entered correct"]})]})}),r&&v.jsx(v.Fragment,{children:!i&&!s&&v.jsx("div",{mt:"2",textSize:"sm",fontWeight:"500",children:r})})]})}function gO(){}function Oa(t){if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(t)==="[object Object]":!1}function Vy(t){return Object.getOwnPropertySymbols(t).filter(e=>Object.prototype.propertyIsEnumerable.call(t,e))}function jy(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const mO="[object RegExp]",yO="[object String]",vO="[object Number]",bO="[object Boolean]",zy="[object Arguments]",wO="[object Symbol]",SO="[object Date]",CO="[object Map]",EO="[object Set]",_O="[object Array]",xO="[object Function]",AO="[object ArrayBuffer]",cd="[object Object]",OO="[object Error]",TO="[object DataView]",kO="[object Uint8Array]",MO="[object Uint8ClampedArray]",PO="[object Uint16Array]",IO="[object Uint32Array]",LO="[object BigUint64Array]",DO="[object Int8Array]",RO="[object Int16Array]",NO="[object Int32Array]",FO="[object BigInt64Array]",HO="[object Float32Array]",BO="[object Float64Array]";function Hi(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o],s=t[o];Array.isArray(i)?Array.isArray(s)?t[o]=Hi(s,i):t[o]=Hi([],i):Oa(i)?Oa(s)?t[o]=Hi(s,i):t[o]=Hi({},i):(s===void 0||i!==void 0)&&(t[o]=i)}return t}function $O(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)}function VO(t,e,n){return Bi(t,e,void 0,void 0,void 0,void 0,n)}function Bi(t,e,n,r,o,i,s){const a=s(t,e,n,r,o,i);if(a!==void 0)return a;if(typeof t==typeof e)switch(typeof t){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return t===e;case"number":return t===e||Object.is(t,e);case"function":return t===e;case"object":return $i(t,e,i,s)}return $i(t,e,i,s)}function $i(t,e,n,r){if(Object.is(t,e))return!0;let o=jy(t),i=jy(e);if(o===zy&&(o=cd),i===zy&&(i=cd),o!==i)return!1;switch(o){case yO:return t.toString()===e.toString();case vO:{const l=t.valueOf(),c=e.valueOf();return $O(l,c)}case bO:case SO:case wO:return Object.is(t.valueOf(),e.valueOf());case mO:return t.source===e.source&&t.flags===e.flags;case xO:return t===e}n=n??new Map;const s=n.get(t),a=n.get(e);if(s!=null&&a!=null)return s===e;n.set(t,e),n.set(e,t);try{switch(o){case CO:{if(t.size!==e.size)return!1;for(const[l,c]of t.entries())if(!e.has(l)||!Bi(c,e.get(l),l,t,e,n,r))return!1;return!0}case EO:{if(t.size!==e.size)return!1;const l=Array.from(t.values()),c=Array.from(e.values());for(let u=0;u<l.length;u++){const d=l[u],h=c.findIndex(f=>Bi(d,f,void 0,t,e,n,r));if(h===-1)return!1;c.splice(h,1)}return!0}case _O:case kO:case MO:case PO:case IO:case LO:case DO:case RO:case NO:case FO:case HO:case BO:{if(typeof Buffer<"u"&&Buffer.isBuffer(t)!==Buffer.isBuffer(e)||t.length!==e.length)return!1;for(let l=0;l<t.length;l++)if(!Bi(t[l],e[l],l,t,e,n,r))return!1;return!0}case AO:return t.byteLength!==e.byteLength?!1:$i(new Uint8Array(t),new Uint8Array(e),n,r);case TO:return t.byteLength!==e.byteLength||t.byteOffset!==e.byteOffset?!1:$i(new Uint8Array(t),new Uint8Array(e),n,r);case OO:return t.name===e.name&&t.message===e.message;case cd:{if(!($i(t.constructor,e.constructor,n,r)||Oa(t)&&Oa(e)))return!1;const c=[...Object.keys(t),...Vy(t)],u=[...Object.keys(e),...Vy(e)];if(c.length!==u.length)return!1;for(let d=0;d<c.length;d++){const h=c[d],f=t[h];if(!Object.hasOwn(e,h))return!1;const p=e[h];if(!Bi(f,p,h,t,e,n,r))return!1}return!0}default:return!1}}finally{n.delete(t),n.delete(e)}}function jO(t,e){return VO(t,e,gO)}function zO(t){return typeof t=="function"}function UO(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function qO(t){return Object.is(t,-0)?"-0":t.toString()}function WO(t){const e=[],n=t.length;if(n===0)return e;let r=0,o="",i="",s=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<n;){const a=t[r];i?a==="\\"&&r+1<n?(r++,o+=t[r]):a===i?i="":o+=a:s?a==='"'||a==="'"?i=a:a==="]"?(s=!1,e.push(o),o=""):o+=a:a==="["?(s=!0,o&&(e.push(o),o="")):a==="."?o&&(e.push(o),o=""):o+=a,r++}return o&&e.push(o),e}function $o(t,e,n){if(t==null)return n;switch(typeof e){case"string":{const r=t[e];return r===void 0?UO(e)?$o(t,WO(e),n):n:r}case"number":case"symbol":{typeof e=="number"&&(e=qO(e));const r=t[e];return r===void 0?n:r}default:{if(Array.isArray(e))return KO(t,e,n);Object.is(e==null?void 0:e.valueOf(),-0)?e="-0":e=String(e);const r=t[e];return r===void 0?n:r}}}function KO(t,e,n){if(e.length===0)return n;let r=t;for(let o=0;o<e.length;o++){if(r==null)return n;r=r[e[o]]}return r===void 0?n:r}function Uy(t){return Array.isArray(t)}function pr(t,e,n){const r=t!=null?$o(e,t):!1,o=t!=null?$o(n,t):!1,i=t!=null?$o(e,t):void 0;return{isError:r,isTouched:o,error:i}}function qy({withFeedbackLabel:t=!0,showCorrectFeedback:e=!1,customFeedbackLabel:n,children:r,...o}){const i=o.name??"";return v.jsx(Je.Field,{name:i,type:"checkbox",children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c}=a,{isError:u,isTouched:d,error:h}=pr(i,l,c);return v.jsxs("div",{children:[v.jsx("input",{type:"checkbox",style:{display:"none"}}),v.jsx(N.Checkbox,{scheme:s.value?"default":"neutral",disabled:a.isSubmitting,borderColor:d&&u?"red":!1,...s,...o}),r,t&&v.jsx(hr,{error:h,touched:d,label:o.label,customFeedbackLabel:n,showCorrectFeedback:e})]})}})}function zn({name:t,label:e,required:n,...r}){if(e)return v.jsxs("label",{htmlFor:t,textSize:"xs",mb:"1",fontWeight:"500",letterSpacing:"wide",textColor:"gray-600",...r,children:[e,n&&v.jsx("span",{textSize:"xs",ms:"1",textColor:"red",verticalAlign:"top",children:"* "})]})}function GO(t){const[e,n,r]=Je.useField(t),{error:o,touched:i}=n;return{isError:o!==void 0,isTouched:i,error:o}}function JO({name:t,options:e,label:n,withFeedbackLabel:r=!0,showCorrectFeedback:o=!1,customFeedbackLabel:i,required:s=!1}){const{isError:a,isTouched:l,error:c}=GO(t);return v.jsxs("div",{w:"full",dflex:!0,flexCol:!0,children:[n&&v.jsx(zn,{name:t,label:n,required:s}),e.length>0&&v.jsx("div",{rounded:!0,overflow:"hidden",border:"0.5",borderColor:l&&a?"red":"#F4F4F4",role:"group",children:e.map((u,d)=>v.jsx(XO,{name:t,label:u.label,value:u.id},d))}),e.length===0&&v.jsx("div",{rounded:!0,border:"0.5",bgColor:"#f4F4F4",borderColor:l&&a?"red":"#F4F4F4",py:"5",textAlign:"center",textSize:"md",fontWeight:"500",textColor:"slate-500",children:"No data"}),r&&v.jsx(hr,{error:c,touched:l,label:n,customFeedbackLabel:i,showCorrectFeedback:o})]})}function XO({name:t,label:e,value:n}){return v.jsx("label",{id:"parent_label",px:"4",py:"3",display:"block",hover_bgColor:"slate-50",cursor:"pointer",children:v.jsx(Je.Field,{name:t,type:"checkbox",value:n,children:({field:r,form:o})=>v.jsx(qy,{scheme:"neutral",disabled:o.isSubmitting,label:v.jsx("span",{flex:"1",w:"full",children:e}),labelPosition:"start",withFeedbackLabel:!1,...r})})})}function YO({name:t,value:e}){const{setFieldValue:n}=Je.useFormikContext();return T.useEffect(()=>{n(t,e)},[e,n]),null}function ud({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,fullWidth:s,...a}){const l=a.name??"";return v.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&v.jsx(zn,{name:l,label:t,required:i}),v.jsx(Je.FastField,{name:l,children:({field:c,form:u})=>{c.value==null&&console.warn(`Input: Value for field ${c.name} is null`);const{errors:d,touched:h}=u,{isError:f,isTouched:p,error:g}=pr(l,d,h),m={...a,...p&&f?{borderColor:"red"}:{}};return v.jsxs(v.Fragment,{children:[v.jsx(N.Input,{w:s?"full":void 0,disabled:u.isSubmitting,scheme:"default",lineHeight:"normal",transition:"all",...c,...m}),e&&v.jsx(hr,{error:g,touched:p,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})]})}function QO(t){return Array.isArray(t)}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function ZO(t,e,n){return t<e?n==="asc"?-1:1:t>e?n==="asc"?1:-1:0}function eT(t,e,n){return t.slice().sort((r,o)=>{const i=n.length;for(let s=0;s<e.length;s++){const a=i>s?n[s]:n[i-1],l=e[s],c=typeof l=="function",u=c?l(r):r[l],d=c?l(o):o[l],h=ZO(u,d,a);if(h!==0)return h}return 0})}function tT(t,e){return eT(t,e,["asc"])}function nT({field:t,onChangeField:e,resetValue:n}){const{setFieldValue:r,values:o}=Je.useFormikContext(),i=N.usePrevious($o(o,e)),s=N.useFirstRender();return T.useEffect(()=>{!s&&!jO($o(o,e),i)&&(QO(t)?t.forEach(a=>r(a,n)):r(t,n))},[s,o,e,r,t,n]),null}function rT({label:t}){return v.jsx("div",{mt:"5",fontWeight:"500",textSize:"lg",children:t})}function oT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,placeholder:s,fullWidth:a,children:l,...c}){const u=c.name??"";return v.jsx(Je.Field,{name:c.name,children:({field:d,form:h})=>{d.value==null&&console.warn(`Select: Value for field ${d.name} is null`);const{errors:f,touched:p}=h,{isError:g,isTouched:m,error:y}=pr(u,f,p),C={...m&&g?{borderColor:"red"}:{}};return v.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"baseline",...c,children:[t&&v.jsx(zn,{name:u,label:t,required:i,flex:"1"}),v.jsxs(N.Select,{disabled:h.isSubmitting||c.disabled,w:a?"full":void 0,...d,...C,children:[v.jsx("option",{value:"",children:s??"Select an option"}),l]}),e&&v.jsx(hr,{error:y,touched:m,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function iT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,children:o,onClick:i,...s}){const a=s.name??"";return v.jsx(Je.Field,{name:a,type:"checkbox",children:({field:l,form:c})=>{l.value==null&&console.warn(`Switch: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=pr(a,u,d);return v.jsxs("label",{children:[v.jsx("input",{type:"checkbox",style:{display:"none"}}),v.jsx("div",{dflex:!0,alignItems:"center",w:"full",children:v.jsx(N.Switch,{scheme:l.value?"default":"neutral",disabled:c.isSubmitting,label:t,borderColor:f&&h?"red":!1,...l})}),o,e&&v.jsx(hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function dd({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,...s}){const a=s.name??"";return v.jsx(Je.Field,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`TextArea : Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=pr(a,u,d),g={...s,...f&&h?{borderColor:"red"}:{}};return v.jsxs("div",{dflex:!0,flexCol:!0,w:"full",children:[t&&v.jsx(zn,{name:a,label:t,required:i}),v.jsx(N.TextArea,{disabled:c.isSubmitting,scheme:"default",...l,...g}),e&&v.jsx(hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function sT({children:t}){return v.jsx("div",{grid:!0,gridCols:"1",md_gridCols:"2",gap:"5",children:t})}function aT(t){const[{value:e}]=Je.useField(t);return T.useMemo(()=>e,[e])}const lT=T.memo(function({field:t,condition:e,form:n,extensions:r}){const[o,i]=T.useState(),s=aT(t),a=T.useMemo(()=>zO(e)?e(s):s==e,[e,s]);return T.useEffect(()=>{a&&i(s)},[a,s,i]),T.useMemo(()=>v.jsx(N.Collapse,{in:a,children:v.jsx("div",{dflex:!0,flexCol:!0,gap:"5",children:v.jsx(zd,{form:Be.runIfFn(n,a?s:o),extensions:r})})}),[a,n,r,s,o])});function cT({field:t,form:e}){const[n]=Je.useField(t),r=n.value;return v.jsx(zd,{form:e(r)})}function uT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,...s}){const a=s.name??"";return v.jsx(Je.FastField,{name:a,children:({field:l,form:c})=>{l.value==null&&console.warn(`Rating: Value for field ${l.name} is null`);const{errors:u,touched:d}=c,{isError:h,isTouched:f,error:p}=pr(a,u,d);return v.jsxs("div",{...s,children:[t&&v.jsx(zn,{name:a,label:t,required:i}),v.jsx(dT,{name:a,rating:l.value,setFieldValue:c.setFieldValue}),e&&v.jsx(hr,{error:p,touched:f,label:t,customFeedbackLabel:r,showCorrectFeedback:n})]})}})}function dT({name:t,rating:e,setFieldValue:n}){const r=T.useRef(null),o=T.useRef(null),i=T.useRef(null),s=T.useRef(null),a=T.useRef(null),l=N.useHover(r),c=N.useHover(o),u=N.useHover(i),d=N.useHover(s),h=N.useHover(a);return v.jsxs("div",{dflex:!0,children:[v.jsx(Vi,{ref:r,index:0,rating:e,hover:l||c||u||d||h,onClick:()=>n(t,"1")}),v.jsx(Vi,{ref:o,index:1,rating:e,hover:c||u||d||h,onClick:()=>n(t,"2")}),v.jsx(Vi,{ref:i,index:2,rating:e,hover:u||d||h,onClick:()=>n(t,"3")}),v.jsx(Vi,{ref:s,index:3,rating:e,hover:d||h,onClick:()=>n(t,"4")}),v.jsx(Vi,{ref:a,index:4,rating:e,hover:h,onClick:()=>n(t,"5")})]})}const Vi=T.forwardRef(function({index:t,rating:e,hover:n,onClick:r},o){const i=e-t;let s=Ax;return i>=.5&&(s=xx),(i>=1||n)&&(s=_x),v.jsx("div",{ref:o,onClick:r,children:v.jsx(N.Icon,{path:s,size:"x2",textColor:"brand"})})});function fT({title:t,divider:e}){return v.jsxs("div",{mt:"3",children:[e&&v.jsx("div",{h:"px",bgColor:"slate-100",w:"full",mb:e?"5":"8"}),v.jsx("div",{textTransform:"uppercase",textSize:"sm",fontWeight:"600",textColor:"slate-700",children:t})]})}function hT({children:t}){return v.jsx("div",{dflex:!0,alignItems:"end",gap:"5",children:t})}function pT({name:t,addItemLabel:e,...n}){const{values:r}=Je.useFormikContext(),o=r;return v.jsx(Je.FieldArray,{name:t,render:i=>v.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",children:[o[t]&&o[t].length>0&&o[t].map((s,a)=>v.jsxs("div",{dflex:!0,alignItems:"start",gap:"2",children:[v.jsx(ud,{flexGrow:"1",name:`${t}.${a}`,...n}),v.jsx(N.Button,{variant:"borderless",mt:"0.5",onClick:()=>i.remove(a),children:v.jsx(N.Icon,{path:jg})})]},a)),v.jsxs(N.Button,{variant:"glass",onClick:()=>i.push(""),children:[" ",e??"Add item"]})]})})}function gT({name:t,label:e,addItemLabel:n,required:r,...o}){const{values:i,isSubmitting:s}=Je.useFormikContext(),a=i;return v.jsx(Je.FieldArray,{name:t,render:l=>v.jsxs("div",{children:[e&&v.jsx(zn,{name:t,label:e,required:r}),v.jsxs("div",{dflex:!0,flexCol:!0,gap:"5",w:"full","data-class":"container",children:[a[t]&&a[t].length>0&&a[t].map((c,u)=>v.jsxs("div",{"data-class":"item",dflex:!0,alignItems:"center",gap:"1",flexGrow:!0,children:[v.jsx(dd,{name:`${t}.${u}`,disabled:s,scheme:"default",flexGrow:"1",...o}),v.jsx(N.IconButton,{variant:"borderless",corners:"pill",icon:jg,size:"xl",onClick:()=>l.remove(u)})]},u)),v.jsxs(N.Button,{onClick:()=>l.push(""),children:[" ",n??"Add item"]})]})]})})}function mT({icon:t,label:e,subtitle:n,...r}){const[o,i]=Be.splitComponentProps(r);return v.jsx(Je.Field,{name:r.name,type:"radio",value:r.value,children:({field:s,form:a})=>{s.value==null&&console.warn(`Checkbox: Value for field ${s.name} is null`);const{errors:l,touched:c,values:u}=a,{isError:d,isTouched:h,error:f}=pr(r.name??"",l,c),p={...h&&d?{borderColor:"red"}:{}};return v.jsxs("label",{htmlFor:r.name,...o,children:[v.jsx("input",{type:"radio",display:"none",...s,...i}),v.jsxs(N.Button,{w:"full",scheme:s.checked?"secondary":"neutral",disabled:i.disabled,easing:s.checked?"out":"linear",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",px:"3",py:"5",rounded:"lg",onClick:()=>a.setFieldValue(r.name??"",r.value),...p,children:[v.jsx(N.Icon,{path:t,size:"x3",mb:"3"}),v.jsx("span",{children:e}),n&&v.jsx("span",{textSize:"sm",textColor:"white",textOpacity:"80",children:n})]})]})}})}function yT({name:t,label:e,provider:n,required:r}){return v.jsxs("div",{dflex:!0,flexCol:!0,children:[v.jsx(zn,{name:t,label:e,required:r,mb:"1"}),v.jsx("div",{grid:!0,gridCols:"2",gap:"3",children:n.map(o=>v.jsx(mT,{value:o.id,name:t,icon:o.icon,label:o.label,subtitle:o.subtitle,disabled:o.disabled},o.id))})]})}function vT(t,e){const[n,r]=T.useState(t);return T.useEffect(()=>{const o=setTimeout(()=>r(t),e||500);return()=>{clearTimeout(o)}},[t,e]),n}function Wy(t){return T.useCallback(e=>{(t||e)&&window.open(t??e,"_blank")},[t])}var Ta={exports:{}},fd={},ka={exports:{}},hd={},Ky;function bT(){return Ky||(Ky=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(n,r){return r===void 0&&(r=""),(n==="/"?"/index":/^\/index(\/|$)/.test(n)?"/index"+n:n)+r}}(hd)),hd}var Ma={exports:{}},Gy;function wT(){return Gy||(Gy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"__unsafeCreateTrustedScriptURL",{enumerable:!0,get:function(){return o}});let n;function r(){if(typeof n>"u"&&typeof window<"u"){var i;n=((i=window.trustedTypes)==null?void 0:i.createPolicy("nextjs",{createHTML:s=>s,createScript:s=>s,createScriptURL:s=>s}))||null}return n}function o(i){var s;return((s=r())==null?void 0:s.createScriptURL(i))||i}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ma,Ma.exports)),Ma.exports}var pd={},Jy;function ST(){return Jy||(Jy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return e}});function e(){return process.env.NEXT_DEPLOYMENT_ID?`?dpl=${process.env.NEXT_DEPLOYMENT_ID}`:""}}(pd)),pd}var Xy;function CT(){return Xy||(Xy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(x,_){for(var A in _)Object.defineProperty(x,A,{enumerable:!0,get:_[A]})}n(e,{createRouteLoader:function(){return E},getClientBuildManifest:function(){return b},isAssetError:function(){return h},markAssetError:function(){return d}});const o=Nt._(bT()),i=wT(),s=Hu(),a=ST(),l=3800;function c(x,_,A){let O=_.get(x);if(O)return"future"in O?O.future:Promise.resolve(O);let k;const M=new Promise(I=>{k=I});return _.set(x,O={resolve:k,future:M}),A?A().then(I=>(k(I),I)).catch(I=>{throw _.delete(x),I}):M}const u=Symbol("ASSET_LOAD_ERROR");function d(x){return Object.defineProperty(x,u,{})}function h(x){return x&&u in x}function f(x){try{return x=document.createElement("link"),!!window.MSInputMethodContext&&!!document.documentMode||x.relList.supports("prefetch")}catch{return!1}}const p=f(),g=()=>(0,a.getDeploymentIdQueryOrEmptyString)();function m(x,_,A){return new Promise((O,k)=>{const M=`
|
10
|
+
link[rel="prefetch"][href^="`+x+`"],
|
11
|
+
link[rel="preload"][href^="`+x+`"],
|
12
|
+
script[src^="`+x+'"]';if(document.querySelector(M))return O();A=document.createElement("link"),_&&(A.as=_),A.rel="prefetch",A.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,A.onload=O,A.onerror=()=>k(d(new Error("Failed to prefetch: "+x))),A.href=x,document.head.appendChild(A)})}function y(x,_){return new Promise((A,O)=>{_=document.createElement("script"),_.onload=A,_.onerror=()=>O(d(new Error("Failed to load script: "+x))),_.crossOrigin=process.env.__NEXT_CROSS_ORIGIN,_.src=x,document.body.appendChild(_)})}let C;function w(x,_,A){return new Promise((O,k)=>{let M=!1;x.then(I=>{M=!0,O(I)}).catch(k),process.env.NODE_ENV==="development"&&(C||Promise.resolve()).then(()=>{(0,s.requestIdleCallback)(()=>setTimeout(()=>{M||k(A)},_))}),process.env.NODE_ENV!=="development"&&(0,s.requestIdleCallback)(()=>setTimeout(()=>{M||k(A)},_))})}function b(){if(self.__BUILD_MANIFEST)return Promise.resolve(self.__BUILD_MANIFEST);const x=new Promise(_=>{const A=self.__BUILD_MANIFEST_CB;self.__BUILD_MANIFEST_CB=()=>{_(self.__BUILD_MANIFEST),A&&A()}});return w(x,l,d(new Error("Failed to load client build manifest")))}function S(x,_){if(process.env.NODE_ENV==="development"){const A=x+"/_next/static/chunks/pages"+encodeURI((0,o.default)(_,".js"))+g();return Promise.resolve({scripts:[(0,i.__unsafeCreateTrustedScriptURL)(A)],css:[]})}return b().then(A=>{if(!(_ in A))throw d(new Error("Failed to lookup route: "+_));const O=A[_].map(k=>x+"/_next/"+encodeURI(k));return{scripts:O.filter(k=>k.endsWith(".js")).map(k=>(0,i.__unsafeCreateTrustedScriptURL)(k)+g()),css:O.filter(k=>k.endsWith(".css")).map(k=>k+g())}})}function E(x){const _=new Map,A=new Map,O=new Map,k=new Map;function M(P){if(process.env.NODE_ENV!=="development"){let F=A.get(P.toString());return F||(document.querySelector('script[src^="'+P+'"]')?Promise.resolve():(A.set(P.toString(),F=y(P)),F))}else return y(P)}function I(P){let F=O.get(P);return F||(O.set(P,F=fetch(P,{credentials:"same-origin"}).then(z=>{if(!z.ok)throw new Error("Failed to load stylesheet: "+P);return z.text().then($=>({href:P,content:$}))}).catch(z=>{throw d(z)})),F)}return{whenEntrypoint(P){return c(P,_)},onEntrypoint(P,F){(F?Promise.resolve().then(()=>F()).then(z=>({component:z&&z.default||z,exports:z}),z=>({error:z})):Promise.resolve(void 0)).then(z=>{const $=_.get(P);$&&"resolve"in $?z&&(_.set(P,z),$.resolve(z)):(z?_.set(P,z):_.delete(P),k.delete(P))})},loadRoute(P,F){return c(P,k,()=>{let z;return process.env.NODE_ENV==="development"&&(C=new Promise($=>{z=$})),w(S(x,P).then($=>{let{scripts:J,css:K}=$;return Promise.all([_.has(P)?[]:Promise.all(J.map(M)),Promise.all(K.map(I))])}).then($=>this.whenEntrypoint(P).then(J=>({entrypoint:J,styles:$[1]}))),l,d(new Error("Route did not complete loading: "+P))).then($=>{let{entrypoint:J,styles:K}=$;const R=Object.assign({styles:K},J);return"error"in J?J:R}).catch($=>{if(F)throw $;return{error:$}}).finally(()=>z==null?void 0:z())})},prefetch(P){let F;return(F=navigator.connection)&&(F.saveData||/2g/.test(F.effectiveType))?Promise.resolve():S(x,P).then(z=>Promise.all(p?z.scripts.map($=>m($.toString(),"script")):[])).then(()=>{(0,s.requestIdleCallback)(()=>this.loadRoute(P,!0).catch(()=>{}))}).catch(()=>{})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(ka,ka.exports)),ka.exports}var Pa={exports:{}},gd={},Yy;function Qy(){return Yy||(Yy=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});const r=Nt._(T).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="HeadManagerContext")}(gd)),gd}var Ia={exports:{}},Zy;function ET(){return Zy||(Zy=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}n(e,{DOMAttributeNames:function(){return r},default:function(){return a},isEqualNode:function(){return i}});const r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function o(l){let{type:c,props:u}=l;const d=document.createElement(c);for(const p in u){if(!u.hasOwnProperty(p)||p==="children"||p==="dangerouslySetInnerHTML"||u[p]===void 0)continue;const g=r[p]||p.toLowerCase();c==="script"&&(g==="async"||g==="defer"||g==="noModule")?d[g]=!!u[p]:d.setAttribute(g,u[p])}const{children:h,dangerouslySetInnerHTML:f}=u;return f?d.innerHTML=f.__html||"":h&&(d.textContent=typeof h=="string"?h:Array.isArray(h)?h.join(""):""),d}function i(l,c){if(l instanceof HTMLElement&&c instanceof HTMLElement){const u=c.getAttribute("nonce");if(u&&!l.getAttribute("nonce")){const d=c.cloneNode(!0);return d.setAttribute("nonce",""),d.nonce=u,u===l.nonce&&l.isEqualNode(d)}}return l.isEqualNode(c)}let s;process.env.__NEXT_STRICT_NEXT_HEAD?s=(l,c)=>{const u=document.querySelector("head");if(!u)return;const d=u.querySelectorAll('meta[name="next-head"]')||[],h=[];if(l==="meta"){const g=u.querySelector("meta[charset]");g&&h.push(g)}for(let g=0;g<d.length;g++){var f;const y=d[g].nextSibling;(y==null||(f=y.tagName)==null?void 0:f.toLowerCase())===l&&h.push(y)}const p=c.map(o).filter(g=>{for(let m=0,y=h.length;m<y;m++){const C=h[m];if(i(C,g))return h.splice(m,1),!1}return!0});h.forEach(g=>{var m;const y=g.previousSibling;if(y&&y.getAttribute("name")==="next-head"){var C;(C=g.parentNode)==null||C.removeChild(y)}(m=g.parentNode)==null||m.removeChild(g)}),p.forEach(g=>{var m;const y=document.createElement("meta");y.name="next-head",y.content="1",((m=g.tagName)==null?void 0:m.toLowerCase())==="meta"&&g.getAttribute("charset")||u.appendChild(y),u.appendChild(g)})}:s=(l,c)=>{const u=document.getElementsByTagName("head")[0],d=u.querySelector("meta[name=next-head-count]");if(process.env.NODE_ENV!=="production"&&!d){console.error("Warning: next-head-count is missing. https://nextjs.org/docs/messages/next-head-count-missing");return}const h=Number(d.content),f=[];for(let m=0,y=d.previousElementSibling;m<h;m++,y=(y==null?void 0:y.previousElementSibling)||null){var p;(y==null||(p=y.tagName)==null?void 0:p.toLowerCase())===l&&f.push(y)}const g=c.map(o).filter(m=>{for(let y=0,C=f.length;y<C;y++){const w=f[y];if(i(w,m))return f.splice(y,1),!1}return!0});f.forEach(m=>{var y;return(y=m.parentNode)==null?void 0:y.removeChild(m)}),g.forEach(m=>u.insertBefore(m,d)),d.content=(h-f.length+g.length).toString()};function a(){return{mountedInstances:new Set,updateHead:l=>{const c={};l.forEach(h=>{if(h.type==="link"&&h.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+h.props["data-href"]+'"]'))return;h.props.href=h.props["data-href"],h.props["data-href"]=void 0}const f=c[h.type]||[];f.push(h),c[h.type]=f});const u=c.title?c.title[0]:null;let d="";if(u){const{children:h}=u.props;d=typeof h=="string"?h:Array.isArray(h)?h.join(""):""}d!==document.title&&(document.title=d),["meta","base","link","style","script"].forEach(h=>{s(h,c[h]||[])})}}}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ia,Ia.exports)),Ia.exports}var e0;function _T(){return e0||(e0=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(E,x){for(var _ in x)Object.defineProperty(E,_,{enumerable:!0,get:x[_]})}n(e,{default:function(){return S},handleClientScriptLoad:function(){return m},initScriptLoader:function(){return w}});const r=Nt,o=ki(),i=Ti,s=r._(Lo),a=o._(T),l=Qy(),c=ET(),u=Hu(),d=new Map,h=new Set,f=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],p=E=>{if(s.default.preinit){E.forEach(x=>{s.default.preinit(x,{as:"style"})});return}if(typeof window<"u"){let x=document.head;E.forEach(_=>{let A=document.createElement("link");A.type="text/css",A.rel="stylesheet",A.href=_,x.appendChild(A)})}},g=E=>{const{src:x,id:_,onLoad:A=()=>{},onReady:O=null,dangerouslySetInnerHTML:k,children:M="",strategy:I="afterInteractive",onError:P,stylesheets:F}=E,z=_||x;if(z&&h.has(z))return;if(d.has(x)){h.add(z),d.get(x).then(A,P);return}const $=()=>{O&&O(),h.add(z)},J=document.createElement("script"),K=new Promise((R,Q)=>{J.addEventListener("load",function(se){R(),A&&A.call(this,se),$()}),J.addEventListener("error",function(se){Q(se)})}).catch(function(R){P&&P(R)});k?(J.innerHTML=k.__html||"",$()):M?(J.textContent=typeof M=="string"?M:Array.isArray(M)?M.join(""):"",$()):x&&(J.src=x,d.set(x,K));for(const[R,Q]of Object.entries(E)){if(Q===void 0||f.includes(R))continue;const se=c.DOMAttributeNames[R]||R.toLowerCase();J.setAttribute(se,Q)}I==="worker"&&J.setAttribute("type","text/partytown"),J.setAttribute("data-nscript",I),F&&p(F),document.body.appendChild(J)};function m(E){const{strategy:x="afterInteractive"}=E;x==="lazyOnload"?window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(E))}):g(E)}function y(E){document.readyState==="complete"?(0,u.requestIdleCallback)(()=>g(E)):window.addEventListener("load",()=>{(0,u.requestIdleCallback)(()=>g(E))})}function C(){[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(x=>{const _=x.id||x.getAttribute("src");h.add(_)})}function w(E){E.forEach(m),C()}function b(E){const{id:x,src:_="",onLoad:A=()=>{},onReady:O=null,strategy:k="afterInteractive",onError:M,stylesheets:I,...P}=E,{updateScripts:F,scripts:z,getIsSsr:$,appDir:J,nonce:K}=(0,a.useContext)(l.HeadManagerContext),R=(0,a.useRef)(!1);(0,a.useEffect)(()=>{const se=x||_;R.current||(O&&se&&h.has(se)&&O(),R.current=!0)},[O,x,_]);const Q=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{Q.current||(k==="afterInteractive"?g(E):k==="lazyOnload"&&y(E),Q.current=!0)},[E,k]),(k==="beforeInteractive"||k==="worker")&&(F?(z[k]=(z[k]||[]).concat([{id:x,src:_,onLoad:A,onReady:O,onError:M,...P}]),F(z)):$&&$()?h.add(x||_):$&&!$()&&g(E)),J){if(I&&I.forEach(se=>{s.default.preinit(se,{as:"style"})}),k==="beforeInteractive")return _?(s.default.preload(_,P.integrity?{as:"script",integrity:P.integrity,nonce:K,crossOrigin:P.crossOrigin}:{as:"script",nonce:K,crossOrigin:P.crossOrigin}),(0,i.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([_,{...P,id:x}])+")"}})):(P.dangerouslySetInnerHTML&&(P.children=P.dangerouslySetInnerHTML.__html,delete P.dangerouslySetInnerHTML),(0,i.jsx)("script",{nonce:K,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...P,id:x}])+")"}}));k==="afterInteractive"&&_&&s.default.preload(_,P.integrity?{as:"script",integrity:P.integrity,nonce:K,crossOrigin:P.crossOrigin}:{as:"script",nonce:K,crossOrigin:P.crossOrigin})}return null}Object.defineProperty(b,"__nextScript",{value:!0});const S=b;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Pa,Pa.exports)),Pa.exports}var md={},yd={},t0;function xT(){return t0||(t0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{getObjectClassLabel:function(){return n},isPlainObject:function(){return r}});function n(o){return Object.prototype.toString.call(o)}function r(o){if(n(o)!=="[object Object]")return!1;const i=Object.getPrototypeOf(o);return i===null||i.hasOwnProperty("isPrototypeOf")}}(yd)),yd}var n0;function r0(){return n0||(n0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{default:function(){return r},getProperError:function(){return o}});const n=xT();function r(i){return typeof i=="object"&&i!==null&&"name"in i&&"message"in i}function o(i){if(r(i))return i;if(process.env.NODE_ENV==="development"){if(typeof i>"u")return new Error("An undefined error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined");if(i===null)return new Error("A null error was thrown, see here for more info: https://nextjs.org/docs/messages/threw-undefined")}return new Error((0,n.isPlainObject)(i)?JSON.stringify(i):i+"")}}(md)),md}var vd={},bd={},o0;function AT(){return o0||(o0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathSep",{enumerable:!0,get:function(){return e}});function e(n){return n.replace(/\\/g,"/")}}(bd)),bd}var i0;function OT(){return i0||(i0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"denormalizePagePath",{enumerable:!0,get:function(){return r}});const e=Cm(),n=AT();function r(o){let i=(0,n.normalizePathSep)(o);return i.startsWith("/index/")&&!(0,e.isDynamicRoute)(i)?i.slice(6):i!=="/index"?i:"/"}}(vd)),vd}var wd={},s0;function TT(){return s0||(s0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return e}});function e(){const n=Object.create(null);return{on(r,o){(n[r]||(n[r]=[])).push(o)},off(r,o){n[r]&&n[r].splice(n[r].indexOf(o)>>>0,1)},emit(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];(n[r]||[]).slice().map(a=>{a(...i)})}}}}(wd)),wd}var Sd={},a0;function Cd(){return a0||(a0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseRelativeUrl",{enumerable:!0,get:function(){return r}});const e=Do(),n=Js();function r(o,i){const s=new URL(typeof window>"u"?"http://n":(0,e.getLocationOrigin)()),a=i?new URL(i,s):o.startsWith(".")?new URL(typeof window>"u"?"http://n":window.location.href):s,{pathname:l,searchParams:c,search:u,hash:d,href:h,origin:f}=new URL(o,a);if(f!==s.origin)throw new Error("invariant: invalid relative URL, router received "+o);return{pathname:l,query:(0,n.searchParamsToUrlQuery)(c),search:u,hash:d,href:h.slice(s.origin.length)}}}(Sd)),Sd}var Ed={},_d={},_n={},l0;function c0(){if(l0)return _n;l0=1,Object.defineProperty(_n,"__esModule",{value:!0});function t(f){for(var p=[],g=0;g<f.length;){var m=f[g];if(m==="*"||m==="+"||m==="?"){p.push({type:"MODIFIER",index:g,value:f[g++]});continue}if(m==="\\"){p.push({type:"ESCAPED_CHAR",index:g++,value:f[g++]});continue}if(m==="{"){p.push({type:"OPEN",index:g,value:f[g++]});continue}if(m==="}"){p.push({type:"CLOSE",index:g,value:f[g++]});continue}if(m===":"){for(var y="",C=g+1;C<f.length;){var w=f.charCodeAt(C);if(w>=48&&w<=57||w>=65&&w<=90||w>=97&&w<=122||w===95){y+=f[C++];continue}break}if(!y)throw new TypeError("Missing parameter name at "+g);p.push({type:"NAME",index:g,value:y}),g=C;continue}if(m==="("){var b=1,S="",C=g+1;if(f[C]==="?")throw new TypeError('Pattern cannot start with "?" at '+C);for(;C<f.length;){if(f[C]==="\\"){S+=f[C++]+f[C++];continue}if(f[C]===")"){if(b--,b===0){C++;break}}else if(f[C]==="("&&(b++,f[C+1]!=="?"))throw new TypeError("Capturing groups are not allowed at "+C);S+=f[C++]}if(b)throw new TypeError("Unbalanced pattern at "+g);if(!S)throw new TypeError("Missing pattern at "+g);p.push({type:"PATTERN",index:g,value:S}),g=C;continue}p.push({type:"CHAR",index:g,value:f[g++]})}return p.push({type:"END",index:g,value:""}),p}function e(f,p){p===void 0&&(p={});for(var g=t(f),m=p.prefixes,y=m===void 0?"./":m,C="[^"+s(p.delimiter||"/#?")+"]+?",w=[],b=0,S=0,E="",x=function(K){if(S<g.length&&g[S].type===K)return g[S++].value},_=function(K){var R=x(K);if(R!==void 0)return R;var Q=g[S],se=Q.type,ie=Q.index;throw new TypeError("Unexpected "+se+" at "+ie+", expected "+K)},A=function(){for(var K="",R;R=x("CHAR")||x("ESCAPED_CHAR");)K+=R;return K};S<g.length;){var O=x("CHAR"),k=x("NAME"),M=x("PATTERN");if(k||M){var I=O||"";y.indexOf(I)===-1&&(E+=I,I=""),E&&(w.push(E),E=""),w.push({name:k||b++,prefix:I,suffix:"",pattern:M||C,modifier:x("MODIFIER")||""});continue}var P=O||x("ESCAPED_CHAR");if(P){E+=P;continue}E&&(w.push(E),E="");var F=x("OPEN");if(F){var I=A(),z=x("NAME")||"",$=x("PATTERN")||"",J=A();_("CLOSE"),w.push({name:z||($?b++:""),pattern:z&&!$?C:$,prefix:I,suffix:J,modifier:x("MODIFIER")||""});continue}_("END")}return w}_n.parse=e;function n(f,p){return r(e(f,p),p)}_n.compile=n;function r(f,p){p===void 0&&(p={});var g=a(p),m=p.encode,y=m===void 0?function(S){return S}:m,C=p.validate,w=C===void 0?!0:C,b=f.map(function(S){if(typeof S=="object")return new RegExp("^(?:"+S.pattern+")$",g)});return function(S){for(var E="",x=0;x<f.length;x++){var _=f[x];if(typeof _=="string"){E+=_;continue}var A=S?S[_.name]:void 0,O=_.modifier==="?"||_.modifier==="*",k=_.modifier==="*"||_.modifier==="+";if(Array.isArray(A)){if(!k)throw new TypeError('Expected "'+_.name+'" to not repeat, but got an array');if(A.length===0){if(O)continue;throw new TypeError('Expected "'+_.name+'" to not be empty')}for(var M=0;M<A.length;M++){var I=y(A[M],_);if(w&&!b[x].test(I))throw new TypeError('Expected all "'+_.name+'" to match "'+_.pattern+'", but got "'+I+'"');E+=_.prefix+I+_.suffix}continue}if(typeof A=="string"||typeof A=="number"){var I=y(String(A),_);if(w&&!b[x].test(I))throw new TypeError('Expected "'+_.name+'" to match "'+_.pattern+'", but got "'+I+'"');E+=_.prefix+I+_.suffix;continue}if(!O){var P=k?"an array":"a string";throw new TypeError('Expected "'+_.name+'" to be '+P)}}return E}}_n.tokensToFunction=r;function o(f,p){var g=[],m=h(f,g,p);return i(m,g,p)}_n.match=o;function i(f,p,g){g===void 0&&(g={});var m=g.decode,y=m===void 0?function(C){return C}:m;return function(C){var w=f.exec(C);if(!w)return!1;for(var b=w[0],S=w.index,E=Object.create(null),x=function(A){if(w[A]===void 0)return"continue";var O=p[A-1];O.modifier==="*"||O.modifier==="+"?E[O.name]=w[A].split(O.prefix+O.suffix).map(function(k){return y(k,O)}):E[O.name]=y(w[A],O)},_=1;_<w.length;_++)x(_);return{path:b,index:S,params:E}}}_n.regexpToFunction=i;function s(f){return f.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function a(f){return f&&f.sensitive?"":"i"}function l(f,p){if(!p)return f;var g=f.source.match(/\((?!\?)/g);if(g)for(var m=0;m<g.length;m++)p.push({name:m,prefix:"",suffix:"",modifier:"",pattern:""});return f}function c(f,p,g){var m=f.map(function(y){return h(y,p,g).source});return new RegExp("(?:"+m.join("|")+")",a(g))}function u(f,p,g){return d(e(f,g),p,g)}function d(f,p,g){g===void 0&&(g={});for(var m=g.strict,y=m===void 0?!1:m,C=g.start,w=C===void 0?!0:C,b=g.end,S=b===void 0?!0:b,E=g.encode,x=E===void 0?function(K){return K}:E,_="["+s(g.endsWith||"")+"]|$",A="["+s(g.delimiter||"/#?")+"]",O=w?"^":"",k=0,M=f;k<M.length;k++){var I=M[k];if(typeof I=="string")O+=s(x(I));else{var P=s(x(I.prefix)),F=s(x(I.suffix));if(I.pattern)if(p&&p.push(I),P||F)if(I.modifier==="+"||I.modifier==="*"){var z=I.modifier==="*"?"?":"";O+="(?:"+P+"((?:"+I.pattern+")(?:"+F+P+"(?:"+I.pattern+"))*)"+F+")"+z}else O+="(?:"+P+"("+I.pattern+")"+F+")"+I.modifier;else O+="("+I.pattern+")"+I.modifier;else O+="(?:"+P+F+")"+I.modifier}}if(S)y||(O+=A+"?"),O+=g.endsWith?"(?="+_+")":"$";else{var $=f[f.length-1],J=typeof $=="string"?A.indexOf($[$.length-1])>-1:$===void 0;y||(O+="(?:"+A+"(?="+_+"))?"),J||(O+="(?="+A+"|"+_+")")}return new RegExp(O,a(g))}_n.tokensToRegexp=d;function h(f,p,g){return f instanceof RegExp?l(f,p):Array.isArray(f)?c(f,p,g):u(f,p,g)}return _n.pathToRegexp=h,_n}var u0;function kT(){return u0||(u0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getPathMatch",{enumerable:!0,get:function(){return n}});const e=c0();function n(r,o){const i=[],s=(0,e.pathToRegexp)(r,i,{delimiter:"/",sensitive:typeof(o==null?void 0:o.sensitive)=="boolean"?o.sensitive:!1,strict:o==null?void 0:o.strict}),a=(0,e.regexpToFunction)(o!=null&&o.regexModifier?new RegExp(o.regexModifier(s.source),s.flags):s,i);return(l,c)=>{if(typeof l!="string")return!1;const u=a(l);if(!u)return!1;if(o!=null&&o.removeUnnamedParams)for(const d of i)typeof d.name=="number"&&delete u.params[d.name];return{...c,...u.params}}}}(_d)),_d}var xd={},Ad={},d0;function MT(){return d0||(d0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parseUrl",{enumerable:!0,get:function(){return r}});const e=Js(),n=Cd();function r(o){if(o.startsWith("/"))return(0,n.parseRelativeUrl)(o);const i=new URL(o);return{hash:i.hash,hostname:i.hostname,href:i.href,pathname:i.pathname,port:i.port,protocol:i.protocol,query:(0,e.searchParamsToUrlQuery)(i.searchParams),search:i.search}}}(Ad)),Ad}var La={exports:{}},f0;function PT(){return f0||(f0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(h,f){for(var p in f)Object.defineProperty(h,p,{enumerable:!0,get:f[p]})}n(e,{ACTION:function(){return o},FLIGHT_PARAMETERS:function(){return c},NEXT_DID_POSTPONE_HEADER:function(){return d},NEXT_ROUTER_PREFETCH_HEADER:function(){return s},NEXT_ROUTER_STATE_TREE:function(){return i},NEXT_RSC_UNION_QUERY:function(){return u},NEXT_URL:function(){return a},RSC_CONTENT_TYPE_HEADER:function(){return l},RSC_HEADER:function(){return r}});const r="RSC",o="Next-Action",i="Next-Router-State-Tree",s="Next-Router-Prefetch",a="Next-Url",l="text/x-component",c=[[r],[i],[s]],u="_rsc",d="x-nextjs-postponed";(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(La,La.exports)),La.exports}var Od={},Td={exports:{}},h0;function IT(){return h0||(h0=1,(()=>{typeof __nccwpck_require__<"u"&&(__nccwpck_require__.ab=__dirname+"/");var t={};(()=>{var e=t;/*!
|
13
|
+
* cookie
|
14
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
15
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
16
|
+
* MIT Licensed
|
17
|
+
*/e.parse=s,e.serialize=a;var n=decodeURIComponent,r=encodeURIComponent,o=/; */,i=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(c,u){if(typeof c!="string")throw new TypeError("argument str must be a string");for(var d={},h=u||{},f=c.split(o),p=h.decode||n,g=0;g<f.length;g++){var m=f[g],y=m.indexOf("=");if(!(y<0)){var C=m.substr(0,y).trim(),w=m.substr(++y,m.length).trim();w[0]=='"'&&(w=w.slice(1,-1)),d[C]==null&&(d[C]=l(w,p))}}return d}function a(c,u,d){var h=d||{},f=h.encode||r;if(typeof f!="function")throw new TypeError("option encode is invalid");if(!i.test(c))throw new TypeError("argument name is invalid");var p=f(u);if(p&&!i.test(p))throw new TypeError("argument val is invalid");var g=c+"="+p;if(h.maxAge!=null){var m=h.maxAge-0;if(isNaN(m)||!isFinite(m))throw new TypeError("option maxAge is invalid");g+="; Max-Age="+Math.floor(m)}if(h.domain){if(!i.test(h.domain))throw new TypeError("option domain is invalid");g+="; Domain="+h.domain}if(h.path){if(!i.test(h.path))throw new TypeError("option path is invalid");g+="; Path="+h.path}if(h.expires){if(typeof h.expires.toUTCString!="function")throw new TypeError("option expires is invalid");g+="; Expires="+h.expires.toUTCString()}if(h.httpOnly&&(g+="; HttpOnly"),h.secure&&(g+="; Secure"),h.sameSite){var y=typeof h.sameSite=="string"?h.sameSite.toLowerCase():h.sameSite;switch(y){case!0:g+="; SameSite=Strict";break;case"lax":g+="; SameSite=Lax";break;case"strict":g+="; SameSite=Strict";break;case"none":g+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return g}function l(c,u){try{return u(c)}catch{return c}}})(),Td.exports=t})()),Td.exports}var p0;function LT(){return p0||(p0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getCookieParser",{enumerable:!0,get:function(){return e}});function e(n){return function(){const{cookie:o}=n;if(!o)return{};const{parse:i}=IT();return i(Array.isArray(o)?o.join("; "):o)}}}(Od)),Od}var g0;function DT(){return g0||(g0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(p,g){for(var m in g)Object.defineProperty(p,m,{enumerable:!0,get:g[m]})}e(t,{compileNonPath:function(){return h},matchHas:function(){return d},prepareDestination:function(){return f}});const n=c0(),r=Am(),o=MT(),i=Ou(),s=PT(),a=LT();function l(p){let g="";for(let m=0;m<p.length;m++){const y=p.charCodeAt(m);(y>64&&y<91||y>96&&y<123)&&(g+=p[m])}return g}function c(p,g){return p.replace(new RegExp(":"+(0,r.escapeStringRegexp)(g),"g"),"__ESC_COLON_"+g)}function u(p){return p.replace(/__ESC_COLON_/gi,":")}function d(p,g,m,y){m===void 0&&(m=[]),y===void 0&&(y=[]);const C={},w=S=>{let E,x=S.key;switch(S.type){case"header":{x=x.toLowerCase(),E=p.headers[x];break}case"cookie":{"cookies"in p?E=p.cookies[S.key]:E=(0,a.getCookieParser)(p.headers)()[S.key];break}case"query":{E=g[x];break}case"host":{const{host:_}=(p==null?void 0:p.headers)||{};E=_==null?void 0:_.split(":",1)[0].toLowerCase();break}}if(!S.value&&E)return C[l(x)]=E,!0;if(E){const _=new RegExp("^"+S.value+"$"),A=Array.isArray(E)?E.slice(-1)[0].match(_):E.match(_);if(A)return Array.isArray(A)&&(A.groups?Object.keys(A.groups).forEach(O=>{C[O]=A.groups[O]}):S.type==="host"&&A[0]&&(C.host=A[0])),!0}return!1};return m.every(S=>w(S))&&!y.some(S=>w(S))?C:!1}function h(p,g){if(!p.includes(":"))return p;for(const m of Object.keys(g))p.includes(":"+m)&&(p=p.replace(new RegExp(":"+m+"\\*","g"),":"+m+"--ESCAPED_PARAM_ASTERISKS").replace(new RegExp(":"+m+"\\?","g"),":"+m+"--ESCAPED_PARAM_QUESTION").replace(new RegExp(":"+m+"\\+","g"),":"+m+"--ESCAPED_PARAM_PLUS").replace(new RegExp(":"+m+"(?!\\w)","g"),"--ESCAPED_PARAM_COLON"+m));return p=p.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g,"\\$1").replace(/--ESCAPED_PARAM_PLUS/g,"+").replace(/--ESCAPED_PARAM_COLON/g,":").replace(/--ESCAPED_PARAM_QUESTION/g,"?").replace(/--ESCAPED_PARAM_ASTERISKS/g,"*"),(0,n.compile)("/"+p,{validate:!1})(g).slice(1)}function f(p){const g=Object.assign({},p.query);delete g.__nextLocale,delete g.__nextDefaultLocale,delete g.__nextDataReq,delete g.__nextInferredLocaleFromDefault,delete g[s.NEXT_RSC_UNION_QUERY];let m=p.destination;for(const M of Object.keys({...p.params,...g}))m=c(m,M);const y=(0,o.parseUrl)(m),C=y.query,w=u(""+y.pathname+(y.hash||"")),b=u(y.hostname||""),S=[],E=[];(0,n.pathToRegexp)(w,S),(0,n.pathToRegexp)(b,E);const x=[];S.forEach(M=>x.push(M.name)),E.forEach(M=>x.push(M.name));const _=(0,n.compile)(w,{validate:!1}),A=(0,n.compile)(b,{validate:!1});for(const[M,I]of Object.entries(C))Array.isArray(I)?C[M]=I.map(P=>h(u(P),p.params)):typeof I=="string"&&(C[M]=h(u(I),p.params));let O=Object.keys(p.params).filter(M=>M!=="nextInternalLocale");if(p.appendParamsToQuery&&!O.some(M=>x.includes(M)))for(const M of O)M in C||(C[M]=p.params[M]);let k;if((0,i.isInterceptionRouteAppPath)(w))for(const M of w.split("/")){const I=i.INTERCEPTION_ROUTE_MARKERS.find(P=>M.startsWith(P));if(I){p.params[0]=I;break}}try{k=_(p.params);const[M,I]=k.split("#",2);y.hostname=A(p.params),y.pathname=M,y.hash=(I?"#":"")+(I||""),delete y.search}catch(M){throw M.message.match(/Expected .*? to not repeat, but got an array/)?new Error("To use a multi-match in the destination you must add `*` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match"):M}return y.query={...g,...y.query},{newUrl:k,destQuery:C,parsedDestination:y}}}(xd)),xd}var Da={exports:{}},m0;function y0(){return m0||(m0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeBasePath",{enumerable:!0,get:function(){return o}});const n=vu(),r=process.env.__NEXT_ROUTER_BASEPATH||"";function o(i){return process.env.__NEXT_MANUAL_CLIENT_BASE_PATH&&!(0,n.hasBasePath)(i)||r.length===0||(i=i.slice(r.length),i.startsWith("/")||(i="/"+i)),i}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Da,Da.exports)),Da.exports}var v0;function RT(){return v0||(v0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const e=kT(),n=DT(),r=Mi(),o=sa(),i=y0(),s=Cd();function a(l,c,u,d,h,f){let p=!1,g=!1,m=(0,s.parseRelativeUrl)(l),y=(0,r.removeTrailingSlash)((0,o.normalizeLocalePath)((0,i.removeBasePath)(m.pathname),f).pathname),C;const w=S=>{let x=(0,e.getPathMatch)(S.source+(process.env.__NEXT_TRAILING_SLASH?"(/)?":""),{removeUnnamedParams:!0,strict:!0})(m.pathname);if((S.has||S.missing)&&x){const _=(0,n.matchHas)({headers:{host:document.location.hostname,"user-agent":navigator.userAgent},cookies:document.cookie.split("; ").reduce((A,O)=>{const[k,...M]=O.split("=");return A[k]=M.join("="),A},{})},m.query,S.has,S.missing);_?Object.assign(x,_):x=!1}if(x){if(!S.destination)return g=!0,!0;const _=(0,n.prepareDestination)({appendParamsToQuery:!0,destination:S.destination,params:x,query:d});if(m=_.parsedDestination,l=_.newUrl,Object.assign(d,_.parsedDestination.query),y=(0,r.removeTrailingSlash)((0,o.normalizeLocalePath)((0,i.removeBasePath)(l),f).pathname),c.includes(y))return p=!0,C=y,!0;if(C=h(y),C!==l&&c.includes(C))return p=!0,!0}};let b=!1;for(let S=0;S<u.beforeFiles.length;S++)w(u.beforeFiles[S]);if(p=c.includes(y),!p){if(!b){for(let S=0;S<u.afterFiles.length;S++)if(w(u.afterFiles[S])){b=!0;break}}if(b||(C=h(y),p=c.includes(C),b=p),!b){for(let S=0;S<u.fallback.length;S++)if(w(u.fallback[S])){b=!0;break}}}return{asPath:l,parsedAs:m,matchedPage:p,resolvedHref:C,externalDest:g}}}(Ed)),Ed}var Ra={exports:{}},b0;function NT(){return b0||(b0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"removeLocale",{enumerable:!0,get:function(){return r}});const n=Ro();function r(o,i){if(process.env.__NEXT_I18N_SUPPORT){const{pathname:s}=(0,n.parsePath)(o),a=s.toLowerCase(),l=i==null?void 0:i.toLowerCase();return i&&(a.startsWith("/"+l+"/")||a==="/"+l)?(s.length===i.length+1?"/":"")+o.slice(i.length+1):o}return o}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ra,Ra.exports)),Ra.exports}var kd={},w0;function FT(){return w0||(w0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isAPIRoute",{enumerable:!0,get:function(){return e}});function e(n){return n==="/api"||!!(n!=null&&n.startsWith("/api/"))}}(kd)),kd}var Md={},Pd={},S0;function HT(){return S0||(S0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removePathPrefix",{enumerable:!0,get:function(){return n}});const e=ea();function n(r,o){if(!(0,e.pathHasPrefix)(r,o))return r;const i=r.slice(o.length);return i.startsWith("/")?i:"/"+i}}(Pd)),Pd}var C0;function BT(){return C0||(C0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getNextPathnameInfo",{enumerable:!0,get:function(){return o}});const e=sa(),n=HT(),r=ea();function o(i,s){var a;const{basePath:l,i18n:c,trailingSlash:u}=(a=s.nextConfig)!=null?a:{},d={pathname:i,trailingSlash:i!=="/"?i.endsWith("/"):u};l&&(0,r.pathHasPrefix)(d.pathname,l)&&(d.pathname=(0,n.removePathPrefix)(d.pathname,l),d.basePath=l);let h=d.pathname;if(d.pathname.startsWith("/_next/data/")&&d.pathname.endsWith(".json")){const p=d.pathname.replace(/^\/_next\/data\//,"").replace(/\.json$/,"").split("/"),g=p[0];d.buildId=g,h=p[1]!=="index"?"/"+p.slice(1).join("/"):"/",s.parseData===!0&&(d.pathname=h)}if(c){let p=s.i18nProvider?s.i18nProvider.analyze(d.pathname):(0,e.normalizeLocalePath)(d.pathname,c.locales);d.locale=p.detectedLocale;var f;d.pathname=(f=p.pathname)!=null?f:d.pathname,!p.detectedLocale&&d.buildId&&(p=s.i18nProvider?s.i18nProvider.analyze(h):(0,e.normalizeLocalePath)(h,c.locales),p.detectedLocale&&(d.locale=p.detectedLocale))}return d}}(Md)),Md}var Id={},Ld={},E0;function $T(){return E0||(E0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathSuffix",{enumerable:!0,get:function(){return n}});const e=Ro();function n(r,o){if(!r.startsWith("/")||!o)return r;const{pathname:i,query:s,hash:a}=(0,e.parsePath)(r);return""+i+o+s+a}}(Ld)),Ld}var _0;function VT(){return _0||(_0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"formatNextPathnameInfo",{enumerable:!0,get:function(){return i}});const e=Mi(),n=Du(),r=$T(),o=Rm();function i(s){let a=(0,o.addLocale)(s.pathname,s.locale,s.buildId?void 0:s.defaultLocale,s.ignorePrefix);return(s.buildId||!s.trailingSlash)&&(a=(0,e.removeTrailingSlash)(a)),s.buildId&&(a=(0,r.addPathSuffix)((0,n.addPathPrefix)(a,"/_next/data/"+s.buildId),s.pathname==="/"?"index.json":".json")),a=(0,n.addPathPrefix)(a,s.basePath),!s.buildId&&s.trailingSlash?a.endsWith("/")?a:(0,r.addPathSuffix)(a,"/"):(0,e.removeTrailingSlash)(a)}}(Id)),Id}var Dd={},x0;function jT(){return x0||(x0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"compareRouterStates",{enumerable:!0,get:function(){return e}});function e(n,r){const o=Object.keys(n);if(o.length!==Object.keys(r).length)return!1;for(let i=o.length;i--;){const s=o[i];if(s==="query"){const a=Object.keys(n.query);if(a.length!==Object.keys(r.query).length)return!1;for(let l=a.length;l--;){const c=a[l];if(!r.query.hasOwnProperty(c)||n.query[c]!==r.query[c])return!1}}else if(!r.hasOwnProperty(s)||n[s]!==r[s])return!1}return!0}}(Dd)),Dd}var Rd={},A0;function zT(){return A0||(A0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return e}});function e(n){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(n)}}(Rd)),Rd}var Nd={},O0;function UT(){return O0||(O0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return e}});function e(n,r){if(r===void 0&&(r={}),r.onlyHashChange){n();return}const o=document.documentElement,i=o.style.scrollBehavior;o.style.scrollBehavior="auto",r.dontForceLayout||o.getClientRects(),n(),o.style.scrollBehavior=i}}(Nd)),Nd}var Na={exports:{}},Ue={};/**
|
18
|
+
* @license React
|
19
|
+
* react-is.production.min.js
|
20
|
+
*
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
22
|
+
*
|
23
|
+
* This source code is licensed under the MIT license found in the
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
25
|
+
*/var T0;function qT(){if(T0)return Ue;T0=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p;p=Symbol.for("react.module.reference");function g(m){if(typeof m=="object"&&m!==null){var y=m.$$typeof;switch(y){case t:switch(m=m.type,m){case n:case o:case r:case c:case u:return m;default:switch(m=m&&m.$$typeof,m){case a:case s:case l:case h:case d:case i:return m;default:return y}}case e:return y}}}return Ue.ContextConsumer=s,Ue.ContextProvider=i,Ue.Element=t,Ue.ForwardRef=l,Ue.Fragment=n,Ue.Lazy=h,Ue.Memo=d,Ue.Portal=e,Ue.Profiler=o,Ue.StrictMode=r,Ue.Suspense=c,Ue.SuspenseList=u,Ue.isAsyncMode=function(){return!1},Ue.isConcurrentMode=function(){return!1},Ue.isContextConsumer=function(m){return g(m)===s},Ue.isContextProvider=function(m){return g(m)===i},Ue.isElement=function(m){return typeof m=="object"&&m!==null&&m.$$typeof===t},Ue.isForwardRef=function(m){return g(m)===l},Ue.isFragment=function(m){return g(m)===n},Ue.isLazy=function(m){return g(m)===h},Ue.isMemo=function(m){return g(m)===d},Ue.isPortal=function(m){return g(m)===e},Ue.isProfiler=function(m){return g(m)===o},Ue.isStrictMode=function(m){return g(m)===r},Ue.isSuspense=function(m){return g(m)===c},Ue.isSuspenseList=function(m){return g(m)===u},Ue.isValidElementType=function(m){return typeof m=="string"||typeof m=="function"||m===n||m===o||m===r||m===c||m===u||m===f||typeof m=="object"&&m!==null&&(m.$$typeof===h||m.$$typeof===d||m.$$typeof===i||m.$$typeof===s||m.$$typeof===l||m.$$typeof===p||m.getModuleId!==void 0)},Ue.typeOf=g,Ue}var qe={};/**
|
26
|
+
* @license React
|
27
|
+
* react-is.development.js
|
28
|
+
*
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
30
|
+
*
|
31
|
+
* This source code is licensed under the MIT license found in the
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
33
|
+
*/var k0;function WT(){return k0||(k0=1,process.env.NODE_ENV!=="production"&&function(){var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=!1,g=!1,m=!1,y=!1,C=!1,w;w=Symbol.for("react.module.reference");function b(G){return!!(typeof G=="string"||typeof G=="function"||G===n||G===o||C||G===r||G===c||G===u||y||G===f||p||g||m||typeof G=="object"&&G!==null&&(G.$$typeof===h||G.$$typeof===d||G.$$typeof===i||G.$$typeof===s||G.$$typeof===l||G.$$typeof===w||G.getModuleId!==void 0))}function S(G){if(typeof G=="object"&&G!==null){var ne=G.$$typeof;switch(ne){case t:var X=G.type;switch(X){case n:case o:case r:case c:case u:return X;default:var W=X&&X.$$typeof;switch(W){case a:case s:case l:case h:case d:case i:return W;default:return ne}}case e:return ne}}}var E=s,x=i,_=t,A=l,O=n,k=h,M=d,I=e,P=o,F=r,z=c,$=u,J=!1,K=!1;function R(G){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1}function Q(G){return K||(K=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1}function se(G){return S(G)===s}function ie(G){return S(G)===i}function de(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ue(G){return S(G)===l}function pe(G){return S(G)===n}function D(G){return S(G)===h}function ce(G){return S(G)===d}function ye(G){return S(G)===e}function be(G){return S(G)===o}function H(G){return S(G)===r}function L(G){return S(G)===c}function He(G){return S(G)===u}qe.ContextConsumer=E,qe.ContextProvider=x,qe.Element=_,qe.ForwardRef=A,qe.Fragment=O,qe.Lazy=k,qe.Memo=M,qe.Portal=I,qe.Profiler=P,qe.StrictMode=F,qe.Suspense=z,qe.SuspenseList=$,qe.isAsyncMode=R,qe.isConcurrentMode=Q,qe.isContextConsumer=se,qe.isContextProvider=ie,qe.isElement=de,qe.isForwardRef=ue,qe.isFragment=pe,qe.isLazy=D,qe.isMemo=ce,qe.isPortal=ye,qe.isProfiler=be,qe.isStrictMode=H,qe.isSuspense=L,qe.isSuspenseList=He,qe.isValidElementType=b,qe.typeOf=S}()),qe}var M0;function KT(){return M0||(M0=1,process.env.NODE_ENV==="production"?Na.exports=qT():Na.exports=WT()),Na.exports}var Fd={},Hd={exports:{}};const Bd=kx(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var P0;function GT(){return P0||(P0=1,(()=>{var t={154:(o,i,s)=>{var a=s(781),l=["write","end","destroy"],c=["resume","pause"],u=["data","close"],d=Array.prototype.slice;o.exports=f;function h(p,g){if(p.forEach)return p.forEach(g);for(var m=0;m<p.length;m++)g(p[m],m)}function f(p,g){var m=new a,y=!1;return h(l,C),h(c,w),h(u,b),g.on("end",S),p.on("drain",function(){m.emit("drain")}),p.on("error",E),g.on("error",E),m.writable=p.writable,m.readable=g.readable,m;function C(x){m[x]=_;function _(){return p[x].apply(p,arguments)}}function w(x){m[x]=_;function _(){m.emit(x);var A=g[x];if(A)return A.apply(g,arguments);g.emit(x)}}function b(x){g.on(x,_);function _(){var A=d.call(arguments);A.unshift(x),m.emit.apply(m,A)}}function S(){if(!y){y=!0;var x=d.call(arguments);x.unshift("end"),m.emit.apply(m,x)}}function E(x){m.emit("error",x)}}},349:(o,i,s)=>{const a=s(147),l=s(781),c=s(796),u=s(154),d=s(530),h=f=>Object.assign({level:9},f);o.exports=(f,p)=>f?d(c.gzip)(f,h(p)).then(g=>g.length).catch(g=>0):Promise.resolve(0),o.exports.sync=(f,p)=>c.gzipSync(f,h(p)).length,o.exports.stream=f=>{const p=new l.PassThrough,g=new l.PassThrough,m=u(p,g);let y=0;const C=c.createGzip(h(f)).on("data",w=>{y+=w.length}).on("error",()=>{m.gzipSize=0}).on("end",()=>{m.gzipSize=y,m.emit("gzip-size",y),g.end()});return p.pipe(C),p.pipe(g,{end:!1}),m},o.exports.file=(f,p)=>new Promise((g,m)=>{const y=a.createReadStream(f);y.on("error",m);const C=y.pipe(o.exports.stream(p));C.on("error",m),C.on("gzip-size",g)}),o.exports.fileSync=(f,p)=>o.exports.sync(a.readFileSync(f),p)},530:o=>{const i=(s,a)=>function(...l){const c=a.promiseModule;return new c((u,d)=>{a.multiArgs?l.push((...h)=>{a.errorFirst?h[0]?d(h):(h.shift(),u(h)):u(h)}):a.errorFirst?l.push((h,f)=>{h?d(h):u(f)}):l.push(u),s.apply(this,l)})};o.exports=(s,a)=>{a=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},a);const l=typeof s;if(!(s!==null&&(l==="object"||l==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${s===null?"null":l}\``);const c=d=>{const h=f=>typeof f=="string"?d===f:f.test(d);return a.include?a.include.some(h):!a.exclude.some(h)};let u;l==="function"?u=function(...d){return a.excludeMain?s(...d):i(s,a).apply(this,d)}:u=Object.create(Object.getPrototypeOf(s));for(const d in s){const h=s[d];u[d]=typeof h=="function"&&c(d)?i(h,a):h}return u}},147:o=>{o.exports=Bd},781:o=>{o.exports=Bd},796:o=>{o.exports=Bd}},e={};function n(o){var i=e[o];if(i!==void 0)return i.exports;var s=e[o]={exports:{}},a=!0;try{t[o](s,s.exports,n),a=!1}finally{a&&delete e[o]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(349);Hd.exports=r})()),Hd.exports}var I0;function JT(){return I0||(I0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BloomFilter",{enumerable:!0,get:function(){return r}});function e(o){let i=0;for(let s=0;s<o.length;s++){const a=o.charCodeAt(s);i=Math.imul(i^a,1540483477),i^=i>>>13,i=Math.imul(i,1540483477)}return i>>>0}const n=1e-4;class r{static from(i,s){s===void 0&&(s=n);const a=new r(i.length,s);for(const l of i)a.add(l);return a}export(){const i={numItems:this.numItems,errorRate:this.errorRate,numBits:this.numBits,numHashes:this.numHashes,bitArray:this.bitArray};if(process.env.NEXT_RUNTIME==="nodejs"&&this.errorRate<n){const s=JSON.stringify(i),a=GT().sync(s);a>1024&&console.warn("Creating filter with error rate less than 0.1% (0.001) can increase the size dramatically proceed with caution. Received error rate "+this.errorRate+" resulted in size "+s.length+" bytes, "+a+" bytes (gzip)")}return i}import(i){this.numItems=i.numItems,this.errorRate=i.errorRate,this.numBits=i.numBits,this.numHashes=i.numHashes,this.bitArray=i.bitArray}add(i){this.getHashValues(i).forEach(a=>{this.bitArray[a]=1})}contains(i){return this.getHashValues(i).every(a=>this.bitArray[a])}getHashValues(i){const s=[];for(let a=1;a<=this.numHashes;a++){const l=e(""+i+a)%this.numBits;s.push(l)}return s}constructor(i,s=n){this.numItems=i,this.errorRate=s,this.numBits=Math.ceil(-(i*Math.log(s))/(Math.log(2)*Math.log(2))),this.numHashes=Math.ceil(this.numBits/i*Math.log(2)),this.bitArray=new Array(this.numBits).fill(0)}}}(Fd)),Fd}var L0;function XT(){return L0||(L0=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(ne,X){for(var W in X)Object.defineProperty(ne,W,{enumerable:!0,get:X[W]})}e(t,{createKey:function(){return H},default:function(){return G},matchesMiddleware:function(){return R}});const n=Nt,r=ki(),o=Mi(),i=CT(),s=_T(),a=r._(r0()),l=OT(),c=sa(),u=n._(TT()),d=Do(),h=wm(),f=Cd(),p=n._(RT()),g=_m(),m=Tm(),y=du(),C=Wm(),w=Ro(),b=Fm(),S=NT(),E=y0(),x=Jm(),_=vu(),A=Im(),O=FT(),k=BT(),M=VT(),I=jT(),P=bu(),F=zT(),z=sm(),$=Mm(),J=UT();function K(){return Object.assign(new Error("Route Cancelled"),{cancelled:!0})}async function R(ne){const X=await Promise.resolve(ne.router.pageLoader.getMiddleware());if(!X)return!1;const{pathname:W}=(0,w.parsePath)(ne.asPath),V=(0,_.hasBasePath)(W)?(0,E.removeBasePath)(W):W,ee=(0,x.addBasePath)((0,b.addLocale)(V,ne.locale));return X.some(Ce=>new RegExp(Ce.regexp).test(ee))}function Q(ne){const X=(0,d.getLocationOrigin)();return ne.startsWith(X)?ne.substring(X.length):ne}function se(ne,X,W){let[V,ee]=(0,A.resolveHref)(ne,X,!0);const Ce=(0,d.getLocationOrigin)(),we=V.startsWith(Ce),Z=ee&&ee.startsWith(Ce);V=Q(V),ee=ee&&Q(ee);const Se=we?V:(0,x.addBasePath)(V),U=W?Q((0,A.resolveHref)(ne,W)):ee||V;return{url:Se,as:Z?U:(0,x.addBasePath)(U)}}function ie(ne,X){const W=(0,o.removeTrailingSlash)((0,l.denormalizePagePath)(ne));return W==="/404"||W==="/_error"?ne:(X.includes(W)||X.some(V=>{if((0,h.isDynamicRoute)(V)&&(0,m.getRouteRegex)(V).re.test(W))return ne=V,!0}),(0,o.removeTrailingSlash)(ne))}function de(ne,X,W){const V={basePath:W.router.basePath,i18n:{locales:W.router.locales},trailingSlash:!!process.env.__NEXT_TRAILING_SLASH},ee=X.headers.get("x-nextjs-rewrite");let Ce=ee||X.headers.get("x-nextjs-matched-path");const we=X.headers.get("x-matched-path");if(we&&!Ce&&!we.includes("__next_data_catchall")&&!we.includes("/_error")&&!we.includes("/404")&&(Ce=we),Ce){if(Ce.startsWith("/")||process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE){const B=(0,f.parseRelativeUrl)(Ce),re=(0,k.getNextPathnameInfo)(B.pathname,{nextConfig:V,parseData:!0});let j=(0,o.removeTrailingSlash)(re.pathname);return Promise.all([W.router.pageLoader.getPageList(),(0,i.getClientBuildManifest)()]).then(te=>{let[fe,{__rewrites:ve}]=te,Ee=(0,b.addLocale)(re.pathname,re.locale);if((0,h.isDynamicRoute)(Ee)||!ee&&fe.includes((0,c.normalizeLocalePath)((0,E.removeBasePath)(Ee),W.router.locales).pathname)){const ze=(0,k.getNextPathnameInfo)((0,f.parseRelativeUrl)(ne).pathname,{nextConfig:process.env.__NEXT_HAS_REWRITES?void 0:V,parseData:!0});Ee=(0,x.addBasePath)(ze.pathname),B.pathname=Ee}if(process.env.__NEXT_HAS_REWRITES){const ze=(0,p.default)(Ee,fe,ve,B.query,q=>ie(q,fe),W.router.locales);ze.matchedPage&&(B.pathname=ze.parsedAs.pathname,Ee=B.pathname,Object.assign(B.query,ze.parsedAs.query))}else if(!fe.includes(j)){const ze=ie(j,fe);ze!==j&&(j=ze)}const Ve=fe.includes(j)?j:ie((0,c.normalizeLocalePath)((0,E.removeBasePath)(B.pathname),W.router.locales).pathname,fe);if((0,h.isDynamicRoute)(Ve)){const ze=(0,g.getRouteMatcher)((0,m.getRouteRegex)(Ve))(Ee);Object.assign(B.query,ze||{})}return{type:"rewrite",parsedAs:B,resolvedHref:Ve}})}const Se=(0,w.parsePath)(ne),U=(0,M.formatNextPathnameInfo)({...(0,k.getNextPathnameInfo)(Se.pathname,{nextConfig:V,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-external",destination:""+U+Se.query+Se.hash})}const Z=X.headers.get("x-nextjs-redirect");if(Z){if(Z.startsWith("/")){const Se=(0,w.parsePath)(Z),U=(0,M.formatNextPathnameInfo)({...(0,k.getNextPathnameInfo)(Se.pathname,{nextConfig:V,parseData:!0}),defaultLocale:W.router.defaultLocale,buildId:""});return Promise.resolve({type:"redirect-internal",newAs:""+U+Se.query+Se.hash,newUrl:""+U+Se.query+Se.hash})}return Promise.resolve({type:"redirect-external",destination:Z})}return Promise.resolve({type:"next"})}async function ue(ne){if(!await R(ne)||!ne.fetchData)return null;const W=await ne.fetchData(),V=await de(W.dataHref,W.response,ne);return{dataHref:W.dataHref,json:W.json,response:W.response,text:W.text,cacheKey:W.cacheKey,effect:V}}const pe=process.env.__NEXT_SCROLL_RESTORATION&&typeof window<"u"&&"scrollRestoration"in window.history&&!!function(){try{let ne="__next";return sessionStorage.setItem(ne,ne),sessionStorage.removeItem(ne),!0}catch{}}(),D=Symbol("SSG_DATA_NOT_FOUND");function ce(ne,X,W){return fetch(ne,{credentials:"same-origin",method:W.method||"GET",headers:Object.assign({},W.headers,{"x-nextjs-data":"1"})}).then(V=>!V.ok&&X>1&&V.status>=500?ce(ne,X-1,W):V)}function ye(ne){try{return JSON.parse(ne)}catch{return null}}function be(ne){let{dataHref:X,inflightCache:W,isPrefetch:V,hasMiddleware:ee,isServerRender:Ce,parseJSON:we,persistCache:Z,isBackground:Se,unstable_skipClientCache:U}=ne;const{href:B}=new URL(X,window.location.href),re=j=>{var te;return ce(X,Ce?3:1,{headers:Object.assign({},V?{purpose:"prefetch"}:{},V&&ee?{"x-middleware-prefetch":"1"}:{}),method:(te=j==null?void 0:j.method)!=null?te:"GET"}).then(fe=>fe.ok&&(j==null?void 0:j.method)==="HEAD"?{dataHref:X,response:fe,text:"",json:{},cacheKey:B}:fe.text().then(ve=>{if(!fe.ok){if(ee&&[301,302,307,308].includes(fe.status))return{dataHref:X,response:fe,text:ve,json:{},cacheKey:B};if(fe.status===404){var Ee;if((Ee=ye(ve))!=null&&Ee.notFound)return{dataHref:X,json:{notFound:D},response:fe,text:ve,cacheKey:B}}const Ve=new Error("Failed to load static props");throw Ce||(0,i.markAssetError)(Ve),Ve}return{dataHref:X,json:we?ye(ve):null,response:fe,text:ve,cacheKey:B}})).then(fe=>((!Z||process.env.NODE_ENV!=="production"||fe.response.headers.get("x-middleware-cache")==="no-cache")&&delete W[B],fe)).catch(fe=>{throw U||delete W[B],(fe.message==="Failed to fetch"||fe.message==="NetworkError when attempting to fetch resource."||fe.message==="Load failed")&&(0,i.markAssetError)(fe),fe})};return U&&Z?re({}).then(j=>(j.response.headers.get("x-middleware-cache")!=="no-cache"&&(W[B]=Promise.resolve(j)),j)):W[B]!==void 0?W[B]:W[B]=re(Se?{method:"HEAD"}:{})}function H(){return Math.random().toString(36).slice(2,10)}function L(ne){let{url:X,router:W}=ne;if(X===(0,x.addBasePath)((0,b.addLocale)(W.asPath,W.locale)))throw new Error("Invariant: attempted to hard navigate to the same URL "+X+" "+location.href);window.location.href=X}const He=ne=>{let{route:X,router:W}=ne,V=!1;const ee=W.clc=()=>{V=!0};return()=>{if(V){const we=new Error('Abort fetching component for route: "'+X+'"');throw we.cancelled=!0,we}ee===W.clc&&(W.clc=null)}};class G{reload(){window.location.reload()}back(){window.history.back()}forward(){window.history.forward()}push(X,W,V){if(V===void 0&&(V={}),process.env.__NEXT_SCROLL_RESTORATION&&pe)try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}return{url:X,as:W}=se(this,X,W),this.change("pushState",X,W,V)}replace(X,W,V){return V===void 0&&(V={}),{url:X,as:W}=se(this,X,W),this.change("replaceState",X,W,V)}async _bfl(X,W,V,ee){if(process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){let Se=!1,U=!1;for(const B of[X,W])if(B){const re=(0,o.removeTrailingSlash)(new URL(B,"http://n").pathname),j=(0,x.addBasePath)((0,b.addLocale)(re,V||this.locale));if(re!==(0,o.removeTrailingSlash)(new URL(this.asPath,"http://n").pathname)){var Ce,we;Se=Se||!!((Ce=this._bfl_s)!=null&&Ce.contains(re))||!!((we=this._bfl_s)!=null&&we.contains(j));for(const te of[re,j]){const fe=te.split("/");for(let ve=0;!U&&ve<fe.length+1;ve++){var Z;const Ee=fe.slice(0,ve).join("/");if(Ee&&((Z=this._bfl_d)!=null&&Z.contains(Ee))){U=!0;break}}}if(Se||U)return ee?!0:(L({url:(0,x.addBasePath)((0,b.addLocale)(X,V||this.locale,this.defaultLocale)),router:this}),new Promise(()=>{}))}}}return!1}async change(X,W,V,ee,Ce){var we;if(!(0,P.isLocalURL)(W))return L({url:W,router:this}),!1;const Z=ee._h===1;!Z&&!ee.shallow&&await this._bfl(V,void 0,ee.locale);let Se=Z||ee._shouldResolveHref||(0,w.parsePath)(W).pathname===(0,w.parsePath)(V).pathname;const U={...this.state},B=this.isReady!==!0;this.isReady=!0;const re=this.isSsr;if(Z||(this.isSsr=!1),Z&&this.clc)return!1;const j=U.locale;if(process.env.__NEXT_I18N_SUPPORT){U.locale=ee.locale===!1?this.defaultLocale:ee.locale||U.locale,typeof ee.locale>"u"&&(ee.locale=U.locale);const _e=(0,f.parseRelativeUrl)((0,_.hasBasePath)(V)?(0,E.removeBasePath)(V):V),nn=(0,c.normalizeLocalePath)(_e.pathname,this.locales);nn.detectedLocale&&(U.locale=nn.detectedLocale,_e.pathname=(0,x.addBasePath)(_e.pathname),V=(0,y.formatWithValidation)(_e),W=(0,x.addBasePath)((0,c.normalizeLocalePath)((0,_.hasBasePath)(W)?(0,E.removeBasePath)(W):W,this.locales).pathname));let Vn=!1;if(process.env.__NEXT_I18N_SUPPORT){var te;(te=this.locales)!=null&&te.includes(U.locale)||(_e.pathname=(0,b.addLocale)(_e.pathname,U.locale),L({url:(0,y.formatWithValidation)(_e),router:this}),Vn=!0)}const Vt=(0,C.detectDomainLocale)(this.domainLocales,void 0,U.locale);if(process.env.__NEXT_I18N_SUPPORT&&!Vn&&Vt&&this.isLocaleDomain&&self.location.hostname!==Vt.domain){const Po=(0,E.removeBasePath)(V);L({url:"http"+(Vt.http?"":"s")+"://"+Vt.domain+(0,x.addBasePath)((U.locale===Vt.defaultLocale?"":"/"+U.locale)+(Po==="/"?"":Po)||"/"),router:this}),Vn=!0}if(Vn)return new Promise(()=>{})}d.ST&&performance.mark("routeChange");const{shallow:fe=!1,scroll:ve=!0}=ee,Ee={shallow:fe};this._inFlightRoute&&this.clc&&(re||G.events.emit("routeChangeError",K(),this._inFlightRoute,Ee),this.clc(),this.clc=null),V=(0,x.addBasePath)((0,b.addLocale)((0,_.hasBasePath)(V)?(0,E.removeBasePath)(V):V,ee.locale,this.defaultLocale));const Ve=(0,S.removeLocale)((0,_.hasBasePath)(V)?(0,E.removeBasePath)(V):V,U.locale);this._inFlightRoute=V;const ze=j!==U.locale;if(!Z&&this.onlyAHashChange(Ve)&&!ze){U.asPath=Ve,G.events.emit("hashChangeStart",V,Ee),this.changeState(X,W,V,{...ee,scroll:!1}),ve&&this.scrollToHash(Ve);try{await this.set(U,this.components[U.route],null)}catch(_e){throw(0,a.default)(_e)&&_e.cancelled&&G.events.emit("routeChangeError",_e,Ve,Ee),_e}return G.events.emit("hashChangeComplete",V,Ee),!0}let q=(0,f.parseRelativeUrl)(W),{pathname:ae,query:ge}=q,Me,ke;try{[Me,{__rewrites:ke}]=await Promise.all([this.pageLoader.getPageList(),(0,i.getClientBuildManifest)(),this.pageLoader.getMiddleware()])}catch{return L({url:V,router:this}),!1}!this.urlIsNew(Ve)&&!ze&&(X="replaceState");let je=V;ae=ae&&(0,o.removeTrailingSlash)((0,E.removeBasePath)(ae));let Ae=(0,o.removeTrailingSlash)(ae);const Ze=V.startsWith("/")&&(0,f.parseRelativeUrl)(V).pathname;if((we=this.components[ae])!=null&&we.__appRouter)return L({url:V,router:this}),new Promise(()=>{});const $n=!!(Ze&&Ae!==Ze&&(!(0,h.isDynamicRoute)(Ae)||!(0,g.getRouteMatcher)((0,m.getRouteRegex)(Ae))(Ze))),it=!ee.shallow&&await R({asPath:V,locale:U.locale,router:this});if(Z&&it&&(Se=!1),Se&&ae!=="/_error")if(ee._shouldResolveHref=!0,process.env.__NEXT_HAS_REWRITES&&V.startsWith("/")){const _e=(0,p.default)((0,x.addBasePath)((0,b.addLocale)(Ve,U.locale),!0),Me,ke,ge,nn=>ie(nn,Me),this.locales);if(_e.externalDest)return L({url:V,router:this}),!0;it||(je=_e.asPath),_e.matchedPage&&_e.resolvedHref&&(ae=_e.resolvedHref,q.pathname=(0,x.addBasePath)(ae),it||(W=(0,y.formatWithValidation)(q)))}else q.pathname=ie(ae,Me),q.pathname!==ae&&(ae=q.pathname,q.pathname=(0,x.addBasePath)(ae),it||(W=(0,y.formatWithValidation)(q)));if(!(0,P.isLocalURL)(V)){if(process.env.NODE_ENV!=="production")throw new Error('Invalid href: "'+W+'" and as: "'+V+`", received relative href and external as
|
34
|
+
See more info: https://nextjs.org/docs/messages/invalid-relative-url-external-as`);return L({url:V,router:this}),!1}je=(0,S.removeLocale)((0,E.removeBasePath)(je),U.locale),Ae=(0,o.removeTrailingSlash)(ae);let kt=!1;if((0,h.isDynamicRoute)(Ae)){const _e=(0,f.parseRelativeUrl)(je),nn=_e.pathname,Vn=(0,m.getRouteRegex)(Ae);kt=(0,g.getRouteMatcher)(Vn)(nn);const Vt=Ae===nn,Po=Vt?(0,$.interpolateAs)(Ae,nn,ge):{};if(!kt||Vt&&!Po.result){const Io=Object.keys(Vn.groups).filter(Oi=>!ge[Oi]&&!Vn.groups[Oi].optional);if(Io.length>0&&!it)throw process.env.NODE_ENV!=="production"&&console.warn((Vt?"Interpolating href":"Mismatching `as` and `href`")+" failed to manually provide "+("the params: "+Io.join(", ")+" in the `href`'s `query`")),new Error((Vt?"The provided `href` ("+W+") value is missing query values ("+Io.join(", ")+") to be interpolated properly. ":"The provided `as` value ("+nn+") is incompatible with the `href` value ("+Ae+"). ")+("Read more: https://nextjs.org/docs/messages/"+(Vt?"href-interpolation-failed":"incompatible-href-as")))}else Vt?V=(0,y.formatWithValidation)(Object.assign({},_e,{pathname:Po.result,query:(0,z.omit)(ge,Po.params)})):Object.assign(ge,kt)}Z||G.events.emit("routeChangeStart",V,Ee);const ar=this.pathname==="/404"||this.pathname==="/_error";try{var st,lr,Ai;let _e=await this.getRouteInfo({route:Ae,pathname:ae,query:ge,as:V,resolvedAs:je,routeProps:Ee,locale:U.locale,isPreview:U.isPreview,hasMiddleware:it,unstable_skipClientCache:ee.unstable_skipClientCache,isQueryUpdating:Z&&!this.isFallback,isMiddlewareRewrite:$n});if(!Z&&!ee.shallow&&await this._bfl(V,"resolvedAs"in _e?_e.resolvedAs:void 0,U.locale),"route"in _e&&it){ae=_e.route||Ae,Ae=ae,Ee.shallow||(ge=Object.assign({},_e.query||{},ge));const vt=(0,_.hasBasePath)(q.pathname)?(0,E.removeBasePath)(q.pathname):q.pathname;if(kt&&ae!==vt&&Object.keys(kt).forEach(Xt=>{kt&&ge[Xt]===kt[Xt]&&delete ge[Xt]}),(0,h.isDynamicRoute)(ae)){let Wr=!Ee.shallow&&_e.resolvedAs?_e.resolvedAs:(0,x.addBasePath)((0,b.addLocale)(new URL(V,location.href).pathname,U.locale),!0);if((0,_.hasBasePath)(Wr)&&(Wr=(0,E.removeBasePath)(Wr)),process.env.__NEXT_I18N_SUPPORT){const W_=(0,c.normalizeLocalePath)(Wr,this.locales);U.locale=W_.detectedLocale||U.locale,Wr=W_.pathname}const Ng=(0,m.getRouteRegex)(ae),q_=(0,g.getRouteMatcher)(Ng)(new URL(Wr,location.href).pathname);q_&&Object.assign(ge,q_)}}if("type"in _e)return _e.type==="redirect-internal"?this.change(X,_e.newUrl,_e.newAs,ee):(L({url:_e.destination,router:this}),new Promise(()=>{}));const nn=_e.Component;if(nn&&nn.unstable_scriptLoader&&[].concat(nn.unstable_scriptLoader()).forEach(Xt=>{(0,s.handleClientScriptLoad)(Xt.props)}),(_e.__N_SSG||_e.__N_SSP)&&_e.props){if(_e.props.pageProps&&_e.props.pageProps.__N_REDIRECT){ee.locale=!1;const vt=_e.props.pageProps.__N_REDIRECT;if(vt.startsWith("/")&&_e.props.pageProps.__N_REDIRECT_BASE_PATH!==!1){const Xt=(0,f.parseRelativeUrl)(vt);Xt.pathname=ie(Xt.pathname,Me);const{url:Wr,as:Ng}=se(this,vt,vt);return this.change(X,Wr,Ng,ee)}return L({url:vt,router:this}),new Promise(()=>{})}if(U.isPreview=!!_e.props.__N_PREVIEW,_e.props.notFound===D){let vt;try{await this.fetchComponent("/404"),vt="/404"}catch{vt="/_error"}if(_e=await this.getRouteInfo({route:vt,pathname:vt,query:ge,as:V,resolvedAs:je,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isNotFound:!0}),"type"in _e)throw new Error("Unexpected middleware effect on /404")}}Z&&this.pathname==="/_error"&&((lr=self.__NEXT_DATA__.props)==null||(st=lr.pageProps)==null?void 0:st.statusCode)===500&&((Ai=_e.props)!=null&&Ai.pageProps)&&(_e.props.pageProps.statusCode=500);var Mo;const Vn=ee.shallow&&U.route===((Mo=_e.route)!=null?Mo:Ae);var V_;const Vt=(V_=ee.scroll)!=null?V_:!Z&&!Vn,Io=Ce??(Vt?{x:0,y:0}:null),Oi={...U,route:Ae,pathname:ae,query:ge,asPath:Ve,isFallback:!1};if(Z&&ar){var j_,z_,U_;if(_e=await this.getRouteInfo({route:this.pathname,pathname:this.pathname,query:ge,as:V,resolvedAs:je,routeProps:{shallow:!1},locale:U.locale,isPreview:U.isPreview,isQueryUpdating:Z&&!this.isFallback}),"type"in _e)throw new Error("Unexpected middleware effect on "+this.pathname);this.pathname==="/_error"&&((z_=self.__NEXT_DATA__.props)==null||(j_=z_.pageProps)==null?void 0:j_.statusCode)===500&&((U_=_e.props)!=null&&U_.pageProps)&&(_e.props.pageProps.statusCode=500);try{await this.set(Oi,_e,Io)}catch(vt){throw(0,a.default)(vt)&&vt.cancelled&&G.events.emit("routeChangeError",vt,Ve,Ee),vt}return!0}if(G.events.emit("beforeHistoryChange",V,Ee),this.changeState(X,W,V,ee),!(Z&&!Io&&!B&&!ze&&(0,I.compareRouterStates)(Oi,this.state))){try{await this.set(Oi,_e,Io)}catch(Xt){if(Xt.cancelled)_e.error=_e.error||Xt;else throw Xt}if(_e.error)throw Z||G.events.emit("routeChangeError",_e.error,Ve,Ee),_e.error;process.env.__NEXT_I18N_SUPPORT&&U.locale&&(document.documentElement.lang=U.locale),Z||G.events.emit("routeChangeComplete",V,Ee),Vt&&/#.+$/.test(V)&&this.scrollToHash(V)}return!0}catch(_e){if((0,a.default)(_e)&&_e.cancelled)return!1;throw _e}}changeState(X,W,V,ee){if(ee===void 0&&(ee={}),process.env.NODE_ENV!=="production"){if(typeof window.history>"u"){console.error("Warning: window.history is not available.");return}if(typeof window.history[X]>"u"){console.error("Warning: window.history."+X+" is not available");return}}(X!=="pushState"||(0,d.getURL)()!==V)&&(this._shallow=ee.shallow,window.history[X]({url:W,as:V,options:ee,__N:!0,key:this._key=X!=="pushState"?this._key:H()},"",V))}async handleRouteInfoError(X,W,V,ee,Ce,we){if(console.error(X),X.cancelled)throw X;if((0,i.isAssetError)(X)||we)throw G.events.emit("routeChangeError",X,ee,Ce),L({url:ee,router:this}),K();try{let Z;const{page:Se,styleSheets:U}=await this.fetchComponent("/_error"),B={props:Z,Component:Se,styleSheets:U,err:X,error:X};if(!B.props)try{B.props=await this.getInitialProps(Se,{err:X,pathname:W,query:V})}catch(re){console.error("Error in error page `getInitialProps`: ",re),B.props={}}return B}catch(Z){return this.handleRouteInfoError((0,a.default)(Z)?Z:new Error(Z+""),W,V,ee,Ce,!0)}}async getRouteInfo(X){let{route:W,pathname:V,query:ee,as:Ce,resolvedAs:we,routeProps:Z,locale:Se,hasMiddleware:U,isPreview:B,unstable_skipClientCache:re,isQueryUpdating:j,isMiddlewareRewrite:te,isNotFound:fe}=X,ve=W;try{var Ee,Ve,ze,q;let ae=this.components[ve];if(Z.shallow&&ae&&this.route===ve)return ae;const ge=He({route:ve,router:this});U&&(ae=void 0);let Me=ae&&!("initial"in ae)&&process.env.NODE_ENV!=="development"?ae:void 0;const ke=j,je={dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:V,query:ee}),skipInterpolation:!0,asPath:fe?"/404":we,locale:Se}),hasMiddleware:!0,isServerRender:this.isSsr,parseJSON:!0,inflightCache:ke?this.sbc:this.sdc,persistCache:!B,isPrefetch:!1,unstable_skipClientCache:re,isBackground:ke};let Ae=j&&!te?null:await ue({fetchData:()=>be(je),asPath:fe?"/404":we,locale:Se,router:this}).catch(st=>{if(j)return null;throw st});if(Ae&&(V==="/_error"||V==="/404")&&(Ae.effect=void 0),j&&(Ae?Ae.json=self.__NEXT_DATA__.props:Ae={json:self.__NEXT_DATA__.props}),ge(),(Ae==null||(Ee=Ae.effect)==null?void 0:Ee.type)==="redirect-internal"||(Ae==null||(Ve=Ae.effect)==null?void 0:Ve.type)==="redirect-external")return Ae.effect;if((Ae==null||(ze=Ae.effect)==null?void 0:ze.type)==="rewrite"){const st=(0,o.removeTrailingSlash)(Ae.effect.resolvedHref),lr=await this.pageLoader.getPageList();if((!j||lr.includes(st))&&(ve=st,V=Ae.effect.resolvedHref,ee={...ee,...Ae.effect.parsedAs.query},we=(0,E.removeBasePath)((0,c.normalizeLocalePath)(Ae.effect.parsedAs.pathname,this.locales).pathname),ae=this.components[ve],Z.shallow&&ae&&this.route===ve&&!U))return{...ae,route:ve}}if((0,O.isAPIRoute)(ve))return L({url:Ce,router:this}),new Promise(()=>{});const Ze=Me||await this.fetchComponent(ve).then(st=>({Component:st.page,styleSheets:st.styleSheets,__N_SSG:st.mod.__N_SSG,__N_SSP:st.mod.__N_SSP}));if(process.env.NODE_ENV!=="production"){const{isValidElementType:st}=KT();if(!st(Ze.Component))throw new Error('The default export is not a React Component in page: "'+V+'"')}const $n=Ae==null||(q=Ae.response)==null?void 0:q.headers.get("x-middleware-skip"),it=Ze.__N_SSG||Ze.__N_SSP;$n&&(Ae!=null&&Ae.dataHref)&&delete this.sdc[Ae.dataHref];const{props:kt,cacheKey:ar}=await this._getData(async()=>{if(it){if(Ae!=null&&Ae.json&&!$n)return{cacheKey:Ae.cacheKey,props:Ae.json};const st=Ae!=null&&Ae.dataHref?Ae.dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:V,query:ee}),asPath:we,locale:Se}),lr=await be({dataHref:st,isServerRender:this.isSsr,parseJSON:!0,inflightCache:$n?{}:this.sdc,persistCache:!B,isPrefetch:!1,unstable_skipClientCache:re});return{cacheKey:lr.cacheKey,props:lr.json||{}}}return{headers:{},props:await this.getInitialProps(Ze.Component,{pathname:V,query:ee,asPath:Ce,locale:Se,locales:this.locales,defaultLocale:this.defaultLocale})}});return Ze.__N_SSP&&je.dataHref&&ar&&delete this.sdc[ar],!this.isPreview&&Ze.__N_SSG&&process.env.NODE_ENV!=="development"&&!j&&be(Object.assign({},je,{isBackground:!0,persistCache:!1,inflightCache:this.sbc})).catch(()=>{}),kt.pageProps=Object.assign({},kt.pageProps),Ze.props=kt,Ze.route=ve,Ze.query=ee,Ze.resolvedAs=we,this.components[ve]=Ze,Ze}catch(ae){return this.handleRouteInfoError((0,a.getProperError)(ae),V,ee,Ce,Z)}}set(X,W,V){return this.state=X,this.sub(W,this.components["/_app"].Component,V)}beforePopState(X){this._bps=X}onlyAHashChange(X){if(!this.asPath)return!1;const[W,V]=this.asPath.split("#",2),[ee,Ce]=X.split("#",2);return Ce&&W===ee&&V===Ce?!0:W!==ee?!1:V!==Ce}scrollToHash(X){const[,W=""]=X.split("#",2);(0,J.handleSmoothScroll)(()=>{if(W===""||W==="top"){window.scrollTo(0,0);return}const V=decodeURIComponent(W),ee=document.getElementById(V);if(ee){ee.scrollIntoView();return}const Ce=document.getElementsByName(V)[0];Ce&&Ce.scrollIntoView()},{onlyHashChange:this.onlyAHashChange(X)})}urlIsNew(X){return this.asPath!==X}async prefetch(X,W,V){if(W===void 0&&(W=X),V===void 0&&(V={}),process.env.NODE_ENV!=="production"||typeof window<"u"&&(0,F.isBot)(window.navigator.userAgent))return;let ee=(0,f.parseRelativeUrl)(X);const Ce=ee.pathname;let{pathname:we,query:Z}=ee;const Se=we;if(process.env.__NEXT_I18N_SUPPORT&&V.locale===!1){we=(0,c.normalizeLocalePath)(we,this.locales).pathname,ee.pathname=we,X=(0,y.formatWithValidation)(ee);let ve=(0,f.parseRelativeUrl)(W);const Ee=(0,c.normalizeLocalePath)(ve.pathname,this.locales);ve.pathname=Ee.pathname,V.locale=Ee.detectedLocale||this.defaultLocale,W=(0,y.formatWithValidation)(ve)}const U=await this.pageLoader.getPageList();let B=W;const re=typeof V.locale<"u"?V.locale||void 0:this.locale,j=await R({asPath:W,locale:re,router:this});if(process.env.__NEXT_HAS_REWRITES&&W.startsWith("/")){let ve;({__rewrites:ve}=await(0,i.getClientBuildManifest)());const Ee=(0,p.default)((0,x.addBasePath)((0,b.addLocale)(W,this.locale),!0),U,ve,ee.query,Ve=>ie(Ve,U),this.locales);if(Ee.externalDest)return;j||(B=(0,S.removeLocale)((0,E.removeBasePath)(Ee.asPath),this.locale)),Ee.matchedPage&&Ee.resolvedHref&&(we=Ee.resolvedHref,ee.pathname=we,j||(X=(0,y.formatWithValidation)(ee)))}ee.pathname=ie(ee.pathname,U),(0,h.isDynamicRoute)(ee.pathname)&&(we=ee.pathname,ee.pathname=we,Object.assign(Z,(0,g.getRouteMatcher)((0,m.getRouteRegex)(ee.pathname))((0,w.parsePath)(W).pathname)||{}),j||(X=(0,y.formatWithValidation)(ee)));const te=process.env.__NEXT_MIDDLEWARE_PREFETCH==="strict"?null:await ue({fetchData:()=>be({dataHref:this.pageLoader.getDataHref({href:(0,y.formatWithValidation)({pathname:Se,query:Z}),skipInterpolation:!0,asPath:B,locale:re}),hasMiddleware:!0,isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0}),asPath:W,locale:re,router:this});if((te==null?void 0:te.effect.type)==="rewrite"&&(ee.pathname=te.effect.resolvedHref,we=te.effect.resolvedHref,Z={...Z,...te.effect.parsedAs.query},B=te.effect.parsedAs.pathname,X=(0,y.formatWithValidation)(ee)),(te==null?void 0:te.effect.type)==="redirect-external")return;const fe=(0,o.removeTrailingSlash)(we);await this._bfl(W,B,V.locale,!0)&&(this.components[Ce]={__appRouter:!0}),await Promise.all([this.pageLoader._isSsg(fe).then(ve=>ve?be({dataHref:te!=null&&te.json?te==null?void 0:te.dataHref:this.pageLoader.getDataHref({href:X,asPath:B,locale:re}),isServerRender:!1,parseJSON:!0,inflightCache:this.sdc,persistCache:!this.isPreview,isPrefetch:!0,unstable_skipClientCache:V.unstable_skipClientCache||V.priority&&!!process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE}).then(()=>!1).catch(()=>!1):!1),this.pageLoader[V.priority?"loadPage":"prefetch"](fe)])}async fetchComponent(X){const W=He({route:X,router:this});try{const V=await this.pageLoader.loadPage(X);return W(),V}catch(V){throw W(),V}}_getData(X){let W=!1;const V=()=>{W=!0};return this.clc=V,X().then(ee=>{if(V===this.clc&&(this.clc=null),W){const Ce=new Error("Loading initial props cancelled");throw Ce.cancelled=!0,Ce}return ee})}_getFlightData(X){return be({dataHref:X,isServerRender:!0,parseJSON:!1,inflightCache:this.sdc,persistCache:!1,isPrefetch:!1}).then(W=>{let{text:V}=W;return{data:V}})}getInitialProps(X,W){const{Component:V}=this.components["/_app"],ee=this._wrapApp(V);return W.AppTree=ee,(0,d.loadGetInitialProps)(V,{AppTree:ee,Component:X,router:this,ctx:W})}get route(){return this.state.route}get pathname(){return this.state.pathname}get query(){return this.state.query}get asPath(){return this.state.asPath}get locale(){return this.state.locale}get isFallback(){return this.state.isFallback}get isPreview(){return this.state.isPreview}constructor(X,W,V,{initialProps:ee,pageLoader:Ce,App:we,wrapApp:Z,Component:Se,err:U,subscription:B,isFallback:re,locale:j,locales:te,defaultLocale:fe,domainLocales:ve,isPreview:Ee}){this.sdc={},this.sbc={},this.isFirstPopStateEvent=!0,this._key=H(),this.onPopState=q=>{const{isFirstPopStateEvent:ae}=this;this.isFirstPopStateEvent=!1;const ge=q.state;if(!ge){const{pathname:it,query:kt}=this;this.changeState("replaceState",(0,y.formatWithValidation)({pathname:(0,x.addBasePath)(it),query:kt}),(0,d.getURL)());return}if(ge.__NA){window.location.reload();return}if(!ge.__N||ae&&this.locale===ge.options.locale&&ge.as===this.asPath)return;let Me;const{url:ke,as:je,options:Ae,key:Ze}=ge;if(process.env.__NEXT_SCROLL_RESTORATION&&pe&&this._key!==Ze){try{sessionStorage.setItem("__next_scroll_"+this._key,JSON.stringify({x:self.pageXOffset,y:self.pageYOffset}))}catch{}try{const it=sessionStorage.getItem("__next_scroll_"+Ze);Me=JSON.parse(it)}catch{Me={x:0,y:0}}}this._key=Ze;const{pathname:$n}=(0,f.parseRelativeUrl)(ke);this.isSsr&&je===(0,x.addBasePath)(this.asPath)&&$n===(0,x.addBasePath)(this.pathname)||this._bps&&!this._bps(ge)||this.change("replaceState",ke,je,Object.assign({},Ae,{shallow:Ae.shallow&&this._shallow,locale:Ae.locale||this.defaultLocale,_h:0}),Me)};const Ve=(0,o.removeTrailingSlash)(X);if(this.components={},X!=="/_error"&&(this.components[Ve]={Component:Se,initial:!0,props:ee,err:U,__N_SSG:ee&&ee.__N_SSG,__N_SSP:ee&&ee.__N_SSP}),this.components["/_app"]={Component:we,styleSheets:[]},process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED){const{BloomFilter:q}=JT(),ae=process.env.__NEXT_CLIENT_ROUTER_S_FILTER,ge=ae||void 0,Me=process.env.__NEXT_CLIENT_ROUTER_D_FILTER,ke=Me||void 0;ge!=null&&ge.numHashes&&(this._bfl_s=new q(ge.numItems,ge.errorRate),this._bfl_s.import(ge)),ke!=null&&ke.numHashes&&(this._bfl_d=new q(ke.numItems,ke.errorRate),this._bfl_d.import(ke))}this.events=G.events,this.pageLoader=Ce;const ze=(0,h.isDynamicRoute)(X)&&self.__NEXT_DATA__.autoExport;if(this.basePath=process.env.__NEXT_ROUTER_BASEPATH||"",this.sub=B,this.clc=null,this._wrapApp=Z,this.isSsr=!0,this.isLocaleDomain=!1,this.isReady=!!(self.__NEXT_DATA__.gssp||self.__NEXT_DATA__.gip||self.__NEXT_DATA__.isExperimentalCompile||self.__NEXT_DATA__.appGip&&!self.__NEXT_DATA__.gsp||!ze&&!self.location.search&&!process.env.__NEXT_HAS_REWRITES),process.env.__NEXT_I18N_SUPPORT&&(this.locales=te,this.defaultLocale=fe,this.domainLocales=ve,this.isLocaleDomain=!!(0,C.detectDomainLocale)(ve,self.location.hostname)),this.state={route:Ve,pathname:X,query:W,asPath:ze?X:V,isPreview:!!Ee,locale:process.env.__NEXT_I18N_SUPPORT?j:void 0,isFallback:re},this._initialMatchesMiddlewarePromise=Promise.resolve(!1),typeof window<"u"){if(!V.startsWith("//")){const q={locale:j},ae=(0,d.getURL)();this._initialMatchesMiddlewarePromise=R({router:this,locale:j,asPath:ae}).then(ge=>(q._shouldResolveHref=V!==X,this.changeState("replaceState",ge?ae:(0,y.formatWithValidation)({pathname:(0,x.addBasePath)(X),query:W}),ae,q),ge))}window.addEventListener("popstate",this.onPopState),process.env.__NEXT_SCROLL_RESTORATION&&pe&&(window.history.scrollRestoration="manual")}}}G.events=(0,u.default)()}(fd)),fd}var Fa={exports:{}},D0;function YT(){return D0||(D0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const n=Ti,r=N0();function o(i){function s(a){return(0,n.jsx)(i,{router:(0,r.useRouter)(),...a})}if(s.getInitialProps=i.getInitialProps,s.origGetInitialProps=i.origGetInitialProps,process.env.NODE_ENV!=="production"){const a=i.displayName||i.name||"Unknown";s.displayName="withRouter("+a+")"}return s}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Fa,Fa.exports)),Fa.exports}var R0;function N0(){return R0||(R0=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});function n(C,w){for(var b in w)Object.defineProperty(C,b,{enumerable:!0,get:w[b]})}n(e,{Router:function(){return i.default},createRouter:function(){return m},default:function(){return p},makePublicRouterInstance:function(){return y},useRouter:function(){return g},withRouter:function(){return l.default}});const r=Nt,o=r._(T),i=r._(XT()),s=Nu(),a=r._(r0()),l=r._(YT()),c={router:null,readyCallbacks:[],ready(C){if(this.router)return C();typeof window<"u"&&this.readyCallbacks.push(C)}},u=["pathname","route","query","asPath","components","isFallback","basePath","locale","locales","defaultLocale","isReady","isPreview","isLocaleDomain","domainLocales"],d=["routeChangeStart","beforeHistoryChange","routeChangeComplete","routeChangeError","hashChangeStart","hashChangeComplete"],h=["push","replace","reload","back","prefetch","beforePopState"];Object.defineProperty(c,"events",{get(){return i.default.events}});function f(){if(!c.router){const C=`No router instance found.
|
35
|
+
You should only use "next/router" on the client side of your app.
|
36
|
+
`;throw new Error(C)}return c.router}u.forEach(C=>{Object.defineProperty(c,C,{get(){return f()[C]}})}),h.forEach(C=>{c[C]=function(){for(var w=arguments.length,b=new Array(w),S=0;S<w;S++)b[S]=arguments[S];return f()[C](...b)}}),d.forEach(C=>{c.ready(()=>{i.default.events.on(C,function(){for(var w=arguments.length,b=new Array(w),S=0;S<w;S++)b[S]=arguments[S];const E="on"+C.charAt(0).toUpperCase()+C.substring(1),x=c;if(x[E])try{x[E](...b)}catch(_){console.error("Error when running the Router event: "+E),console.error((0,a.default)(_)?_.message+`
|
37
|
+
`+_.stack:_+"")}})})});const p=c;function g(){const C=o.default.useContext(s.RouterContext);if(!C)throw new Error("NextRouter was not mounted. https://nextjs.org/docs/messages/next-router-not-mounted");return C}function m(){for(var C=arguments.length,w=new Array(C),b=0;b<C;b++)w[b]=arguments[b];return c.router=new i.default(...w),c.readyCallbacks.forEach(S=>S()),c.readyCallbacks=[],c.router}function y(C){const w=C,b={};for(const S of u){if(typeof w[S]=="object"){b[S]=Object.assign(Array.isArray(w[S])?[]:{},w[S]);continue}b[S]=w[S]}return b.events=i.default.events,h.forEach(S=>{b[S]=function(){for(var E=arguments.length,x=new Array(E),_=0;_<E;_++)x[_]=arguments[_];return w[S](...x)}}),b}(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Ta,Ta.exports)),Ta.exports}N0();function QT({label:t,withFeedbackLabel:e=!0,showCorrectFeedback:n=!1,customFeedbackLabel:r,solid:o=!1,required:i=!1,fullWidth:s,...a}){const l=a.name??"";return v.jsxs("div",{dflex:!0,flexCol:!0,...a,children:[t&&v.jsx(zn,{name:l,label:t,required:i}),v.jsx(Je.FastField,{name:l,children:({field:c,form:u})=>v.jsx(ZT,{name:l,field:c,form:u,label:t,withFeedbackLabel:e,showCorrectFeedback:n,customFeedbackLabel:r,fullWidth:s,...a})})]})}function ZT({name:t,field:e,form:n,label:r,withFeedbackLabel:o,showCorrectFeedback:i=!1,customFeedbackLabel:s,fullWidth:a,...l}){e.value==null&&console.warn(`Input: Value for field ${e.name} is null`);const[c,u]=T.useState(e.value),d=vT(c,300),{errors:h,touched:f}=n,{isError:p,isTouched:g,error:m}=pr(t,h,f),y={...l,...g&&p?{borderColor:"red"}:{}};return T.useEffect(()=>{n.setFieldValue(t,d)},[t,d,n]),v.jsxs(v.Fragment,{children:[v.jsx(N.Input,{w:a?"full":void 0,scheme:"default",lineHeight:"normal",transition:"all",...e,...y,value:c,onChange:C=>u(C.target.value)}),o&&v.jsx(hr,{error:m,touched:g,label:r,customFeedbackLabel:s,showCorrectFeedback:i})]})}function Ha({children:t,...e}){return v.jsx("div",{dflex:!0,placeContent:"center",alignItems:"center",...e,children:t})}function gr({...t}){const e=T.useCallback(n=>{n.preventDefault(),n.stopPropagation()},[]);return v.jsx("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",py:"16",cursor:"not-allowed",onClick:e,...t,children:v.jsx(N.Spinner,{size:"x2"})})}function ji(){return v.jsx(gr,{bgColor:"black",bgOpacity:"30",position:"absolute",top:"0",start:"0",bottom:"0",w:"100%",h:"100%"})}const ek="Oops, something went wrong!";function Yr({label:t,onClick:e,...n}){const r=T.useCallback(o=>{o.preventDefault(),o.stopPropagation()},[]);return v.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",h:"full",onClick:r,children:v.jsxs(N.Tile,{scheme:"danger",variant:"light",p:"10",textAlign:"center",children:[v.jsx("div",{textSize:"lg",fontWeight:"600",children:t??ek}),v.jsx(N.Button,{mt:"5",onClick:e,scheme:"danger",children:"Retry"})]})})}var gt={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};let tk=0;function F0(t,e){const n=`atom${++tk}`,r={toString:()=>n};return typeof t=="function"?r.read=t:(r.init=t,r.read=o=>o(r),r.write=(o,i,s)=>i(r,typeof s=="function"?s(o(r)):s)),e&&(r.write=e),r}const $d=t=>"init"in t,Vd=t=>!!t.write,Ba=new WeakMap,nk=(t,e)=>{Ba.set(t,e),t.catch(()=>{}).finally(()=>Ba.delete(t))},H0=(t,e)=>{const n=Ba.get(t);n&&(Ba.delete(t),n(e))},B0=(t,e)=>{t.status="fulfilled",t.value=e},$0=(t,e)=>{t.status="rejected",t.reason=e},rk=t=>typeof(t==null?void 0:t.then)=="function",$a=(t,e)=>"v"in t&&"v"in e&&Object.is(t.v,e.v),V0=(t,e)=>"e"in t&&"e"in e&&Object.is(t.e,e.e),zi=t=>"v"in t&&t.v instanceof Promise,ok=(t,e)=>"v"in t&&"v"in e&&t.v.orig&&t.v.orig===e.v.orig,Va=t=>{if("e"in t)throw t.e;return t.v},ik=()=>{const t=new WeakMap,e=new WeakMap,n=new Map;let r,o;(gt?"production":void 0)!=="production"&&(r=new Set,o=new Set);const i=_=>t.get(_),s=(_,A)=>{(gt?"production":void 0)!=="production"&&Object.freeze(A);const O=t.get(_);if(t.set(_,A),n.has(_)||n.set(_,O),O&&zi(O)){const k="v"in A?A.v instanceof Promise?A.v:Promise.resolve(A.v):Promise.reject(A.e);H0(O.v,k)}},a=(_,A,O)=>{const k=new Map;let M=!1;O.forEach((I,P)=>{!I&&P===_&&(I=A),I?(k.set(P,I),A.d.get(P)!==I&&(M=!0)):(gt?"production":void 0)!=="production"&&console.warn("[Bug] atom state not found")}),(M||A.d.size!==k.size)&&(A.d=k)},l=(_,A,O)=>{const k=i(_),M={d:(k==null?void 0:k.d)||new Map,v:A};if(O&&a(_,M,O),k&&$a(k,M)&&k.d===M.d)return k;if(k&&zi(k)&&zi(M)&&ok(k,M)){if(k.d===M.d)return k;M.v=k.v}return s(_,M),M},c=(_,A,O,k)=>{if(rk(A)){let M;const I=new Promise((P,F)=>{let z=!1;A.then($=>{if(!z){z=!0;const J=i(_),K=l(_,I,O);B0(I,$),P($),(J==null?void 0:J.d)!==K.d&&S(_,K,J==null?void 0:J.d)}},$=>{if(!z){z=!0;const J=i(_),K=l(_,I,O);$0(I,$),F($),(J==null?void 0:J.d)!==K.d&&S(_,K,J==null?void 0:J.d)}}),M=$=>{z||(z=!0,$.then(J=>B0(I,J),J=>$0(I,J)),P($))}});return I.orig=A,I.status="pending",nk(I,P=>{P&&M(P),k==null||k()}),l(_,I,O)}return l(_,A,O)},u=(_,A,O)=>{const k=i(_),M={d:(k==null?void 0:k.d)||new Map,e:A};return O&&a(_,M,O),k&&V0(k,M)&&k.d===M.d?k:(s(_,M),M)},d=(_,A)=>{const O=i(_);if(!A&&O&&(e.has(_)||Array.from(O.d).every(([$,J])=>$===_||d($)===J)))return O;const k=new Map;let M=!0;const I=$=>{if($===_){const K=i($);if(K)return k.set($,K),Va(K);if($d($))return k.set($,void 0),$.init;throw new Error("no atom init")}const J=d($);return k.set($,J),Va(J)};let P,F;const z={get signal(){return P||(P=new AbortController),P.signal},get setSelf(){return(gt?"production":void 0)!=="production"&&!Vd(_)&&console.warn("setSelf function cannot be used with read-only atom"),!F&&Vd(_)&&(F=(...$)=>{if((gt?"production":void 0)!=="production"&&M&&console.warn("setSelf function cannot be called in sync"),!M)return C(_,...$)}),F}};try{const $=_.read(I,z);return c(_,$,k,()=>P==null?void 0:P.abort())}catch($){return u(_,$,k)}finally{M=!1}},h=_=>Va(d(_)),f=_=>{let A=e.get(_);return A||(A=w(_)),A},p=(_,A)=>!A.l.size&&(!A.t.size||A.t.size===1&&A.t.has(_)),g=_=>{const A=e.get(_);A&&p(_,A)&&b(_)},m=_=>{const A=new Map,O=new WeakMap,k=I=>{const P=e.get(I);P==null||P.t.forEach(F=>{F!==I&&(A.set(F,(A.get(F)||new Set).add(I)),O.set(F,(O.get(F)||0)+1),k(F))})};k(_);const M=I=>{const P=e.get(I);P==null||P.t.forEach(F=>{var z;if(F!==I){let $=O.get(F);if($&&O.set(F,--$),!$){let J=!!((z=A.get(F))!=null&&z.size);if(J){const K=i(F),R=d(F,!0);J=!K||!$a(K,R)}J||A.forEach(K=>K.delete(F))}M(F)}})};M(_)},y=(_,...A)=>{let O=!0;const k=P=>Va(d(P)),M=(P,...F)=>{let z;if(P===_){if(!$d(P))throw new Error("atom not writable");const $=i(P),J=c(P,F[0]);(!$||!$a($,J))&&m(P)}else z=y(P,...F);if(!O){const $=E();(gt?"production":void 0)!=="production"&&r.forEach(J=>J({type:"async-write",flushed:$}))}return z},I=_.write(k,M,...A);return O=!1,I},C=(_,...A)=>{const O=y(_,...A),k=E();return(gt?"production":void 0)!=="production"&&r.forEach(M=>M({type:"write",flushed:k})),O},w=(_,A)=>{var O;(O=i(_))==null||O.d.forEach((M,I)=>{const P=e.get(I);P?P.t.add(_):I!==_&&w(I,_)}),d(_);const k={t:new Set(A&&[A]),l:new Set};if(e.set(_,k),(gt?"production":void 0)!=="production"&&o.add(_),Vd(_)&&_.onMount){const M=_.onMount((...I)=>C(_,...I));M&&(k.u=M)}return k},b=_=>{var A;const O=(A=e.get(_))==null?void 0:A.u;O&&O(),e.delete(_),(gt?"production":void 0)!=="production"&&o.delete(_);const k=i(_);k?(zi(k)&&H0(k.v),k.d.forEach((M,I)=>{if(I!==_){const P=e.get(I);P&&(P.t.delete(_),p(I,P)&&b(I))}})):(gt?"production":void 0)!=="production"&&console.warn("[Bug] could not find atom state to unmount",_)},S=(_,A,O)=>{const k=new Set(A.d.keys());O==null||O.forEach((M,I)=>{if(k.has(I)){k.delete(I);return}const P=e.get(I);P&&(P.t.delete(_),p(I,P)&&b(I))}),k.forEach(M=>{const I=e.get(M);I?I.t.add(_):e.has(_)&&w(M,_)})},E=()=>{let _;for((gt?"production":void 0)!=="production"&&(_=new Set);n.size;){const A=Array.from(n);n.clear(),A.forEach(([O,k])=>{const M=i(O);if(M){M.d!==(k==null?void 0:k.d)&&S(O,M,k==null?void 0:k.d);const I=e.get(O);I&&!(k&&!zi(k)&&($a(k,M)||V0(k,M)))&&(I.l.forEach(P=>P()),(gt?"production":void 0)!=="production"&&_.add(O))}else(gt?"production":void 0)!=="production"&&console.warn("[Bug] no atom state to flush")})}if((gt?"production":void 0)!=="production")return _},x=(_,A)=>{const O=f(_),k=E(),M=O.l;return M.add(A),(gt?"production":void 0)!=="production"&&r.forEach(I=>I({type:"sub",flushed:k})),()=>{M.delete(A),g(_),(gt?"production":void 0)!=="production"&&r.forEach(I=>I({type:"unsub"}))}};return(gt?"production":void 0)!=="production"?{get:h,set:C,sub:x,dev_subscribe_store:(_,A)=>{if(A!==2)throw new Error("The current StoreListener revision is 2.");return r.add(_),()=>{r.delete(_)}},dev_get_mounted_atoms:()=>o.values(),dev_get_atom_state:_=>t.get(_),dev_get_mounted:_=>e.get(_),dev_restore_atoms:_=>{for(const[O,k]of _)$d(O)&&(c(O,k),m(O));const A=E();r.forEach(O=>O({type:"restore",flushed:A}))}}:{get:h,set:C,sub:x}};let jd;(gt?"production":void 0)!=="production"&&(typeof globalThis.__NUMBER_OF_JOTAI_INSTANCES__=="number"?++globalThis.__NUMBER_OF_JOTAI_INSTANCES__:globalThis.__NUMBER_OF_JOTAI_INSTANCES__=1);const sk=()=>(jd||((gt?"production":void 0)!=="production"&&globalThis.__NUMBER_OF_JOTAI_INSTANCES__!==1&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"),jd=ik()),jd);var ak={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const lk=T.createContext(void 0),j0=t=>{const e=T.useContext(lk);return(t==null?void 0:t.store)||e||sk()},ck=t=>typeof(t==null?void 0:t.then)=="function",uk=T.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}),t)});function dk(t,e){const n=j0(e),[[r,o,i],s]=T.useReducer(c=>{const u=n.get(t);return Object.is(c[0],u)&&c[1]===n&&c[2]===t?c:[u,n,t]},void 0,()=>[n.get(t),n,t]);let a=r;(o!==n||i!==t)&&(s(),a=n.get(t));const l=e==null?void 0:e.delay;return T.useEffect(()=>{const c=n.sub(t,()=>{if(typeof l=="number"){setTimeout(s,l);return}s()});return s(),c},[n,t,l]),T.useDebugValue(a),ck(a)?uk(a):a}function fk(t,e){const n=j0(e);return T.useCallback((...o)=>{if((ak?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...o)},[n,t])}function hk(t,e){return[dk(t,e),fk(t,e)]}var pk={VITE_CJS_IGNORE_WARNING:"true",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const gk=Symbol(),mk=t=>typeof(t==null?void 0:t.then)=="function";function yk(t){let e,n;const r={getItem:(o,i)=>{var s,a;const l=u=>{if(u=u||"",e!==u){try{n=JSON.parse(u)}catch{return i}e=u}return n},c=(a=(s=t())==null?void 0:s.getItem(o))!=null?a:null;return mk(c)?c.then(l):l(c)},setItem:(o,i)=>{var s;return(s=t())==null?void 0:s.setItem(o,JSON.stringify(i))},removeItem:o=>{var i;return(i=t())==null?void 0:i.removeItem(o)}};return typeof window<"u"&&typeof window.addEventListener=="function"&&(r.subscribe=(o,i,s)=>{if(!(t()instanceof window.Storage))return()=>{};const a=l=>{if(l.storageArea===t()&&l.key===o){let c;try{c=JSON.parse(l.newValue||"")}catch{c=s}i(c)}};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}),r}const vk=yk(()=>typeof window<"u"?window.localStorage:void 0);function bk(t,e,n=vk,r){const o=r==null?void 0:r.unstable_getOnInit,i=F0(o?n.getItem(t,e):e);return(pk?"production":void 0)!=="production"&&(i.debugPrivate=!0),i.onMount=a=>{o||a(n.getItem(t,e));let l;return n.subscribe&&(l=n.subscribe(t,a,e)),l},F0(a=>a(i),(a,l,c)=>{const u=typeof c=="function"?c(a(i)):c;return u===gk?(l(i,e),n.removeItem(t)):u instanceof Promise?u.then(d=>(l(i,d),n.setItem(t,d))):(l(i,u),n.setItem(t,u))})}function wk({tabs:t,initialTabIndex:e=0,saveKey:n,onChange:r,children:o,lazy:i=!1,tabStyle:s="buttons",...a}){const l=T.useMemo(()=>bk(n??"",e),[n]),[c,u]=hk(l),d=T.useCallback(h=>{u(h),r==null||r(h)},[u,r]);return v.jsxs("div",{children:[s==="google"&&v.jsx("div",{borderColor:"brand",borderB:"px",px:"5",children:t.map((h,f)=>v.jsxs(N.Button,{size:"md",rounded:"0",roundedT:"lg",flex:"1",px:"5",variant:"borderless",position:"relative",transition:"none",onClick:()=>d(f),children:[h,v.jsx("div",{bgColor:"brand",position:"absolute",bottom:"0",start:"0",end:"0",h:"1",opacity:c===f?"100 ":"0",transition:"opacity",duration:"300",easing:"in"})]},h))}),s==="buttons"&&v.jsx(N.Tile,{dflex:!0,flexRow:!0,gap:"2",mb:"5",scheme:"light",p:"1.5",w:"auto",children:t.map((h,f)=>v.jsx(N.Button,{size:"lg",scheme:c==f?"default":"neutral",hover_scheme:"default",flex:"1",variant:c==f?"default":"borderless",onClick:()=>d(f),children:h},h))}),!i&&o.map((h,f)=>v.jsx("div",{hidden:c!=f,children:h},f)),i&&o&&o.length>=c+1&&o[c]]})}function Sk(t,e,n){var r=this,o=T.useRef(null),i=T.useRef(0),s=T.useRef(null),a=T.useRef([]),l=T.useRef(),c=T.useRef(),u=T.useRef(t),d=T.useRef(!0);T.useEffect(function(){u.current=t},[t]);var h=!e&&e!==0&&typeof window<"u";if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var f=!!(n=n||{}).leading,p=!("trailing"in n)||!!n.trailing,g="maxWait"in n,m=g?Math.max(+n.maxWait||0,e):null;T.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var y=T.useMemo(function(){var C=function(_){var A=a.current,O=l.current;return a.current=l.current=null,i.current=_,c.current=u.current.apply(O,A)},w=function(_,A){h&&cancelAnimationFrame(s.current),s.current=h?requestAnimationFrame(_):setTimeout(_,A)},b=function(_){if(!d.current)return!1;var A=_-o.current;return!o.current||A>=e||A<0||g&&_-i.current>=m},S=function(_){return s.current=null,p&&a.current?C(_):(a.current=l.current=null,c.current)},E=function _(){var A=Date.now();if(b(A))return S(A);if(d.current){var O=e-(A-o.current),k=g?Math.min(O,m-(A-i.current)):O;w(_,k)}},x=function(){var _=Date.now(),A=b(_);if(a.current=[].slice.call(arguments),l.current=r,o.current=_,A){if(!s.current&&d.current)return i.current=o.current,w(E,e),f?C(o.current):c.current;if(g)return w(E,e),C(o.current)}return s.current||w(E,e),c.current};return x.cancel=function(){s.current&&(h?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,a.current=o.current=l.current=s.current=null},x.isPending=function(){return!!s.current},x.flush=function(){return s.current?S(Date.now()):c.current},x},[f,g,e,m,p,h]);return y}function Ck({api:t,name:e,apiResultIdProp:n,apiResultLabelProp:r,searchKey:o,...i}){const{values:s,setFieldValue:a}=Je.useFormikContext(),[l,c]=T.useState(!1),[u,d]=T.useState(""),[h,f]=T.useState(!1),p=N.useFirstRender(),g=s[e],{data:m,isError:y}=Sn(t.queryKey,t.get,g,{enabled:p}),{data:C,isFetching:w,isError:b}=Sn(t.queryKey,t.getAll,{[o??"title"]:u},{enabled:u!=""}),S=No(t.queryKey),E=Sk(M=>d(M),300),x=T.useCallback(M=>{E(M.target.value),a(`${e}-label`,M.target.value),f(!1),c(!0)},[E,f]),_=T.useCallback(M=>{a(e,M[n??"id"]),a(`${e}-label`,M[r??"title"]),f(!0),c(!1)},[a]),A=T.useCallback(()=>c(!1),[c]);T.useEffect(()=>{m&&(a(`${e}-label`,m[r??"title"]),f(!0)),y&&(a(`${e}-label`,"Couldn't find object"),f(!0))},[m,y]);const O=l&&!h&&(w||b||C!=null),k=r??"title";return v.jsxs(N.Popup,{show:O,position:"relative",side:"bottom-start",modal:!0,onHide:A,children:[v.jsx("div",{children:v.jsx(ud,{name:`${e}-label`,onChange:x,...i,autoComplete:"off"})}),v.jsxs("div",{maxH:"64",minW:"48",bgColor:"white",overflowY:"auto",z:"9999",border:"0.5",borderColor:"slate-100",rounded:!0,children:[w&&v.jsx("div",{dflex:!0,alignItems:"center",placeContent:"center",w:"full",py:"2",children:v.jsx(N.Spinner,{})}),b&&v.jsx(Yr,{w:"full",onClick:()=>S()}),C==null?void 0:C.sort((M,I)=>M[k].localeCompare(I[k])).map((M,I)=>v.jsx("div",{px:"5",py:"2",cursor:"pointer",hover_bgColor:"slate-100",onClick:()=>_(M),children:M[r??"title"]},I)),!w&&!b&&C!=null&&C.length===0&&v.jsx("div",{px:"5",py:"2",children:"No result"})]})]})}const zd=T.memo(function({form:e,extensions:n}){return e.map((r,o)=>{if(!r){console.warn("Form Renderer: you have an undefined item",r);return}const i=Ud(r,o);if(i)return i;switch(r.type){case"twoColSection":return v.jsx(sT,{children:r.children.map((s,a)=>Ud(s,a))},o);case"row":return v.jsx(hT,{children:r.children.map((s,a)=>Ud(s,a,!1))},o);case"hidden":return v.jsx(YO,{name:r.name,value:r.value},o);case"resetField":return v.jsx(nT,{field:r.resetKey,onChangeField:r.onChangeKey,resetValue:r.resetValue},o);case"sectionHeader":return v.jsx(rT,{label:r.label},o);case"condition":return v.jsx(lT,{field:r.field,condition:r.condition,form:r.form,extensions:n},o);case"dependsOnValue":return v.jsx(cT,{field:r.field,form:r.form},o);case"rating":return v.jsx(uT,{name:r.name,label:r.label,required:r.required},o);case"groupHeader":return v.jsx(fT,{title:r.title,divider:r.divider},o);case"inputArray":return v.jsx(pT,{...r},o??r.name);case"textArray":return v.jsx(gT,{...r},o??r.name);case"cardRadio":return v.jsx(yT,{...r},o??r.name);case"divider":return v.jsx("div",{my:"3",h:"px",bgColor:"slate-200",w:"full"},o);case"autocomplete":return v.jsx(Ck,{...r},o??r.name)}return n&&n[r.type]?n[r.type](r,o):(console.warn("FormRenderer element not found: ",r.type),null)}).filter(r=>r!=null)});function Ud(t,e,n=!0){var r;switch(t.type){case"input":{const o={...t};return delete o.type,delete o.inputType,v.jsx(ud,{type:t.inputType??"text",fullWidth:n,...o},e??t.name)}case"debouncedInput":{const o={...t};return delete o.type,delete o.inputType,v.jsx(QT,{type:t.inputType??"text",fullWidth:n,...o},e??t.name)}case"text":return v.jsx(dd,{...t},e??t.name);case"select":{const{provider:o,idField:i,keyField:s,valueField:a,...l}=t;return v.jsx(oT,{fullWidth:n,...l,children:o==null?void 0:o.map(c=>v.jsx("option",{value:c[i??"id"],children:c[a??"label"]},c[s??i??"id"]))},e??t.name)}case"checklist":return v.jsx(JO,{name:t.name,label:t.label,required:t.required,options:((r=t.provider)==null?void 0:r.map(o=>({id:o[t.valueField??"id"],label:o[t.labelField??"label"]})))??[]},e??t.name);case"checkbox":return v.jsx(qy,{...t},e??t.name);case"switch":return v.jsx(iT,{...t,type:"checkbox"},e??t.name);case"custom":return v.jsxs("div",{dflex:!0,flexCol:!0,children:[t.label&&v.jsx(zn,{name:t.name,label:t.label}),Be.isFunction(t.render)?t.render(t.name):t.render]},e);case"hFillSpace":return v.jsx("div",{flexGrow:!0},e)}return null}function Qr({form:t,extensions:e,...n}){return v.jsx(pO,{...n,children:v.jsx(zd,{form:t,extensions:e})})}const z0={array:Ek,cardRadio:_k,checkbox:Fk,checklist:jk,color:xk,condition:Ak,custom:zk,date:Rk,datetime:Nk,debouncedInput:Pk,dependsOnValue:Ok,groupHeader:Jk,hFillSpace:Uk,hidden:qk,input:Mk,inputArray:Ik,row:kk,number:Dk,rating:Gk,reset:Wk,select:Vk,sectionHeader:Kk,switch:Hk,text:Bk,textArray:$k,twoColSection:Tk,url:Lk};function Ek(...t){return t}function _k(t,e,n,r){return{type:"cardRadio",name:t,label:e,provider:n,required:r}}function xk(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"color"}}function Ak(t,e,n){return{type:"condition",field:t,condition:e,form:n}}function Ok(t,e){return{type:"dependsOnValue",field:t,form:e}}function Tk(t,e){return{type:"twoColSection",children:[t,e]}}function kk(...t){return{type:"row",children:t}}function Mk(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r}}function Pk(t,e,n,r){return{type:"debouncedInput",name:t,label:e,required:n,placeholder:r}}function Ik(t,e,n,r,o){return{type:"inputArray",name:t,label:e,required:n,placeholder:r,addItemLabel:o}}function Lk(t,e,n,r){return{type:"input",name:t,label:e,required:n,placeholder:r,inputType:"url"}}function Dk(t,e,n,r,o,i){return{type:"input",name:t,label:e,required:o,placeholder:i,min:n,max:r,inputType:"number"}}function Rk(t,e,n,r,o,i){return{type:"input",name:t,label:e,required:o,placeholder:i,min:n,max:r,inputType:"date"}}function Nk(t,e,n,r,o,i){return typeof n=="string"?{type:"input",inputType:"datetime-local",name:t,label:e,min:n,max:r,required:o,placeholder:i}:{type:"input",inputType:"datetime-local",name:t,label:e,...n}}function Fk(t,e,n){return typeof n=="boolean"?{type:"checkbox",name:t,label:e,required:n}:{type:"checkbox",name:t,label:e,...n}}function Hk(t,e,n){return{type:"switch",name:t,label:e,required:n}}function Bk(t,e,n,r){return{type:"text",name:t,label:e,rows:n,required:r}}function $k(t,e,n,r,o){return{type:"textArray",name:t,label:e,rows:n,required:r,addItemLabel:o}}function Vk(t,e,n,r,o,i,s,a){return typeof s=="boolean"?{type:"select",name:t,label:e,provider:n,keyField:i,idField:r,valueField:o,required:s,placeholder:a}:{type:"select",name:t,label:e,provider:n,keyField:i,idField:r,valueField:o,...s}}function jk(t,e,n,r,o,i){return{type:"checklist",name:t,label:e,provider:n,labelField:r,valueField:o,required:i}}function zk(t,e,n){return{type:"custom",name:t,label:e,render:n}}function Uk(){return{type:"hFillSpace"}}function qk(t,e){return{type:"hidden",name:t,value:e}}function Wk(t,e,n){return{type:"resetField",resetKey:t,onChangeKey:e,resetValue:n}}function Kk(t){return{type:"sectionHeader",label:t}}function Gk(t,e,n){return{type:"rating",name:t,label:e,required:n}}function Jk(t,e){return{type:"groupHeader",title:t,divider:e}}function Xk(){const{isValid:t,values:e,dirty:n,submitForm:r}=Je.useFormikContext();return T.useEffect(()=>{t&&n&&r()},[t,e,n,r]),null}function Yk(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function qd({initialValues:t,autoSubmitOnChange:e,children:n,...r}){return v.jsx(Je.Formik,{initialValues:Yk(t),...r,children:v.jsxs(v.Fragment,{children:[e&&v.jsx(Xk,{}),Uy(n)?v.jsx(v.Fragment,{children:n}):n]})})}function U0({useDirty:t,disabled:e,...n}){const{dirty:r,handleSubmit:o}=Je.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}},i=T.useCallback(()=>o(),[o]);return v.jsx(N.Button,{disabled:t&&!r||e,onClick:i,...n})}function Wd(){return Wd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Wd.apply(this,arguments)}var q0=["shift","alt","meta","mod","ctrl"],Qk={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function mr(t){return(Qk[t]||t).trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Zk(t){return q0.includes(t)}function Kd(t,e){return e===void 0&&(e=","),t.split(e)}function Gd(t,e,n){e===void 0&&(e="+");var r=t.toLocaleLowerCase().split(e).map(function(s){return mr(s)}),o={alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},i=r.filter(function(s){return!q0.includes(s)});return Wd({},o,{keys:i,description:n})}(function(){typeof document<"u"&&(document.addEventListener("keydown",function(t){t.key!==void 0&&W0([mr(t.key),mr(t.code)])}),document.addEventListener("keyup",function(t){t.key!==void 0&&K0([mr(t.key),mr(t.code)])})),typeof window<"u"&&window.addEventListener("blur",function(){yr.clear()})})();var yr=new Set;function Jd(t){return Array.isArray(t)}function eM(t,e){e===void 0&&(e=",");var n=Jd(t)?t:t.split(e);return n.every(function(r){return yr.has(r.trim().toLowerCase())})}function W0(t){var e=Array.isArray(t)?t:[t];yr.has("meta")&&yr.forEach(function(n){return!Zk(n)&&yr.delete(n.toLowerCase())}),e.forEach(function(n){return yr.add(n.toLowerCase())})}function K0(t){var e=Array.isArray(t)?t:[t];t==="meta"?yr.clear():e.forEach(function(n){return yr.delete(n.toLowerCase())})}function tM(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function nM(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function rM(t){return G0(t,["input","textarea","select"])}function G0(t,e){var n=t.target;e===void 0&&(e=!1);var r=n&&n.tagName;return Jd(e)?!!(r&&e&&e.some(function(o){return o.toLowerCase()===r.toLowerCase()})):!!(r&&e&&e===!0)}function oM(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(function(n){return e.includes(n)})||t.includes("*"):!0}var iM=function(e,n,r){r===void 0&&(r=!1);var o=n.alt,i=n.meta,s=n.mod,a=n.shift,l=n.ctrl,c=n.keys,u=e.key,d=e.code,h=e.ctrlKey,f=e.metaKey,p=e.shiftKey,g=e.altKey,m=mr(d),y=u.toLowerCase();if(!(c!=null&&c.includes(m))&&!(c!=null&&c.includes(y))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(m))return!1;if(!r){if(o===!g&&y!=="alt"||a===!p&&y!=="shift")return!1;if(s){if(!f&&!h)return!1}else if(i===!f&&y!=="meta"&&y!=="os"||l===!h&&y!=="ctrl"&&y!=="control")return!1}return c&&c.length===1&&(c.includes(y)||c.includes(m))?!0:c?eM(c):!c},sM=T.createContext(void 0),aM=function(){return T.useContext(sM)};function J0(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce(function(n,r){return n&&J0(t[r],e[r])},!0):t===e}var lM=T.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),cM=function(){return T.useContext(lM)};function uM(t){var e=T.useRef(void 0);return J0(e.current,t)||(e.current=t),e.current}var X0=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},dM=typeof window<"u"?T.useLayoutEffect:T.useEffect;function Y0(t,e,n,r){var o=T.useRef(null),i=T.useRef(!1),s=n instanceof Array?r instanceof Array?void 0:r:n,a=Jd(t)?t.join(s==null?void 0:s.splitKey):t,l=n instanceof Array?n:r instanceof Array?r:void 0,c=T.useCallback(e,l??[]),u=T.useRef(c);l?u.current=c:u.current=e;var d=uM(s),h=cM(),f=h.enabledScopes,p=aM();return dM(function(){if(!((d==null?void 0:d.enabled)===!1||!oM(f,d==null?void 0:d.scopes))){var g=function(b,S){var E;if(S===void 0&&(S=!1),!(rM(b)&&!G0(b,d==null?void 0:d.enableOnFormTags))){if(o.current!==null){var x=o.current.getRootNode();if((x instanceof Document||x instanceof ShadowRoot)&&x.activeElement!==o.current&&!o.current.contains(x.activeElement)){X0(b);return}}(E=b.target)!=null&&E.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||Kd(a,d==null?void 0:d.splitKey).forEach(function(_){var A,O=Gd(_,d==null?void 0:d.combinationKey);if(iM(b,O,d==null?void 0:d.ignoreModifiers)||(A=O.keys)!=null&&A.includes("*")){if(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(b)||S&&i.current)return;if(tM(b,O,d==null?void 0:d.preventDefault),!nM(b,O,d==null?void 0:d.enabled)){X0(b);return}u.current(b,O),S||(i.current=!0)}})}},m=function(b){b.key!==void 0&&(W0(mr(b.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&g(b))},y=function(b){b.key!==void 0&&(K0(mr(b.code)),i.current=!1,d!=null&&d.keyup&&g(b,!0))},C=o.current||(s==null?void 0:s.document)||document;return C.addEventListener("keyup",y),C.addEventListener("keydown",m),p&&Kd(a,d==null?void 0:d.splitKey).forEach(function(w){return p.addHotkey(Gd(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){C.removeEventListener("keyup",y),C.removeEventListener("keydown",m),p&&Kd(a,d==null?void 0:d.splitKey).forEach(function(w){return p.removeHotkey(Gd(w,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[a,d,f]),o}function Q0({...t}){const{dirty:e,handleSubmit:n}=Je.useFormikContext()??{dirty:!1,handleSubmit:void 0,values:{}};return Y0("ctrl+s",()=>{e&&!t.disabled&&n()},{preventDefault:!0},[e,t,n]),v.jsxs(U0,{type:"submit",corners:"pill",px:"4",dflex:!0,alignItems:"center",gap:"3",...t,children:[v.jsx(N.Icon,{path:ix}),"Update"]})}function Z0({path:t,icon:e,...n}){const r=T.useCallback(()=>{window.open(t,"_blank")},[t]);return v.jsx(N.Button,{type:"submit",scheme:"dark",variant:"glass",corners:"pill",w:"10",h:"10",onClick:r,...n,children:v.jsx(N.Icon,{path:e??au})})}function fM({api:t,postId:e,order:n}){const r=ju(t.moveDown,t.queryKey),o=ju(t.moveUp,t.queryKey),i=T.useCallback(a=>{a.stopPropagation(),r.mutateAsync(e).catch(l=>{De.error(`Error: ${l}`)})},[r,e]),s=T.useCallback(a=>{a.stopPropagation(),o.mutateAsync(e).catch(l=>{De.error(`Error: ${l}`)})},[o,e]);return v.jsxs(Ha,{placeContent:"start",numericFontVariant:"tabular-nums",children:[n,v.jsx(N.Button,{ms:"3",variant:"borderless",scheme:"dark",onClick:s,children:v.jsx(N.Icon,{path:Q_})}),v.jsx(N.Button,{variant:"borderless",scheme:"dark",onClick:i,children:v.jsx(N.Icon,{path:Y_})})]})}function ja({children:t,...e}){return v.jsx(N.Container,{center:!0,dflex:!0,flexCol:!0,gap:"8",...e,children:t})}function _t(t){this.content=t}_t.prototype={constructor:_t,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,o=r.find(t),i=r.content.slice();return o==-1?i.push(n||t,e):(i[o+1]=e,n&&(i[o]=n)),new _t(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new _t(n)},addToStart:function(t,e){return new _t([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new _t(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),i=r.find(t);return o.splice(i==-1?o.length:i,0,e,n),new _t(o)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=_t.from(t),t.size?new _t(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=_t.from(t),t.size?new _t(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=_t.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},_t.from=function(t){if(t instanceof _t)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new _t(e)};function e1(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),i=e.child(r);if(o==i){n+=o.nodeSize;continue}if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(let s=0;o.text[s]==i.text[s];s++)n++;return n}if(o.content.size||i.content.size){let s=e1(o.content,i.content,n+1);if(s!=null)return s}n+=o.nodeSize}}function t1(t,e,n,r){for(let o=t.childCount,i=e.childCount;;){if(o==0||i==0)return o==i?null:{a:n,b:r};let s=t.child(--o),a=e.child(--i),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=t1(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class le{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>e&&r(l,o+a,i||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,o+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?o?typeof o=="function"?o(a):o:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(s?s=!1:i+=r),i+=c},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i<e.content.length;i++)o.push(e.content[i]);return new le(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),o+=a.nodeSize),s=l}return new le(r,o)}cutByIndex(e,n){return e==n?le.empty:e==0&&n==this.content.length?this:new le(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new le(o,i)}addToStart(e){return new le([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new le(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return e1(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return t1(this,e,n,r)}findIndex(e,n=-1){if(e==0)return za(0,e);if(e==this.size)return za(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let i=this.child(r),s=o+i.nodeSize;if(s>=e)return s==e||n>0?za(r+1,s):za(r,o);o=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return le.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new le(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return le.empty;let n,r=0;for(let o=0;o<e.length;o++){let i=e[o];r+=i.nodeSize,o&&i.isText&&e[o-1].sameMarkup(i)?(n||(n=e.slice(0,o)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new le(n||e,r)}static from(e){if(!e)return le.empty;if(e instanceof le)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new le([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}le.empty=new le([],0);const Xd={index:0,offset:0};function za(t,e){return Xd.index=t,Xd.offset=e,Xd}function Ua(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Ua(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ua(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ye=class Fg{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let i=e[o];if(this.eq(i))return e;if(this.type.excludes(i.type))n||(n=e.slice(0,o));else{if(i.type.excludes(this.type))return e;!r&&i.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(i)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ua(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Fg.none;if(e instanceof Fg)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ye.none=[];class qa extends Error{}class me{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=r1(this.content,e+this.openStart,n);return r&&new me(r,this.openStart,this.openEnd)}removeBetween(e,n){return new me(n1(this.content,e+this.openStart,n+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,n){if(!n)return me.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new me(le.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let i=e.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(let i=e.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)o++;return new me(e,r,o)}}me.empty=new me(le.empty,0,0);function n1(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(o==e||i.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(n1(i.content,e-o-1,n-o-1)))}function r1(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o);if(i==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=r1(s.content,e-i-1,n);return a&&t.replaceChild(o,s.copy(a))}function hM(t,e,n){if(n.openStart>t.depth)throw new qa("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new qa("Inconsistent open depths");return o1(t,e,n,0)}function o1(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let s=o1(t,e,n,r+1);return i.copy(i.content.replaceChild(o,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return eo(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=pM(n,t);return eo(i,s1(t,s,a,e,r))}else return eo(i,Wa(t,e,r))}function i1(t,e){if(!e.type.compatibleContent(t.type))throw new qa("Cannot join "+e.type.name+" onto "+t.type.name)}function Yd(t,e,n){let r=t.node(n);return i1(r,e.node(n)),r}function Zr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ui(t,e,n,r){let o=(e||t).node(n),i=0,s=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(Zr(t.nodeAfter,r),i++));for(let a=i;a<s;a++)Zr(o.child(a),r);e&&e.depth==n&&e.textOffset&&Zr(e.nodeBefore,r)}function eo(t,e){return t.type.checkContent(e),t.copy(e)}function s1(t,e,n,r,o){let i=t.depth>o&&Yd(t,e,o+1),s=r.depth>o&&Yd(n,r,o+1),a=[];return Ui(null,t,o,a),i&&s&&e.index(o)==n.index(o)?(i1(i,s),Zr(eo(i,s1(t,e,n,r,o+1)),a)):(i&&Zr(eo(i,Wa(t,e,o+1)),a),Ui(e,n,o,a),s&&Zr(eo(s,Wa(n,r,o+1)),a)),Ui(r,null,o,a),new le(a)}function Wa(t,e,n){let r=[];if(Ui(null,t,n,r),t.depth>n){let o=Yd(t,e,n+1);Zr(eo(o,Wa(t,e,n+1)),r)}return Ui(e,null,n,r),new le(r)}function pM(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let i=n-1;i>=0;i--)o=e.node(i).copy(le.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class qi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.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,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let i=0;i<e;i++)o+=r.child(i).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let a=r;r=o,o=a}let i=r.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!o||!i[s].isInSet(o.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var i=0;i<r.length;i++)r[i].type.spec.inclusive===!1&&(!o||!r[i].isInSet(o.marks))&&(r=r[i--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ka(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<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],o=0,i=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(r.push(s,a,o+l),!c||(s=s.child(a),s.isText))break;i=c-1,o+=l+1}return new qi(n,r,i)}static resolveCached(e,n){let r=a1.get(e);if(r)for(let i=0;i<r.elts.length;i++){let s=r.elts[i];if(s.pos==n)return s}else a1.set(e,r=new gM);let o=r.elts[r.i]=qi.resolve(e,n);return r.i=(r.i+1)%mM,o}}class gM{constructor(){this.elts=[],this.i=0}}const mM=12,a1=new WeakMap;class Ka{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const yM=Object.create(null);let vr=class Hg{constructor(e,n,r,o=Ye.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||le.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,o=0){this.content.nodesBetween(e,n,r,o,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,o){return this.content.textBetween(e,n,r,o)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Ua(this.attrs,n||e.defaultAttrs||yM)&&Ye.sameSet(this.marks,r||Ye.none)}copy(e=null){return e==this.content?this:new Hg(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Hg(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return me.empty;let o=this.resolve(e),i=this.resolve(n),s=r?0:o.sharedDepth(n),a=o.start(s),c=o.node(s).content.cut(o.pos-a,i.pos-a);return new me(c,o.depth-s,i.depth-s)}replace(e,n,r){return hM(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return qi.resolveCached(this,e)}resolveNoCache(e){return qi.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,i=>(r.isInSet(i.marks)&&(o=!0),!o)),o}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()+")"),l1(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=le.empty,o=0,i=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,o,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=o;l<i;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let i=this.contentMatchAt(e).matchType(r),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ye.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let o=le.fromJSON(e,n.content),i=e.nodeType(n.type).create(n.attrs,o,r);return i.type.checkAttrs(i.attrs),i}};vr.prototype.text=void 0;class Ga extends vr{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):l1(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ga(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ga(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function l1(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class to{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new vM(e,n);if(r.next==null)return to.empty;let o=c1(r);r.next&&r.err("Unexpected trailing text");let i=xM(_M(o));return AM(i,r),i}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let o=this;for(let i=n;o&&i<r;i++)o=o.matchType(e.child(i).type);return o}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function i(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return le.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:u,next:d}=s.next[c];if(!(u.isText||u.hasRequiredAttrs())&&o.indexOf(d)==-1){o.push(d);let h=i(d,a.concat(u));if(h)return h}}return null}return i(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),i=o.match;if(i.matchType(e)){let s=[];for(let a=o;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!o.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:o}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let i=o+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)i+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return i}).join(`
|
38
|
+
`)}}to.empty=new to(!0);class vM{constructor(e,n){this.string=e,this.nodeTypes=n,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 c1(t){let e=[];do e.push(bM(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function bM(t){let e=[];do e.push(wM(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function wM(t){let e=EM(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=SM(t,e);else break;return e}function u1(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function SM(t,e){let n=u1(t),r=n;return t.eat(",")&&(t.next!="}"?r=u1(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function CM(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let s=n[i];s.isInGroup(e)&&o.push(s)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function EM(t){if(t.eat("(")){let e=c1(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=CM(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function _M(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let c={term:l,to:a};return e[s].push(c),c}function o(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;o(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),o(i(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return o(i(s.expr,a),l),o(i(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();o(i(s.expr,l),u),l=u}if(s.max==-1)o(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),o(i(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function d1(t,e){return e-t}function f1(t,e){let n=[];return r(e),n.sort(d1);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&r(l)}}}function xM(t){let e=Object.create(null);return n(f1(t,0));function n(r){let o=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<o.length;u++)o[u][0]==a&&(c=o[u][1]);f1(t,l).forEach(u=>{c||o.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let i=e[r.join(",")]=new to(r.indexOf(t.length-1)>-1);for(let s=0;s<o.length;s++){let a=o[s][1].sort(d1);i.next.push({type:o[s][0],next:e[a.join(",")]||n(a)})}return i}}function AM(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,s=[];for(let a=0;a<o.next.length;a++){let{type:l,next:c}=o.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),r.indexOf(c)==-1&&r.push(c)}i&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function h1(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function p1(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let i=t[r];if(i.hasDefault)o=i.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function g1(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let i=t[o];i.validate&&i.validate(e[o])}}function m1(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new TM(t,r,e[r]);return n}let y1=class K_{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=m1(e,r.attrs),this.defaultAttrs=h1(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==to.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-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:p1(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new vr(this,this.computeAttrs(e),le.from(n),Ye.setFrom(r))}createChecked(e=null,n,r){return n=le.from(n),this.checkContent(n),new vr(this,this.computeAttrs(e),n,Ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=le.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(le.empty,!0);return i?new vr(this,e,n.append(i),Ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){g1(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,s)=>r[i]=new K_(i,n,s));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");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 OM(t,e,n){let r=n.split("|");return o=>{let i=o===null?"null":typeof o;if(r.indexOf(i)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${i}`)}}class TM{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?OM(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Ja{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=m1(e,o.attrs),this.excluded=null;let i=h1(this.attrs);this.instance=i?new Ye(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ye(this,p1(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,s)=>r[i]=new Ja(i,o++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){g1(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class v1{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=_t.from(e.nodes),n.marks=_t.from(e.marks||{}),this.nodes=y1.compile(this.spec.nodes,this),this.marks=Ja.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let i=this.nodes[o],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=r[s]||(r[s]=to.parse(s,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=a=="_"?null:a?b1(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:b1(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof y1){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(n,r,o)}text(e,n){let r=this.nodes.text;return new Ga(r,r.defaultAttrs,e,Ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return vr.fromJSON(this,e)}markFromJSON(e){return Ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function b1(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],s=i;if(i)n.push(i);else for(let a in t.marks){let l=t.marks[a];(o=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function kM(t){return t.tag!=null}function MM(t){return t.style!=null}let Wi=class Bg{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(kM(o))this.tags.push(o);else if(MM(o)){let i=/[^=]*/.exec(o.style)[0];r.indexOf(i)<0&&r.push(i),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let i=e.nodes[o.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new E1(this,n,!1);return r.addAll(e,Ye.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new E1(this,n,!0);return r.addAll(e,Ye.none,n.from,n.to),me.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let i=this.tags[o];if(LM(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(e);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(e,n,r,o){for(let i=o?this.styles.indexOf(o)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_1(s)),s.mark||s.ignore||s.clearMark||(s.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(s=>{r(s=_1(s)),s.node||s.ignore||s.mark||(s.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Bg(e,Bg.schemaRules(e)))}};const w1={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},PM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},S1={ol:!0,ul:!0},Ki=1,Qd=2,Gi=4;function C1(t,e,n){return e!=null?(e?Ki:0)|(e==="full"?Qd:0):t&&t.whitespace=="pre"?Ki|Qd:n&~Gi}class Xa{constructor(e,n,r,o,i,s){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ye.none,this.match=i||(s&Gi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(le.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ki)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let i=r;r.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-o[0].length))}}let n=le.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(le.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!w1.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class E1{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,i,s=C1(null,n.preserveWhitespace,0)|(r?Gi:0);o?i=new Xa(o.type,o.attrs,Ye.none,!0,n.topMatch||o.type.contentMatch,s):r?i=new Xa(null,null,Ye.none,!0,null,s):i=new Xa(e.schema.topNodeType,null,Ye.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,o=this.top,i=o.options&Qd?"full":this.localPreserveWS||(o.options&Ki)>0;if(i==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(i)i!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
39
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=o.content[o.content.length-1],a=e.previousSibling;(!s||a&&a.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),a;S1.hasOwnProperty(s)&&this.parser.normalizeLists&&IM(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:PM.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(w1.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let d=l&&l.skip?n:this.readStyles(e,n);d&&this.addAll(e,d),c&&this.sync(i),this.needsBlock=u}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
40
|
+
`),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let i=this.parser.matchedStyles[o],s=r.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(c=>!l.clearMark(c)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,o){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),r)||this.leafFallback(e,r);else{let l=this.enter(s,n.attrs||null,r,n.preserveWhitespace);l&&(i=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}i&&this.sync(a)&&this.open--}addAll(e,n,r,o){let i=r||0;for(let s=r?e.childNodes[r]:e.firstChild,a=o==null?null:e.childNodes[o];s!=a;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s,n);this.findAtPoint(e,i)}findPlace(e,n){let r,o;for(let i=this.open;i>=0;i--){let s=this.nodes[i],a=s.findWrapping(e);if(a&&(!r||r.length>a.length)&&(r=a,o=s,!a.length)||s.solid)break}if(!r)return null;this.sync(o);for(let i=0;i<r.length;i++)n=this.enterInner(r[i],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let i=Ye.none;for(let s of r.concat(e.marks))(o.type?o.type.allowsMarkType(s.type):x1(s.type,e.type))&&(i=s.addToSet(i));return o.content.push(e.mark(i)),!0}return!1}enter(e,n,r,o){let i=this.findPlace(e.create(n),r);return i&&(i=this.enterInner(e,n,r,!0,o)),i}enterInner(e,n,r,o=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(e);let a=C1(e,i,s.options);s.options&Gi&&s.content.length==0&&(a|=Gi);let l=Ye.none;return r=r.filter(c=>(s.type?s.type.allowsMarkType(c.type):x1(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Xa(e,n,l,o,null,a)),this.open++,r}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Ki)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&o?this.nodes[l].type:r&&l>=i?r.node(l-i).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function IM(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&S1.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function LM(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function _1(t){let e={};for(let n in t)e[n]=t[n];return e}function x1(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||i.indexOf(u)<0&&s(u))return!0}};if(s(o.contentMatch))return!0}}class no{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Zd(n).createDocumentFragment());let o=r,i=[];return e.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)o=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],u=this.serializeMark(c,s.isInline,n);u&&(i.push([c,o]),o.appendChild(u.dom),o=u.contentDOM||u.dom)}}o.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ya(Zd(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let i=this.serializeMark(e.marks[o],e.isInline,n);i&&((i.contentDOM||i.dom).appendChild(r),r=i.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ya(Zd(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ya(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new no(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=A1(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return A1(e.marks)}}function A1(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Zd(t){return t.document||window.document}const O1=new WeakMap;function DM(t){let e=O1.get(t);return e===void 0&&O1.set(t,e=RM(t)),e}function RM(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ya(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let o=e[0],i;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(i=DM(r))&&i.indexOf(e)>-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 s=o.indexOf(" ");s>0&&(n=o.slice(0,s),o=o.slice(s+1));let a,l=n?t.createElementNS(n,o):t.createElement(o),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?l.setAttributeNS(d.slice(0,h),d.slice(h+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let h=e[d];if(h===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Ya(t,h,n,r);if(l.appendChild(f),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const T1=65535,k1=Math.pow(2,16);function NM(t,e){return t+e*k1}function M1(t){return t&T1}function FM(t){return(t-(t&T1))/k1}const P1=1,I1=2,Qa=4,L1=8;class ef{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&L1)>0}get deletedBefore(){return(this.delInfo&(P1|Qa))>0}get deletedAfter(){return(this.delInfo&(I1|Qa))>0}get deletedAcross(){return(this.delInfo&Qa)>0}}class Yt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&Yt.empty)return Yt.empty}recover(e){let n=0,r=M1(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+FM(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>e)break;let c=this.ranges[a+i],u=this.ranges[a+s],d=l+c;if(e<=d){let h=c?e==l?-1:e==d?1:n:n,f=l+o+(h<0?0:u);if(r)return f;let p=e==(n<0?l:d)?null:NM(a/3,e-l),g=e==l?I1:e==d?P1:Qa;return(n<0?e!=l:e!=d)&&(g|=L1),new ef(f,g,p)}o+=u-c}return r?e+o:new ef(e+o,0,null)}touches(e,n){let r=0,o=M1(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+i],u=l+c;if(e<=u&&a==o*3)return!0;r+=this.ranges[a+s]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,i=0;o<this.ranges.length;o+=3){let s=this.ranges[o],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[o+n],u=this.ranges[o+r];e(a,a+c,l,l+u),i+=u-c}}invert(){return new Yt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Yt.empty:new Yt(e<0?[0,-e,0]:[0,0,e])}}Yt.empty=new Yt([]);class Ji{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new Ji(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new Ji;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,e=this._maps[l].recover(a.recover);continue}}o|=a.delInfo,e=a.pos}return r?e:new ef(e,o,null)}}const tf=Object.create(null);class Mt{getMap(){return Yt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=tf[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in tf)throw new RangeError("Duplicate use of step JSON ID "+e);return tf[e]=n,n.prototype.jsonID=e,n}}class ht{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new ht(e,null)}static fail(e){return new ht(null,e)}static fromReplace(e,n,r,o){try{return ht.ok(e.replace(n,r,o))}catch(i){if(i instanceof qa)return ht.fail(i.message);throw i}}}function nf(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(nf(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return le.fromArray(r)}class br extends Mt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),i=new me(nf(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),o),n.openStart,n.openEnd);return ht.fromReplace(e,this.from,this.to,i)}invert(){return new xn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new br(n.pos,r.pos,this.mark)}merge(e){return e instanceof br&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new br(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new br(n.from,n.to,e.markFromJSON(n.mark))}}Mt.jsonID("addMark",br);class xn extends Mt{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new me(nf(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return ht.fromReplace(e,this.from,this.to,r)}invert(){return new br(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new xn(n.pos,r.pos,this.mark)}merge(e){return e instanceof xn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xn(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xn(n.from,n.to,e.markFromJSON(n.mark))}}Mt.jsonID("removeMark",xn);class wr extends Mt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ht.fromReplace(e,this.pos,this.pos+1,new me(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new wr(this.pos,n.marks[o]);return new wr(this.pos,this.mark)}}return new Vo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new wr(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new wr(n.pos,e.markFromJSON(n.mark))}}Mt.jsonID("addNodeMark",wr);class Vo extends Mt{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return ht.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ht.fromReplace(e,this.pos,this.pos+1,new me(le.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new wr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Vo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Vo(n.pos,e.markFromJSON(n.mark))}}Mt.jsonID("removeNodeMark",Vo);class bt extends Mt{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&rf(e,this.from,this.to)?ht.fail("Structure replace would overwrite content"):ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Yt([this.from,this.to-this.from,this.slice.size])}invert(e){return new bt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new bt(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof bt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?me.empty:new me(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new bt(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?me.empty:new me(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new bt(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new bt(n.from,n.to,me.fromJSON(e,n.slice),!!n.structure)}}Mt.jsonID("replace",bt);class wt extends Mt{constructor(e,n,r,o,i,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=s,this.structure=a}apply(e){if(this.structure&&(rf(e,this.from,this.gapFrom)||rf(e,this.gapTo,this.to)))return ht.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ht.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ht.fromReplace(e,this.from,this.to,r):ht.fail("Content does not fit in gap")}getMap(){return new Yt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new wt(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new wt(n.pos,r.pos,o,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new wt(n.from,n.to,n.gapFrom,n.gapTo,me.fromJSON(e,n.slice),n.insert,!!n.structure)}}Mt.jsonID("replaceAround",wt);function rf(t,e,n){let r=t.resolve(e),o=n-e,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let s=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,o--}}return!1}function HM(t,e,n,r){let o=[],i=[],s,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),f=Math.min(c+l.nodeSize,n),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(s&&s.to==h&&s.mark.eq(d[g])?s.to=f:o.push(s=new xn(h,f,d[g])));a&&a.to==h?a.to=f:i.push(a=new br(h,f,r))}}),o.forEach(l=>t.step(l)),i.forEach(l=>t.step(l))}function BM(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(r instanceof Ja){let c=s.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let d=l[u],h;for(let f=0;f<o.length;f++){let p=o[f];p.step==i-1&&d.eq(o[f].style)&&(h=p)}h?(h.to=c,h.step=i):o.push({style:d,from:Math.max(a,e),to:c,step:i})}}}),o.forEach(s=>t.step(new xn(s.from,s.to,s.style)))}function of(t,e,n,r=n.contentMatch,o=!0){let i=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)s.push(new bt(a,u,me.empty));else{r=d;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new xn(a,u,c.marks[h]));if(o&&c.isText&&n.whitespace!="pre"){let h,f=/\r?\n|\r/g,p;for(;h=f.exec(c.text);)p||(p=new me(le.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),s.push(new bt(a+h.index,a+h.index+h[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(le.empty,!0);t.replace(a,a,new me(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function $M(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function jo(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),i=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,s,n))return r;if(r==0||o.type.spec.isolating||!$M(o,i,s))break}return null}function VM(t,e,n){let{$from:r,$to:o,depth:i}=e,s=r.before(i+1),a=o.after(i+1),l=s,c=a,u=le.empty,d=0;for(let p=i,g=!1;p>n;p--)g||r.index(p)>0?(g=!0,u=le.from(r.node(p).copy(u)),d++):l--;let h=le.empty,f=0;for(let p=i,g=!1;p>n;p--)g||o.after(p+1)<o.end(p)?(g=!0,h=le.from(o.node(p).copy(h)),f++):c++;t.step(new wt(l,c,s,a,new me(u.append(h),d,f),u.size-d,!0))}function sf(t,e,n=null,r=t){let o=jM(t,e),i=o&&zM(r,e);return i?o.map(D1).concat({type:e,attrs:n}).concat(i.map(D1)):null}function D1(t){return{type:t,attrs:null}}function jM(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let s=i.length?i[0]:e;return n.canReplaceWith(r,o,s)?i:null}function zM(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),s=e.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let c=r;l&&c<o;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:s}function UM(t,e,n){let r=le.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=le.from(n[s].type.create(n[s].attrs,r))}let o=e.start,i=e.end;t.step(new wt(o,i,o,i,new me(r,0,0),n.length,!0))}function qM(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{let l=typeof o=="function"?o(s):o;if(s.isTextblock&&!s.hasMarkup(r,l)&&WM(t.doc,t.mapping.slice(i).map(a),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&&N1(t,s,a,i),of(t,t.mapping.slice(i).map(a,1),r,void 0,c===null);let u=t.mapping.slice(i),d=u.map(a,1),h=u.map(a+s.nodeSize,1);return t.step(new wt(d,h,d+1,h-1,new me(le.from(r.create(l,null,s.marks)),0,0),1,!0)),c===!0&&R1(t,s,a,i),!1}})}function R1(t,e,n,r){e.forEach((o,i)=>{if(o.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(o.text);){let l=t.mapping.slice(r).map(n+1+i+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function N1(t,e,n,r){e.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+i);t.replaceWith(s,s+1,e.type.schema.text(`
|
41
|
+
`))}})}function WM(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function KM(t,e,n,r,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new wt(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new me(le.from(s),0,0),1,!0))}function zo(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,u=n-2;c>i;c--,u--){let d=o.node(c),h=o.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 g=r&&r[u]||d;if(!d.canReplace(h+1,d.childCount)||!g.type.validContent(f))return!1}let a=o.indexAfter(i),l=r&&r[0];return o.node(i).canReplaceWith(a,a,l?l.type:o.node(i+1).type)}function GM(t,e,n=1,r){let o=t.doc.resolve(e),i=le.empty,s=le.empty;for(let a=o.depth,l=o.depth-n,c=n-1;a>l;a--,c--){i=le.from(o.node(a).copy(i));let u=r&&r[c];s=le.from(u?u.type.create(u.attrs,s):o.node(a).copy(s))}t.step(new bt(e,e,new me(i.append(s),n,n),!0))}function Sr(t,e){let n=t.resolve(e),r=n.index();return F1(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function JM(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let i=e.child(o),s=i.type==r?t.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!t.type.allowsMarks(i.marks))return!1}return n.validEnd}function F1(t,e){return!!(t&&e&&!t.isLeaf&&JM(t,e))}function Za(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,s,a=r.index(o);if(o==r.depth?(i=r.nodeBefore,s=r.nodeAfter):n>0?(i=r.node(o+1),a++,s=r.node(o).maybeChild(a)):(i=r.node(o).maybeChild(a-1),s=r.node(o+1)),i&&!i.isTextblock&&F1(i,s)&&r.node(o).canReplace(a,a+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function XM(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,i=t.doc.resolve(e-n),s=i.node().type;if(o&&s.inlineContent){let u=s.whitespace=="pre",d=!!s.contentMatch.matchType(o);u&&!d?r=!1:!u&&d&&(r=!0)}let a=t.steps.length;if(r===!1){let u=t.doc.resolve(e+n);N1(t,u.node(),u.before(),a)}s.inlineContent&&of(t,e+n-1,s,i.node().contentMatchAt(i.index()),r==null);let l=t.mapping.slice(a),c=l.map(e-n);if(t.step(new bt(c,l.map(e+n,-1),me.empty,!0)),r===!0){let u=t.doc.resolve(c);R1(t,u.node(),u.before(),t.steps.length)}return t}function YM(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let i=r.indexAfter(o);if(r.node(o).canReplaceWith(i,i,n))return r.after(o+1);if(i<r.node(o).childCount)return null}return null}function H1(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let i=0;i<n.openStart;i++)o=o.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),c=r.node(s),u=!1;if(i==1)u=c.canReplace(l,l,o);else{let d=c.contentMatchAt(l).findWrapping(o.firstChild.type);u=d&&c.canReplaceWith(l,l,d[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function el(t,e,n=e,r=me.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return B1(o,i,r)?new bt(e,n,r):new QM(o,i,r).fit()}function B1(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class QM{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=le.empty;for(let o=0;o<=e.depth;o++){let i=e.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=le.from(e.node(o).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(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let i=this.placed,s=r.depth,a=o.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new me(i,s,a);return e>-1?new wt(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new bt(r.pos,o.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let i=n.firstChild;if(n.childCount>1&&(o=0),i.type.spec.isolating&&o<=r){e=r;break}n=i.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,i=null;r?(i=af(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let s=o.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,d=null;if(n==1&&(s?c.matchType(s.type)||(d=c.fillBefore(le.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:i,wrap:u};if(i&&c.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=af(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new me(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=af(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new me(Xi(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new me(Xi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,c=0,u=[],{match:d,type:h}=this.frontier[n];if(o){for(let g=0;g<o.childCount;g++)u.push(o.child(g));d=d.matchFragment(o)}let f=a.size+e-(s.content.size-s.openEnd);for(;c<a.childCount;){let g=a.child(c),m=d.matchType(g.type);if(!m)break;c++,(c>1||l==0||g.content.size)&&(d=m,u.push($1(g.mark(h.allowedMarks(g.marks)),c==1?l:0,c==a.childCount?f:-1)))}let p=c==a.childCount;p||(f=-1),this.placed=Yi(this.placed,n,le.from(u)),this.frontier[n].match=d,p&&f<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,m=a;g<f;g++){let y=m.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),m=y.content}this.unplaced=p?e==0?me.empty:new me(Xi(s.content,e-1,1),e-1,f<0?s.openEnd:e-1):new me(Xi(s.content,e,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!lf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],i=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=lf(e,n,o,r,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=lf(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:i?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Yi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),i=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,i)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=Yi(this.placed,this.depth,le.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(le.empty,!0);n.childCount&&(this.placed=Yi(this.placed,this.frontier.length,n))}}function Xi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xi(t.firstChild.content,e-1,n)))}function Yi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Yi(t.lastChild.content,e-1,n)))}function af(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function $1(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,$1(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(le.empty,!0)))),t.copy(r)}function lf(t,e,n,r,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=r.fillBefore(i.content,!0,s);return a&&!ZM(n,i.content,s)?a:null}function ZM(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function eP(t){return t.spec.defining||t.spec.definingForContent}function tP(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(B1(o,i,r))return t.step(new bt(e,n,r));let s=j1(o,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let h=o.depth,f=o.pos-1;h>0;h--,f--){let p=o.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(h)>-1?a=h:o.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),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=eP(f.type);if(p&&!f.sameMarkup(o.node(Math.abs(a)-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 g=0;g<s.length;g++){let m=s[(g+l)%s.length],y=!0;m<0&&(y=!1,m=-m);let C=o.node(m-1),w=o.index(m-1);if(C.canReplaceWith(w,w,p.type,p.marks))return t.replace(o.before(m),y?i.after(m):n,new me(V1(r.content,0,r.openStart,f),f,r.openEnd))}}let d=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>d));h--){let f=s[h];f<0||(e=o.before(f),n=i.after(f))}}function V1(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(V1(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),s=i.fillBefore(t).append(t);t=s.append(i.matchFragment(s).fillBefore(le.empty,!0))}return t}function nP(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=YM(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new me(le.from(r),0,0))}function rP(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=j1(r,o);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),o.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),o.indexAfter(a-1))))return t.delete(r.before(a),o.after(a))}for(let s=1;s<=r.depth&&s<=o.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&o.end(s)-n!=o.depth-s&&r.start(s-1)==o.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),o.index(s-1)))return t.delete(r.before(s),n);t.delete(e,n)}function j1(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Uo extends Mt{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return ht.fail("No node at attribute step's position");let r=Object.create(null);for(let i in n.attrs)r[i]=n.attrs[i];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return ht.fromReplace(e,this.pos,this.pos+1,new me(le.from(o),0,n.isLeaf?0:1))}getMap(){return Yt.empty}invert(e){return new Uo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Uo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Uo(n.pos,n.attr,n.value)}}Mt.jsonID("attr",Uo);class Qi extends Mt{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return ht.ok(r)}getMap(){return Yt.empty}invert(e){return new Qi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qi(n.attr,n.value)}}Mt.jsonID("docAttr",Qi);let qo=class extends Error{};qo=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},qo.prototype=Object.create(Error.prototype),qo.prototype.constructor=qo,qo.prototype.name="TransformError";class z1{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ji}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new qo(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=me.empty){let o=el(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new me(le.from(r),0,0))}delete(e,n){return this.replace(e,n,me.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return tP(this,e,n,r),this}replaceRangeWith(e,n,r){return nP(this,e,n,r),this}deleteRange(e,n){return rP(this,e,n),this}lift(e,n){return VM(this,e,n),this}join(e,n=1){return XM(this,e,n),this}wrap(e,n){return UM(this,e,n),this}setBlockType(e,n=e,r,o=null){return qM(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return KM(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new Uo(e,n,r)),this}setDocAttribute(e,n){return this.step(new Qi(e,n)),this}addNodeMark(e,n){return this.step(new wr(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ye)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Vo(e,n)),this}split(e,n=1,r){return GM(this,e,n,r),this}addMark(e,n,r){return HM(this,e,n,r),this}removeMark(e,n,r){return BM(this,e,n,r),this}clearIncompatible(e,n,r){return of(this,e,n,r),this}}const cf=Object.create(null);class Re{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new oP(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=me.empty){let r=n.content.lastChild,o=null;for(let a=0;a<n.openEnd;a++)o=r,r=r.lastChild;let i=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],u=e.mapping.slice(i);e.replaceRange(u.map(l.pos),u.map(c.pos),a?me.empty:n),a==0&&W1(e,i,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let i=0;i<o.length;i++){let{$from:s,$to:a}=o[i],l=e.mapping.slice(r),c=l.map(s.pos),u=l.map(a.pos);i?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),W1(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Le(e):Wo(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let i=e.depth-1;i>=0;i--){let s=n<0?Wo(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):Wo(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new sn(e.node(0))}static atStart(e){return Wo(e,e,0,0,1)||new sn(e)}static atEnd(e){return Wo(e,e,e.content.size,e.childCount,-1)||new sn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=cf[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in cf)throw new RangeError("Duplicate use of selection JSON ID "+e);return cf[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Le.between(this.$anchor,this.$head).getBookmark()}}Re.prototype.visible=!0;class oP{constructor(e,n){this.$from=e,this.$to=n}}let U1=!1;function q1(t){!U1&&!t.parent.inlineContent&&(U1=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Le extends Re{constructor(e,n=e){q1(e),q1(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Re.near(r);let o=e.resolve(n.map(this.anchor));return new Le(o.parent.inlineContent?o:r,r)}replace(e,n=me.empty){if(super.replace(e,n),n==me.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new tl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let i=Re.findFrom(n,r,!0)||Re.findFrom(n,-r,!0);if(i)n=i.$head;else return Re.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Re.findFrom(e,-r,!0)||Re.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Le(e,n)}}Re.jsonID("text",Le);class tl{constructor(e,n){this.anchor=e,this.head=n}map(e){return new tl(e.map(this.anchor),e.map(this.head))}resolve(e){return Le.between(e.resolve(this.anchor),e.resolve(this.head))}}class Te extends Re{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),i=e.resolve(o);return r?Re.near(i):new Te(i)}content(){return new me(le.from(this.node),0,0)}eq(e){return e instanceof Te&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new uf(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Te(e.resolve(n.anchor))}static create(e,n){return new Te(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Te.prototype.visible=!1,Re.jsonID("node",Te);class uf{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new tl(r,r):new uf(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Te.isSelectable(r)?new Te(n):Re.near(n)}}class sn extends Re{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=me.empty){if(n==me.empty){e.delete(0,e.doc.content.size);let r=Re.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new sn(e)}map(e){return new sn(e)}eq(e){return e instanceof sn}getBookmark(){return iP}}Re.jsonID("all",sn);const iP={map(){return this},resolve(t){return new sn(t)}};function Wo(t,e,n,r,o,i=!1){if(e.inlineContent)return Le.create(t,n);for(let s=r-(o>0?0:1);o>0?s<e.childCount:s>=0;s+=o){let a=e.child(s);if(a.isAtom){if(!i&&Te.isSelectable(a))return Te.create(t,n-(o<0?a.nodeSize:0))}else{let l=Wo(t,a,n+o,o<0?a.childCount:0,o,i);if(l)return l}n+=a.nodeSize*o}return null}function W1(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof bt||o instanceof wt))return;let i=t.mapping.maps[r],s;i.forEach((a,l,c,u)=>{s==null&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),n))}const K1=1,nl=2,G1=4;let sP=class extends z1{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|K1)&~nl,this.storedMarks=null,this}get selectionSet(){return(this.updated&K1)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=nl,this}ensureMarks(e){return Ye.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&nl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~nl,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(Re.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,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|=G1,this}get scrolledIntoView(){return(this.updated&G1)>0}};function J1(t,e){return!e||!t?t:t.bind(e)}class Zi{constructor(e,n,r){this.name=e,this.init=J1(n.init,r),this.apply=J1(n.apply,r)}}const aP=[new Zi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Zi("selection",{init(t,e){return t.selection||Re.atStart(e.doc)},apply(t){return t.selection}}),new Zi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Zi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class df{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=aP.slice(),n&&n.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 Zi(r.key,r.spec.state,r))})}}class Ko{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,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=o?o[s].n:0,c=o?o[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!o){o=[];for(let d=0;d<this.config.plugins.length;d++)o.push(d<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),i=!0}o&&(o[s]={state:r,n:n.length})}}if(!i)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ko(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let i=r[o];n[i.name]=i.apply(e,this[i.name],this,n)}return n}get tr(){return new sP(this)}static create(e){let n=new df(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ko(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new df(this.schema,e.plugins),r=n.fields,o=new Ko(n);for(let i=0;i<r.length;i++){let s=r[i].name;o[s]=this.hasOwnProperty(s)?this[s]:r[i].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.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 o=e[r],i=o.spec.state;i&&i.toJSON&&(n[r]=i.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new df(e.schema,e.plugins),i=new Ko(o);return o.fields.forEach(s=>{if(s.name=="doc")i.doc=vr.fromJSON(e.schema,n.doc);else if(s.name=="selection")i.selection=Re.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=c.fromJSON.call(l,e,n[a],i);return}}i[s.name]=s.init(e,i)}}),i}}function X1(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=X1(o,e,{})),n[r]=o}return n}class at{constructor(e){this.spec=e,this.props={},e.props&&X1(e.props,this,this.props),this.key=e.key?e.key.key:Y1("plugin")}getState(e){return e[this.key]}}const ff=Object.create(null);function Y1(t){return t in ff?t+"$"+ ++ff[t]:(ff[t]=0,t+"$")}class mt{constructor(e="key"){this.key=Y1(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const xt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Go=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let hf=null;const Un=function(t,e,n){let r=hf||(hf=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},lP=function(){hf=null},ro=function(t,e,n,r){return n&&(Q1(t,e,n,r,-1)||Q1(t,e,n,r,1))},cP=/^(img|br|input|textarea|hr)$/i;function Q1(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:an(t))){let i=t.parentNode;if(!i||i.nodeType!=1||es(t)||cP.test(t.nodeName)||t.contentEditable=="false")return!1;e=xt(t)+(o<0?0:1),t=i}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?an(t):0}else return!1}}function an(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function uP(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=an(t)}else if(t.parentNode&&!es(t))e=xt(t),t=t.parentNode;else return null}}function dP(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!es(t))e=xt(t)+1,t=t.parentNode;else return null}}function fP(t,e,n){for(let r=e==0,o=e==an(t);r||o;){if(t==n)return!0;let i=xt(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==an(t)}}function es(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const rl=function(t){return t.focusNode&&ro(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function oo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function hP(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function pP(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(an(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(an(r.startContainer),r.startOffset)}}}const An=typeof navigator<"u"?navigator:null,Z1=typeof document<"u"?document:null,Cr=An&&An.userAgent||"",pf=/Edge\/(\d+)/.exec(Cr),ev=/MSIE \d/.exec(Cr),gf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Cr),zt=!!(ev||gf||pf),Er=ev?document.documentMode:gf?+gf[1]:pf?+pf[1]:0,mn=!zt&&/gecko\/(\d+)/i.test(Cr);mn&&+(/Firefox\/(\d+)/.exec(Cr)||[0,0])[1];const mf=!zt&&/Chrome\/(\d+)/.exec(Cr),Pt=!!mf,tv=mf?+mf[1]:0,Ft=!zt&&!!An&&/Apple Computer/.test(An.vendor),Jo=Ft&&(/Mobile\/\w+/.test(Cr)||!!An&&An.maxTouchPoints>2),ln=Jo||(An?/Mac/.test(An.platform):!1),gP=An?/Win/.test(An.platform):!1,qn=/Android \d/.test(Cr),ts=!!Z1&&"webkitFontSmoothing"in Z1.documentElement.style,mP=ts?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function yP(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Wn(t,e){return typeof t=="number"?t:t[e]}function vP(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function nv(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=n||t.dom;s;){if(s.nodeType!=1){s=Go(s);continue}let a=s,l=a==i.body,c=l?yP(i):vP(a),u=0,d=0;if(e.top<c.top+Wn(r,"top")?d=-(c.top-e.top+Wn(o,"top")):e.bottom>c.bottom-Wn(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Wn(o,"top")-c.top:e.bottom-c.bottom+Wn(o,"bottom")),e.left<c.left+Wn(r,"left")?u=-(c.left-e.left+Wn(o,"left")):e.right>c.right-Wn(r,"right")&&(u=e.right-c.right+Wn(o,"right")),u||d)if(l)i.defaultView.scrollBy(u,d);else{let f=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),u&&(a.scrollLeft+=u);let g=a.scrollLeft-f,m=a.scrollTop-p;e={left:e.left-g,top:e.top-m,right:e.right-g,bottom:e.bottom-m}}let h=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(h))break;s=h=="absolute"?s.offsetParent:Go(s)}}function bP(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(i,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,o=l.top;break}}return{refDOM:r,refTop:o,stack:rv(t.dom)}}function rv(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Go(r));return e}function wP({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;ov(n,r==0?0:r-e)}function ov(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:i}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=i&&(r.scrollLeft=i)}}let Xo=null;function SP(t){if(t.setActive)return t.setActive();if(Xo)return t.focus(Xo);let e=rv(t);t.focus(Xo==null?{get preventScroll(){return Xo={preventScroll:!0},!0}}:void 0),Xo||(Xo=!1,ov(e,0))}function iv(t,e){let n,r=2e8,o,i=0,s=e.top,a=e.top,l,c;for(let u=t.firstChild,d=0;u;u=u.nextSibling,d++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=Un(u).getClientRects();else continue;for(let f=0;f<h.length;f++){let p=h[f];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<r){n=u,r=g,o=g&&n.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!l&&p.left<=e.left&&p.right>=e.left&&(l=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,o=c,r=0),n&&n.nodeType==3?CP(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:iv(n,o)}function CP(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let i=_r(r,1);if(i.top!=i.bottom&&yf(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function yf(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function EP(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function _P(t,e,n){let{node:r,offset:o}=iv(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function xP(t,e,n,r){let o=-1;for(let i=e,s=!1;i!=t.dom;){let a=t.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?o=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(o=a.posAfter),s=!0),!a.contentDOM&&o<0&&!a.node.isText))return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function sv(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),i=o;;){let s=t.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(yf(e,c))return sv(s,e,c)}}if((i=(i+1)%r)==o)break}return t}function AP(t,e){let n=t.dom.ownerDocument,r,o=0,i=pP(n,e.left,e.top);i&&({node:r,offset:o}=i);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=t.dom.getBoundingClientRect();if(!yf(e,c)||(s=sv(t.dom,e,c),!s))return null}if(Ft)for(let c=s;r&&c;c=Go(c))c.draggable&&(r=void 0);if(s=EP(s,e),r){if(mn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let u=r.childNodes[o],d;u.nodeName=="IMG"&&(d=u.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&o++}let c;ts&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(a=xP(t,r,o,e))}a==null&&(a=_P(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function av(t){return t.top<t.bottom||t.left<t.right}function _r(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(av(r))return r}return Array.prototype.find.call(n,av)||t.getBoundingClientRect()}const OP=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function lv(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),s=ts||mn;if(r.nodeType==3)if(s&&(OP.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let l=_r(Un(r,o,o),n);if(mn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=_r(Un(r,o-1,o-1),-1);if(c.top==l.top){let u=_r(Un(r,o,o+1),-1);if(u.top!=l.top)return ns(u,u.left<c.left)}}return l}else{let l=o,c=o,u=n<0?1:-1;return n<0&&!o?(c++,u=-1):n>=0&&o==r.nodeValue.length?(l--,u=1):n<0?l--:c++,ns(_r(Un(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==an(r))){let l=r.childNodes[o-1];if(l.nodeType==1)return vf(l.getBoundingClientRect(),!1)}if(i==null&&o<an(r)){let l=r.childNodes[o];if(l.nodeType==1)return vf(l.getBoundingClientRect(),!0)}return vf(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==an(r))){let l=r.childNodes[o-1],c=l.nodeType==3?Un(l,an(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return ns(_r(c,1),!1)}if(i==null&&o<an(r)){let l=r.childNodes[o];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Un(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return ns(_r(c,-1),!0)}return ns(_r(r.nodeType==3?Un(r):r,-n),n>=0)}function ns(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function vf(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function cv(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function TP(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return cv(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=lv(t,o.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Un(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const kP=/[\u0590-\u08ac]/;function MP(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,s=o==r.parent.content.size,a=t.domSelection();return a?!kP.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:cv(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:d}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let f=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),m=p&&!f.contains(p.nodeType==1?p:p.parentNode)||l==p&&c==g;try{a.collapse(u,d),l&&(l!=u||c!=d)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),m}):r.pos==r.start()||r.pos==r.end()}let uv=null,dv=null,fv=!1;function PP(t,e,n){return uv==e&&dv==n?fv:(uv=e,dv=n,fv=n=="up"||n=="down"?TP(t,e,n):MP(t,e,n))}const cn=0,hv=1,io=2,On=3;class rs{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=cn,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let i,s;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>xt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!1;break}if(i.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){o=!0;break}if(i.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let i=this.getDesc(o),s;if(i&&(!n||i.node))if(r&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return i}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let i=this.getDesc(o);if(i)return i.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],i=r+o.size;if(r==e&&i!=r){for(;!o.border&&o.children.length;)for(let s=0;s<o.children.length;s++){let a=o.children[s];if(a.size){o=a;break}}return o}if(e<i)return o.descAt(e-r-o.border);r=i}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let i=0;r<this.children.length;r++){let s=this.children[r],a=i+s.size;if(a>e||s instanceof mv){o=e-i;break}i=a}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let i;r&&!(i=this.children[r-1]).size&&i instanceof pv&&i.side>=0;r--);if(n<=0){let i,s=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?xt(i.dom)+1:0}}else{let i,s=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?xt(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,i=-1;for(let s=r,a=0;;a++){let l=this.children[a],c=s+l.size;if(o==-1&&e<=c){let u=s+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){o=xt(h.dom)+1;break}e-=h.size}o==-1&&(o=0)}if(o>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let d=this.children[u];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=xt(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let i=Math.min(e,n),s=Math.max(e,n);for(let f=0,p=0;f<this.children.length;f++){let g=this.children[f],m=p+g.size;if(i>p&&s<m)return g.setSelection(e-p-g.border,n-p-g.border,r,o);p=m}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),u=r.domSelectionRange(),d=!1;if((mn||Ft)&&e==n){let{node:f,offset:p}=a;if(f.nodeType==3){if(d=!!(p&&f.nodeValue[p-1]==`
|
42
|
+
`),d&&p==f.nodeValue.length)for(let g=f,m;g;g=g.parentNode){if(m=g.nextSibling){m.nodeName=="BR"&&(a=l={node:m.parentNode,offset:xt(m)+1});break}let y=g.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let g=f.childNodes[p-1];d=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(mn&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(o=!0)}if(!(o||d&&Ft)&&ro(a.node,a.offset,u.anchorNode,u.anchorOffset)&&ro(l.node,l.offset,u.focusNode,u.focusOffset))return;let h=!1;if((c.extend||e==n)&&!d){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),h=!0}catch{}}if(!h){if(e>n){let p=a;a=l,l=p}let f=document.createRange();f.setEnd(l.node,l.offset),f.setStart(a.node,a.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,n){for(let r=0,o=0;o<this.children.length;o++){let i=this.children[o],s=r+i.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+i.border,l=s-i.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?io:hv,e==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=On:i.markDirty(e-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?io:On}r=s}this.dirty=io}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?io:hv;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class pv extends rs{constructor(e,n,r,o){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!i)return o;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(e){return this.dirty==cn&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(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 side(){return this.widget.type.side}}class IP extends rs{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class so extends rs{constructor(e,n,r,o,i){super(e,[],r,o),this.mark=n,this.spec=i}static create(e,n,r,o){let i=o.nodeViews[n.type.name],s=i&&i(n,o,r);return(!s||!s.dom)&&(s=no.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new so(e,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&On||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=On&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=cn){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=cn}}slice(e,n,r){let o=so.create(this.parent,this.mark,!0,r),i=this.children,s=this.size;n<s&&(i=wf(i,n,s,r)),e>0&&(i=wf(i,0,e,r));for(let a=0;a<i.length;a++)i[a].parent=o;return o.children=i,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class xr extends rs{constructor(e,n,r,o,i,s,a,l,c){super(e,[],i,s),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=a}static create(e,n,r,o,i,s){let a=i.nodeViews[n.type.name],l,c=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,o),u=c&&c.dom,d=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=no.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=bv(u,r,n),c?l=new LP(e,n,r,o,u,d||null,h,c,i,s+1):n.isText?new ol(e,n,r,o,u,h,i):new xr(e,n,r,o,u,d||null,h,i,s+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 n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>le.empty)}return e}matchesNode(e,n,r){return this.dirty==cn&&e.eq(this.node)&&il(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,i=e.composing?this.localCompositionInfo(e,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new RP(this,s&&s.node,e);HP(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&l.syncToMarks(u==this.node.childCount?Ye.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,o)},(c,u,d,h)=>{l.syncToMarks(c.marks,r,e);let f;l.findNodeMatch(c,u,d,h)||a&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(f=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,u,d,f,e)||l.updateNextNode(c,u,d,e,h,o)||l.addNode(c,u,d,e,o),o+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==io)&&(s&&this.protectLocalComposition(e,s),yv(this.contentDOM,this.children,e),Jo&&BP(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Le)||r<n||o>n+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 s=i.nodeValue,a=$P(this.node.content,s,r-n,o-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){if(this.getDesc(n))return;let i=n;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 s=new IP(this,i,n,o);e.input.compositionNodes.push(s),this.children=wf(this.children,r,r+o.length,e,s)}update(e,n,r,o){return this.dirty==On||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=cn}updateOuterDeco(e){if(il(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=vv(this.dom,this.nodeDOM,bf(this.outerDeco,this.node,n),bf(e,this.node,n)),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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function gv(t,e,n,r,o){bv(r,e,t);let i=new xr(void 0,t,e,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class ol extends xr{constructor(e,n,r,o,i,s,a){super(e,n,r,o,i,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,o){return this.dirty==On||this.dirty!=cn&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=cn||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=cn,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),i=document.createTextNode(o.text);return new ol(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=On)}get domAtom(){return!1}isText(e){return this.node.text==e}}class mv extends rs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==cn&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class LP extends xr{constructor(e,n,r,o,i,s,a,l,c,u){super(e,n,r,o,i,s,a,c,u),this.spec=l}update(e,n,r,o){if(this.dirty==On)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,n,r);return i&&this.updateInner(e,n,r,o),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}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 yv(t,e,n){let r=t.firstChild,o=!1;for(let i=0;i<e.length;i++){let s=e[i],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=wv(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(a,r);if(s instanceof so){let l=r?r.previousSibling:t.lastChild;yv(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=wv(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const is=function(t){t&&(this.nodeName=t)};is.prototype=Object.create(null);const ao=[new is];function bf(t,e,n){if(t.length==0)return ao;let r=n?ao[0]:new is,o=[r];for(let i=0;i<t.length;i++){let s=t[i].type.attrs;if(s){s.nodeName&&o.push(r=new is(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&o.length==1&&o.push(r=new is(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return o}function vv(t,e,n,r){if(n==ao&&r==ao)return e;let o=e;for(let i=0;i<r.length;i++){let s=r[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&o!=t&&(l=o.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(o),a=ao[0]),o=l}DP(o,a||ao[0],s)}return o}function DP(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&t.classList.remove(r[i]);for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&t.classList.add(o[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function bv(t,e,n){return vv(t,t,ao,bf(e,n,t.nodeType!=1))}function il(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function wv(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class RP{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=NP(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,i=this.stack.length>>1,s=Math.min(i,e.length);for(;o<s&&(o==i-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<i;)this.destroyRest(),this.top.dirty=cn,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=so.create(this.top,e[i],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(e,n,r,o){let i=-1,s;if(o>=this.preMatch.index&&(s=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,n,r,o,i){let s=this.top.children[o];return s.dirty==On&&s.dom==s.contentDOM&&(s.dirty=io),s.update(e,n,r,i)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof xr){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let u=l.dom,d,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=On&&il(n,l.outerDeco));if(!h&&l.update(e,n,r,o))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(d=this.recreateWrapper(l,e,n,r,o,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=io,d.updateChildren(o,s+1),d.dirty=cn),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,i,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!il(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let a=xr.create(this.top,n,r,o,i,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,o,i){let s=xr.create(this.top,e,n,r,o,i);s.contentDOM&&s.updateChildren(o,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let i=new pv(this.top,e,n,r);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof so;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ol)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ft||Pt)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new mv(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function NP(t,e){let n=e,r=n.children.length,o=t.childCount,i=new Map,s=[];e:for(;o>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof so)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}function FP(t,e){return t.type.side-e.type.side}function HP(t,e,n,r){let o=e.locals(t),i=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,o,e.forChild(i,u),c),i+=u.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let u,d;for(;s<o.length&&o[s].to==i;){let m=o[s++];m.widget&&(u?(d||(d=[u])).push(m):u=m)}if(u)if(d){d.sort(FP);for(let m=0;m<d.length;m++)n(d[m],c,!!l)}else n(u,c,!!l);let h,f;if(l)f=-1,h=l,l=null;else if(c<t.childCount)f=c,h=t.child(c++);else break;for(let m=0;m<a.length;m++)a[m].to<=i&&a.splice(m--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)a.push(o[s++]);let p=i+h.nodeSize;if(h.isText){let m=p;s<o.length&&o[s].from<m&&(m=o[s].from);for(let y=0;y<a.length;y++)a[y].to<m&&(m=a[y].to);m<p&&(l=h.cut(m-i),h=h.cut(0,m-i),p=m,f=-1)}else for(;s<o.length&&o[s].to<p;)s++;let g=h.isInline&&!h.isLeaf?a.filter(m=>!m.inline):a.slice();r(h,g,e.forChild(i,h),f),i=p}}function BP(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function $P(t,e,n,r){for(let o=0,i=0;o<t.childCount&&i<=r;){let s=t.child(o++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;o<t.childCount;){let c=t.child(o++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n){if(i>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function wf(t,e,n,r,o){let i=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],c=a,u=a+=l.size;c>=n||u<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,r)),o&&(i.push(o),o=void 0),u>n&&i.push(l.slice(n-c,l.size,r)))}return i}function Sf(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),i=o&&o.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,c;if(rl(n)){for(l=s;o&&!o.node;)o=o.parent;let d=o.node;if(o&&d.isAtom&&Te.isSelectable(d)&&o.parent&&!(d.isInline&&fP(n.focusNode,n.focusOffset,o.dom))){let h=o.posBefore;c=new Te(s==h?a:r.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,h=s;for(let f=0;f<n.rangeCount;f++){let p=n.getRangeAt(f);d=Math.min(d,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,s]=h==t.state.selection.anchor?[h,d]:[d,h],a=r.resolve(s)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=r.resolve(l);if(!c){let d=e=="pointer"||t.state.selection.head<a.pos&&!i?1:-1;c=Ef(t,u,a,d)}return c}function Sv(t){return t.editable?t.hasFocus():Tv(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Kn(t,e=!1){let n=t.state.selection;if(xv(t,n),!!Sv(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Pt){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&ro(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)jP(t);else{let{anchor:r,head:o}=n,i,s;Cv&&!(n instanceof Le)&&(n.$from.parent.inlineContent||(i=Ev(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=Ev(t,n.to))),t.docView.setSelection(r,o,t,e),Cv&&(i&&_v(i),s&&_v(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&VP(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Cv=Ft||Pt&&tv<63;function Ev(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(Ft&&o&&o.contentEditable=="false")return Cf(o);if((!o||o.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(o)return Cf(o);if(i)return Cf(i)}}function Cf(t){return t.contentEditable="true",Ft&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function _v(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function VP(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Sv(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function jP(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,xt(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&zt&&Er<=11&&(r.disabled=!0,r.disabled=!1)}function xv(t,e){if(e instanceof Te){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Av(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Av(t)}function Av(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Ef(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Le.between(e,n,r)}function Ov(t){return t.editable&&!t.hasFocus()?!1:Tv(t)}function Tv(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function zP(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ro(e.node,e.offset,n.anchorNode,n.anchorOffset)}function _f(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Re.findFrom(i,e)}function Ar(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function kv(t,e,n){let r=t.state.selection;if(r instanceof Le)if(n.indexOf("s")>-1){let{$head:o}=r,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=t.state.doc.resolve(o.pos+i.nodeSize*(e<0?-1:1));return Ar(t,new Le(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=_f(t.state,e);return o&&o instanceof Te?Ar(t,o):!1}else if(!(ln&&n.indexOf("m")>-1)){let o=r.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,s;if(!i||i.isText)return!1;let a=e<0?o.pos-i.nodeSize:o.pos;return i.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?Te.isSelectable(i)?Ar(t,new Te(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):ts?Ar(t,new Le(t.state.doc.resolve(e<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Te&&r.node.isInline)return Ar(t,new Le(e>0?r.$to:r.$from));{let o=_f(t.state,e);return o?Ar(t,o):!1}}}function sl(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function ss(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Yo(t,e){return e<0?UP(t):qP(t)}function UP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,i,s=!1;for(mn&&n.nodeType==1&&r<sl(n)&&ss(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(ss(a,-1))o=n,i=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Mv(n))break;{let a=n.previousSibling;for(;a&&ss(a,-1);)o=n.parentNode,i=xt(a),a=a.previousSibling;if(a)n=a,r=sl(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?xf(t,n,r):o&&xf(t,o,i)}function qP(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=sl(n),i,s;for(;;)if(r<o){if(n.nodeType!=1)break;let a=n.childNodes[r];if(ss(a,1))i=n,s=++r;else break}else{if(Mv(n))break;{let a=n.nextSibling;for(;a&&ss(a,1);)i=a.parentNode,s=xt(a)+1,a=a.nextSibling;if(a)n=a,r=0,o=sl(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}i&&xf(t,i,s)}function Mv(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function WP(t,e){for(;t&&e==t.childNodes.length&&!es(t);)e=xt(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function KP(t,e){for(;t&&!e&&!es(t);)e=xt(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function xf(t,e,n){if(e.nodeType!=3){let i,s;(s=WP(e,n))?(e=s,n=0):(i=KP(e,n))&&(e=i,n=i.nodeValue.length)}let r=t.domSelection();if(!r)return;if(rl(r)){let i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Kn(t)},50)}function Pv(t,e){let n=t.state.doc.resolve(e);if(!(Pt||gP)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Iv(t,e,n){let r=t.state.selection;if(r instanceof Le&&!r.empty||n.indexOf("s")>-1||ln&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=_f(t.state,e);if(s&&s instanceof Te)return Ar(t,s)}if(!o.parent.inlineContent){let s=e<0?o:i,a=r instanceof sn?Re.near(s,e):Re.findFrom(s,e);return a?Ar(t,a):!1}return!1}function Lv(t,e){if(!(t.state.selection instanceof Le))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=t.state.tr;return e<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),t.dispatch(s),!0}return!1}function Dv(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function GP(t){if(!Ft||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Dv(t,r,"true"),setTimeout(()=>Dv(t,r,"false"),20)}return!1}function JP(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function XP(t,e){let n=e.keyCode,r=JP(e);if(n==8||ln&&n==72&&r=="c")return Lv(t,-1)||Yo(t,-1);if(n==46&&!e.shiftKey||ln&&n==68&&r=="c")return Lv(t,1)||Yo(t,1);if(n==13||n==27)return!0;if(n==37||ln&&n==66&&r=="c"){let o=n==37?Pv(t,t.state.selection.from)=="ltr"?-1:1:-1;return kv(t,o,r)||Yo(t,o)}else if(n==39||ln&&n==70&&r=="c"){let o=n==39?Pv(t,t.state.selection.from)=="ltr"?1:-1:1;return kv(t,o,r)||Yo(t,o)}else{if(n==38||ln&&n==80&&r=="c")return Iv(t,-1,r)||Yo(t,-1);if(n==40||ln&&n==78&&r=="c")return GP(t)||Iv(t,1,r)||Yo(t,1);if(r==(ln?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Af(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let n=[],{content:r,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,i--;let f=r.firstChild;n.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),r=f.content}let s=t.someProp("clipboardSerializer")||no.fromSchema(t.state.schema),a=jv(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c=l.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=$v[c.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=a.createElement(u[f]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,`
|
43
|
+
|
44
|
+
`);return{dom:l,text:h,slice:e}}function Rv(t,e,n,r,o){let i=o.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||i||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,i||r,t)}),i)return e?new me(le.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
45
|
+
`))),0,0):me.empty;let d=t.someProp("clipboardTextParser",h=>h(e,o,r,t));if(d)a=d;else{let h=o.marks(),{schema:f}=t.state,p=no.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let m=s.appendChild(document.createElement("p"));g&&m.appendChild(p.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",d=>{n=d(n,t)}),s=e2(n),ts&&t2(s);let c=s&&s.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=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Wi.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:o,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!YP.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=n2(Bv(a,+u[1],+u[2]),u[4]);else if(a=me.maxOpen(QP(a.content,o),!0),a.openStart||a.openEnd){let d=0,h=0;for(let f=a.content.firstChild;d<a.openStart&&!f.type.spec.isolating;d++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Bv(a,d,h)}return t.someProp("transformPasted",d=>{a=d(a,t)}),a}const YP=/^(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 QP(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),i,s=[];if(t.forEach(a=>{if(!s)return;let l=o.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Fv(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Hv(s[s.length-1],i.length));let u=Nv(a,l);s.push(u),o=o.matchType(u.type),i=l}}),s)return le.from(s)}return t}function Nv(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,le.from(t));return t}function Fv(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let i=Fv(t,e,n,r.lastChild,o+1);if(i)return r.copy(r.content.replaceChild(r.childCount-1,i));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(le.from(Nv(n,t,o+1))))}}function Hv(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Hv(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(le.empty,!0);return t.copy(n.append(r))}function Of(t,e,n,r,o,i){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(i=0),o<r-1&&(a=Of(a,e,n,r,o+1,i)),o>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(le.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Bv(t,e,n){return e<t.openStart&&(t=new me(Of(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new me(Of(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const $v={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Vv=null;function jv(){return Vv||(Vv=document.implementation.createHTMLDocument("title"))}let Tf=null;function ZP(t){let e=window.trustedTypes;return e?(Tf||(Tf=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),Tf.createHTML(t)):t}function e2(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=jv().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&$v[r[1].toLowerCase()])&&(t=o.map(i=>"<"+i+">").join("")+t+o.map(i=>"</"+i+">").reverse().join("")),n.innerHTML=ZP(t),o)for(let i=0;i<o.length;i++)n=n.querySelector(o[i])||n;return n}function t2(t){let e=t.querySelectorAll(Pt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function n2(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:i,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;o=le.from(l.create(r[a+1],o)),i++,s++}return new me(o,i,s)}const Ht={},Bt={},r2={touchstart:!0,touchmove:!0};class o2{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function i2(t){for(let e in Ht){let n=Ht[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{a2(t,r)&&!Mf(t,r)&&(t.editable||!(r.type in Bt))&&n(t,r)},r2[e]?{passive:!0}:void 0)}Ft&&t.dom.addEventListener("input",()=>null),kf(t)}function Or(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function s2(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function kf(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Mf(t,r))})}function Mf(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function a2(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function l2(t,e){!Mf(t,e)&&Ht[e.type]&&(t.editable||!(e.type in Bt))&&Ht[e.type](t,e)}Bt.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Uv(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(qn&&Pt&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),Jo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,oo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||XP(t,n)?n.preventDefault():Or(t,"key")},Bt.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Bt.keypress=(t,e)=>{let n=e;if(Uv(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ln&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Le)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",i=>i(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function al(t){return{left:t.clientX,top:t.clientY}}function c2(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Pf(t,e,n,r,o){if(r==-1)return!1;let i=t.state.doc.resolve(r);for(let s=i.depth+1;s>0;s--)if(t.someProp(e,a=>s>i.depth?a(t,n,i.nodeAfter,i.before(s),o,!0):a(t,n,i.node(s),i.before(s),o,!1)))return!0;return!1}function Qo(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);n=="pointer"&&r.setMeta("pointer",!0),t.dispatch(r)}function u2(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Te.isSelectable(r)?(Qo(t,new Te(n),"pointer"),!0):!1}function d2(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Te&&(r=n.node);let i=t.state.doc.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(Te.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?o=i.before(n.$from.depth):o=i.before(s);break}}return o!=null?(Qo(t,Te.create(t.state.doc,o),"pointer"),!0):!1}function f2(t,e,n,r,o){return Pf(t,"handleClickOn",e,n,r)||t.someProp("handleClick",i=>i(t,e,r))||(o?d2(t,n):u2(t,n))}function h2(t,e,n,r){return Pf(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function p2(t,e,n,r){return Pf(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||g2(t,n,r)}function g2(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Qo(t,Le.create(r,0,r.content.size),"pointer"),!0):!1;let o=r.resolve(e);for(let i=o.depth+1;i>0;i--){let s=i>o.depth?o.nodeAfter:o.node(i),a=o.before(i);if(s.inlineContent)Qo(t,Le.create(r,a+1,a+1+s.content.size),"pointer");else if(Te.isSelectable(s))Qo(t,Te.create(r,a),"pointer");else continue;return!0}}function If(t){return ll(t)}const zv=ln?"metaKey":"ctrlKey";Ht.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=If(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&c2(n,t.input.lastClick)&&!n[zv]&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};let s=t.posAtCoords(al(n));s&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new m2(t,s,n,!!r)):(i=="doubleClick"?h2:p2)(t,s.pos,s.inside,n)?n.preventDefault():Or(t,"pointer"))};class m2{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[zv],this.allowDefault=r.shiftKey;let i,s;if(n.inside>-1)i=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);i=u.parent,s=u.depth?u.before():0}const a=o?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Te&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&mn&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Or(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>Kn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(al(e))),this.updateAllowDefault(e),this.allowDefault||!n?Or(this.view,"pointer"):f2(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ft&&this.mightDrag&&!this.mightDrag.node.isAtom||Pt&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Qo(this.view,Re.near(this.view.state.doc.resolve(n.pos)),"pointer"),e.preventDefault()):Or(this.view,"pointer")}move(e){this.updateAllowDefault(e),Or(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ht.touchstart=t=>{t.input.lastTouch=Date.now(),If(t),Or(t,"pointer")},Ht.touchmove=t=>{t.input.lastTouch=Date.now(),Or(t,"pointer")},Ht.contextmenu=t=>If(t);function Uv(t,e){return t.composing?!0:Ft&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const y2=qn?5e3:-1;Bt.compositionstart=Bt.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),ll(t,!0),t.markCursor=null;else if(ll(t,!e.selection.empty),mn&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,i=r.focusOffset;o&&o.nodeType==1&&i!=0;){let s=i<0?o.lastChild:o.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=t.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else o=s,i=-1}}t.input.composing=!0}qv(t,y2)},Bt.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,qv(t,20))};function qv(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>ll(t),e))}function Wv(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=b2());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function v2(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=uP(e.focusNode,e.focusOffset),r=dP(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function b2(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function ll(t,e=!1){if(!(qn&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Wv(t),e||t.docView&&t.docView.dirty){let n=Sf(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function w2(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const as=zt&&Er<15||Jo&&mP<604;Ht.copy=Bt.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let i=as?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Af(t,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):w2(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function S2(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function C2(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ls(t,r.value,null,o,e):ls(t,r.textContent,r.innerHTML,o,e)},50)}function ls(t,e,n,r,o){let i=Rv(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,o,i||me.empty)))return!0;if(!i)return!1;let s=S2(i),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Kv(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Bt.paste=(t,e)=>{let n=e;if(t.composing&&!qn)return;let r=as?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ls(t,Kv(r),r.getData("text/html"),o,n)?n.preventDefault():C2(t,n)};class Gv{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Jv=ln?"altKey":"ctrlKey";Ht.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(al(n)),s;if(!(i&&i.pos>=o.from&&i.pos<=(o instanceof Te?o.to-1:o.to))){if(r&&r.mightDrag)s=Te.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let d=t.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=t.docView&&(s=Te.create(t.state.doc,d.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:c,slice:u}=Af(t,a);(!n.dataTransfer.files.length||!Pt||tv>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(as?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",as||n.dataTransfer.setData("text/plain",c),t.dragging=new Gv(u,!n[Jv],s)},Ht.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Bt.dragover=Bt.dragenter=(t,e)=>e.preventDefault(),Bt.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(al(n));if(!o)return;let i=t.state.doc.resolve(o.pos),s=r&&r.slice;s?t.someProp("transformPasted",p=>{s=p(s,t)}):s=Rv(t,Kv(n.dataTransfer),as?null:n.dataTransfer.getData("text/html"),!1,i);let a=!!(r&&!n[Jv]);if(t.someProp("handleDrop",p=>p(t,n,s||me.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?H1(t.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=t.state.tr;if(a){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Te.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Te(f));else{let p=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,m,y,C)=>p=C),c.setSelection(Ef(t,f,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Ht.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Kn(t)},20))},Ht.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Ht.beforeinput=(t,e)=>{if(Pt&&qn&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,oo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in Bt)Ht[t]=Bt[t];function cs(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class cl{constructor(e,n){this.toDOM=e,this.spec=n||lo,this.side=this.spec.side||0}map(e,n,r,o){let{pos:i,deleted:s}=e.mapResult(n.from+o,this.side<0?-1:1);return s?null:new Ut(i-r,i-r,this)}valid(){return!0}eq(e){return this==e||e instanceof cl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&cs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Tr{constructor(e,n){this.attrs=e,this.spec=n||lo}map(e,n,r,o){let i=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return i>=s?null:new Ut(i,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Tr&&cs(this.attrs,e.attrs)&&cs(this.spec,e.spec)}static is(e){return e.type instanceof Tr}destroy(){}}class Lf{constructor(e,n){this.attrs=e,this.spec=n||lo}map(e,n,r,o){let i=e.mapResult(n.from+o,1);if(i.deleted)return null;let s=e.mapResult(n.to+o,-1);return s.deleted||s.pos<=i.pos?null:new Ut(i.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),i;return o==n.from&&!(i=e.child(r)).isText&&o+i.nodeSize==n.to}eq(e){return this==e||e instanceof Lf&&cs(this.attrs,e.attrs)&&cs(this.spec,e.spec)}destroy(){}}class Ut{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Ut(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Ut(e,e,new cl(n,r))}static inline(e,n,r,o){return new Ut(e,n,new Tr(r,o))}static node(e,n,r,o){return new Ut(e,n,new Lf(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof Tr}get widget(){return this.type instanceof cl}}const Zo=[],lo={};class ut{constructor(e,n){this.local=e.length?e:Zo,this.children=n.length?n:Zo}static create(e,n){return n.length?ul(n,e,0,lo):It}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!i||i(a.spec))&&r.push(a.copy(a.from+o,a.to+o))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,o+a,i)}}map(e,n,r){return this==It||e.maps.length==0?this:this.mapInner(e,n,0,0,r||lo)}mapInner(e,n,r,o,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,o);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?E2(this.children,s||[],e,n,r,o,i):s?new ut(s.sort(co),Zo):It}add(e,n){return n.length?this==It?ut.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,i=0;e.forEach((a,l)=>{let c=l+r,u;if(u=Yv(n,a,c)){for(o||(o=this.children.slice());i<o.length&&o[i]<l;)i+=3;o[i]==l?o[i+2]=o[i+2].addInner(a,u,c+1):o.splice(i,0,l,l+a.nodeSize,ul(u,a,c+1,lo)),i+=3}});let s=Xv(i?Qv(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new ut(s.length?this.local.concat(s).sort(co):this.local,o||this.children)}remove(e){return e.length==0||this==It?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let i=0;i<r.length;i+=3){let s,a=r[i]+n,l=r[i+1]+n;for(let u=0,d;u<e.length;u++)(d=e[u])&&d.from>a&&d.to<l&&(e[u]=null,(s||(s=[])).push(d));if(!s)continue;r==this.children&&(r=this.children.slice());let c=r[i+2].removeInner(s,a+1);c!=It?r[i+2]=c:(r.splice(i,3),i-=3)}if(o.length){for(let i=0,s;i<e.length;i++)if(s=e[i])for(let a=0;a<o.length;a++)o[a].eq(s,n)&&(o==this.local&&(o=this.local.slice()),o.splice(a--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ut(o,r):It}forChild(e,n){if(this==It)return this;if(n.isLeaf)return ut.empty;let r,o;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let i=e+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof Tr){let c=Math.max(i,l.from)-i,u=Math.min(s,l.to)-i;c<u&&(o||(o=[])).push(l.copy(c,u))}}if(o){let a=new ut(o.sort(co),Zo);return r?new kr([a,r]):a}return r||It}eq(e){if(this==e)return!0;if(!(e instanceof ut)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Df(this.localsInner(e))}localsInner(e){if(this==It)return Zo;if(e.inlineContent||!this.local.some(Tr.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Tr||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ut.empty=new ut([],[]),ut.removeOverlap=Df;const It=ut.empty;class kr{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,lo));return kr.from(r)}forChild(e,n){if(n.isLeaf)return ut.empty;let r=[];for(let o=0;o<this.members.length;o++){let i=this.members[o].forChild(e,n);i!=It&&(i instanceof kr?r=r.concat(i.members):r.push(i))}return kr.from(r)}eq(e){if(!(e instanceof kr)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let o=0;o<this.members.length;o++){let i=this.members[o].localsInner(e);if(i.length)if(!n)n=i;else{r&&(n=n.slice(),r=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Df(r?n:n.sort(co)):Zo}static from(e){switch(e.length){case 0:return It;case 1:return e[0];default:return new kr(e.every(n=>n instanceof ut)?e:e.reduce((n,r)=>n.concat(r instanceof ut?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function E2(t,e,n,r,o,i,s){let a=t.slice();for(let c=0,u=i;c<n.maps.length;c++){let d=0;n.maps[c].forEach((h,f,p,g)=>{let m=g-p-(f-h);for(let y=0;y<a.length;y+=3){let C=a[y+1];if(C<0||h>C+u-d)continue;let w=a[y]+u-d;f>=w?a[y+1]=h<=w?-2:-1:h>=u&&m&&(a[y]+=m,a[y+1]+=m)}d+=m}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+i),d=u-o;if(d<0||d>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+i,-1),f=h-o,{index:p,offset:g}=r.content.findIndex(d),m=r.maybeChild(p);if(m&&g==d&&g+m.nodeSize==f){let y=a[c+2].mapInner(n,m,u+1,t[c]+i+1,s);y!=It?(a[c]=d,a[c+1]=f,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=_2(a,t,e,n,o,i,s),u=ul(c,r,0,s);e=u.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,h=0;d<u.children.length;d+=3){let f=u.children[d];for(;h<a.length&&a[h]<f;)h+=3;a.splice(h,0,u.children[d],u.children[d+1],u.children[d+2])}}return new ut(e.sort(co),a)}function Xv(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Ut(o.from+e,o.to+e,o.type))}return n}function _2(t,e,n,r,o,i,s){function a(l,c){for(let u=0;u<l.local.length;u++){let d=l.local[u].map(r,o,c);d?n.push(d):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+i+1);return n}function Yv(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let i=0,s;i<t.length;i++)(s=t[i])&&s.from>n&&s.to<r&&((o||(o=[])).push(s),t[i]=null);return o}function Qv(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function ul(t,e,n,r){let o=[],i=!1;e.forEach((a,l)=>{let c=Yv(t,a,l+n);if(c){i=!0;let u=ul(c,a,n+l+1,r);u!=It&&o.push(l,l+a.nodeSize,u)}});let s=Xv(i?Qv(t):t,-n).sort(co);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||o.length?new ut(s,o):It}function co(t,e){return t.from-e.from||t.to-e.to}function Df(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let i=e[o];if(i.from==r.from){i.to!=r.to&&(e==t&&(e=t.slice()),e[o]=i.copy(i.from,r.to),Zv(e,o+1,i.copy(r.to,i.to)));continue}else{i.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,i.from),Zv(e,o,r.copy(i.from,r.to)));break}}}return e}function Zv(t,e,n){for(;e<t.length&&co(n,t[e])>0;)e++;t.splice(e,0,n)}function Rf(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=It&&e.push(r)}),t.cursorWrapper&&e.push(ut.create(t.state.doc,[t.cursorWrapper.deco])),kr.from(e)}const x2={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},A2=zt&&Er<=11;class O2{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 T2{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new O2,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);zt&&Er<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),A2&&(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,x2)),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 n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.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(Ov(this.view)){if(this.suppressingSelectionUpdates)return Kn(this.view);if(zt&&Er<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ro(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 n=new Set,r;for(let i=e.focusNode;i;i=Go(i))n.add(i);for(let i=e.anchorNode;i;i=Go(i))if(n.has(i)){r=i;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.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 n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Ov(e)&&!this.ignoreSelectionChange(r),i=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let d=this.registerMutation(n[u],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(mn&&l.length){let u=l.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||P2(e,d)!=f)&&h.remove()}}}let c=null;i<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&rl(r)&&(c=Sf(e))&&c.eq(Re.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Kn(e),this.currentSelection.set(r),e.scrollToSelection()):(i>-1||o)&&(i>-1&&(e.docView.markDirty(i,s),k2(e)),this.handleDOMChange(i,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Kn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.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;u<e.addedNodes.length;u++){let d=e.addedNodes[u];n.push(d),d.nodeType==3&&(this.lastChangedTextNode=d)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,i=e.nextSibling;if(zt&&Er<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:d,nextSibling:h}=e.addedNodes[u];(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(i=h)}let s=o&&o.parentNode==e.target?xt(o)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=i&&i.parentNode==e.target?xt(i):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let eb=new WeakMap,tb=!1;function k2(t){if(!eb.has(t)&&(eb.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=mn,tb)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),tb=!0}}function nb(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,i=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return ro(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function M2(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return nb(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?nb(t,n):null}function P2(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function I2(t,e,n){let{node:r,fromOffset:o,toOffset:i,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],rl(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Pt&&t.input.lastKeyCode===8)for(let m=i;m>o;m--){let y=r.childNodes[m-1],C=y.pmViewDesc;if(y.nodeName=="BR"&&!C){i=m;break}if(!C||C.size)break}let d=t.state.doc,h=t.someProp("domParser")||Wi.fromSchema(t.state.schema),f=d.resolve(s),p=null,g=h.parse(r,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:L2,context:f});if(c&&c[0].pos!=null){let m=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=m),p={anchor:m+s,head:y+s}}return{doc:g,sel:p,from:s,to:a}}function L2(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ft&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Ft&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const D2=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function R2(t,e,n,r,o){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,O=Sf(t,A);if(O&&!t.state.selection.eq(O)){if(Pt&&qn&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",M=>M(t,oo(13,"Enter"))))return;let k=t.state.tr.setSelection(O);A=="pointer"?k.setMeta("pointer",!0):A=="key"&&k.scrollIntoView(),i&&k.setMeta("composition",i),t.dispatch(k)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=I2(t,e,n),u=t.state.doc,d=u.slice(c.from,c.to),h,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,f="end"):(h=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=H2(d.content,c.doc.content,c.from,h,f);if(p&&t.input.domChangeCount++,(Jo&&t.input.lastIOSEnter>Date.now()-225||qn)&&o.some(A=>A.nodeType==1&&!D2.test(A.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",A=>A(t,oo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(r&&l instanceof Le&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let A=rb(t,t.state.doc,c.sel);if(A&&!A.eq(t.state.selection)){let O=t.state.tr.setSelection(A);i&&O.setMeta("composition",i),t.dispatch(O)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Le&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),zt&&Er<=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 g=c.doc.resolveNoCache(p.start-c.from),m=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),C=g.sameParent(m)&&g.parent.inlineContent&&y.end()>=p.endA,w;if((Jo&&t.input.lastIOSEnter>Date.now()-225&&(!C||o.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!C&&g.pos<c.doc.content.size&&!g.sameParent(m)&&(w=Re.findFrom(c.doc.resolve(g.pos+1),1,!0))&&w.head==m.pos)&&t.someProp("handleKeyDown",A=>A(t,oo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&F2(u,p.start,p.endA,g,m)&&t.someProp("handleKeyDown",A=>A(t,oo(8,"Backspace")))){qn&&Pt&&t.domObserver.suppressSelectionUpdates();return}Pt&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),qn&&!C&&g.start()!=m.start()&&m.parentOffset==0&&g.depth==m.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,m=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(A){return A(t,oo(13,"Enter"))})},20));let b=p.start,S=p.endA,E,x,_;if(C){if(g.pos==m.pos)zt&&Er<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Kn(t),20)),E=t.state.tr.delete(b,S),x=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(_=N2(g.parent.content.cut(g.parentOffset,m.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))E=t.state.tr,_.type=="add"?E.addMark(b,S,_.mark):E.removeMark(b,S,_.mark);else if(g.parent.child(g.index()).isText&&g.index()==m.index()-(m.textOffset?0:1)){let A=g.parent.textBetween(g.parentOffset,m.parentOffset);if(t.someProp("handleTextInput",O=>O(t,b,S,A)))return;E=t.state.tr.insertText(A,b,S)}}if(E||(E=t.state.tr.replace(b,S,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let A=rb(t,E.doc,c.sel);A&&!(Pt&&t.composing&&A.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==b||A.head==E.mapping.map(S)-1)||zt&&A.empty&&A.head==b)&&E.setSelection(A)}x&&E.ensureMarks(x),i&&E.setMeta("composition",i),t.dispatch(E.scrollIntoView())}function rb(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ef(t,e.resolve(n.anchor),e.resolve(n.head))}function N2(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,i=r,s,a,l;for(let u=0;u<r.length;u++)o=r[u].removeFromSet(o);for(let u=0;u<n.length;u++)i=n[u].removeFromSet(i);if(o.length==1&&i.length==0)a=o[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(o.length==0&&i.length==1)a=i[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(le.from(c).eq(t))return{mark:a,type:s}}function F2(t,e,n,r,o){if(n-e<=o.pos-r.pos||Nf(r,!0,!1)<o.pos)return!1;let i=t.resolve(e);if(!r.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==e+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=t.resolve(Nf(i,!0,!0));return!s.parent.isTextblock||s.pos>n||Nf(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Nf(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let i=t.node(r).maybeChild(t.indexAfter(r));for(;i&&!i.isLeaf;)i=i.firstChild,o++}return o}function H2(t,e,n,r,o){let i=t.findDiffStart(e,n);if(i==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let l=Math.max(0,i-Math.min(s,a));r-=s+l-i}if(s<i&&t.size<e.size){let l=r<=i&&r>=s?i-r:0;i-=l,i&&i<e.size&&ob(e.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=r<=i&&r>=a?i-r:0;i-=l,i&&i<t.size&&ob(t.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function ob(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class B2{constructor(e,n){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 o2,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(cb),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=ab(this),sb(this),this.nodeViews=lb(this),this.docView=gv(this.state.doc,ib(this),Rf(this),this.dom,this),this.domObserver=new T2(this,(r,o,i,s)=>R2(this,r,o,i,s)),this.domObserver.start(),i2(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&kf(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(cb),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,i=!1,s=!1;e.storedMarks&&this.composing&&(Wv(this),s=!0),this.state=e;let a=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=lb(this);V2(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&kf(this),this.editable=ab(this),sb(this);let l=Rf(this),c=ib(this),u=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(e.doc,c,l);(d||!e.selection.eq(o.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&bP(this);if(s){this.domObserver.stop();let f=d&&(zt||Pt)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&$2(o.selection,e.selection);if(d){let p=Pt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=v2(this)),(i||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=gv(e.doc,c,l,this.dom,this)),p&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&zP(this))?Kn(this,f):(xv(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&wP(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Te){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&nv(this,n.getBoundingClientRect(),e)}else nv(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 n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let i=r.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==r.node&&(o=i)}this.dragging=new Gv(e.slice,e.move,o<0?void 0:Te.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))return o;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(o=n?n(a):a))return o}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[e];if(a!=null&&(o=n?n(a):a))return o}}hasFocus(){if(zt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&SP(this.dom),Kn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return AP(this,e)}coordsAtPos(e,n=1){return lv(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return PP(this,n||this.state,e)}pasteHTML(e,n){return ls(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ls(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Af(this,e)}destroy(){this.docView&&(s2(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Rf(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,lP())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return l2(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Ft&&this.root.nodeType===11&&hP(this.dom.ownerDocument)==this.dom&&M2(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function ib(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Ut.node(0,t.state.doc.content.size,e)]}function sb(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ut.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ab(t){return!t.someProp("editable",e=>e(t.state)===!1)}function $2(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function lb(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function V2(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function cb(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Mr={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:"'"},dl={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},j2=typeof navigator<"u"&&/Mac/.test(navigator.platform),z2=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),At=0;At<10;At++)Mr[48+At]=Mr[96+At]=String(At);for(var At=1;At<=24;At++)Mr[At+111]="F"+At;for(var At=65;At<=90;At++)Mr[At]=String.fromCharCode(At+32),dl[At]=String.fromCharCode(At);for(var Ff in Mr)dl.hasOwnProperty(Ff)||(dl[Ff]=Mr[Ff]);function U2(t){var e=j2&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||z2&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?dl:Mr)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const q2=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function W2(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))q2?s=!0:o=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function K2(t){let e=Object.create(null);for(let n in t)e[W2(n)]=t[n];return e}function Hf(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function G2(t){return new at({props:{handleKeyDown:ub(t)}})}function ub(t){let e=K2(t);return function(n,r){let o=U2(r),i,s=e[Hf(o,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Hf(o,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=Mr[r.keyCode])&&i!=o){let a=e[Hf(i,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const J2=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function db(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const X2=(t,e,n)=>{let r=db(t,n);if(!r)return!1;let o=Bf(r);if(!o){let s=r.blockRange(),a=s&&jo(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let i=o.nodeBefore;if(gb(t,o,e,-1))return!0;if(r.parent.content.size==0&&(ei(i,"end")||Te.isSelectable(i)))for(let s=r.depth;;s--){let a=el(t.doc,r.before(s),r.after(s),me.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(ei(i,"end")?Re.findFrom(l.doc.resolve(l.mapping.map(o.pos,-1)),-1):Te.create(l.doc,o.pos-i.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0):!1},Y2=(t,e,n)=>{let r=db(t,n);if(!r)return!1;let o=Bf(r);return o?fb(t,o,e):!1},Q2=(t,e,n)=>{let r=hb(t,n);if(!r)return!1;let o=$f(r);return o?fb(t,o,e):!1};function fb(t,e,n){let r=e.nodeBefore,o=r,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let u=o.lastChild;if(!u)return!1;o=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=el(t.doc,i,l,me.empty);if(!c||c.from!=i||c instanceof bt&&c.slice.size>=l-i)return!1;if(n){let u=t.tr.step(c);u.setSelection(Le.create(u.doc,i)),n(u.scrollIntoView())}return!0}function ei(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const Z2=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Bf(r)}let s=i&&i.nodeBefore;return!s||!Te.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Te.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Bf(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function hb(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const eI=(t,e,n)=>{let r=hb(t,n);if(!r)return!1;let o=$f(r);if(!o)return!1;let i=o.nodeAfter;if(gb(t,o,e,1))return!0;if(r.parent.content.size==0&&(ei(i,"start")||Te.isSelectable(i))){let s=el(t.doc,r.before(),r.after(),me.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(ei(i,"start")?Re.findFrom(a.doc.resolve(a.mapping.map(o.pos)),1):Te.create(a.doc,a.mapping.map(o.pos))),e(a.scrollIntoView())}return!0}}return i.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0):!1},tI=(t,e,n)=>{let{$head:r,empty:o}=t.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=$f(r)}let s=i&&i.nodeAfter;return!s||!Te.isSelectable(s)?!1:(e&&e(t.tr.setSelection(Te.create(t.doc,i.pos)).scrollIntoView()),!0)};function $f(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const nI=(t,e)=>{let n=t.selection,r=n instanceof Te,o;if(r){if(n.node.isTextblock||!Sr(t.doc,n.from))return!1;o=n.from}else if(o=Za(t.doc,n.from,-1),o==null)return!1;if(e){let i=t.tr.join(o);r&&i.setSelection(Te.create(i.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},rI=(t,e)=>{let n=t.selection,r;if(n instanceof Te){if(n.node.isTextblock||!Sr(t.doc,n.to))return!1;r=n.to}else if(r=Za(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},oI=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),i=o&&jo(o);return i==null?!1:(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)},iI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
46
|
+
`).scrollIntoView()),!0)};function pb(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const sI=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=pb(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Re.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},aI=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof sn||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=pb(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let s=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,a=t.tr.insert(s,i.createAndFill());a.setSelection(Le.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},lI=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(zo(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let r=n.blockRange(),o=r&&jo(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)},cI=(t,e)=>{let{$from:n,to:r}=t.selection,o,i=n.sharedDepth(r);return i==0?!1:(o=n.before(i),e&&e(t.tr.setSelection(Te.create(t.doc,o))),!0)};function uI(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,i=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(o.isTextblock||Sr(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function gb(t,e,n,r){let o=e.nodeBefore,i=e.nodeAfter,s,a,l=o.type.spec.isolating||i.type.spec.isolating;if(!l&&uI(t,e,n))return!0;let c=!l&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(a=o.contentMatchAt(o.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,p=le.empty;for(let y=s.length-1;y>=0;y--)p=le.from(s[y].create(null,p));p=le.from(o.copy(p));let g=t.tr.step(new wt(e.pos-1,f,e.pos,f,new me(p,1,0),s.length,!0)),m=g.doc.resolve(f+2*s.length);m.nodeAfter&&m.nodeAfter.type==o.type&&Sr(g.doc,m.pos)&&g.join(m.pos),n(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||r>0&&l?null:Re.findFrom(e,1),d=u&&u.$from.blockRange(u.$to),h=d&&jo(d);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(d,h).scrollIntoView()),!0;if(c&&ei(i,"start",!0)&&ei(o,"end")){let f=o,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let g=i,m=1;for(;!g.isTextblock;g=g.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let y=le.empty;for(let w=p.length-1;w>=0;w--)y=le.from(p[w].copy(y));let C=t.tr.step(new wt(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new me(y,p.length,0),0,!0));n(C.scrollIntoView())}return!0}}return!1}function mb(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return o.node(i).isTextblock?(n&&n(e.tr.setSelection(Le.create(e.doc,t<0?o.start(i):o.end(i)))),!0):!1}}const dI=mb(-1),fI=mb(1);function hI(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),a=s&&sf(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function yb(t,e=null){return function(n,r){let o=!1;for(let i=0;i<n.selection.ranges.length&&!o;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,c)=>{if(o)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)o=!0;else{let u=n.doc.resolve(c),d=u.index();o=u.parent.canReplaceWith(d,d+1,t)}})}if(!o)return!1;if(r){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,t,e)}r(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function pI(t,e=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let a=r?n.tr:null;return gI(a,s,t,e)?(r&&r(a.scrollIntoView()),!0):!1}}function gI(t,e,n,r=null){let o=!1,i=e,s=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=s.resolve(e.start-2);i=new Ka(l,l,e.depth),e.endIndex<e.parent.childCount&&(e=new Ka(e.$from,s.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let a=sf(i,n,r,e);return a?(t&&mI(t,e,a,o,n),!0):!1}function mI(t,e,n,r,o){let i=le.empty;for(let u=n.length-1;u>=0;u--)i=le.from(n[u].type.create(n[u].attrs,i));t.step(new wt(e.start-(r?2:0),e.end,e.start,e.end,new me(i,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==o&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,d=e.endIndex,h=!0;u<d;u++,h=!1)!h&&zo(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function yI(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,s=>s.childCount>0&&s.firstChild.type==t);return i?n?r.node(i.depth-1).type==t?vI(e,n,t,i):bI(e,n,i):!0:!1}}function vI(t,e,n,r){let o=t.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new wt(i-1,s,i,s,new me(le.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ka(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));const a=jo(r);if(a==null)return!1;o.lift(r,a);let l=o.doc.resolve(o.mapping.map(i,-1)-1);return Sr(o.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&o.join(l.pos),e(o.scrollIntoView()),!0}function bI(t,e,n){let r=t.tr,o=n.parent;for(let f=n.end,p=n.endIndex-1,g=n.startIndex;p>g;p--)f-=o.child(p).nodeSize,r.delete(f-1,f+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?le.empty:le.from(o))))return!1;let d=i.pos,h=d+s.nodeSize;return r.step(new wt(d-(a?1:0),h+(l?1:0),d+1,h-1,new me((a?le.empty:le.from(o.copy(le.empty))).append(l?le.empty:le.from(o.copy(le.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function wI(t){return function(e,n){let{$from:r,$to:o}=e.selection,i=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=le.from(c?t.create():null),d=new me(le.from(t.create(null,le.from(a.type.create(null,u)))),c?3:1,0),h=i.start,f=i.end;n(e.tr.step(new wt(h-(c?3:1),f,h,f,d,1,!0)).scrollIntoView())}return!0}}function fl(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=n,{storedMarks:i}=n;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 o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}class hl{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:i}=r,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const d=l(...u)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a=[],l=!!e,c=e||i.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),a.every(h=>h===!0)),d={...Object.fromEntries(Object.entries(r).map(([h,f])=>[h,(...g)=>{const m=this.buildProps(c,n),y=f(...g)(m);return a.push(y),d}])),run:u};return d}createCan(e){const{rawCommands:n,state:r}=this,o=!1,i=e||r.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:i}=this,{view:s}=o,a={tr:e,editor:o,view:s,state:fl({state:i,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class SI{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function xe(t,e,n){return t.config[e]===void 0&&t.parent?xe(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?xe(t.parent,e,n):null}):t.config[e]}function pl(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function vb(t){const e=[],{nodeExtensions:n,markExtensions:r}=pl(t),o=[...n,...r],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:o},l=xe(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([h,f])=>{e.push({type:d,name:h,attribute:{...i,...f}})})})})}),o.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=xe(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,d])=>{const h={...i,...d};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function St(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function rt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,i])=>{if(!r[o]){r[o]=i;return}if(o==="class"){const a=i?String(i).split(" "):[],l=r[o]?r[o].split(" "):[],c=a.filter(u=>!l.includes(u));r[o]=[...l,...c].join(" ")}else if(o==="style"){const a=i?i.split(";").map(u=>u.trim()).filter(Boolean):[],l=r[o]?r[o].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;l.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),a.forEach(u=>{const[d,h]=u.split(":").map(f=>f.trim());c.set(d,h)}),r[o]=Array.from(c.entries()).map(([u,d])=>`${u}: ${d}`).join("; ")}else r[o]=i}),r},{})}function gl(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>rt(n,r),{})}function bb(t){return typeof t=="function"}function Ne(t,e=void 0,...n){return bb(t)?e?t.bind(e)(...n):t(...n):t}function CI(t={}){return Object.keys(t).length===0&&t.constructor===Object}function EI(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function wb(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):EI(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...r,...o}}}}function Sb(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&CI(n)?!1:n!=null))}function _I(t,e){var n;const r=vb(t),{nodeExtensions:o,markExtensions:i}=pl(t),s=(n=o.find(c=>xe(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(o.map(c=>{const u=r.filter(y=>y.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((y,C)=>{const w=xe(C,"extendNodeSchema",d);return{...y,...w?w(c):{}}},{}),f=Sb({...h,content:Ne(xe(c,"content",d)),marks:Ne(xe(c,"marks",d)),group:Ne(xe(c,"group",d)),inline:Ne(xe(c,"inline",d)),atom:Ne(xe(c,"atom",d)),selectable:Ne(xe(c,"selectable",d)),draggable:Ne(xe(c,"draggable",d)),code:Ne(xe(c,"code",d)),whitespace:Ne(xe(c,"whitespace",d)),linebreakReplacement:Ne(xe(c,"linebreakReplacement",d)),defining:Ne(xe(c,"defining",d)),isolating:Ne(xe(c,"isolating",d)),attrs:Object.fromEntries(u.map(y=>{var C;return[y.name,{default:(C=y==null?void 0:y.attribute)===null||C===void 0?void 0:C.default}]}))}),p=Ne(xe(c,"parseHTML",d));p&&(f.parseDOM=p.map(y=>wb(y,u)));const g=xe(c,"renderHTML",d);g&&(f.toDOM=y=>g({node:y,HTMLAttributes:gl(y,u)}));const m=xe(c,"renderText",d);return m&&(f.toText=m),[c.name,f]})),l=Object.fromEntries(i.map(c=>{const u=r.filter(m=>m.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((m,y)=>{const C=xe(y,"extendMarkSchema",d);return{...m,...C?C(c):{}}},{}),f=Sb({...h,inclusive:Ne(xe(c,"inclusive",d)),excludes:Ne(xe(c,"excludes",d)),group:Ne(xe(c,"group",d)),spanning:Ne(xe(c,"spanning",d)),code:Ne(xe(c,"code",d)),attrs:Object.fromEntries(u.map(m=>{var y;return[m.name,{default:(y=m==null?void 0:m.attribute)===null||y===void 0?void 0:y.default}]}))}),p=Ne(xe(c,"parseHTML",d));p&&(f.parseDOM=p.map(m=>wb(m,u)));const g=xe(c,"renderHTML",d);return g&&(f.toDOM=m=>g({mark:m,HTMLAttributes:gl(m,u)})),[c.name,f]}));return new v1({topNode:s,nodes:a,marks:l})}function Vf(t,e){return e.nodes[t]||e.marks[t]||null}function Cb(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function jf(t,e){const n=no.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const xI=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,i,s,a)=>{var l,c;const u=((c=(l=o.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:o,pos:i,parent:s,index:a}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?u:u.slice(0,Math.max(0,r-i))}),n};function zf(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ml{constructor(e){this.find=e.find,this.handler=e.handler}}const AI=(t,e)=>{if(zf(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function yl(t){var e;const{editor:n,from:r,to:o,text:i,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const d=xI(c)+i;return s.forEach(h=>{if(u)return;const f=AI(d,h.find);if(!f)return;const p=l.state.tr,g=fl({state:l.state,transaction:p}),m={from:r-(f[0].length-i.length),to:o},{commands:y,chain:C,can:w}=new hl({editor:n,state:g});h.handler({state:g,range:m,match:f,commands:y,chain:C,can:w})===null||!p.steps.length||(p.setMeta(a,{transform:p,from:r,to:o,text:i}),l.dispatch(p),u=!0)}),u}function OI(t){const{editor:e,rules:n}=t,r=new at({state:{init(){return null},apply(o,i,s){const a=o.getMeta(r);if(a)return a;const l=o.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:u}=l;typeof u=="string"?u=u:u=jf(le.from(u),s.schema);const{from:d}=l,h=d+u.length;yl({editor:e,from:d,to:h,text:u,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:i}},props:{handleTextInput(o,i,s,a){return yl({editor:e,from:i,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:i}=o.state.selection;i&&yl({editor:e,from:i.pos,to:i.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,i){if(i.key!=="Enter")return!1;const{$cursor:s}=o.state.selection;return s?yl({editor:e,from:s.pos,to:s.pos,text:`
|
47
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function TI(t){return Object.prototype.toString.call(t).slice(8,-1)}function vl(t){return TI(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function bl(t,e){const n={...t};return vl(t)&&vl(e)&&Object.keys(e).forEach(r=>{vl(e[r])&&vl(t[r])?n[r]=bl(t[r],e[r]):n[r]=e[r]}),n}class Lt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Lt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>bl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new Lt(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const s=o.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function kI(t){return typeof t=="number"}class Eb{constructor(e){this.find=e.find,this.handler=e.handler}}const MI=(t,e,n)=>{if(zf(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const i=[o.text];return i.index=o.index,i.input=t,i.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(o.replaceWith)),i}):[]};function PI(t){const{editor:e,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:c,can:u}=new hl({editor:e,state:n}),d=[];return n.doc.nodesBetween(r,o,(f,p)=>{if(!f.isTextblock||f.type.spec.code)return;const g=Math.max(r,p),m=Math.min(o,p+f.content.size),y=f.textBetween(g-p,m-p,void 0,"");MI(y,i.find,s).forEach(w=>{if(w.index===void 0)return;const b=g+w.index+1,S=b+w[0].length,E={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},x=i.handler({state:n,range:E,match:w,commands:l,chain:c,can:u,pasteEvent:s,dropEvent:a});d.push(x)})}),d.every(f=>f!==null)}let wl=null;const II=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function LI(t){const{editor:e,rules:n}=t;let r=null,o=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:u,from:d,to:h,rule:f,pasteEvt:p})=>{const g=u.tr,m=fl({state:u,transaction:g});if(!(!PI({editor:e,state:m,from:Math.max(d-1,0),to:h.b-1,rule:f,pasteEvent:p,dropEvent:a})||!g.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return n.map(u=>new at({view(d){const h=p=>{var g;r=!((g=d.dom.parentElement)===null||g===void 0)&&g.contains(p.target)?d.dom.parentElement:null,r&&(wl=e)},f=()=>{wl&&(wl=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,a=h,!i){const f=wl;f&&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||f===void 0?void 0:f.getData("text/html");return s=h,o=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(d,h,f)=>{const p=d[0],g=p.getMeta("uiEvent")==="paste"&&!o,m=p.getMeta("uiEvent")==="drop"&&!i,y=p.getMeta("applyPasteRules"),C=!!y;if(!g&&!m&&!C)return;if(C){let{text:S}=y;typeof S=="string"?S=S:S=jf(le.from(S),f.schema);const{from:E}=y,x=E+S.length,_=II(S);return l({rule:u,state:f,from:E,to:{b:x},pasteEvt:_})}const w=h.doc.content.findDiffStart(f.doc.content),b=h.doc.content.findDiffEnd(f.doc.content);if(!(!kI(w)||!b||w===b.b))return l({rule:u,state:f,from:w,to:b,pasteEvt:s})}}))}function DI(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class ti{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ti.resolve(e),this.schema=_I(this.extensions,n),this.setupExtensions()}static resolve(e){const n=ti.sort(ti.flatten(e)),r=DI(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=xe(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const i=xe(r,"priority")||100,s=xe(o,"priority")||100;return i>s?-1:i<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Vf(n.name,this.schema)},o=xe(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=ti.sort([...this.extensions].reverse()),r=[],o=[],i=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Vf(s.name,this.schema)},l=[],c=xe(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&xe(s,"exitable",a)&&(u.ArrowRight=()=>Lt.handleExit({editor:e,mark:s})),c){const g=Object.fromEntries(Object.entries(c()).map(([m,y])=>[m,()=>y({editor:e})]));u={...u,...g}}const d=G2(u);l.push(d);const h=xe(s,"addInputRules",a);Cb(s,e.options.enableInputRules)&&h&&r.push(...h());const f=xe(s,"addPasteRules",a);Cb(s,e.options.enablePasteRules)&&f&&o.push(...f());const p=xe(s,"addProseMirrorPlugins",a);if(p){const g=p();l.push(...g)}return l}).flat();return[OI({editor:e,rules:r}),...LI({editor:e,rules:o}),...i]}get attributes(){return vb(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=pl(this.extensions);return Object.fromEntries(n.filter(r=>!!xe(r,"addNodeView")).map(r=>{const o=this.attributes.filter(l=>l.type===r.name),i={name:r.name,options:r.options,storage:r.storage,editor:e,type:St(r.name,this.schema)},s=xe(r,"addNodeView",i);if(!s)return[];const a=(l,c,u,d,h)=>{const f=gl(l,o);return s()({node:l,view:c,getPos:u,decorations:d,innerDecorations:h,editor:e,extension:r,HTMLAttributes:f})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Vf(e.name,this.schema)};e.type==="mark"&&(!((n=Ne(xe(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=xe(e,"onBeforeCreate",r),i=xe(e,"onCreate",r),s=xe(e,"onUpdate",r),a=xe(e,"onSelectionUpdate",r),l=xe(e,"onTransaction",r),c=xe(e,"onFocus",r),u=xe(e,"onBlur",r),d=xe(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),d&&this.editor.on("destroy",d)})}}class pt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new pt(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>bl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new pt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}}function _b(t,e,n){const{from:r,to:o}=e,{blockSeparator:i=`
|
48
|
+
|
49
|
+
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,o,(l,c,u,d)=>{var h;l.isBlock&&c>r&&(a+=i);const f=s==null?void 0:s[l.type.name];if(f)return u&&(a+=f({node:l,pos:c,parent:u,index:d,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,o-c))}),a}function xb(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const RI=pt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new at({key:new mt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:i}=o,s=Math.min(...i.map(u=>u.$from.pos)),a=Math.max(...i.map(u=>u.$to.pos)),l=xb(n);return _b(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),NI=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),FI=(t=!1)=>({commands:e})=>e.setContent("",t),HI=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:i,$to:s})=>{t.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,d=c.resolve(u.map(l)),h=c.resolve(u.map(l+a.nodeSize)),f=d.blockRange(h);if(!f)return;const p=jo(f);if(a.type.isTextblock){const{defaultType:g}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(f.start,g)}(p||p===0)&&e.lift(f,p)})}),!0},BI=t=>e=>t(e),$I=()=>({state:t,dispatch:e})=>aI(t,e),VI=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,i=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,i.content),r.setSelection(new Le(r.doc.resolve(s-1))),!0},jI=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let i=o.depth;i>0;i-=1)if(o.node(i).type===r.type){if(e){const a=o.before(i),l=o.after(i);t.delete(a,l).scrollIntoView()}return!0}return!1},zI=t=>({tr:e,state:n,dispatch:r})=>{const o=St(t,n.schema),i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o){if(r){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1},UI=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},qI=()=>({state:t,dispatch:e})=>J2(t,e),WI=()=>({commands:t})=>t.keyboardShortcut("Enter"),KI=()=>({state:t,dispatch:e})=>sI(t,e);function Sl(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:zf(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function Ab(t,e,n={}){return t.find(r=>r.type===e&&Sl(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function Ob(t,e,n={}){return!!Ab(t,e,n)}function Uf(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(u=>u.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(u=>u.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!Ab([...o.node.marks],e,n)))return;let s=o.index,a=t.start()+o.offset,l=s+1,c=a+o.node.nodeSize;for(;s>0&&Ob([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&Ob([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Pr(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const GI=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const i=Pr(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(o){const d=Uf(l,i,e);if(d&&d.from<=c&&d.to>=u){const h=Le.create(s,d.from,d.to);n.setSelection(h)}}return!0},JI=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function qf(t){return t instanceof Le}function Gn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Tb(t,e=null){if(!e)return null;const n=Re.atStart(t),r=Re.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,i=r.to;return e==="all"?Le.create(t,Gn(0,o,i),Gn(t.content.size,o,i)):Le.create(t,Gn(e,o,i),Gn(e,o,i))}function kb(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Cl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const XI=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:i})=>{e={scrollIntoView:!0,...e};const s=()=>{(Cl()||kb())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!qf(n.state.selection))return s(),!0;const a=Tb(o.doc,t)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||o.setSelection(a),l&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},YI=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),QI=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Mb=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Mb(r)}return t};function El(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Mb(n)}function _l(t,e,n){if(t instanceof vr||t instanceof le)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return le.fromArray(t.map(a=>e.nodeFromJSON(a)));const s=e.nodeFromJSON(t);return n.errorOnInvalidContent&&s.check(),s}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),_l("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new v1({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=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Wi.fromSchema(l).parseSlice(El(t),n.parseOptions):Wi.fromSchema(l).parse(El(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Wi.fromSchema(e);return n.slice?i.parseSlice(El(t),n.parseOptions).content:i.parse(El(t),n.parseOptions)}return _l("",e,n)}function ZI(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof bt||o instanceof wt))return;const i=t.mapping.maps[r];let s=0;i.forEach((a,l,c,u)=>{s===0&&(s=u)}),t.setSelection(Re.near(t.doc.resolve(s),n))}const eL=t=>!("type"in t),tL=(t,e,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;try{a=_l(e,i.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(p){return i.emit("contentError",{editor:i,error:p,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}}),!1}let{from:l,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},u=!0,d=!0;if((eL(a)?a:[a]).forEach(p=>{p.check(),u=u?p.isText&&p.marks.length===0:!1,d=d?p.isBlock:!1}),l===c&&d){const{parent:p}=r.doc.resolve(l);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(l-=1,c+=1)}let f;if(u){if(Array.isArray(e))f=e.map(p=>p.text||"").join("");else if(e instanceof le){let p="";e.forEach(g=>{g.text&&(p+=g.text)}),f=p}else typeof e=="object"&&e&&e.text?f=e.text:f=e;r.insertText(f,l,c)}else f=a,r.replaceWith(l,c,f);n.updateSelection&&ZI(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:l,text:f}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:l,text:f})}return!0},nL=()=>({state:t,dispatch:e})=>nI(t,e),rL=()=>({state:t,dispatch:e})=>rI(t,e),oL=()=>({state:t,dispatch:e})=>X2(t,e),iL=()=>({state:t,dispatch:e})=>eI(t,e),sL=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Za(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},aL=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Za(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},lL=()=>({state:t,dispatch:e})=>Y2(t,e),cL=()=>({state:t,dispatch:e})=>Q2(t,e);function Pb(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function uL(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,i,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))o=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Cl()||Pb()?s=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}const dL=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const i=uL(t).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&o&&r.maybeStep(u)}),!0};function us(t,e,n={}){const{from:r,to:o,empty:i}=t.selection,s=e?St(e,t.schema):null,a=[];t.doc.nodesBetween(r,o,(d,h)=>{if(d.isText)return;const f=Math.max(r,h),p=Math.min(o,h+d.nodeSize);a.push({node:d,from:f,to:p})});const l=o-r,c=a.filter(d=>s?s.name===d.node.type.name:!0).filter(d=>Sl(d.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((d,h)=>d+h.to-h.from,0)>=l}const fL=(t,e={})=>({state:n,dispatch:r})=>{const o=St(t,n.schema);return us(n,o,e)?oI(n,r):!1},hL=()=>({state:t,dispatch:e})=>lI(t,e),pL=t=>({state:e,dispatch:n})=>{const r=St(t,e.schema);return yI(r)(e,n)},gL=()=>({state:t,dispatch:e})=>iI(t,e);function xl(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Ib(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const mL=(t,e)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=xl(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=St(t,r.schema)),a==="mark"&&(s=Pr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{i&&i===c.type&&n.setNodeMarkup(u,void 0,Ib(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(d=>{s===d.type&&n.addMark(u,u+c.nodeSize,s.create(Ib(d.attrs,e)))})})}),!0):!1},yL=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),vL=()=>({tr:t,dispatch:e})=>{if(e){const n=new sn(t.doc);t.setSelection(n)}return!0},bL=()=>({state:t,dispatch:e})=>Z2(t,e),wL=()=>({state:t,dispatch:e})=>tI(t,e),SL=()=>({state:t,dispatch:e})=>cI(t,e),CL=()=>({state:t,dispatch:e})=>fI(t,e),EL=()=>({state:t,dispatch:e})=>dI(t,e);function Wf(t,e,n={},r={}){return _l(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const _L=(t,e=!1,n={},r={})=>({editor:o,tr:i,dispatch:s,commands:a})=>{var l,c;const{doc:u}=i;if(n.preserveWhitespace!=="full"){const d=Wf(t,o.schema,n,{errorOnInvalidContent:(l=r.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck});return s&&i.replaceWith(0,u.content.size,d).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:u.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function Lb(t,e){const n=Pr(e,t.schema),{from:r,to:o,empty:i}=t.selection,s=[];i?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function xL(t,e){const n=new z1(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function AL(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function OL(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,i)=>{n(o)&&r.push({node:o,pos:i})}),r}function TL(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Kf(t){return e=>TL(e.$from,t)}function kL(t,e){const n={from:0,to:t.content.size};return _b(t,n,e)}function ML(t,e){const n=St(e,t.schema),{from:r,to:o}=t.selection,i=[];t.doc.nodesBetween(r,o,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function Db(t,e){const n=xl(typeof e=="string"?e:e.name,t.schema);return n==="node"?ML(t,e):n==="mark"?Lb(t,e):{}}function PL(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function IL(t){const e=PL(t);return e.length===1?e:e.filter((n,r)=>!e.filter((i,s)=>s!==r).some(i=>n.oldRange.from>=i.oldRange.from&&n.oldRange.to<=i.oldRange.to&&n.newRange.from>=i.newRange.from&&n.newRange.to<=i.newRange.to))}function LL(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,i)=>{const s=[];if(o.ranges.length)o.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=n[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=e.slice(i).map(a,-1),u=e.slice(i).map(l),d=e.invert().map(c,-1),h=e.invert().map(u);r.push({oldRange:{from:d,to:h},newRange:{from:c,to:u}})})}),IL(r)}function Gf(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const i=n.resolve(t),s=Uf(i,o.type);s&&r.push({mark:o,...s})}):n.nodesBetween(t,e,(o,i)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(s=>({from:i,to:i+o.nodeSize,mark:s})))}),r}function Al(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(i=>i.type===e&&i.name===r);return o?o.attribute.keepOnSplit:!1}))}function Jf(t,e,n={}){const{empty:r,ranges:o}=t.selection,i=e?Pr(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(d=>i?i.name===d.type.name:!0).find(d=>Sl(d.attrs,n,{strict:!1}));let s=0;const a=[];if(o.forEach(({$from:d,$to:h})=>{const f=d.pos,p=h.pos;t.doc.nodesBetween(f,p,(g,m)=>{if(!g.isText&&!g.marks.length)return;const y=Math.max(f,m),C=Math.min(p,m+g.nodeSize),w=C-y;s+=w,a.push(...g.marks.map(b=>({mark:b,from:y,to:C})))})}),s===0)return!1;const l=a.filter(d=>i?i.name===d.mark.type.name:!0).filter(d=>Sl(d.mark.attrs,n,{strict:!1})).reduce((d,h)=>d+h.to-h.from,0),c=a.filter(d=>i?d.mark.type!==i&&d.mark.type.excludes(i):!0).reduce((d,h)=>d+h.to-h.from,0);return(l>0?l+c:l)>=s}function DL(t,e,n={}){if(!e)return us(t,null,n)||Jf(t,null,n);const r=xl(e,t.schema);return r==="node"?us(t,e,n):r==="mark"?Jf(t,e,n):!1}function Rb(t,e){const{nodeExtensions:n}=pl(e),r=n.find(s=>s.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},i=Ne(xe(r,"group",o));return typeof i!="string"?!1:i.split(" ").includes("list")}function Xf(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(i=>{o!==!1&&(Xf(i,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function Nb(t){return t instanceof Te}function RL(t,e,n){const o=t.state.doc.content.size,i=Gn(e,0,o),s=Gn(n,0,o),a=t.coordsAtPos(i),l=t.coordsAtPos(s,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),d=Math.min(a.left,l.left),h=Math.max(a.right,l.right),f=h-d,p=u-c,y={top:c,bottom:u,left:d,right:h,width:f,height:p,x:d,y:c};return{...y,toJSON:()=>y}}function NL(t,e,n){var r;const{selection:o}=e;let i=null;if(qf(o)&&(i=o.$cursor),i){const a=(r=t.storedMarks)!==null&&r!==void 0?r:i.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,d,h)=>{if(c)return!1;if(u.isInline){const f=!h||h.type.allowsMarkType(n),p=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));c=f&&p}return!c}),c})}const FL=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:i}=n,{empty:s,ranges:a}=i,l=Pr(t,r.schema);if(o)if(s){const c=Lb(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;r.doc.nodesBetween(u,d,(h,f)=>{const p=Math.max(f,u),g=Math.min(f+h.nodeSize,d);h.marks.find(y=>y.type===l)?h.marks.forEach(y=>{l===y.type&&n.addMark(p,g,l.create({...y.attrs,...e}))}):n.addMark(p,g,l.create(e))})});return NL(r,n,l)},HL=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),BL=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const i=St(t,n.schema);let s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?o().command(({commands:a})=>yb(i,{...s,...e})(n)?!0:a.clearNodes()).command(({state:a})=>yb(i,{...s,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},$L=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Gn(t,0,r.content.size),i=Te.create(r,o);e.setSelection(i)}return!0},VL=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:i}=typeof t=="number"?{from:t,to:t}:t,s=Le.atStart(r).from,a=Le.atEnd(r).to,l=Gn(o,s,a),c=Gn(i,s,a),u=Le.create(r,l,c);e.setSelection(u)}return!0},jL=t=>({state:e,dispatch:n})=>{const r=St(t,e.schema);return wI(r)(e,n)};function Fb(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const zL=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:i,doc:s}=e,{$from:a,$to:l}=i,c=o.extensionManager.attributes,u=Al(c,a.node().type.name,a.node().attrs);if(i instanceof Te&&i.node.isBlock)return!a.parentOffset||!zo(s,a.pos)?!1:(r&&(t&&Fb(n,o.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const d=l.parentOffset===l.parent.content.size,h=a.depth===0?void 0:AL(a.node(-1).contentMatchAt(a.indexAfter(-1)));let f=d&&h?[{type:h,attrs:u}]:void 0,p=zo(e.doc,e.mapping.map(a.pos),1,f);if(!f&&!p&&zo(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(p=!0,f=h?[{type:h,attrs:u}]:void 0),r){if(p&&(i instanceof Le&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,f),h&&!d&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),m=e.doc.resolve(g);a.node(-1).canReplaceWith(m.index(),m.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Fb(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return p},UL=(t,e={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;const a=St(t,r.schema),{$from:l,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||l.depth<2||!l.sameParent(c))return!1;const d=l.node(-1);if(d.type!==a)return!1;const h=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(o){let y=le.empty;const C=l.index(-1)?1:l.index(-2)?2:3;for(let _=l.depth-C;_>=l.depth-3;_-=1)y=le.from(l.node(_).copy(y));const w=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,b={...Al(h,l.node().type.name,l.node().attrs),...e},S=((s=a.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(b))||void 0;y=y.append(le.from(a.createAndFill(null,S)||void 0));const E=l.before(l.depth-(C-1));n.replace(E,l.after(-w),new me(y,4-C,0));let x=-1;n.doc.nodesBetween(E,n.doc.content.size,(_,A)=>{if(x>-1)return!1;_.isTextblock&&_.content.size===0&&(x=A+1)}),x>-1&&n.setSelection(Le.near(n.doc.resolve(x))),n.scrollIntoView()}return!0}const f=c.pos===l.end()?d.contentMatchAt(0).defaultType:null,p={...Al(h,d.type.name,d.attrs),...e},g={...Al(h,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,c.pos);const m=f?[{type:a,attrs:p},{type:f,attrs:g}]:[{type:a,attrs:p}];if(!zo(n.doc,l.pos,2))return!1;if(o){const{selection:y,storedMarks:C}=r,{splittableMarks:w}=i.extensionManager,b=C||y.$to.parentOffset&&y.$from.marks();if(n.split(l.pos,2,m).scrollIntoView(),!b||!o)return!0;const S=b.filter(E=>w.includes(E.type.name));n.ensureMarks(S)}return!0},Yf=(t,e)=>{const n=Kf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Sr(t.doc,n.pos)&&t.join(n.pos),!0},Qf=(t,e)=>{const n=Kf(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Sr(t.doc,r)&&t.join(r),!0};var qL=Object.freeze({__proto__:null,blur:NI,clearContent:FI,clearNodes:HI,command:BI,createParagraphNear:$I,cut:VI,deleteCurrentNode:jI,deleteNode:zI,deleteRange:UI,deleteSelection:qI,enter:WI,exitCode:KI,extendMarkRange:GI,first:JI,focus:XI,forEach:YI,insertContent:QI,insertContentAt:tL,joinBackward:oL,joinDown:rL,joinForward:iL,joinItemBackward:sL,joinItemForward:aL,joinTextblockBackward:lL,joinTextblockForward:cL,joinUp:nL,keyboardShortcut:dL,lift:fL,liftEmptyBlock:hL,liftListItem:pL,newlineInCode:gL,resetAttributes:mL,scrollIntoView:yL,selectAll:vL,selectNodeBackward:bL,selectNodeForward:wL,selectParentNode:SL,selectTextblockEnd:CL,selectTextblockStart:EL,setContent:_L,setMark:FL,setMeta:HL,setNode:BL,setNodeSelection:$L,setTextSelection:VL,sinkListItem:jL,splitBlock:zL,splitListItem:UL,toggleList:(t,e,n,r={})=>({editor:o,tr:i,state:s,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:d,splittableMarks:h}=o.extensionManager,f=St(t,s.schema),p=St(e,s.schema),{selection:g,storedMarks:m}=s,{$from:y,$to:C}=g,w=y.blockRange(C),b=m||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const S=Kf(E=>Rb(E.type.name,d))(g);if(w.depth>=1&&S&&w.depth-S.depth<=1){if(S.node.type===f)return c.liftListItem(p);if(Rb(S.node.type.name,d)&&f.validContent(S.node.content)&&a)return l().command(()=>(i.setNodeMarkup(S.pos,f),!0)).command(()=>Yf(i,f)).command(()=>Qf(i,f)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(f,r)?!0:c.clearNodes()).wrapInList(f,r).command(()=>Yf(i,f)).command(()=>Qf(i,f)).run():l().command(()=>{const E=u().wrapInList(f,r),x=b.filter(_=>h.includes(_.type.name));return i.ensureMarks(x),E?!0:c.clearNodes()}).wrapInList(f,r).command(()=>Yf(i,f)).command(()=>Qf(i,f)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:i=!1}=n,s=Pr(t,r.schema);return Jf(r,s,e)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const i=St(t,r.schema),s=St(e,r.schema),a=us(r,i,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?o.setNode(s,l):o.setNode(i,{...l,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=St(t,n.schema);return us(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let i;if(o.spec.isInputRules&&(i=o.getState(t))){if(e){const s=t.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,t.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var i;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Pr(t,r.schema),{$from:c,empty:u,ranges:d}=a;if(!o)return!0;if(u&&s){let{from:h,to:f}=a;const p=(i=c.marks().find(m=>m.type===l))===null||i===void 0?void 0:i.attrs,g=Uf(c,l,p);g&&(h=g.from,f=g.to),n.removeMark(h,f,l)}else d.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null;const a=xl(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(i=St(t,r.schema)),a==="mark"&&(s=Pr(t,r.schema)),o&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;let d,h,f,p;n.selection.empty?r.doc.nodesBetween(c,u,(g,m)=>{i&&i===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g)}):r.doc.nodesBetween(c,u,(g,m)=>{m<c&&i&&i===g.type&&(f=Math.max(m,c),p=Math.min(m+g.nodeSize,u),d=m,h=g),m>=c&&m<=u&&(i&&i===g.type&&n.setNodeMarkup(m,void 0,{...g.attrs,...e}),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type){const C=Math.max(m,c),w=Math.min(m+g.nodeSize,u);n.addMark(C,w,s.create({...y.attrs,...e}))}}))}),h&&(d!==void 0&&n.setNodeMarkup(d,void 0,{...h.attrs,...e}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&n.addMark(f,p,s.create({...g.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=St(t,n.schema);return hI(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=St(t,n.schema);return pI(o,e)(n,r)}});const WL=pt.create({name:"commands",addCommands(){return{...qL}}}),KL=pt.create({name:"drop",addProseMirrorPlugins(){return[new at({key:new mt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),GL=pt.create({name:"editable",addProseMirrorPlugins(){return[new at({key:new mt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),JL=pt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new at({key:new mt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),XL=pt.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:d}=l,{pos:h,parent:f}=d,p=d.parent.isTextblock&&h>0?a.doc.resolve(h-1):d,g=p.parent.type.spec.isolating,m=d.pos-d.parentOffset,y=g&&p.parent.childCount===1?m===d.pos:Re.atStart(c).from===h;return!u||!f.type.isTextblock||f.textContent.length||!y||y&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...r},i={...r,"Ctrl-h":t,"Alt-Backspace":t,"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 Cl()||Pb()?i:o},addProseMirrorPlugins(){return[new at({key:new mt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(g=>g.getMeta("composition")))return;const r=t.some(g=>g.docChanged)&&!e.doc.eq(n.doc),o=t.some(g=>g.getMeta("preventClearDocument"));if(!r||o)return;const{empty:i,from:s,to:a}=e.selection,l=Re.atStart(e.doc).from,c=Re.atEnd(e.doc).to;if(i||!(s===l&&a===c)||!Xf(n.doc))return;const h=n.tr,f=fl({state:n,transaction:h}),{commands:p}=new hl({editor:this.editor,state:f});if(p.clearNodes(),!!h.steps.length)return h}})]}}),YL=pt.create({name:"paste",addProseMirrorPlugins(){return[new at({key:new mt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),QL=pt.create({name:"tabindex",addProseMirrorPlugins(){return[new at({key:new mt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class uo{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}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!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=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}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,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),n=this.resolvedPos.doc.resolve(e);return new uo(n,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 uo(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 uo(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+(i?0:1),a=this.resolvedPos.doc.resolve(s);if(!o&&a.depth<=this.depth)return;const l=new uo(a,this.editor,o,o?n:null);o&&(l.actualDepth=this.depth+1),e.push(new uo(a,this.editor,o,o?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const i=o.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(i[l]!==n[l])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const i=Object.keys(n);return this.children.forEach(s=>{r&&o.length>0||(s.node.type.name===e&&i.every(l=>n[l]===s.node.attrs[l])&&o.push(s),!(r&&o.length>0)&&(o=o.concat(s.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const ZL=`.ProseMirror {
|
50
|
+
position: relative;
|
51
|
+
}
|
52
|
+
|
53
|
+
.ProseMirror {
|
54
|
+
word-wrap: break-word;
|
55
|
+
white-space: pre-wrap;
|
56
|
+
white-space: break-spaces;
|
57
|
+
-webkit-font-variant-ligatures: none;
|
58
|
+
font-variant-ligatures: none;
|
59
|
+
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
60
|
+
}
|
61
|
+
|
62
|
+
.ProseMirror [contenteditable="false"] {
|
63
|
+
white-space: normal;
|
64
|
+
}
|
65
|
+
|
66
|
+
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
67
|
+
white-space: pre-wrap;
|
68
|
+
}
|
69
|
+
|
70
|
+
.ProseMirror pre {
|
71
|
+
white-space: pre-wrap;
|
72
|
+
}
|
73
|
+
|
74
|
+
img.ProseMirror-separator {
|
75
|
+
display: inline !important;
|
76
|
+
border: none !important;
|
77
|
+
margin: 0 !important;
|
78
|
+
width: 0 !important;
|
79
|
+
height: 0 !important;
|
80
|
+
}
|
81
|
+
|
82
|
+
.ProseMirror-gapcursor {
|
83
|
+
display: none;
|
84
|
+
pointer-events: none;
|
85
|
+
position: absolute;
|
86
|
+
margin: 0;
|
87
|
+
}
|
88
|
+
|
89
|
+
.ProseMirror-gapcursor:after {
|
90
|
+
content: "";
|
91
|
+
display: block;
|
92
|
+
position: absolute;
|
93
|
+
top: -2px;
|
94
|
+
width: 20px;
|
95
|
+
border-top: 1px solid black;
|
96
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
97
|
+
}
|
98
|
+
|
99
|
+
@keyframes ProseMirror-cursor-blink {
|
100
|
+
to {
|
101
|
+
visibility: hidden;
|
102
|
+
}
|
103
|
+
}
|
104
|
+
|
105
|
+
.ProseMirror-hideselection *::selection {
|
106
|
+
background: transparent;
|
107
|
+
}
|
108
|
+
|
109
|
+
.ProseMirror-hideselection *::-moz-selection {
|
110
|
+
background: transparent;
|
111
|
+
}
|
112
|
+
|
113
|
+
.ProseMirror-hideselection * {
|
114
|
+
caret-color: transparent;
|
115
|
+
}
|
116
|
+
|
117
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
118
|
+
display: block;
|
119
|
+
}
|
120
|
+
|
121
|
+
.tippy-box[data-animation=fade][data-state=hidden] {
|
122
|
+
opacity: 0
|
123
|
+
}`;function eD(t,e,n){const r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(r!==null)return r;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),o.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(o),o}let tD=class extends SI{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),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:n,slice:r,moved:o})=>this.options.onDrop(n,r,o)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}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&&document&&(this.css=eD(ZL,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=bb(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;const n=this.state.plugins;let r=n;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;r=n.filter(a=>!a.key.startsWith(s))}),n.length===r.length)return;const o=this.state.reconfigure({plugins:r});return this.view.updateState(o),o}createExtensionManager(){var e,n;const o=[...this.options.enableCoreExtensions?[GL,RI.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),WL,JL,XL,QL,KL,YL].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new ti(o,this)}createCommandManager(){this.commandManager=new hl({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let n;try{n=Wf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(s){if(!(s instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(s.message))throw s;this.emit("contentError",{editor:this,error:s,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(a=>a.name!=="collaboration"),this.createExtensionManager()}}),n=Wf(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const r=Tb(n,this.options.autofocus);this.view=new B2(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:Ko.create({doc:n,selection:r||void 0})});const o=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(o),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:n}),this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return Db(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,o=typeof e=="string"?n:e;return DL(this.state,r,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return jf(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
124
|
+
|
125
|
+
`,textSerializers:r={}}=e||{};return kL(this.state.doc,{blockSeparator:n,textSerializers:{...xb(this.schema),...r}})}get isEmpty(){return Xf(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new uo(n,this)}get $doc(){return this.$pos(0)}};function fo(t){return new ml({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ne(t.getAttributes,void 0,r);if(o===!1||o===null)return null;const{tr:i}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),c=n.from+a.indexOf(s),u=c+s.length;if(Gf(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>c).length)return null;u<n.to&&i.delete(u,n.to),c>n.from&&i.delete(n.from+l,c);const h=n.from+l+s.length;i.addMark(n.from+l,h,t.type.create(o||{})),i.removeStoredMark(t.type)}}})}function nD(t){return new ml({find:t.find,handler:({state:e,range:n,match:r})=>{const o=Ne(t.getAttributes,void 0,r)||{},{tr:i}=e,s=n.from;let a=n.to;const l=t.type.create(o);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=s+c;u>a?u=a:a=u+r[1].length;const d=r[0][r[0].length-1];i.insertText(d,s+r[0].length-1),i.replaceWith(u,a,l)}else if(r[0]){const c=t.type.isInline?s:s-1;i.insert(c,t.type.create(o)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()}})}function Zf(t){return new ml({find:t.find,handler:({state:e,range:n,match:r})=>{const o=e.doc.resolve(n.from),i=Ne(t.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,i)}})}function ds(t){return new ml({find:t.find,handler:({state:e,range:n,match:r,chain:o})=>{const i=Ne(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),c=l&&sf(l,t.type,i);if(!c)return null;if(s.wrap(l,c),t.keepMarks&&t.editor){const{selection:d,storedMarks:h}=e,{splittableMarks:f}=t.editor.extensionManager,p=h||d.$to.parentOffset&&d.$from.marks();if(p){const g=p.filter(m=>f.includes(m.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const d=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";o().updateAttributes(d,i).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Sr(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class $t{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Ne(xe(this,"addOptions",{name:this.name}))),this.storage=Ne(xe(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new $t(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>bl(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new $t(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=Ne(xe(n,"addOptions",{name:n.name})),n.storage=Ne(xe(n,"addStorage",{name:n.name,options:n.options})),n}}class rD{constructor(e,n,r){this.isDragging=!1,this.component=e,this.editor=n.editor,this.options={stopEvent:null,ignoreMutation:null,...r},this.extension=n.extension,this.node=n.node,this.decorations=n.decorations,this.innerDecorations=n.innerDecorations,this.view=n.view,this.HTMLAttributes=n.HTMLAttributes,this.getPos=n.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var n,r,o,i,s,a,l;const{view:c}=this.editor,u=e.target,d=u.nodeType===3?(n=u.parentElement)===null||n===void 0?void 0:n.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(!this.dom||!((r=this.contentDOM)===null||r===void 0)&&r.contains(u)||!d)return;let h=0,f=0;if(this.dom!==d){const y=this.dom.getBoundingClientRect(),C=d.getBoundingClientRect(),w=(o=e.offsetX)!==null&&o!==void 0?o:(i=e.nativeEvent)===null||i===void 0?void 0:i.offsetX,b=(s=e.offsetY)!==null&&s!==void 0?s:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetY;h=C.x-y.x+w,f=C.y-y.y+b}(l=e.dataTransfer)===null||l===void 0||l.setDragImage(this.dom,h,f);const p=this.getPos();if(typeof p!="number")return;const g=Te.create(c.state.doc,p),m=c.state.tr.setSelection(g);c.dispatch(m)}stopEvent(e){var n;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const r=e.target;if(!(this.dom.contains(r)&&!(!((n=this.contentDOM)===null||n===void 0)&&n.contains(r))))return!1;const i=e.type.startsWith("drag"),s=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!s&&!i)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,d=Te.isSelectable(this.node),h=e.type==="copy",f=e.type==="paste",p=e.type==="cut",g=e.type==="mousedown";if(!u&&d&&i&&e.target===this.dom&&e.preventDefault(),u&&i&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&g){const m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(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||s||h||f||p||g&&d)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(Cl()||kb())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(r=>r.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:n})=>{const r=this.getPos();return typeof r!="number"?!1:(n.setNodeMarkup(r,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const n=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:n})}}function Ir(t){return new Eb({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:o})=>{const i=Ne(t.getAttributes,void 0,r,o);if(i===!1||i===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),d=n.from+l.indexOf(a),h=d+a.length;if(Gf(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===t.type&&m!==p.mark.type)).filter(p=>p.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+u,d),c=n.from+u+a.length,s.addMark(n.from+u,c,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function oD(t){return t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function iD(t){return new Eb({find:t.find,handler({match:e,chain:n,range:r,pasteEvent:o}){const i=Ne(t.getAttributes,void 0,e,o),s=Ne(t.getContent,void 0,i);if(i===!1||i===null)return null;const a={type:t.type.name,attrs:i};s&&(a.content=s),e.input&&n().deleteRange(r).insertContentAt(r.from,a)}})}var qt="top",un="bottom",dn="right",Wt="left",eh="auto",fs=[qt,un,dn,Wt],ni="start",hs="end",sD="clippingParents",Hb="viewport",ps="popper",aD="reference",Bb=fs.reduce(function(t,e){return t.concat([e+"-"+ni,e+"-"+hs])},[]),$b=[].concat(fs,[eh]).reduce(function(t,e){return t.concat([e,e+"-"+ni,e+"-"+hs])},[]),lD="beforeRead",cD="read",uD="afterRead",dD="beforeMain",fD="main",hD="afterMain",pD="beforeWrite",gD="write",mD="afterWrite",yD=[lD,cD,uD,dD,fD,hD,pD,gD,mD];function Tn(t){return t?(t.nodeName||"").toLowerCase():null}function Qt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function ho(t){var e=Qt(t).Element;return t instanceof e||t instanceof Element}function fn(t){var e=Qt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function th(t){if(typeof ShadowRoot>"u")return!1;var e=Qt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function vD(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!fn(i)||!Tn(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function bD(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!fn(o)||!Tn(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Vb={name:"applyStyles",enabled:!0,phase:"write",fn:vD,effect:bD,requires:["computeStyles"]};function kn(t){return t.split("-")[0]}var po=Math.max,Ol=Math.min,ri=Math.round;function nh(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function jb(){return!/^((?!chrome|android).)*safari/i.test(nh())}function oi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),o=1,i=1;e&&fn(t)&&(o=t.offsetWidth>0&&ri(r.width)/t.offsetWidth||1,i=t.offsetHeight>0&&ri(r.height)/t.offsetHeight||1);var s=ho(t)?Qt(t):window,a=s.visualViewport,l=!jb()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,d=r.width/o,h=r.height/i;return{width:d,height:h,top:u,right:c+d,bottom:u+h,left:c,x:c,y:u}}function rh(t){var e=oi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function zb(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&th(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Jn(t){return Qt(t).getComputedStyle(t)}function wD(t){return["table","td","th"].indexOf(Tn(t))>=0}function Lr(t){return((ho(t)?t.ownerDocument:t.document)||window.document).documentElement}function Tl(t){return Tn(t)==="html"?t:t.assignedSlot||t.parentNode||(th(t)?t.host:null)||Lr(t)}function Ub(t){return!fn(t)||Jn(t).position==="fixed"?null:t.offsetParent}function SD(t){var e=/firefox/i.test(nh()),n=/Trident/i.test(nh());if(n&&fn(t)){var r=Jn(t);if(r.position==="fixed")return null}var o=Tl(t);for(th(o)&&(o=o.host);fn(o)&&["html","body"].indexOf(Tn(o))<0;){var i=Jn(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function gs(t){for(var e=Qt(t),n=Ub(t);n&&wD(n)&&Jn(n).position==="static";)n=Ub(n);return n&&(Tn(n)==="html"||Tn(n)==="body"&&Jn(n).position==="static")?e:n||SD(t)||e}function oh(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ms(t,e,n){return po(t,Ol(e,n))}function CD(t,e,n){var r=ms(t,e,n);return r>n?n:r}function qb(){return{top:0,right:0,bottom:0,left:0}}function Wb(t){return Object.assign({},qb(),t)}function Kb(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var ED=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Wb(typeof e!="number"?e:Kb(e,fs))};function _D(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=kn(n.placement),l=oh(a),c=[Wt,dn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var d=ED(o.padding,n),h=rh(i),f=l==="y"?qt:Wt,p=l==="y"?un:dn,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],m=s[l]-n.rects.reference[l],y=gs(i),C=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,w=g/2-m/2,b=d[f],S=C-h[u]-d[p],E=C/2-h[u]/2+w,x=ms(b,E,S),_=l;n.modifiersData[r]=(e={},e[_]=x,e.centerOffset=x-E,e)}}function xD(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||zb(e.elements.popper,o)&&(e.elements.arrow=o))}const AD={name:"arrow",enabled:!0,phase:"main",fn:_D,effect:xD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ii(t){return t.split("-")[1]}var OD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function TD(t,e){var n=t.x,r=t.y,o=e.devicePixelRatio||1;return{x:ri(n*o)/o||0,y:ri(r*o)/o||0}}function Gb(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,d=t.isFixed,h=s.x,f=h===void 0?0:h,p=s.y,g=p===void 0?0:p,m=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=m.x,g=m.y;var y=s.hasOwnProperty("x"),C=s.hasOwnProperty("y"),w=Wt,b=qt,S=window;if(c){var E=gs(n),x="clientHeight",_="clientWidth";if(E===Qt(n)&&(E=Lr(n),Jn(E).position!=="static"&&a==="absolute"&&(x="scrollHeight",_="scrollWidth")),E=E,o===qt||(o===Wt||o===dn)&&i===hs){b=un;var A=d&&E===S&&S.visualViewport?S.visualViewport.height:E[x];g-=A-r.height,g*=l?1:-1}if(o===Wt||(o===qt||o===un)&&i===hs){w=dn;var O=d&&E===S&&S.visualViewport?S.visualViewport.width:E[_];f-=O-r.width,f*=l?1:-1}}var k=Object.assign({position:a},c&&OD),M=u===!0?TD({x:f,y:g},Qt(n)):{x:f,y:g};if(f=M.x,g=M.y,l){var I;return Object.assign({},k,(I={},I[b]=C?"0":"",I[w]=y?"0":"",I.transform=(S.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",I))}return Object.assign({},k,(e={},e[b]=C?g+"px":"",e[w]=y?f+"px":"",e.transform="",e))}function kD(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:kn(e.placement),variation:ii(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,Gb(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,Gb(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const MD={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kD,data:{}};var kl={passive:!0};function PD(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=Qt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,kl)}),a&&l.addEventListener("resize",n.update,kl),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,kl)}),a&&l.removeEventListener("resize",n.update,kl)}}const ID={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:PD,data:{}};var LD={left:"right",right:"left",bottom:"top",top:"bottom"};function Ml(t){return t.replace(/left|right|bottom|top/g,function(e){return LD[e]})}var DD={start:"end",end:"start"};function Jb(t){return t.replace(/start|end/g,function(e){return DD[e]})}function ih(t){var e=Qt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function sh(t){return oi(Lr(t)).left+ih(t).scrollLeft}function RD(t,e){var n=Qt(t),r=Lr(t),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=jb();(c||!c&&e==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+sh(t),y:l}}function ND(t){var e,n=Lr(t),r=ih(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=po(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=po(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+sh(t),l=-r.scrollTop;return Jn(o||n).direction==="rtl"&&(a+=po(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function ah(t){var e=Jn(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Xb(t){return["html","body","#document"].indexOf(Tn(t))>=0?t.ownerDocument.body:fn(t)&&ah(t)?t:Xb(Tl(t))}function ys(t,e){var n;e===void 0&&(e=[]);var r=Xb(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=Qt(r),s=o?[i].concat(i.visualViewport||[],ah(r)?r:[]):r,a=e.concat(s);return o?a:a.concat(ys(Tl(s)))}function lh(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function FD(t,e){var n=oi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Yb(t,e,n){return e===Hb?lh(RD(t,n)):ho(e)?FD(e,n):lh(ND(Lr(t)))}function HD(t){var e=ys(Tl(t)),n=["absolute","fixed"].indexOf(Jn(t).position)>=0,r=n&&fn(t)?gs(t):t;return ho(r)?e.filter(function(o){return ho(o)&&zb(o,r)&&Tn(o)!=="body"}):[]}function BD(t,e,n,r){var o=e==="clippingParents"?HD(t):[].concat(e),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=Yb(t,c,r);return l.top=po(u.top,l.top),l.right=Ol(u.right,l.right),l.bottom=Ol(u.bottom,l.bottom),l.left=po(u.left,l.left),l},Yb(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Qb(t){var e=t.reference,n=t.element,r=t.placement,o=r?kn(r):null,i=r?ii(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(o){case qt:l={x:s,y:e.y-n.height};break;case un:l={x:s,y:e.y+e.height};break;case dn:l={x:e.x+e.width,y:a};break;case Wt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=o?oh(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case ni:l[c]=l[c]-(e[u]/2-n[u]/2);break;case hs:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function vs(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.strategy,s=i===void 0?t.strategy:i,a=n.boundary,l=a===void 0?sD:a,c=n.rootBoundary,u=c===void 0?Hb:c,d=n.elementContext,h=d===void 0?ps:d,f=n.altBoundary,p=f===void 0?!1:f,g=n.padding,m=g===void 0?0:g,y=Wb(typeof m!="number"?m:Kb(m,fs)),C=h===ps?aD:ps,w=t.rects.popper,b=t.elements[p?C:h],S=BD(ho(b)?b:b.contextElement||Lr(t.elements.popper),l,u,s),E=oi(t.elements.reference),x=Qb({reference:E,element:w,strategy:"absolute",placement:o}),_=lh(Object.assign({},w,x)),A=h===ps?_:E,O={top:S.top-A.top+y.top,bottom:A.bottom-S.bottom+y.bottom,left:S.left-A.left+y.left,right:A.right-S.right+y.right},k=t.modifiersData.offset;if(h===ps&&k){var M=k[o];Object.keys(O).forEach(function(I){var P=[dn,un].indexOf(I)>=0?1:-1,F=[qt,un].indexOf(I)>=0?"y":"x";O[I]+=M[F]*P})}return O}function $D(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?$b:l,u=ii(r),d=u?a?Bb:Bb.filter(function(p){return ii(p)===u}):fs,h=d.filter(function(p){return c.indexOf(p)>=0});h.length===0&&(h=d);var f=h.reduce(function(p,g){return p[g]=vs(t,{placement:g,boundary:o,rootBoundary:i,padding:s})[kn(g)],p},{});return Object.keys(f).sort(function(p,g){return f[p]-f[g]})}function VD(t){if(kn(t)===eh)return[];var e=Ml(t);return[Jb(t),e,Jb(e)]}function jD(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,d=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,p=f===void 0?!0:f,g=n.allowedAutoPlacements,m=e.options.placement,y=kn(m),C=y===m,w=l||(C||!p?[Ml(m)]:VD(m)),b=[m].concat(w).reduce(function(de,ue){return de.concat(kn(ue)===eh?$D(e,{placement:ue,boundary:u,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:g}):ue)},[]),S=e.rects.reference,E=e.rects.popper,x=new Map,_=!0,A=b[0],O=0;O<b.length;O++){var k=b[O],M=kn(k),I=ii(k)===ni,P=[qt,un].indexOf(M)>=0,F=P?"width":"height",z=vs(e,{placement:k,boundary:u,rootBoundary:d,altBoundary:h,padding:c}),$=P?I?dn:Wt:I?un:qt;S[F]>E[F]&&($=Ml($));var J=Ml($),K=[];if(i&&K.push(z[M]<=0),a&&K.push(z[$]<=0,z[J]<=0),K.every(function(de){return de})){A=k,_=!1;break}x.set(k,K)}if(_)for(var R=p?3:1,Q=function(ue){var pe=b.find(function(D){var ce=x.get(D);if(ce)return ce.slice(0,ue).every(function(ye){return ye})});if(pe)return A=pe,"break"},se=R;se>0;se--){var ie=Q(se);if(ie==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0)}}const zD={name:"flip",enabled:!0,phase:"main",fn:jD,requiresIfExists:["offset"],data:{_skip:!1}};function Zb(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function ew(t){return[qt,dn,un,Wt].some(function(e){return t[e]>=0})}function UD(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,s=vs(e,{elementContext:"reference"}),a=vs(e,{altBoundary:!0}),l=Zb(s,r),c=Zb(a,o,i),u=ew(l),d=ew(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const qD={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:UD};function WD(t,e,n){var r=kn(t),o=[Wt,qt].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[Wt,dn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function KD(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,s=$b.reduce(function(u,d){return u[d]=WD(d,e.rects,i),u},{}),a=s[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const GD={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:KD};function JD(t){var e=t.state,n=t.name;e.modifiersData[n]=Qb({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const XD={name:"popperOffsets",enabled:!0,phase:"read",fn:JD,data:{}};function YD(t){return t==="x"?"y":"x"}function QD(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,d=n.padding,h=n.tether,f=h===void 0?!0:h,p=n.tetherOffset,g=p===void 0?0:p,m=vs(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:u}),y=kn(e.placement),C=ii(e.placement),w=!C,b=oh(y),S=YD(b),E=e.modifiersData.popperOffsets,x=e.rects.reference,_=e.rects.popper,A=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,O=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),k=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,M={x:0,y:0};if(E){if(i){var I,P=b==="y"?qt:Wt,F=b==="y"?un:dn,z=b==="y"?"height":"width",$=E[b],J=$+m[P],K=$-m[F],R=f?-_[z]/2:0,Q=C===ni?x[z]:_[z],se=C===ni?-_[z]:-x[z],ie=e.elements.arrow,de=f&&ie?rh(ie):{width:0,height:0},ue=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:qb(),pe=ue[P],D=ue[F],ce=ms(0,x[z],de[z]),ye=w?x[z]/2-R-ce-pe-O.mainAxis:Q-ce-pe-O.mainAxis,be=w?-x[z]/2+R+ce+D+O.mainAxis:se+ce+D+O.mainAxis,H=e.elements.arrow&&gs(e.elements.arrow),L=H?b==="y"?H.clientTop||0:H.clientLeft||0:0,He=(I=k==null?void 0:k[b])!=null?I:0,G=$+ye-He-L,ne=$+be-He,X=ms(f?Ol(J,G):J,$,f?po(K,ne):K);E[b]=X,M[b]=X-$}if(a){var W,V=b==="x"?qt:Wt,ee=b==="x"?un:dn,Ce=E[S],we=S==="y"?"height":"width",Z=Ce+m[V],Se=Ce-m[ee],U=[qt,Wt].indexOf(y)!==-1,B=(W=k==null?void 0:k[S])!=null?W:0,re=U?Z:Ce-x[we]-_[we]-B+O.altAxis,j=U?Ce+x[we]+_[we]-B-O.altAxis:Se,te=f&&U?CD(re,Ce,j):ms(f?re:Z,Ce,f?j:Se);E[S]=te,M[S]=te-Ce}e.modifiersData[r]=M}}const ZD={name:"preventOverflow",enabled:!0,phase:"main",fn:QD,requiresIfExists:["offset"]};function eR(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function tR(t){return t===Qt(t)||!fn(t)?ih(t):eR(t)}function nR(t){var e=t.getBoundingClientRect(),n=ri(e.width)/t.offsetWidth||1,r=ri(e.height)/t.offsetHeight||1;return n!==1||r!==1}function rR(t,e,n){n===void 0&&(n=!1);var r=fn(e),o=fn(e)&&nR(e),i=Lr(e),s=oi(t,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Tn(e)!=="body"||ah(i))&&(a=tR(e)),fn(e)?(l=oi(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):i&&(l.x=sh(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function oR(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&o(l)}}),r.push(i)}return t.forEach(function(i){n.has(i.name)||o(i)}),r}function iR(t){var e=oR(t);return yD.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function sR(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function aR(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var tw={placement:"bottom",modifiers:[],strategy:"absolute"};function nw(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function lR(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?tw:o;return function(a,l,c){c===void 0&&(c=i);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},tw,i),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},d=[],h=!1,f={state:u,setOptions:function(y){var C=typeof y=="function"?y(u.options):y;g(),u.options=Object.assign({},i,u.options,C),u.scrollParents={reference:ho(a)?ys(a):a.contextElement?ys(a.contextElement):[],popper:ys(l)};var w=iR(aR([].concat(r,u.options.modifiers)));return u.orderedModifiers=w.filter(function(b){return b.enabled}),p(),f.update()},forceUpdate:function(){if(!h){var y=u.elements,C=y.reference,w=y.popper;if(nw(C,w)){u.rects={reference:rR(C,gs(w),u.options.strategy==="fixed"),popper:rh(w)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(O){return u.modifiersData[O.name]=Object.assign({},O.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],E=S.fn,x=S.options,_=x===void 0?{}:x,A=S.name;typeof E=="function"&&(u=E({state:u,options:_,name:A,instance:f})||u)}}}},update:sR(function(){return new Promise(function(m){f.forceUpdate(),m(u)})}),destroy:function(){g(),h=!0}};if(!nw(a,l))return f;f.setOptions(c).then(function(m){!h&&c.onFirstUpdate&&c.onFirstUpdate(m)});function p(){u.orderedModifiers.forEach(function(m){var y=m.name,C=m.options,w=C===void 0?{}:C,b=m.effect;if(typeof b=="function"){var S=b({state:u,name:y,instance:f,options:w}),E=function(){};d.push(S||E)}})}function g(){d.forEach(function(m){return m()}),d=[]}return f}}var cR=[ID,XD,MD,Vb,GD,zD,ZD,AD,qD],uR=lR({defaultModifiers:cR}),dR="tippy-box",rw="tippy-content",fR="tippy-backdrop",ow="tippy-arrow",iw="tippy-svg-arrow",go={passive:!0,capture:!0},sw=function(){return document.body};function hR(t,e){return{}.hasOwnProperty.call(t,e)}function ch(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function uh(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function aw(t,e){return typeof t=="function"?t.apply(void 0,e):t}function lw(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function pR(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function gR(t){return t.split(/\s+/).filter(Boolean)}function si(t){return[].concat(t)}function cw(t,e){t.indexOf(e)===-1&&t.push(e)}function mR(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function yR(t){return t.split("-")[0]}function Pl(t){return[].slice.call(t)}function uw(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function bs(){return document.createElement("div")}function ws(t){return["Element","Fragment"].some(function(e){return uh(t,e)})}function vR(t){return uh(t,"NodeList")}function bR(t){return uh(t,"MouseEvent")}function wR(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function SR(t){return ws(t)?[t]:vR(t)?Pl(t):Array.isArray(t)?t:Pl(document.querySelectorAll(t))}function dh(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function dw(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function CR(t){var e,n=si(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function ER(t,e){var n=e.clientX,r=e.clientY;return t.every(function(o){var i=o.popperRect,s=o.popperState,a=o.props,l=a.interactiveBorder,c=yR(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,f=c==="right"?u.left.x:0,p=c==="left"?u.right.x:0,g=i.top-r+d>l,m=r-i.bottom-h>l,y=i.left-n+f>l,C=n-i.right-p>l;return g||m||y||C})}function fh(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(o){t[r](o,n)})}function fw(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Mn={isTouch:!1},hw=0;function _R(){Mn.isTouch||(Mn.isTouch=!0,window.performance&&document.addEventListener("mousemove",pw))}function pw(){var t=performance.now();t-hw<20&&(Mn.isTouch=!1,document.removeEventListener("mousemove",pw)),hw=t}function xR(){var t=document.activeElement;if(wR(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function AR(){document.addEventListener("touchstart",_R,go),window.addEventListener("blur",xR)}var OR=typeof window<"u"&&typeof document<"u",TR=OR?!!window.msCrypto:!1;function ai(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function gw(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function kR(t){return gw(`
|
126
|
+
%ctippy.js
|
127
|
+
|
128
|
+
%c`+gw(t)+`
|
129
|
+
|
130
|
+
%c👷 This is a development-only message. It will be removed in production.
|
131
|
+
`)}function mw(t){return[kR(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var Ss;process.env.NODE_ENV!=="production"&&MR();function MR(){Ss=new Set}function Xn(t,e){if(t&&!Ss.has(e)){var n;Ss.add(e),(n=console).warn.apply(n,mw(e))}}function hh(t,e){if(t&&!Ss.has(e)){var n;Ss.add(e),(n=console).error.apply(n,mw(e))}}function PR(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;hh(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),hh(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var yw={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},IR={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Zt=Object.assign({appendTo:sw,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},yw,IR),LR=Object.keys(Zt),DR=function(e){process.env.NODE_ENV!=="production"&&ww(e,[]);var n=Object.keys(e);n.forEach(function(r){Zt[r]=e[r]})};function vw(t){var e=t.plugins||[],n=e.reduce(function(r,o){var i=o.name,s=o.defaultValue;if(i){var a;r[i]=t[i]!==void 0?t[i]:(a=Zt[i])!=null?a:s}return r},{});return Object.assign({},t,n)}function RR(t,e){var n=e?Object.keys(vw(Object.assign({},Zt,{plugins:e}))):LR,r=n.reduce(function(o,i){var s=(t.getAttribute("data-tippy-"+i)||"").trim();if(!s)return o;if(i==="content")o[i]=s;else try{o[i]=JSON.parse(s)}catch{o[i]=s}return o},{});return r}function bw(t,e){var n=Object.assign({},e,{content:aw(e.content,[t])},e.ignoreAttributes?{}:RR(t,e.plugins));return n.aria=Object.assign({},Zt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function ww(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var o=pR(Zt,Object.keys(yw)),i=!hR(o,r);i&&(i=e.filter(function(s){return s.name===r}).length===0),Xn(i,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
132
|
+
|
133
|
+
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
134
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var NR=function(){return"innerHTML"};function ph(t,e){t[NR()]=e}function Sw(t){var e=bs();return t===!0?e.className=ow:(e.className=iw,ws(t)?e.appendChild(t):ph(e,t)),e}function Cw(t,e){ws(e.content)?(ph(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?ph(t,e.content):t.textContent=e.content)}function gh(t){var e=t.firstElementChild,n=Pl(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(rw)}),arrow:n.find(function(r){return r.classList.contains(ow)||r.classList.contains(iw)}),backdrop:n.find(function(r){return r.classList.contains(fR)})}}function Ew(t){var e=bs(),n=bs();n.className=dR,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=bs();r.className=rw,r.setAttribute("data-state","hidden"),Cw(r,t.props),e.appendChild(n),n.appendChild(r),o(t.props,t.props);function o(i,s){var a=gh(e),l=a.box,c=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(i.content!==s.content||i.allowHTML!==s.allowHTML)&&Cw(c,t.props),s.arrow?u?i.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(Sw(s.arrow))):l.appendChild(Sw(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:o}}Ew.$$tippy=!0;var FR=1,Il=[],mh=[];function HR(t,e){var n=bw(t,Object.assign({},Zt,vw(uw(e)))),r,o,i,s=!1,a=!1,l=!1,c=!1,u,d,h,f=[],p=lw(G,n.interactiveDebounce),g,m=FR++,y=null,C=mR(n.plugins),w={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:m,reference:t,popper:bs(),popperInstance:y,props:n,state:w,plugins:C,clearDelayTimeouts:re,setProps:j,setContent:te,show:fe,hide:ve,hideWithInteractivity:Ee,enable:U,disable:B,unmount:Ve,destroy:ze};if(!n.render)return process.env.NODE_ENV!=="production"&&hh(!0,"render() function has not been supplied."),b;var S=n.render(b),E=S.popper,x=S.onUpdate;E.setAttribute("data-tippy-root",""),E.id="tippy-"+b.id,b.popper=E,t._tippy=b,E._tippy=b;var _=C.map(function(q){return q.fn(b)}),A=t.hasAttribute("aria-expanded");return H(),R(),$(),J("onCreate",[b]),n.showOnCreate&&Z(),E.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),E.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&P().addEventListener("mousemove",p)}),b;function O(){var q=b.props.touch;return Array.isArray(q)?q:[q,0]}function k(){return O()[0]==="hold"}function M(){var q;return!!((q=b.props.render)!=null&&q.$$tippy)}function I(){return g||t}function P(){var q=I().parentNode;return q?CR(q):document}function F(){return gh(E)}function z(q){return b.state.isMounted&&!b.state.isVisible||Mn.isTouch||u&&u.type==="focus"?0:ch(b.props.delay,q?0:1,Zt.delay)}function $(q){q===void 0&&(q=!1),E.style.pointerEvents=b.props.interactive&&!q?"":"none",E.style.zIndex=""+b.props.zIndex}function J(q,ae,ge){if(ge===void 0&&(ge=!0),_.forEach(function(ke){ke[q]&&ke[q].apply(ke,ae)}),ge){var Me;(Me=b.props)[q].apply(Me,ae)}}function K(){var q=b.props.aria;if(q.content){var ae="aria-"+q.content,ge=E.id,Me=si(b.props.triggerTarget||t);Me.forEach(function(ke){var je=ke.getAttribute(ae);if(b.state.isVisible)ke.setAttribute(ae,je?je+" "+ge:ge);else{var Ae=je&&je.replace(ge,"").trim();Ae?ke.setAttribute(ae,Ae):ke.removeAttribute(ae)}})}}function R(){if(!(A||!b.props.aria.expanded)){var q=si(b.props.triggerTarget||t);q.forEach(function(ae){b.props.interactive?ae.setAttribute("aria-expanded",b.state.isVisible&&ae===I()?"true":"false"):ae.removeAttribute("aria-expanded")})}}function Q(){P().removeEventListener("mousemove",p),Il=Il.filter(function(q){return q!==p})}function se(q){if(!(Mn.isTouch&&(l||q.type==="mousedown"))){var ae=q.composedPath&&q.composedPath()[0]||q.target;if(!(b.props.interactive&&fw(E,ae))){if(si(b.props.triggerTarget||t).some(function(ge){return fw(ge,ae)})){if(Mn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else J("onClickOutside",[b,q]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||pe())}}}function ie(){l=!0}function de(){l=!1}function ue(){var q=P();q.addEventListener("mousedown",se,!0),q.addEventListener("touchend",se,go),q.addEventListener("touchstart",de,go),q.addEventListener("touchmove",ie,go)}function pe(){var q=P();q.removeEventListener("mousedown",se,!0),q.removeEventListener("touchend",se,go),q.removeEventListener("touchstart",de,go),q.removeEventListener("touchmove",ie,go)}function D(q,ae){ye(q,function(){!b.state.isVisible&&E.parentNode&&E.parentNode.contains(E)&&ae()})}function ce(q,ae){ye(q,ae)}function ye(q,ae){var ge=F().box;function Me(ke){ke.target===ge&&(fh(ge,"remove",Me),ae())}if(q===0)return ae();fh(ge,"remove",d),fh(ge,"add",Me),d=Me}function be(q,ae,ge){ge===void 0&&(ge=!1);var Me=si(b.props.triggerTarget||t);Me.forEach(function(ke){ke.addEventListener(q,ae,ge),f.push({node:ke,eventType:q,handler:ae,options:ge})})}function H(){k()&&(be("touchstart",He,{passive:!0}),be("touchend",ne,{passive:!0})),gR(b.props.trigger).forEach(function(q){if(q!=="manual")switch(be(q,He),q){case"mouseenter":be("mouseleave",ne);break;case"focus":be(TR?"focusout":"blur",X);break;case"focusin":be("focusout",X);break}})}function L(){f.forEach(function(q){var ae=q.node,ge=q.eventType,Me=q.handler,ke=q.options;ae.removeEventListener(ge,Me,ke)}),f=[]}function He(q){var ae,ge=!1;if(!(!b.state.isEnabled||W(q)||a)){var Me=((ae=u)==null?void 0:ae.type)==="focus";u=q,g=q.currentTarget,R(),!b.state.isVisible&&bR(q)&&Il.forEach(function(ke){return ke(q)}),q.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?ge=!0:Z(q),q.type==="click"&&(s=!ge),ge&&!Me&&Se(q)}}function G(q){var ae=q.target,ge=I().contains(ae)||E.contains(ae);if(!(q.type==="mousemove"&&ge)){var Me=we().concat(E).map(function(ke){var je,Ae=ke._tippy,Ze=(je=Ae.popperInstance)==null?void 0:je.state;return Ze?{popperRect:ke.getBoundingClientRect(),popperState:Ze,props:n}:null}).filter(Boolean);ER(Me,q)&&(Q(),Se(q))}}function ne(q){var ae=W(q)||b.props.trigger.indexOf("click")>=0&&s;if(!ae){if(b.props.interactive){b.hideWithInteractivity(q);return}Se(q)}}function X(q){b.props.trigger.indexOf("focusin")<0&&q.target!==I()||b.props.interactive&&q.relatedTarget&&E.contains(q.relatedTarget)||Se(q)}function W(q){return Mn.isTouch?k()!==q.type.indexOf("touch")>=0:!1}function V(){ee();var q=b.props,ae=q.popperOptions,ge=q.placement,Me=q.offset,ke=q.getReferenceClientRect,je=q.moveTransition,Ae=M()?gh(E).arrow:null,Ze=ke?{getBoundingClientRect:ke,contextElement:ke.contextElement||I()}:t,$n={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(ar){var st=ar.state;if(M()){var lr=F(),Ai=lr.box;["placement","reference-hidden","escaped"].forEach(function(Mo){Mo==="placement"?Ai.setAttribute("data-placement",st.placement):st.attributes.popper["data-popper-"+Mo]?Ai.setAttribute("data-"+Mo,""):Ai.removeAttribute("data-"+Mo)}),st.attributes.popper={}}}},it=[{name:"offset",options:{offset:Me}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!je}},$n];M()&&Ae&&it.push({name:"arrow",options:{element:Ae,padding:3}}),it.push.apply(it,(ae==null?void 0:ae.modifiers)||[]),b.popperInstance=uR(Ze,E,Object.assign({},ae,{placement:ge,onFirstUpdate:h,modifiers:it}))}function ee(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Ce(){var q=b.props.appendTo,ae,ge=I();b.props.interactive&&q===sw||q==="parent"?ae=ge.parentNode:ae=aw(q,[ge]),ae.contains(E)||ae.appendChild(E),b.state.isMounted=!0,V(),process.env.NODE_ENV!=="production"&&Xn(b.props.interactive&&q===Zt.appendTo&&ge.nextElementSibling!==E,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
135
|
+
|
136
|
+
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
137
|
+
|
138
|
+
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
139
|
+
|
140
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function we(){return Pl(E.querySelectorAll("[data-tippy-root]"))}function Z(q){b.clearDelayTimeouts(),q&&J("onTrigger",[b,q]),ue();var ae=z(!0),ge=O(),Me=ge[0],ke=ge[1];Mn.isTouch&&Me==="hold"&&ke&&(ae=ke),ae?r=setTimeout(function(){b.show()},ae):b.show()}function Se(q){if(b.clearDelayTimeouts(),J("onUntrigger",[b,q]),!b.state.isVisible){pe();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(q.type)>=0&&s)){var ae=z(!1);ae?o=setTimeout(function(){b.state.isVisible&&b.hide()},ae):i=requestAnimationFrame(function(){b.hide()})}}function U(){b.state.isEnabled=!0}function B(){b.hide(),b.state.isEnabled=!1}function re(){clearTimeout(r),clearTimeout(o),cancelAnimationFrame(i)}function j(q){if(process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("setProps")),!b.state.isDestroyed){J("onBeforeUpdate",[b,q]),L();var ae=b.props,ge=bw(t,Object.assign({},ae,uw(q),{ignoreAttributes:!0}));b.props=ge,H(),ae.interactiveDebounce!==ge.interactiveDebounce&&(Q(),p=lw(G,ge.interactiveDebounce)),ae.triggerTarget&&!ge.triggerTarget?si(ae.triggerTarget).forEach(function(Me){Me.removeAttribute("aria-expanded")}):ge.triggerTarget&&t.removeAttribute("aria-expanded"),R(),$(),x&&x(ae,ge),b.popperInstance&&(V(),we().forEach(function(Me){requestAnimationFrame(Me._tippy.popperInstance.forceUpdate)})),J("onAfterUpdate",[b,q])}}function te(q){b.setProps({content:q})}function fe(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("show"));var q=b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,Me=Mn.isTouch&&!b.props.touch,ke=ch(b.props.duration,0,Zt.duration);if(!(q||ae||ge||Me)&&!I().hasAttribute("disabled")&&(J("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,M()&&(E.style.visibility="visible"),$(),ue(),b.state.isMounted||(E.style.transition="none"),M()){var je=F(),Ae=je.box,Ze=je.content;dh([Ae,Ze],0)}h=function(){var it;if(!(!b.state.isVisible||c)){if(c=!0,E.offsetHeight,E.style.transition=b.props.moveTransition,M()&&b.props.animation){var kt=F(),ar=kt.box,st=kt.content;dh([ar,st],ke),dw([ar,st],"visible")}K(),R(),cw(mh,b),(it=b.popperInstance)==null||it.forceUpdate(),J("onMount",[b]),b.props.animation&&M()&&ce(ke,function(){b.state.isShown=!0,J("onShown",[b])})}},Ce()}}function ve(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("hide"));var q=!b.state.isVisible,ae=b.state.isDestroyed,ge=!b.state.isEnabled,Me=ch(b.props.duration,1,Zt.duration);if(!(q||ae||ge)&&(J("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,c=!1,s=!1,M()&&(E.style.visibility="hidden"),Q(),pe(),$(!0),M()){var ke=F(),je=ke.box,Ae=ke.content;b.props.animation&&(dh([je,Ae],Me),dw([je,Ae],"hidden"))}K(),R(),b.props.animation?M()&&D(Me,b.unmount):b.unmount()}}function Ee(q){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("hideWithInteractivity")),P().addEventListener("mousemove",p),cw(Il,p),p(q)}function Ve(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(ee(),we().forEach(function(q){q._tippy.unmount()}),E.parentNode&&E.parentNode.removeChild(E),mh=mh.filter(function(q){return q!==b}),b.state.isMounted=!1,J("onHidden",[b]))}function ze(){process.env.NODE_ENV!=="production"&&Xn(b.state.isDestroyed,ai("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),L(),delete t._tippy,b.state.isDestroyed=!0,J("onDestroy",[b]))}}function li(t,e){e===void 0&&(e={});var n=Zt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(PR(t),ww(e,n)),AR();var r=Object.assign({},e,{plugins:n}),o=SR(t);if(process.env.NODE_ENV!=="production"){var i=ws(r.content),s=o.length>1;Xn(i&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
141
|
+
|
142
|
+
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
143
|
+
|
144
|
+
`,`1) content: element.innerHTML
|
145
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=o.reduce(function(l,c){var u=c&&HR(c,r);return u&&l.push(u),l},[]);return ws(t)?a[0]:a}li.defaultProps=Zt,li.setDefaultProps=DR,li.currentInput=Mn,Object.assign({},Vb,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),li.setDefaultProps({render:Ew});class BR{constructor({editor:e,element:n,view:r,tippyOptions:o={},updateDelay:i=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:d,selection:h}=l,{empty:f}=h,p=!d.textBetween(c,u).length&&qf(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||f||p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||(a==null?void 0:a.relatedTarget)!==this.editor.view.dom&&this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var d,h,f;const{state:p,composing:g}=a,{selection:m}=p;if(g||!l&&!c)return;this.createTooltip();const{ranges:C}=m,w=Math.min(...C.map(E=>E.$from.pos)),b=Math.max(...C.map(E=>E.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,element:this.element,view:a,state:p,oldState:u,from:w,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((f=this.tippyOptions)===null||f===void 0?void 0:f.getReferenceClientRect)||(()=>{if(Nb(p.selection)){let E=a.nodeDOM(w);if(E){const x=E.dataset.nodeViewWrapper?E:E.querySelector("[data-node-view-wrapper]");if(x&&(E=x.firstChild),E)return E.getBoundingClientRect()}}return RL(a,w,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=i,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=o,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=li(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,o=r.selection.from!==r.selection.to;if(this.updateDelay>0&&o){this.handleDebouncedUpdate(e,n);return}const i=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,i,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const _w=t=>new at({key:typeof t.pluginKey=="string"?new mt(t.pluginKey):t.pluginKey,view:e=>new BR({view:e,...t})});pt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[_w({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});function $R(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var yh={exports:{}},vh={};/**
|
146
|
+
* @license React
|
147
|
+
* use-sync-external-store-shim.production.min.js
|
148
|
+
*
|
149
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
150
|
+
*
|
151
|
+
* This source code is licensed under the MIT license found in the
|
152
|
+
* LICENSE file in the root directory of this source tree.
|
153
|
+
*/var xw;function VR(){if(xw)return vh;xw=1;var t=T;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,o=t.useEffect,i=t.useLayoutEffect,s=t.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),g=p[0].inst,m=p[1];return i(function(){g.value=f,g.getSnapshot=h,l(g)&&m({inst:g})},[d,f,h]),o(function(){return l(g)&&m({inst:g}),d(function(){l(g)&&m({inst:g})})},[d]),s(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return vh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,vh}var bh={};/**
|
154
|
+
* @license React
|
155
|
+
* use-sync-external-store-shim.development.js
|
156
|
+
*
|
157
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
158
|
+
*
|
159
|
+
* This source code is licensed under the MIT license found in the
|
160
|
+
* LICENSE file in the root directory of this source tree.
|
161
|
+
*/var Aw;function jR(){return Aw||(Aw=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=T,e=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var b=arguments.length,S=new Array(b>1?b-1:0),E=1;E<b;E++)S[E-1]=arguments[E];r("error",w,S)}}function r(w,b,S){{var E=e.ReactDebugCurrentFrame,x=E.getStackAddendum();x!==""&&(b+="%s",S=S.concat([x]));var _=S.map(function(A){return String(A)});_.unshift("Warning: "+b),Function.prototype.apply.call(console[w],console,_)}}function o(w,b){return w===b&&(w!==0||1/w===1/b)||w!==w&&b!==b}var i=typeof Object.is=="function"?Object.is:o,s=t.useState,a=t.useEffect,l=t.useLayoutEffect,c=t.useDebugValue,u=!1,d=!1;function h(w,b,S){u||t.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var E=b();if(!d){var x=b();i(E,x)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var _=s({inst:{value:E,getSnapshot:b}}),A=_[0].inst,O=_[1];return l(function(){A.value=E,A.getSnapshot=b,f(A)&&O({inst:A})},[w,E,b]),a(function(){f(A)&&O({inst:A});var k=function(){f(A)&&O({inst:A})};return w(k)},[w]),c(E),E}function f(w){var b=w.getSnapshot,S=w.value;try{var E=b();return!i(S,E)}catch{return!0}}function p(w,b,S){return b()}var g=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",m=!g,y=m?p:h,C=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:y;bh.useSyncExternalStore=C,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),bh}process.env.NODE_ENV==="production"?yh.exports=VR():yh.exports=jR();var Ll=yh.exports;const zR=(...t)=>e=>{t.forEach(n=>{typeof n=="function"?n(e):n&&(n.current=e)})},UR=({contentComponent:t})=>{const e=Ll.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return T.createElement(T.Fragment,null,Object.values(e))};function qR(){const t=new Set;let e={};return{subscribe(n){return t.add(n),()=>{t.delete(n)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(n,r){e={...e,[n]:Lo.createPortal(r.reactElement,r.element,n)},t.forEach(o=>o())},removeRenderer(n){const r={...e};delete r[n],e=r,t.forEach(o=>o())}}}class WR extends T.Component{constructor(e){var n;super(e),this.editorContentRef=T.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((n=e.editor)===null||n===void 0)&&n.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const n=this.editorContentRef.current;n.append(...e.options.element.childNodes),e.setOptions({element:n}),e.contentComponent=qR(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(r=>r.hasContentComponentInitialized?r:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const n=document.createElement("div");n.append(...e.options.element.childNodes),e.setOptions({element:n})}render(){const{editor:e,innerRef:n,...r}=this.props;return T.createElement(T.Fragment,null,T.createElement("div",{ref:zR(n,this.editorContentRef),...r}),(e==null?void 0:e.contentComponent)&&T.createElement(UR,{contentComponent:e.contentComponent}))}}const KR=T.forwardRef((t,e)=>{const n=T.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return T.createElement(WR,{key:n,innerRef:e,...t})}),GR=T.memo(KR);var JR=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!t(e[o],n[o]))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!t(o[1],n.get(o[0])))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(r=e.length,r!=n.length)return!1;for(o=r;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var s=i[o];if(!(s==="_owner"&&e.$$typeof)&&!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n},XR=$R(JR),wh={exports:{}},Sh={};/**
|
162
|
+
* @license React
|
163
|
+
* use-sync-external-store-shim/with-selector.production.min.js
|
164
|
+
*
|
165
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
166
|
+
*
|
167
|
+
* This source code is licensed under the MIT license found in the
|
168
|
+
* LICENSE file in the root directory of this source tree.
|
169
|
+
*/var Ow;function YR(){if(Ow)return Sh;Ow=1;var t=T,e=Ll;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;return Sh.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function y(E){if(!C){if(C=!0,w=E,E=h(E),f!==void 0&&g.hasValue){var x=g.value;if(f(x,E))return b=x}return b=E}if(x=b,r(w,E))return x;var _=h(E);return f!==void 0&&f(x,_)?x:(w=E,b=_)}var C=!1,w,b,S=d===void 0?null:d;return[function(){return y(u())},S===null?void 0:function(){return y(S())}]},[u,d,h,f]);var m=o(c,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=m},[m]),l(m),m},Sh}var Ch={};/**
|
170
|
+
* @license React
|
171
|
+
* use-sync-external-store-shim/with-selector.development.js
|
172
|
+
*
|
173
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
174
|
+
*
|
175
|
+
* This source code is licensed under the MIT license found in the
|
176
|
+
* LICENSE file in the root directory of this source tree.
|
177
|
+
*/var Tw;function QR(){return Tw||(Tw=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t=T,e=Ll;function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=e.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;function c(u,d,h,f,p){var g=i(null),m;g.current===null?(m={hasValue:!1,value:null},g.current=m):m=g.current;var y=a(function(){var S=!1,E,x,_=function(M){if(!S){S=!0,E=M;var I=f(M);if(p!==void 0&&m.hasValue){var P=m.value;if(p(P,I))return x=P,P}return x=I,I}var F=E,z=x;if(r(F,M))return z;var $=f(M);return p!==void 0&&p(z,$)?z:(E=M,x=$,$)},A=h===void 0?null:h,O=function(){return _(d())},k=A===null?void 0:function(){return _(A())};return[O,k]},[d,h,f,p]),C=y[0],w=y[1],b=o(u,C,w);return s(function(){m.hasValue=!0,m.value=b},[b]),l(b),b}Ch.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Ch}process.env.NODE_ENV==="production"?wh.exports=YR():wh.exports=QR();var ZR=wh.exports;const eN=typeof window<"u"?T.useLayoutEffect:T.useEffect;class tN{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,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(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const n=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},r=this.editor;return r.on("transaction",n),()=>{r.off("transaction",n)}}}}function nN(t){var e;const[n]=T.useState(()=>new tN(t.editor)),r=ZR.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:XR);return eN(()=>n.watch(t.editor),[t.editor,n]),T.useDebugValue(r),r}const kw=process.env.NODE_ENV!=="production",Eh=typeof window>"u",rN=Eh||!!(typeof window<"u"&&window.next);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(n=>n())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return Eh||rN?(kw&&console.warn("Tiptap Error: SSR has been detected, please set `immediatelyRender` explicitly to `false` to avoid hydration mismatches."),null):this.createEditor();if(this.options.current.immediatelyRender&&Eh&&kw)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const e={...this.options.current,onBeforeCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(o,...r)},onBlur:(...r)=>{var o,i;return(i=(o=this.options.current).onBlur)===null||i===void 0?void 0:i.call(o,...r)},onCreate:(...r)=>{var o,i;return(i=(o=this.options.current).onCreate)===null||i===void 0?void 0:i.call(o,...r)},onDestroy:(...r)=>{var o,i;return(i=(o=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(o,...r)},onFocus:(...r)=>{var o,i;return(i=(o=this.options.current).onFocus)===null||i===void 0?void 0:i.call(o,...r)},onSelectionUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(o,...r)},onTransaction:(...r)=>{var o,i;return(i=(o=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(o,...r)},onUpdate:(...r)=>{var o,i;return(i=(o=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(o,...r)},onContentError:(...r)=>{var o,i;return(i=(o=this.options.current).onContentError)===null||i===void 0?void 0:i.call(o,...r)},onDrop:(...r)=>{var o,i;return(i=(o=this.options.current).onDrop)===null||i===void 0?void 0:i.call(o,...r)},onPaste:(...r)=>{var o,i;return(i=(o=this.options.current).onPaste)===null||i===void 0?void 0:i.call(o,...r)}};return new tD(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,n){return Object.keys(e).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&e.extensions&&n.extensions?e.extensions.length!==n.extensions.length?!1:e.extensions.every((o,i)=>{var s;return o===((s=n.extensions)===null||s===void 0?void 0:s[i])}):e[r]===n[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,o)=>r===e[o]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function oN(t={},e=[]){const n=T.useRef(t);n.current=t;const[r]=T.useState(()=>new _h(n)),o=Ll.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return T.useDebugValue(o),T.useEffect(r.onRender(e)),nN({editor:o,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),o}const Mw=T.createContext({editor:null});Mw.Consumer;const iN=()=>T.useContext(Mw),sN=t=>{const[e,n]=T.useState(null),{editor:r}=iN();return T.useEffect(()=>{var o;if(!e||!((o=t.editor)===null||o===void 0)&&o.isDestroyed||r!=null&&r.isDestroyed)return;const{pluginKey:i="bubbleMenu",editor:s,tippyOptions:a={},updateDelay:l,shouldShow:c=null}=t,u=s||r;if(!u){console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");return}const d=_w({updateDelay:l,editor:u,element:e,pluginKey:i,shouldShow:c,tippyOptions:a});return u.registerPlugin(d),()=>{u.unregisterPlugin(i)}},[t.editor,r,e]),T.createElement("div",{ref:n,className:t.className,style:{visibility:"hidden"}},t.children)},Pw=T.createContext({onDragStart:void 0}),Iw=()=>T.useContext(Pw),Cs=t=>{const e=t.as||"div",{nodeViewContentRef:n}=Iw();return T.createElement(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};T.forwardRef((t,e)=>{const{onDragStart:n}=Iw(),r=t.as||"div";return T.createElement(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function aN(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function lN(t){var e;return typeof t=="object"&&((e=t.$$typeof)===null||e===void 0?void 0:e.toString())==="Symbol(react.forward_ref)"}class Lw{constructor(e,{editor:n,props:r={},as:o="div",className:i=""}){this.ref=null,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=n,this.props=r,this.element=document.createElement(o),this.element.classList.add("react-renderer"),i&&this.element.classList.add(...i.split(" ")),this.editor.isInitialized?Lo.flushSync(()=>{this.render()}):this.render()}render(){var e;const n=this.component,r=this.props,o=this.editor;(aN(n)||lN(n))&&(r.ref=i=>{this.ref=i}),this.reactElement=T.createElement(n,{...r}),(e=o==null?void 0:o.contentComponent)===null||e===void 0||e.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){var e;const n=this.editor;(e=n==null?void 0:n.contentComponent)===null||e===void 0||e.removeRenderer(this.id)}updateAttributes(e){Object.keys(e).forEach(n=>{this.element.setAttribute(n,e[n])})}}class cN extends rD{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode()};if(!this.component.displayName){const c=u=>u.charAt(0).toUpperCase()+u.substring(1);this.component.displayName=c(this.extension.name)}const o={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&c.appendChild(this.contentDOMElement)}},i=this.component,s=T.memo(c=>T.createElement(Pw.Provider,{value:o},T.createElement(i,c)));s.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.style.whiteSpace="inherit");let a=this.node.isInline?"span":"div";this.options.as&&(a=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new Lw(s,{editor:this.editor,props:e,as:a,className:`node-${this.node.type.name} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var e;if(this.renderer.element.firstElementChild&&!(!((e=this.renderer.element.firstElementChild)===null||e===void 0)&&e.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(){const{from:e,to:n}=this.editor.state.selection,r=this.getPos();if(typeof r=="number")if(e<=r&&n>=r+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,n,r){const o=i=>{this.renderer.updateProps(i),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const i=this.node,s=this.decorations,a=this.innerDecorations;return this.node=e,this.decorations=n,this.innerDecorations=r,this.options.update({oldNode:i,oldDecorations:s,newNode:e,newDecorations:n,oldInnerDecorations:a,innerDecorations:r,updateProps:()=>o({node:e,decorations:n,innerDecorations:r})})}return e===this.node&&this.decorations===n&&this.innerDecorations===r||(this.node=e,this.decorations=n,this.innerDecorations=r,o({node:e,decorations:n,innerDecorations:r})),!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.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs=="function"){const n=this.editor.extensionManager.attributes,r=gl(this.node,n);e=this.options.attrs({node:this.node,HTMLAttributes:r})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}}function mo(t,e){return n=>n.editor.contentComponent?new cN(t,n,e):{}}function Dw({...t}){return v.jsx(N.Button,{scheme:"light",variant:"borderless",corners:"square",size:"sm",...t})}function uN({children:t,...e}){return v.jsxs(N.Button,{scheme:"light",variant:"borderless",size:"sm",dflex:!0,alignItems:"center",whiteSpace:"nowrap",fontWeight:"500",corners:"square",...e,children:[t,v.jsx(N.Icon,{path:tx})]})}function dN({children:t,...e}){return v.jsx(N.Tile,{scheme:"light",position:"fixed",top:"100%",dflex:!0,flexCol:!0,z:"99999",mt:"1",p:"1.5",overflow:"hidden",rounded:!0,border:!0,borderColor:"stone-200",shadow:"xl",...e,children:t})}function yo({icon:t,name:e,isActive:n,...r}){return v.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",justifyContent:"between",spaceX:"2",rounded:"sm",px:"2",py:"2",w:"48",textSize:"sm",textColor:"stone-600",...r,children:[t,v.jsx("span",{flex:"1",children:e}),n&&v.jsx(N.Icon,{path:ou})]})}const Rw=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function fN(t){const e=Rw.find(({color:n})=>t.isActive("highlight",{color:n}));return{textColor:e==null?void 0:e.color}}function hN({editor:t,onHide:e}){return Rw.map(({name:n,color:r},o)=>v.jsx(yo,{icon:v.jsx(N.Icon,{path:$g,textColor:r}),name:n,isActive:t.isActive("highlight",{color:r}),onClick:()=>{t.commands.unsetHighlight(),n!=="Default"&&t.chain().focus().setHighlight({color:r}).run(),e()}},o))}const Nw=[{name:"Default",color:"var(--novel-black)"},{name:"Purple",color:"#9333EA"},{name:"Red",color:"#E00000"},{name:"Yellow",color:"#EAB308"},{name:"Blue",color:"#2563EB"},{name:"Green",color:"#008A00"},{name:"Orange",color:"#FFA500"},{name:"Pink",color:"#BA4081"},{name:"Gray",color:"#A8A29E"}];function pN(t){const e=Nw.find(({color:n})=>t.isActive("textStyle",{color:n}));return{textColor:e==null?void 0:e.color}}function gN({editor:t,onHide:e}){return Nw.map(({name:n,color:r},o)=>v.jsx(yo,{icon:v.jsx(N.Icon,{path:$g,textColor:r}),name:n,isActive:t.isActive("textStyle",{color:r}),onClick:()=>{t.commands.unsetColor(),n!=="Default"&&t.chain().focus().setColor(r).run(),e()}},o))}function mN({editor:t,onHide:e}){const n=T.useRef(null);T.useEffect(()=>{var o;n.current&&((o=n.current)==null||o.focus())});const r=T.useCallback(o=>{var i,s;o.preventDefault(),(i=n.current)!=null&&i.checkValidity()&&(t.commands.setLink({href:(s=n.current)==null?void 0:s.value}),e())},[n,e,t]);return v.jsxs("div",{dflex:!0,alignItems:"center",w:"full",children:[v.jsx(N.Input,{ref:n,type:"url",size:"sm",variant:"default",minW:"64",placeholder:"Paste a link",textColor:"slate-700",flexGrow:!0,defaultValue:t.getAttributes("link").href||"",border:"0"}),v.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",type:"submit",onClick:r,children:v.jsx(N.Icon,{path:ou})}),t.getAttributes("link").href&&v.jsx(N.Button,{variant:"borderless",size:"sm",scheme:"light",onClick:()=>{t.chain().focus().unsetLink().run(),e()},children:v.jsx(N.Icon,{path:em})})]})}const Fw="M11 7h2v10h-2v-4H7v4H5V7h2v4h4V7zm6.57 0c-.594.95-1.504 1.658-2.57 2v1h2v7h2V7h-1.43z",Hw="M9 7h2v10H9v-4H5v4H3V7h2v4h4V7zm8 8c.51-.41.6-.62 1.06-1.05.437-.4.848-.828 1.23-1.28.334-.39.62-.82.85-1.28.2-.39.305-.822.31-1.26.005-.44-.087-.878-.27-1.28-.177-.385-.437-.726-.76-1-.346-.283-.743-.497-1.17-.63-.485-.153-.99-.227-1.5-.22-.36 0-.717.033-1.07.1-.343.06-.678.158-1 .29-.304.13-.593.295-.86.49-.287.21-.56.437-.82.68l1.24 1.22c.308-.268.643-.502 1-.7.35-.2.747-.304 1.15-.3.455-.03.906.106 1.27.38.31.278.477.684.45 1.1-.014.396-.14.78-.36 1.11-.285.453-.62.872-1 1.25-.44.43-.98.92-1.59 1.43-.61.51-1.41 1.06-2.16 1.65V17h8v-2h-4z",Bw="M14.11 14.218c.355.287.75.523 1.17.7.434.18.9.273 1.37.27.484.017.965-.086 1.4-.3.333-.146.55-.476.55-.84.003-.203-.05-.403-.15-.58-.123-.19-.3-.34-.51-.43-.32-.137-.655-.228-1-.27-.503-.073-1.012-.106-1.52-.1v-1.57c.742.052 1.485-.07 2.17-.36.37-.164.615-.525.63-.93.026-.318-.12-.627-.38-.81-.34-.203-.734-.3-1.13-.28-.395.013-.784.108-1.14.28-.375.167-.73.375-1.06.62l-1.22-1.39c.5-.377 1.053-.68 1.64-.9.608-.224 1.252-.336 1.9-.33.525-.007 1.05.05 1.56.17.43.1.84.277 1.21.52.325.21.595.495.79.83.19.342.287.73.28 1.12.01.48-.177.943-.52 1.28-.417.39-.916.685-1.46.86v.06c.61.14 1.175.425 1.65.83.437.382.68.94.66 1.52.005.42-.113.835-.34 1.19-.23.357-.538.657-.9.88-.408.253-.853.44-1.32.55-.514.128-1.04.192-1.57.19-.786.02-1.57-.106-2.31-.37-.59-.214-1.126-.556-1.57-1l1.12-1.41zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z",$w="M11 17H9v-4H5v4H3V7h2v4h4V7h2v10zm10-2h-1v2h-2v-2h-5v-2l4.05-6H20v6h1v2zm-3-2V9l-2.79 4H18z";function yN(t){const n=Vw(t).filter(r=>{var o;return(o=r.isActive)==null?void 0:o.call(r,t)});return n.length>1?Ox:n.length==0?yx:n[0].icon}function Vw(t){return[{type:"basic",name:"Text",icon:Zg,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").run(),isActive:()=>t.isActive("paragraph")&&!t.isActive("bulletList")&&!t.isActive("orderedList")},{type:"basic",name:"Heading 1",icon:Fw,command:()=>t.chain().focus().toggleHeading({level:1}).run(),isActive:()=>t.isActive("heading",{level:1})},{type:"basic",name:"Heading 2",icon:Hw,command:()=>t.chain().focus().toggleHeading({level:2}).run(),isActive:()=>t.isActive("heading",{level:2})},{type:"basic",name:"Heading 3",icon:Bw,command:()=>t.chain().focus().toggleHeading({level:3}).run(),isActive:()=>t.isActive("heading",{level:3})},{type:"basic",name:"Heading 4",icon:$w,command:()=>t.chain().focus().toggleHeading({level:4}).run(),isActive:()=>t.isActive("heading",{level:4})},{type:"basic",name:"Bullet List",icon:Wg,command:()=>t.chain().focus().toggleBulletList().run(),isActive:()=>t.isActive("bulletList")},{type:"basic",name:"Numbered List",icon:Kg,command:()=>t.chain().focus().toggleOrderedList().run(),isActive:()=>t.isActive("orderedList")},{type:"basic",name:"Quote",icon:Gg,command:()=>t.chain().focus().toggleNode("paragraph","paragraph").toggleBlockquote().run(),isActive:()=>t.isActive("blockquote")}]}function vN({editor:t,onHide:e}){const{items:n,activeItems:r}=T.useMemo(()=>{const o=Vw(t),i=o.filter(s=>{var a;return(a=s.isActive)==null?void 0:a.call(s,t)}).map(s=>s.name);return{items:o,activeItems:i}},[t]);return n.map((o,i)=>o.type=="basic"&&v.jsx(yo,{icon:v.jsx(N.Icon,{path:o.icon}),name:o.name,isActive:r.includes(o.name),onClick:()=>{var s;(s=o.command)==null||s.call(o,t),e()}},i))}function bN(t){return t.isActive("uppercase")?qg:t.isActive("lowercase")?Ug:zg}function wN({editor:t,onHide:e}){return v.jsxs(v.Fragment,{children:[v.jsx(yo,{icon:v.jsx(N.Icon,{path:zg}),name:"Capitalize",isActive:!1,onClick:()=>{t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleCapitalize().run(),e()}}),v.jsx(yo,{icon:v.jsx(N.Icon,{path:qg}),name:"Uppercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetLowercase().run(),t.chain().focus().toggleUppercase().run(),e()}}),v.jsx(yo,{icon:v.jsx(N.Icon,{path:Ug}),name:"Lowercase",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().toggleLowercase().run(),e()}}),v.jsx(yo,{icon:v.jsx(N.Icon,{path:Vg}),name:"None",isActive:!1,onClick:()=>{t.chain().focus().unsetCapitalize().run(),t.chain().focus().unsetUppercase().run(),t.chain().focus().unsetLowercase().run()}})]})}function SN(){return[{type:"popupMenu",icon:t=>yN(t),name:"nodeSelector",excludeFromNodeType:["link"],renderPopupMenu:(t,e)=>v.jsx(vN,{editor:t,onHide:e})},{type:"basic",name:"bold",isActive:t=>t.isActive("bold"),command:t=>t.chain().focus().toggleBold().run(),icon:dx,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"italic",isActive:t=>t.isActive("italic"),command:t=>t.chain().focus().toggleItalic().run(),icon:hx,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"underline",isActive:t=>t.isActive("underline"),command:t=>t.chain().focus().toggleUnderline().run(),icon:mx,excludeFromNodeType:["heading","blockquote","link"]},{type:"basic",name:"strike",isActive:t=>t.isActive("strike"),command:t=>t.chain().focus().toggleStrike().run(),icon:px,excludeFromNodeType:["heading","blockquote","link"]},{type:"popupMenu",icon:t=>bN(t),isActive:t=>t.isActive("capitalize")||t.isActive("uppercase")||t.isActive("lowercase"),name:"caseSelector",renderPopupMenu:(t,e)=>v.jsx(wN,{editor:t,onHide:e})},{type:"popupMenu",icon:gx,iconProps:t=>pN(t),name:"colorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>v.jsx(gN,{editor:t,onHide:e})},{type:"popupMenu",icon:fx,iconProps:t=>fN(t),name:"bgColorSelector",excludeFromNodeType:["heading","blockquote","link"],renderPopupMenu:(t,e)=>v.jsx(hN,{editor:t,onHide:e})},{type:"popupMenu",icon:Sx,name:"linkSelector",isActive:t=>t.isActive("link"),renderPopupMenu:(t,e)=>v.jsx(mN,{editor:t,onHide:e}),popupMenuPosition:"end",popupMenuWidth:"full"}]}function CN({editor:t,menuItems:e,...n}){var u;const[r,o]=T.useState(""),[i,s]=T.useState(""),a=T.useCallback(()=>s(""),[s]),l=T.useMemo(()=>SN().concat(e??[]),[e]),c={editor:t,...n,shouldShow:({editor:d})=>{var h,f;return d.isActive("image")||(f=(h=d.state.selection.node)==null?void 0:h.type)!=null&&f.isAtom?!1:d.view.state.selection.content().size>0},tippyOptions:{moveTransition:"transform 0.15s ease-out",maxWidth:600,zIndex:1e3,onHidden:()=>{s("")}}};return v.jsxs(v.Fragment,{children:[v.jsx(sN,{...c,children:v.jsx("div",{dflex:!0,w:"fit",divideX:!0,divideColor:"stone-200",rounded:!0,border:!0,borderColor:"stone-200",bgColor:"white",shadow:"xl",children:l.map((d,h)=>{var f,p,g,m,y,C,w,b,S;return v.jsx(T.Fragment,{children:!((f=d.excludeFromNodeType)!=null&&f.find(E=>t.isActive(E)))&&v.jsxs(v.Fragment,{children:[d.type=="basic"&&v.jsx(Dw,{disabled:(p=d.isDisabled)==null?void 0:p.call(d,t),onClick:()=>{var E;return(E=d.command)==null?void 0:E.call(d,t)},children:v.jsx("span",{textColor:(g=d.isActive)!=null&&g.call(d,t)?"sky-500":void 0,children:v.jsx(N.Icon,{path:Be.runIfFn(d.icon,t)})})}),d.type=="dialog"&&v.jsx(Dw,{disabled:(m=d.isDisabled)==null?void 0:m.call(d,t),onClick:()=>o(d.name),children:v.jsx("span",{textColor:(y=d.isActive)!=null&&y.call(d,t)?"sky-500":void 0,children:v.jsx(N.Icon,{path:Be.runIfFn(d.icon,t)})})}),d.type=="popupMenu"&&v.jsxs("div",{position:"relative",children:[v.jsx(uN,{disabled:(C=d.isDisabled)==null?void 0:C.call(d,t),onClick:()=>s(d.name),h:"full",children:v.jsx(N.Icon,{mt:"0.5",path:Be.runIfFn(d.icon,t),textColor:(w=d.isActive)!=null&&w.call(d,t)?"sky-500":void 0,...((b=d.iconProps)==null?void 0:b.call(d,t))??{}})}),i===d.name&&v.jsx(dN,{start:d.popupMenuPosition==="start"?0:void 0,end:d.popupMenuPosition==="end"?0:void 0,w:d.popupMenuWidth==="full"?"full":void 0,minW:d.popupMenuWidth==="full"?"96":void 0,children:(S=d.renderPopupMenu)==null?void 0:S.call(d,t,a)})]})]})},h)})})}),r&&((u=l.find(d=>d.type=="dialog"&&d.name==r))==null?void 0:u.renderDialog(t,()=>o("")))]})}const EN=/^\s*>\s$/,jw=$t.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[ds({find:EN,type:this.type})]}}),_N="listItem",zw="textStyle",Uw=/^\s*([-+*])\s$/,qw=$t.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:t}){return["ul",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(_N,this.editor.getAttributes(zw)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=ds({find:Uw,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ds({find:Uw,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zw),editor:this.editor})),[t]}}),xN=t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach(n=>{var r,o;const i=n.getAttribute("style"),s=(o=(r=n.parentElement)===null||r===void 0?void 0:r.closest("span"))===null||o===void 0?void 0:o.getAttribute("style");n.setAttribute("style",`${s};${i}`)})},AN=Lt.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&xN(t),{}):!1}]},renderHTML({HTMLAttributes:t}){return["span",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,(n,r)=>{if(n.isTextblock)return!0;n.marks.filter(o=>o.type===this.type).some(o=>Object.values(o.attrs).some(i=>!!i))||t.removeMark(r,r+n.nodeSize,this.type)}),!0}}}}),ON=pt.create({name:"color",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return(e=t.style.color)===null||e===void 0?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands(){return{setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}),Ww=$t.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,rt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>Zf({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),TN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,kN=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,MN=Lt.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:t=>t.getAttribute("data-color")||t.style.backgroundColor,renderHTML:t=>t.color?{"data-color":t.color,style:`background-color: ${t.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:t}){return["mark",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setHighlight:t=>({commands:e})=>e.setMark(this.name,t),toggleHighlight:t=>({commands:e})=>e.toggleMark(this.name,t),unsetHighlight:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[fo({find:TN,type:this.type})]},addPasteRules(){return[Ir({find:kN,type:this.type})]}}),PN="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",IN="ελ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",ci=(t,e)=>{for(const n in e)t[n]=e[n];return t},xh="numeric",Ah="ascii",Oh="alpha",Es="asciinumeric",_s="alphanumeric",Th="domain",Kw="emoji",LN="scheme",DN="slashscheme",kh="whitespace";function RN(t,e){return t in e||(e[t]=[]),e[t]}function vo(t,e,n){e[xh]&&(e[Es]=!0,e[_s]=!0),e[Ah]&&(e[Es]=!0,e[Oh]=!0),e[Es]&&(e[_s]=!0),e[Oh]&&(e[_s]=!0),e[_s]&&(e[Th]=!0),e[Kw]&&(e[Th]=!0);for(const r in e){const o=RN(r,n);o.indexOf(t)<0&&o.push(t)}}function NN(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}function Kt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}Kt.groups={},Kt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let r=0;r<e.jr.length;r++){const o=e.jr[r][0],i=e.jr[r][1];if(i&&o.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let o=0;o<t.length;o++)this.tt(t[o],e,n,r)},tr(t,e,n,r){r=r||Kt.groups;let o;return e&&e.j?o=e:(o=new Kt(e),n&&r&&vo(e,n,r)),this.jr.push([t,o]),o},ts(t,e,n,r){let o=this;const i=t.length;if(!i)return o;for(let s=0;s<i-1;s++)o=o.tt(t[s]);return o.tt(t[i-1],e,n,r)},tt(t,e,n,r){r=r||Kt.groups;const o=this;if(e&&e.j)return o.j[t]=e,e;const i=e;let s,a=o.go(t);if(a?(s=new Kt,ci(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Kt,i){if(r)if(s.t&&typeof s.t=="string"){const l=ci(NN(s.t,r),n);vo(i,l,r)}else n&&vo(i,n,r);s.t=i}return o.j[t]=s,s}};const Fe=(t,e,n,r,o)=>t.ta(e,n,r,o),lt=(t,e,n,r,o)=>t.tr(e,n,r,o),Gw=(t,e,n,r,o)=>t.ts(e,n,r,o),he=(t,e,n,r,o)=>t.tt(e,n,r,o),Yn="WORD",Mh="UWORD",Jw="ASCIINUMERICAL",Xw="ALPHANUMERICAL",xs="LOCALHOST",Ph="TLD",Ih="UTLD",Dl="SCHEME",ui="SLASH_SCHEME",Lh="NUM",Dh="WS",Rh="NL",As="OPENBRACE",Os="CLOSEBRACE",Rl="OPENBRACKET",Nl="CLOSEBRACKET",Fl="OPENPAREN",Hl="CLOSEPAREN",Bl="OPENANGLEBRACKET",$l="CLOSEANGLEBRACKET",Vl="FULLWIDTHLEFTPAREN",jl="FULLWIDTHRIGHTPAREN",zl="LEFTCORNERBRACKET",Ul="RIGHTCORNERBRACKET",ql="LEFTWHITECORNERBRACKET",Wl="RIGHTWHITECORNERBRACKET",Kl="FULLWIDTHLESSTHAN",Gl="FULLWIDTHGREATERTHAN",Jl="AMPERSAND",Nh="APOSTROPHE",Xl="ASTERISK",Dr="AT",Yl="BACKSLASH",Ql="BACKTICK",Zl="CARET",Rr="COLON",Fh="COMMA",ec="DOLLAR",Pn="DOT",tc="EQUALS",Hh="EXCLAMATION",hn="HYPHEN",Ts="PERCENT",nc="PIPE",rc="PLUS",oc="POUND",ks="QUERY",Bh="QUOTE",Yw="FULLWIDTHMIDDLEDOT",$h="SEMI",In="SLASH",Ms="TILDE",ic="UNDERSCORE",Qw="EMOJI",sc="SYM";var Zw=Object.freeze({__proto__:null,WORD:Yn,UWORD:Mh,ASCIINUMERICAL:Jw,ALPHANUMERICAL:Xw,LOCALHOST:xs,TLD:Ph,UTLD:Ih,SCHEME:Dl,SLASH_SCHEME:ui,NUM:Lh,WS:Dh,NL:Rh,OPENBRACE:As,CLOSEBRACE:Os,OPENBRACKET:Rl,CLOSEBRACKET:Nl,OPENPAREN:Fl,CLOSEPAREN:Hl,OPENANGLEBRACKET:Bl,CLOSEANGLEBRACKET:$l,FULLWIDTHLEFTPAREN:Vl,FULLWIDTHRIGHTPAREN:jl,LEFTCORNERBRACKET:zl,RIGHTCORNERBRACKET:Ul,LEFTWHITECORNERBRACKET:ql,RIGHTWHITECORNERBRACKET:Wl,FULLWIDTHLESSTHAN:Kl,FULLWIDTHGREATERTHAN:Gl,AMPERSAND:Jl,APOSTROPHE:Nh,ASTERISK:Xl,AT:Dr,BACKSLASH:Yl,BACKTICK:Ql,CARET:Zl,COLON:Rr,COMMA:Fh,DOLLAR:ec,DOT:Pn,EQUALS:tc,EXCLAMATION:Hh,HYPHEN:hn,PERCENT:Ts,PIPE:nc,PLUS:rc,POUND:oc,QUERY:ks,QUOTE:Bh,FULLWIDTHMIDDLEDOT:Yw,SEMI:$h,SLASH:In,TILDE:Ms,UNDERSCORE:ic,EMOJI:Qw,SYM:sc});const Qn=/[a-z]/,Ps=new RegExp("\\p{L}","u"),Vh=new RegExp("\\p{Emoji}","u"),Zn=/\d/,jh=/\s/,eS="\r",zh=`
|
178
|
+
`,FN="️",HN="",Uh="";let ac=null,lc=null;function BN(t=[]){const e={};Kt.groups=e;const n=new Kt;ac==null&&(ac=nS(PN)),lc==null&&(lc=nS(IN)),he(n,"'",Nh),he(n,"{",As),he(n,"}",Os),he(n,"[",Rl),he(n,"]",Nl),he(n,"(",Fl),he(n,")",Hl),he(n,"<",Bl),he(n,">",$l),he(n,"(",Vl),he(n,")",jl),he(n,"「",zl),he(n,"」",Ul),he(n,"『",ql),he(n,"』",Wl),he(n,"<",Kl),he(n,">",Gl),he(n,"&",Jl),he(n,"*",Xl),he(n,"@",Dr),he(n,"`",Ql),he(n,"^",Zl),he(n,":",Rr),he(n,",",Fh),he(n,"$",ec),he(n,".",Pn),he(n,"=",tc),he(n,"!",Hh),he(n,"-",hn),he(n,"%",Ts),he(n,"|",nc),he(n,"+",rc),he(n,"#",oc),he(n,"?",ks),he(n,'"',Bh),he(n,"/",In),he(n,";",$h),he(n,"~",Ms),he(n,"_",ic),he(n,"\\",Yl),he(n,"・",Yw);const r=lt(n,Zn,Lh,{[xh]:!0});lt(r,Zn,r);const o=lt(r,Qn,Jw,{[Es]:!0}),i=lt(r,Ps,Xw,{[_s]:!0}),s=lt(n,Qn,Yn,{[Ah]:!0});lt(s,Zn,o),lt(s,Qn,s),lt(o,Zn,o),lt(o,Qn,o);const a=lt(n,Ps,Mh,{[Oh]:!0});lt(a,Qn),lt(a,Zn,i),lt(a,Ps,a),lt(i,Zn,i),lt(i,Qn),lt(i,Ps,i);const l=he(n,zh,Rh,{[kh]:!0}),c=he(n,eS,Dh,{[kh]:!0}),u=lt(n,jh,Dh,{[kh]:!0});he(n,Uh,u),he(c,zh,l),he(c,Uh,u),lt(c,jh,u),he(u,eS),he(u,zh),lt(u,jh,u),he(u,Uh,u);const d=lt(n,Vh,Qw,{[Kw]:!0});he(d,"#"),lt(d,Vh,d),he(d,FN,d);const h=he(d,HN);he(h,"#"),lt(h,Vh,d);const f=[[Qn,s],[Zn,o]],p=[[Qn,null],[Ps,a],[Zn,i]];for(let g=0;g<ac.length;g++)Nr(n,ac[g],Ph,Yn,f);for(let g=0;g<lc.length;g++)Nr(n,lc[g],Ih,Mh,p);vo(Ph,{tld:!0,ascii:!0},e),vo(Ih,{utld:!0,alpha:!0},e),Nr(n,"file",Dl,Yn,f),Nr(n,"mailto",Dl,Yn,f),Nr(n,"http",ui,Yn,f),Nr(n,"https",ui,Yn,f),Nr(n,"ftp",ui,Yn,f),Nr(n,"ftps",ui,Yn,f),vo(Dl,{scheme:!0,ascii:!0},e),vo(ui,{slashscheme:!0,ascii:!0},e),t=t.sort((g,m)=>g[0]>m[0]?1:-1);for(let g=0;g<t.length;g++){const m=t[g][0],C=t[g][1]?{[LN]:!0}:{[DN]:!0};m.indexOf("-")>=0?C[Th]=!0:Qn.test(m)?Zn.test(m)?C[Es]=!0:C[Ah]=!0:C[xh]=!0,Gw(n,m,m,C)}return Gw(n,"localhost",xs,{ascii:!0}),n.jd=new Kt(sc),{start:n,tokens:ci({groups:e},Zw)}}function tS(t,e){const n=$N(e.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=t,l=null,c=0,u=null,d=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,h=0,u=a):d>=0&&(d+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=d,s-=h,c-=d,o.push({t:u.t,v:e.slice(i-c,i),s:i-c,e:i})}return o}function $N(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),i,s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}function Nr(t,e,n,r,o){let i;const s=e.length;for(let a=0;a<s-1;a++){const l=e[a];t.j[l]?i=t.j[l]:(i=new Kt(r),i.jr=o.slice(),t.j[l]=i),t=i}return i=new Kt(n),i.jr=o.slice(),t.j[e[s-1]]=i,i}function nS(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let i=0;for(;o.indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(r,r+i),10);s>0;s--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Is={defaultProtocol:"http",events:null,format:rS,formatHref:rS,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function qh(t,e=null){let n=ci({},Is);t&&(n=ci(n,t instanceof qh?t.o:t));const r=n.ignoreTags,o=[];for(let i=0;i<r.length;i++)o.push(r[i].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}qh.prototype={o:Is,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Is[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function rS(t){return t}function oS(t,e){this.t="token",this.v=t,this.tk=e}oS.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Is.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),i=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),u=t.getObj("attributes",n,e),d=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),u&&ci(s,u),{tagName:o,attributes:s,content:i,eventListeners:d}}};function cc(t,e){class n extends oS{constructor(o,i){super(o,i),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const iS=cc("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),sS=cc("text"),VN=cc("nl"),uc=cc("url",{isLink:!0,toHref(t=Is.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==xs&&t[1].t===Rr}}),pn=t=>new Kt(t);function jN({groups:t}){const e=t.domain.concat([Jl,Xl,Dr,Yl,Ql,Zl,ec,tc,hn,Lh,Ts,nc,rc,oc,In,sc,Ms,ic]),n=[Rr,Fh,Pn,Hh,Ts,ks,Bh,$h,Bl,$l,As,Os,Nl,Rl,Fl,Hl,Vl,jl,zl,Ul,ql,Wl,Kl,Gl],r=[Jl,Nh,Xl,Yl,Ql,Zl,ec,tc,hn,As,Os,Ts,nc,rc,oc,ks,In,sc,Ms,ic],o=pn(),i=he(o,Ms);Fe(i,r,i),Fe(i,t.domain,i);const s=pn(),a=pn(),l=pn();Fe(o,t.domain,s),Fe(o,t.scheme,a),Fe(o,t.slashscheme,l),Fe(s,r,i),Fe(s,t.domain,s);const c=he(s,Dr);he(i,Dr,c),he(a,Dr,c),he(l,Dr,c);const u=he(i,Pn);Fe(u,r,i),Fe(u,t.domain,i);const d=pn();Fe(c,t.domain,d),Fe(d,t.domain,d);const h=he(d,Pn);Fe(h,t.domain,d);const f=pn(iS);Fe(h,t.tld,f),Fe(h,t.utld,f),he(c,xs,f);const p=he(d,hn);he(p,hn,p),Fe(p,t.domain,d),Fe(f,t.domain,d),he(f,Pn,h),he(f,hn,p);const g=he(f,Rr);Fe(g,t.numeric,iS);const m=he(s,hn),y=he(s,Pn);he(m,hn,m),Fe(m,t.domain,s),Fe(y,r,i),Fe(y,t.domain,s);const C=pn(uc);Fe(y,t.tld,C),Fe(y,t.utld,C),Fe(C,t.domain,s),Fe(C,r,i),he(C,Pn,y),he(C,hn,m),he(C,Dr,c);const w=he(C,Rr),b=pn(uc);Fe(w,t.numeric,b);const S=pn(uc),E=pn();Fe(S,e,S),Fe(S,n,E),Fe(E,e,S),Fe(E,n,E),he(C,In,S),he(b,In,S);const x=he(a,Rr),_=he(l,Rr),A=he(_,In),O=he(A,In);Fe(a,t.domain,s),he(a,Pn,y),he(a,hn,m),Fe(l,t.domain,s),he(l,Pn,y),he(l,hn,m),Fe(x,t.domain,S),he(x,In,S),he(x,ks,S),Fe(O,t.domain,S),Fe(O,e,S),he(O,In,S);const k=[[As,Os],[Rl,Nl],[Fl,Hl],[Bl,$l],[Vl,jl],[zl,Ul],[ql,Wl],[Kl,Gl]];for(let M=0;M<k.length;M++){const[I,P]=k[M],F=he(S,I);he(E,I,F),he(F,P,S);const z=pn(uc);Fe(F,e,z);const $=pn();Fe(F,n),Fe(z,e,z),Fe(z,n,$),Fe($,e,z),Fe($,n,$),he(z,P,S),he($,P,S)}return he(o,xs,C),he(o,Rh,VN),{start:o,tokens:Zw}}function zN(t,e,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=t,l=null,c=null,u=0,d=null,h=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(h=0,d=a):h>=0&&h++,o++,u++;if(h<0)o-=u,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(Wh(sS,e,s)),s=[]),o-=h,u-=h;const f=d.t,p=n.slice(o-u,o);i.push(Wh(f,e,p))}}return s.length>0&&i.push(Wh(sS,e,s)),i}function Wh(t,e,n){const r=n[0].s,o=n[n.length-1].e,i=e.slice(r,o);return new t(i,n)}const UN=typeof console<"u"&&console&&console.warn||(()=>{}),qN="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",nt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function WN(){return Kt.groups={},nt.scanner=null,nt.parser=null,nt.tokenQueue=[],nt.pluginQueue=[],nt.customSchemes=[],nt.initialized=!1,nt}function aS(t,e=!1){if(nt.initialized&&UN(`linkifyjs: already initialized - will not register custom scheme "${t}" ${qN}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
|
179
|
+
1. Must only contain digits, lowercase ASCII letters or "-"
|
180
|
+
2. Cannot start or end with "-"
|
181
|
+
3. "-" cannot repeat`);nt.customSchemes.push([t,e])}function KN(){nt.scanner=BN(nt.customSchemes);for(let t=0;t<nt.tokenQueue.length;t++)nt.tokenQueue[t][1]({scanner:nt.scanner});nt.parser=jN(nt.scanner.tokens);for(let t=0;t<nt.pluginQueue.length;t++)nt.pluginQueue[t][1]({scanner:nt.scanner,parser:nt.parser});return nt.initialized=!0,nt}function Kh(t){return nt.initialized||KN(),zN(nt.parser.start,t,tS(nt.scanner.start,t))}Kh.scan=tS;function lS(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new qh(n),o=Kh(t),i=[];for(let s=0;s<o.length;s++){const a=o[s];a.isLink&&(!e||a.t===e)&&r.check(a)&&i.push(a.toFormattedObject(r))}return i}function GN(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function JN(t){return new at({key:new mt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),i=e.some(c=>c.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=xL(n.doc,[...e]);if(LL(a).forEach(({newRange:c})=>{const u=OL(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," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],h=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&h){const f=h.split(" ").filter(y=>y!=="");if(f.length<=0)return!1;const p=f[f.length-1],g=d.pos+h.lastIndexOf(p);if(!p)return!1;const m=Kh(p).map(y=>y.toObject(t.defaultProtocol));if(!GN(m))return!1;m.filter(y=>y.isLink).map(y=>({...y,from:g+y.start+1,to:g+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>t.validate(y.value)).filter(y=>t.shouldAutoLink(y.value)).forEach(y=>{Gf(y.from,y.to,r.doc).some(C=>C.mark.type===t.type)||s.addMark(y.from,y.to,t.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function XN(t){return new at({key:new mt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(r.button!==0||!e.editable)return!1;let s=r.target;const a=[];for(;s.nodeName!=="DIV";)a.push(s),s=s.parentNode;if(!a.find(h=>h.nodeName==="A"))return!1;const l=Db(e.state,t.type.name),c=r.target,u=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:l.href,d=(i=c==null?void 0:c.target)!==null&&i!==void 0?i:l.target;return c&&u?(window.open(u,d),!0):!1}}})}function YN(t){return new at({key:new mt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(c=>{a+=c.textContent});const l=lS(a,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===a);return!a||!l?!1:t.editor.commands.setMark(t.type,{href:l.href})}}})}const QN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function bo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(QN,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const ZN=Lt.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(t=>{if(typeof t=="string"){aS(t);return}aS(t.scheme,t.optionalSlashes)})},onDestroy(){WN()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!bo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!bo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!bo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",rt(this.options.HTMLAttributes,t),0]:["a",rt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!bo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!bo(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Ir({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=lS(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!bo(s,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(i=>e.push({text:i.value,data:{href:i.href},index:i.start}))}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(JN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!bo(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(XN({type:this.type})),this.options.linkOnPaste&&t.push(YN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}}),cS=$t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",rt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),eF="listItem",uS="textStyle",dS=/^(\d+)\.\s$/,fS=$t.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:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:void 0,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",rt(this.options.HTMLAttributes,n),0]:["ol",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(eF,this.editor.getAttributes(uS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=ds({find:dS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=ds({find:dS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(uS)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),hS=$t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),tF=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,nF=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,pS=t=>t.match(tF),gS=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",rF=t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:o,ccLoadPolicy:i,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:u,ivLoadPolicy:d,loop:h,modestBranding:f,nocookie:p,origin:g,playlist:m,progressBarColor:y,startAt:C}=t;if(!pS(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const x=e.split("/").pop();return x?`${gS(p)}${x}`:null}const b=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!b||!b[1])return null;let S=`${gS(p)}${b[1]}`;const E=[];return n===!1&&E.push("fs=0"),r&&E.push("autoplay=1"),o&&E.push(`cc_lang_pref=${o}`),i&&E.push("cc_load_policy=1"),s||E.push("controls=0"),a&&E.push("disablekb=1"),l&&E.push("enablejsapi=1"),c&&E.push(`end=${c}`),u&&E.push(`hl=${u}`),d&&E.push(`iv_load_policy=${d}`),h&&E.push("loop=1"),f&&E.push("modestbranding=1"),g&&E.push(`origin=${g}`),m&&E.push(`playlist=${m}`),C&&E.push(`start=${C}`),y&&E.push(`color=${y}`),E.length&&(S+=`?${E.join("&")}`),S},oF=$t.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:t=>({commands:e})=>pS(t.src)?e.insertContent({type:this.name,attrs:t}):!1}},addPasteRules(){return this.options.addPasteHandler?[iD({find:nF,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML({HTMLAttributes:t}){const e=rF({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=e,["div",{"data-youtube-video":""},["iframe",rt(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),iF=Lt.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),sF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,aF=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,lF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,cF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,uF=Lt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[fo({find:sF,type:this.type}),fo({find:lF,type:this.type})]},addPasteRules(){return[Ir({find:aF,type:this.type}),Ir({find:cF,type:this.type})]}}),dF=/(^|[^`])`([^`]+)`(?!`)/,fF=/(^|[^`])`([^`]+)`(?!`)/g,hF=Lt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[fo({find:dF,type:this.type})]},addPasteRules(){return[Ir({find:fF,type:this.type})]}}),pF=/^```([a-z]+)?[\s\n]$/,gF=/^~~~([a-z]+)?[\s\n]$/,mF=$t.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",rt(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
182
|
+
|
183
|
+
`);return!i||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||!(o.parentOffset===o.parent.nodeSize-2))return!1;const a=o.after();return a===void 0?!1:r.nodeAt(a)?t.commands.command(({tr:c})=>(c.setSelection(Re.near(r.resolve(a))),!0)):t.commands.exitCode()}}},addInputRules(){return[Zf({find:pF,type:this.type,getAttributes:t=>({language:t[1]})}),Zf({find:gF,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new at({key:new mt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=o==null?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,`
|
184
|
+
`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Le.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),yF=$t.create({name:"doc",topNode:!0,content:"block+"});function vF(t={}){return new at({view(e){return new bF(e,t)}})}class bF{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let i=s=>{this[o](s)};return e.dom.addEventListener(o,i),{name:o,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.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),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=a?u.bottom:u.top;a&&l&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.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",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let i,s;if(!o||o==document.body&&getComputedStyle(o).position=="static")i=-pageXOffset,s=-pageYOffset;else{let a=o.getBoundingClientRect();i=a.left-o.scrollLeft,s=a.top-o.scrollTop}this.element.style.left=r.left-i+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,i=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!i){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=H1(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const wF=pt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[vF(this.options)]}});class ct extends Re{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return ct.valid(r)?new ct(r):Re.near(r)}content(){return me.empty}eq(e){return e instanceof ct&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new ct(e.resolve(n.pos))}getBookmark(){return new Gh(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!SF(e)||!CF(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&ct.valid(e))return e;let o=e.pos,i=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){i=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;o+=n;let l=e.doc.resolve(o);if(ct.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!Te.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*n),r=!1;continue e}break}i=s,o+=n;let a=e.doc.resolve(o);if(ct.valid(a))return a}return null}}}ct.prototype.visible=!1,ct.findFrom=ct.findGapCursorFrom,Re.jsonID("gapcursor",ct);class Gh{constructor(e){this.pos=e}map(e){return new Gh(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return ct.valid(n)?new ct(n):Re.near(n)}}function SF(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function CF(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function EF(){return new at({props:{decorations:OF,createSelectionBetween(t,e,n){return e.pos==n.pos&&ct.valid(n)?new ct(n):null},handleClick:xF,handleKeyDown:_F,handleDOMEvents:{beforeinput:AF}}})}const _F=ub({ArrowLeft:dc("horiz",-1),ArrowRight:dc("horiz",1),ArrowUp:dc("vert",-1),ArrowDown:dc("vert",1)});function dc(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,i){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof Le){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let c=ct.findGapCursorFrom(a,e,l);return c?(o&&o(r.tr.setSelection(new ct(c))),!0):!1}}function xF(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!ct.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Te.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new ct(r))),!0)}function AF(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof ct))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=le.empty;for(let s=r.length-1;s>=0;s--)o=le.from(r[s].createAndFill(null,o));let i=t.state.tr.replace(n.pos,n.pos,new me(o,0,0));return i.setSelection(Le.near(i.doc.resolve(n.pos+1))),t.dispatch(i),!1}function OF(t){if(!(t.selection instanceof ct))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ut.create(t.doc,[Ut.widget(t.selection.head,e,{key:"gapcursor"})])}const TF=pt.create({name:"gapCursor",addProseMirrorPlugins(){return[EF()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Ne(xe(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),kF=$t.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",rt(this.options.HTMLAttributes,t)]},renderText(){return`
|
185
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:i}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=i||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const d=l.filter(h=>a.includes(h.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var fc=200,Ct=function(){};Ct.prototype.append=function(e){return e.length?(e=Ct.from(e),!this.length&&e||e.length<fc&&this.leafAppend(e)||this.length<fc&&e.leafPrepend(this)||this.appendInner(e)):this},Ct.prototype.prepend=function(e){return e.length?Ct.from(e).append(this):this},Ct.prototype.appendInner=function(e){return new MF(this,e)},Ct.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ct.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ct.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ct.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Ct.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(i,s){return o.push(e(i,s))},n,r),o},Ct.from=function(e){return e instanceof Ct?e:e&&e.length?new mS(e):Ct.empty};var mS=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=fc)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=fc)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ct);Ct.empty=new mS([]);var MF=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,i,s){var a=this.left.length;if(o<a&&this.left.forEachInner(r,o,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(r,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,i,s){var a=this.left.length;if(o>a&&this.right.forEachInvertedInner(r,o-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(r,Math.min(o,a),i,s)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(r,o):r>=i?this.right.slice(r-i,o-i):this.left.slice(r,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,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}(Ct);const PF=500;class yn{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,i;n&&(o=this.remapping(r,this.items.length),i=o.maps.length);let s=e.tr,a,l,c=[],u=[];return this.items.forEach((d,h)=>{if(!d.step){o||(o=this.remapping(r,h+1),i=o.maps.length),i--,u.push(d);return}if(o){u.push(new Fr(d.map));let f=d.step.map(o.slice(i)),p;f&&s.maybeStep(f).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new Fr(p,void 0,void 0,c.length+u.length))),i--,p&&o.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return a=o?d.selection.map(o.slice(i)):d.selection,l=new yn(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,o){let i=[],s=this.eventCount,a=this.items,l=!o&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let d=e.steps[u].invert(e.docs[u]),h=new Fr(e.mapping.maps[u],d,n),f;(f=l&&l.merge(h))&&(h=f,u?i.pop():a=a.slice(0,a.length-1)),i.push(h),n&&(s++,n=void 0),o||(l=h)}let c=s-r.depth;return c>LF&&(a=IF(a,c),s-=c),new yn(a.append(i),s)}remapping(e,n){let r=new Ji;return this.items.forEach((o,i)=>{let s=o.mirrorOffset!=null&&i-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new yn(this.items.append(e.map(n=>new Fr(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),i=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},o);let l=n;this.items.forEach(h=>{let f=i.getMirror(--l);if(f==null)return;s=Math.min(s,f);let p=i.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),m=h.selection&&h.selection.map(i.slice(l+1,f));m&&a++,r.push(new Fr(p,g,m))}else r.push(new Fr(p))},o);let c=[];for(let h=n;h<s;h++)c.push(new Fr(i.maps[h]));let u=this.items.slice(0,o).append(c).append(r),d=new yn(u,a);return d.emptyItemCount()>PF&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],i=0;return this.items.forEach((s,a)=>{if(a>=e)o.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&i++;let d=new Fr(c.invert(),l,u),h,f=o.length-1;(h=o.length&&o[f].merge(d))?o[f]=h:o.push(d)}}else s.map&&r--},this.items.length,0),new yn(Ct.from(o.reverse()),i)}}yn.empty=new yn(Ct.empty,0);function IF(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}let Fr=class G_{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new G_(n.getMap().invert(),n,this.selection)}}};class Hr{constructor(e,n,r,o,i){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=i}}const LF=20;function DF(t,e,n,r){let o=n.getMeta(wo),i;if(o)return o.historyState;n.getMeta(FF)&&(t=new Hr(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(wo))return s.getMeta(wo).redo?new Hr(t.done.addTransform(n,void 0,r,hc(e)),t.undone,yS(n.mapping.maps),t.prevTime,t.prevComposition):new Hr(t.done,t.undone.addTransform(n,void 0,r,hc(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!RF(n,t.prevRanges)),c=s?Jh(t.prevRanges,n.mapping):yS(n.mapping.maps);return new Hr(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,hc(e)),yn.empty,c,n.time,a??t.prevComposition)}else return(i=n.getMeta("rebased"))?new Hr(t.done.rebased(n,i),t.undone.rebased(n,i),Jh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Hr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Jh(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function RF(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let i=0;i<e.length;i+=2)r<=e[i+1]&&o>=e[i]&&(n=!0)}),n}function yS(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,i,s)=>e.push(i,s));return e}function Jh(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),i=e.map(t[r+1],-1);o<=i&&n.push(o,i)}return n}function NF(t,e,n){let r=hc(e),o=wo.get(e).spec.config,i=(n?t.undone:t.done).popEvent(e,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),o,r),l=new Hr(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(wo,{redo:n,historyState:l})}let Xh=!1,vS=null;function hc(t){let e=t.plugins;if(vS!=e){Xh=!1,vS=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Xh=!0;break}}return Xh}const wo=new mt("history"),FF=new mt("closeHistory");function HF(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new at({key:wo,state:{init(){return new Hr(yn.empty,yn.empty,null,0,-1)},apply(e,n,r){return DF(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?wS:r=="historyRedo"?SS:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function bS(t,e){return(n,r)=>{let o=wo.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let i=NF(o,n,t);i&&r(e?i.scrollIntoView():i)}return!0}}const wS=bS(!1,!0),SS=bS(!0,!0),CS=pt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>wS(t,e),redo:()=>({state:t,dispatch:e})=>SS(t,e)}},addProseMirrorPlugins(){return[HF(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()}}}),BF=$t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",rt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,i=t();return r.parentOffset===0?i.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):Nb(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:s,dispatch:a})=>{var l;if(a){const{$to:c}=s.selection,u=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?s.setSelection(Le.create(s.doc,c.pos+1)):c.nodeAfter.isBlock?s.setSelection(Te.create(s.doc,c.pos)):s.setSelection(Le.create(s.doc,c.pos));else{const d=(l=c.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();d&&(s.insert(u,d),s.setSelection(Le.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[nD({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),$F=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,VF=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,zF=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,UF=Lt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[fo({find:$F,type:this.type}),fo({find:jF,type:this.type})]},addPasteRules(){return[Ir({find:VF,type:this.type}),Ir({find:zF,type:this.type})]}}),qF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,WF=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,KF=Lt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[fo({find:qF,type:this.type})]},addPasteRules(){return[Ir({find:WF,type:this.type})]}}),GF=$t.create({name:"text",group:"inline"}),JF=pt.create({name:"starterKit",addExtensions(){var t,e,n,r,o,i,s,a,l,c,u,d,h,f,p,g,m,y;const C=[];return this.options.bold!==!1&&C.push(uF.configure((t=this.options)===null||t===void 0?void 0:t.bold)),this.options.blockquote!==!1&&C.push(jw.configure((e=this.options)===null||e===void 0?void 0:e.blockquote)),this.options.bulletList!==!1&&C.push(qw.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&C.push(hF.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(mF.configure((o=this.options)===null||o===void 0?void 0:o.codeBlock)),this.options.document!==!1&&C.push(yF.configure((i=this.options)===null||i===void 0?void 0:i.document)),this.options.dropcursor!==!1&&C.push(wF.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&C.push(TF.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&C.push(kF.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&C.push(Ww.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&C.push(CS.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(BF.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&C.push(UF.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&C.push(cS.configure((f=this.options)===null||f===void 0?void 0:f.listItem)),this.options.orderedList!==!1&&C.push(fS.configure((p=this.options)===null||p===void 0?void 0:p.orderedList)),this.options.paragraph!==!1&&C.push(hS.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&C.push(KF.configure((m=this.options)===null||m===void 0?void 0:m.strike)),this.options.text!==!1&&C.push(GF.configure((y=this.options)===null||y===void 0?void 0:y.text)),C}});function XF(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:a}=t,l=r&&!o,c=oD(n),u=new RegExp(`\\s${c}$`),d=s?"^":"",h=o?"":c,f=l?new RegExp(`${d}${c}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${d}(?:^)?${c}[^\\s${h}]*`,"gm"),p=((e=a.nodeBefore)===null||e===void 0?void 0:e.isText)&&a.nodeBefore.text;if(!p)return null;const g=a.pos-p.length,m=Array.from(p.matchAll(f)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const y=m.input.slice(Math.max(0,m.index-1),m.index),C=new RegExp(`^[${i==null?void 0:i.join("")}\0]?$`).test(y);if(i!==null&&!C)return null;const w=g+m.index;let b=w+m[0].length;return l&&u.test(p.slice(b-1,b+1))&&(m[0]+=" ",b+=1),w<a.pos&&b>=a.pos?{range:{from:w,to:b},query:m[0].slice(n.length),text:m[0]}:null}const YF=new mt("suggestion");function QF({pluginKey:t=YF,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:i=[" "],startOfLine:s=!1,decorationTag:a="span",decorationClass:l="suggestion",command:c=()=>null,items:u=()=>[],render:d=()=>({}),allow:h=()=>!0,findSuggestionMatch:f=XF}){let p;const g=d==null?void 0:d(),m=new at({key:t,view(){return{update:async(y,C)=>{var w,b,S,E,x,_,A;const O=(w=this.key)===null||w===void 0?void 0:w.getState(C),k=(b=this.key)===null||b===void 0?void 0:b.getState(y.state),M=O.active&&k.active&&O.range.from!==k.range.from,I=!O.active&&k.active,P=O.active&&!k.active,F=!I&&!P&&O.query!==k.query,z=I||M&&F,$=F||M,J=P||M&&F;if(!z&&!$&&!J)return;const K=J&&!z?O:k,R=y.dom.querySelector(`[data-decoration-id="${K.decorationId}"]`);p={editor:e,range:K.range,query:K.query,text:K.text,items:[],command:Q=>c({editor:e,range:K.range,props:Q}),decorationNode:R,clientRect:R?()=>{var Q;const{decorationId:se}=(Q=this.key)===null||Q===void 0?void 0:Q.getState(e.state),ie=y.dom.querySelector(`[data-decoration-id="${se}"]`);return(ie==null?void 0:ie.getBoundingClientRect())||null}:null},z&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,p)),$&&((E=g==null?void 0:g.onBeforeUpdate)===null||E===void 0||E.call(g,p)),($||z)&&(p.items=await u({editor:e,query:K.query})),J&&((x=g==null?void 0:g.onExit)===null||x===void 0||x.call(g,p)),$&&((_=g==null?void 0:g.onUpdate)===null||_===void 0||_.call(g,p)),z&&((A=g==null?void 0:g.onStart)===null||A===void 0||A.call(g,p))},destroy:()=>{var y;p&&((y=g==null?void 0:g.onExit)===null||y===void 0||y.call(g,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,C,w,b){const{isEditable:S}=e,{composing:E}=e.view,{selection:x}=y,{empty:_,from:A}=x,O={...C};if(O.composing=E,S&&(_||e.view.composing)){(A<C.range.from||A>C.range.to)&&!E&&!C.composing&&(O.active=!1);const k=f({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:i,startOfLine:s,$position:x.$from}),M=`id_${Math.floor(Math.random()*4294967295)}`;k&&h({editor:e,state:b,range:k.range,isActive:C.active})?(O.active=!0,O.decorationId=C.decorationId?C.decorationId:M,O.range=k.range,O.query=k.query,O.text=k.text):O.active=!1}else O.active=!1;return O.active||(O.decorationId=null,O.range={from:0,to:0},O.query=null,O.text=null),O}},props:{handleKeyDown(y,C){var w;const{active:b,range:S}=m.getState(y.state);return b&&((w=g==null?void 0:g.onKeyDown)===null||w===void 0?void 0:w.call(g,{view:y,event:C,range:S}))||!1},decorations(y){const{active:C,range:w,decorationId:b}=m.getState(y);return C?ut.create(y.doc,[Ut.inline(w.from,w.to,{nodeName:a,class:l,"data-decoration-id":b})]):null}}});return m}function ZF({icon:t,title:e,description:n,...r}){return v.jsxs(N.Tile,{scheme:"light",hoverable:!0,dflex:!0,alignItems:"center",spaceX:"3",p:"2",...r,children:[v.jsx("div",{dflex:!0,alignItems:"center",justifyContent:"center",h:"10",w:"10",rounded:!0,border:!0,borderColor:"stone-200",textColor:"stone-500",bgColor:"white",children:v.jsx(N.Icon,{path:t})}),v.jsxs("div",{children:[v.jsx("p",{fontWeight:"600",userSelect:"none",children:e}),v.jsx("p",{textSize:"xs",textColor:"stone-500",userSelect:"none",children:n})]})]})}function e3(t,e,...n){const[r,o]=T.useState(0),i=T.useCallback(s=>{const a=t[s];a&&e(a)},[t,e,...n]);return T.useEffect(()=>{const s=["ArrowUp","ArrowDown","Enter"],a=l=>{if(s.includes(l.key)){switch(l.preventDefault(),l.key){case"ArrowUp":return o((r+t.length-1)%t.length),!0;case"ArrowDown":return o((r+1)%t.length),!0;case"Enter":return i(r),!0}return!1}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,r,o,i]),T.useEffect(()=>o(0),[t]),r}function t3({items:t,command:e,editor:n,...r}){const o=T.useRef(null),i=T.useCallback(a=>e(a),[e]),s=e3(t,i,n);return T.useLayoutEffect(()=>{const a=o==null?void 0:o.current,l=a==null?void 0:a.children[s];l&&a&&n3(a,l)},[s]),t.length>0?v.jsx(N.Tile,{scheme:"light",id:"slash-command",ref:o,z:"50",h:"auto",maxH:"96",w:"80",p:"2",overflowY:"auto",border:"px",borderColor:"stone-200",shadow:"md",transition:"all",children:t.map((a,l)=>v.jsx(ZF,{onClick:c=>{c.preventDefault(),e(t[l])},active:l==s,icon:a.icon,title:a.title,description:a.description},l))}):null}function n3(t,e){const n=t.offsetHeight,r=e?e.offsetHeight:0,o=e.offsetTop,i=o+r;o<t.scrollTop?t.scrollTop-=t.scrollTop-o+5:i>n+t.scrollTop&&(t.scrollTop+=i-n-t.scrollTop+5)}const r3=[{title:"Text",description:"Just start typing with plain text.",searchTerms:["p","text","paragraph"],icon:Zg,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").run()}},{title:"Image",description:"Upload an image from your computer.",searchTerms:["image","img","photo","picture","media"],icon:vx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setImage({src:""}).setNode("paragraph").run()}},{title:"Youtube",description:"Insert a Youtube video",searchTerms:["youtube","yt","video"],icon:Tx,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setYoutubeVideo({src:"https://www.youtube.com/embed/5vheNbQlsyU?si=g_Max_pgn7AgEZVc"}).setNode("paragraph").run()}},{title:"Heading 1",description:"Big section heading.",searchTerms:["heading","h1","title","big","large"],icon:Fw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:1}).run()}},{title:"Heading 2",description:"Medium section heading.",searchTerms:["h2","subtitle","medium"],icon:Hw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",description:"Small section heading.",searchTerms:["h3","subtitle","small"],icon:Bw,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Heading 4",description:"X-Small section heading.",searchTerms:["h4","subtitle","small"],icon:$w,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).setNode("heading",{level:4}).run()}},{title:"Bullet List",description:"Create a simple bullet list.",searchTerms:["ul","unordered","point"],icon:Wg,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",description:"Create a list with numbering.",searchTerms:["ol","ordered"],icon:Kg,command:({editor:t,range:e})=>{t.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Quote",description:"Capture a quote.",searchTerms:["quote","blockquote"],icon:Gg,command:({editor:t,range:e})=>t.chain().focus().deleteRange(e).toggleNode("paragraph","paragraph").toggleBlockquote().run()}],o3=t=>({query:e})=>r3.concat(t??[]).filter(n=>{if(typeof e=="string"&&e.length>0){const r=e.toLowerCase();return n.title.toLowerCase().includes(r)||n.description.toLowerCase().includes(r)||n.searchTerms&&n.searchTerms.some(o=>o.includes(r))}return!0}),i3=pt.create({name:"slash-command",addOptions(){return{suggestion:{char:"/",command:({editor:t,range:e,props:n})=>n.command({editor:t,range:e})}}},addProseMirrorPlugins(){return[QF({editor:this.editor,...this.options.suggestion})]}}),s3=t=>i3.configure({suggestion:{items:o3(t),render:()=>{let e=null,n=null;return{onStart:r=>{e=new Lw(t3,{props:r,editor:r.editor}),n=li("body",{getReferenceClientRect:r.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"})},onUpdate:r=>{e==null||e.updateProps(r),n&&n[0].setProps({getReferenceClientRect:r.clientRect})},onKeyDown:r=>{var o;return r.event.key==="Escape"?(n==null||n[0].hide(),!0):(o=e==null?void 0:e.ref)==null?void 0:o.onKeyDown(r)},onExit:()=>{n==null||n[0].destroy(),e==null||e.destroy()}}}}});function Dt(t){return t.toFixed(7).replace(/(\.[0-9]+?)0+$/,"$1").replace(/\.0$/,"")}function Y(t,e){return`${Dt(t/e)}em`}const ES={defaultProps:{fontWeight:"500",italic:!0,textColor:"var(--tw-prose-quotes)",borderS:"0.25rem",borderSColor:"var(--tw-prose-quote-borders)",style:{quotes:'"\\201C""\\201D""\\2018""\\2019"'},css:{"& p:first-of-type::before":{content:"open-quote"},"& p:last-of-type::after":{content:"close-quote"}},mt:Y(32,20),mb:Y(32,20),ps:Y(20,20),sm_mt:Y(24,18),sm_mb:Y(24,18),sm_ps:Y(20,18),lg_mt:Y(40,24),lg_mb:Y(40,24),lg_ps:Y(24,24),xl_mt:Y(48,30),xl_mb:Y(48,30),xl_ps:Y(32,30),x2_mt:Y(64,36),x2_mb:Y(64,36),x2_ps:Y(40,36)}},a3=T.createContext({onDragStart:void 0}),_S=()=>T.useContext(a3),So=T.forwardRef((t,e)=>{const{onDragStart:n}=_S(),r=t.as||"div";return v.jsx(r,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...t.style}})});function pc(t,e){var r,o,i,s;const n=((r=t.decorations)==null?void 0:r.length)>0?(s=(i=(o=t.decorations[0])==null?void 0:o.type)==null?void 0:i.attrs)==null?void 0:s["data-placeholder"]:null;return{css:{"&:before":{content:`"${n?e??n:""}"`,float:"left",color:"gray",pointerEvents:"none",height:0}}}}N.ComponentManager.registerComponent("Editor.BlockQuote",ES);function l3({...t}){const e=N.useComponentConfig("Editor.BlockQuote",void 0,{},{});return v.jsx(So,{as:"blockquote",...e,...pc(t,"Quote"),children:v.jsx(Cs,{})})}const xS={defaultProps:{listStyle:"disc",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}};N.ComponentManager.registerComponent("Editor.BulletList",xS);function c3(){const t=N.useComponentConfig("Editor.BulletList",void 0,{},{});return v.jsx(So,{as:"ul",...t,children:v.jsx(Cs,{})})}const AS={defaultProps:{fontWeight:"700",textColor:"slate-800",textSize:Y(20,16),mt:Y(48,24),mb:Y(24,24),lineHeight:Dt(32/24),sm_textSize:Y(20,14),sm_mt:Y(32,20),sm_mb:Y(16,20),sm_lineHeight:Dt(28/20),lg_textSize:Y(30,18),lg_mt:Y(56,30),lg_mb:Y(32,30),lg_lineHeight:Dt(40/30),xl_textSize:Y(36,20),xl_mt:Y(56,36),xl_mb:Y(32,36),xl_lineHeight:Dt(40/36),x2_textSize:Y(48,24),x2_mt:Y(72,48),x2_mb:Y(40,48),x2_lineHeight:Dt(52/48)}},OS={defaultProps:{fontWeight:"600",textColor:"slate-800",textSize:Y(18,16),mt:Y(32,20),mb:Y(12,20),lineHeight:Dt(32/20),sm_textSize:Y(18,14),sm_mt:Y(28,18),sm_mb:Y(8,18),sm_lineHeight:Dt(28/18),lg_textSize:Y(24,18),lg_mt:Y(40,24),lg_mb:Y(16,24),lg_lineHeight:Dt(36/24),xl_textSize:Y(30,20),xl_mt:Y(48,30),xl_mb:Y(20,30),xl_lineHeight:Dt(40/30),x2_textSize:Y(36,24),x2_mt:Y(56,36),x2_mb:Y(24,36),x2_lineHeight:Dt(44/36)}},TS={defaultProps:{fontWeight:"600",textColor:"slate-800",mt:Y(24,16),mb:Y(8,16),lineHeight:Dt(24/16),sm_mt:Y(20,14),sm_mb:Y(8,14),sm_lineHeight:Dt(20/14),lg_mt:Y(32,18),lg_mb:Y(8,18),lg_lineHeight:Dt(28/18),xl_mt:Y(36,20),xl_mb:Y(12,20),xl_lineHeight:Dt(32/20),x2_mt:Y(40,24),x2_mb:Y(16,24),x2_lineHeight:Dt(36/24)}};N.ComponentManager.registerComponent("Editor.H1",AS),N.ComponentManager.registerComponent("Editor.H2",OS),N.ComponentManager.registerComponent("Editor.H3",TS);function u3({...t}){const e=t.node.attrs.level,n=N.useComponentConfig(`Editor.H${e}`,void 0,{},{}),r=`h${e}`;return v.jsx(So,{as:r,...n,...pc(t),children:v.jsx(Cs,{})})}var Yh={exports:{}},gc={exports:{}},We={};/** @license React v16.13.1
|
186
|
+
* react-is.production.min.js
|
187
|
+
*
|
188
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
189
|
+
*
|
190
|
+
* This source code is licensed under the MIT license found in the
|
191
|
+
* LICENSE file in the root directory of this source tree.
|
192
|
+
*/var kS;function d3(){if(kS)return We;kS=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function w(S){if(typeof S=="object"&&S!==null){var E=S.$$typeof;switch(E){case e:switch(S=S.type,S){case l:case c:case r:case i:case o:case d:return S;default:switch(S=S&&S.$$typeof,S){case a:case u:case p:case f:case s:return S;default:return E}}case n:return E}}}function b(S){return w(S)===c}return We.AsyncMode=l,We.ConcurrentMode=c,We.ContextConsumer=a,We.ContextProvider=s,We.Element=e,We.ForwardRef=u,We.Fragment=r,We.Lazy=p,We.Memo=f,We.Portal=n,We.Profiler=i,We.StrictMode=o,We.Suspense=d,We.isAsyncMode=function(S){return b(S)||w(S)===l},We.isConcurrentMode=b,We.isContextConsumer=function(S){return w(S)===a},We.isContextProvider=function(S){return w(S)===s},We.isElement=function(S){return typeof S=="object"&&S!==null&&S.$$typeof===e},We.isForwardRef=function(S){return w(S)===u},We.isFragment=function(S){return w(S)===r},We.isLazy=function(S){return w(S)===p},We.isMemo=function(S){return w(S)===f},We.isPortal=function(S){return w(S)===n},We.isProfiler=function(S){return w(S)===i},We.isStrictMode=function(S){return w(S)===o},We.isSuspense=function(S){return w(S)===d},We.isValidElementType=function(S){return typeof S=="string"||typeof S=="function"||S===r||S===c||S===i||S===o||S===d||S===h||typeof S=="object"&&S!==null&&(S.$$typeof===p||S.$$typeof===f||S.$$typeof===s||S.$$typeof===a||S.$$typeof===u||S.$$typeof===m||S.$$typeof===y||S.$$typeof===C||S.$$typeof===g)},We.typeOf=w,We}var Ke={};/** @license React v16.13.1
|
193
|
+
* react-is.development.js
|
194
|
+
*
|
195
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
196
|
+
*
|
197
|
+
* This source code is licensed under the MIT license found in the
|
198
|
+
* LICENSE file in the root directory of this source tree.
|
199
|
+
*/var MS;function f3(){return MS||(MS=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,f=t?Symbol.for("react.memo"):60115,p=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,C=t?Symbol.for("react.scope"):60119;function w(L){return typeof L=="string"||typeof L=="function"||L===r||L===c||L===i||L===o||L===d||L===h||typeof L=="object"&&L!==null&&(L.$$typeof===p||L.$$typeof===f||L.$$typeof===s||L.$$typeof===a||L.$$typeof===u||L.$$typeof===m||L.$$typeof===y||L.$$typeof===C||L.$$typeof===g)}function b(L){if(typeof L=="object"&&L!==null){var He=L.$$typeof;switch(He){case e:var G=L.type;switch(G){case l:case c:case r:case i:case o:case d:return G;default:var ne=G&&G.$$typeof;switch(ne){case a:case u:case p:case f:case s:return ne;default:return He}}case n:return He}}}var S=l,E=c,x=a,_=s,A=e,O=u,k=r,M=p,I=f,P=n,F=i,z=o,$=d,J=!1;function K(L){return J||(J=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),R(L)||b(L)===l}function R(L){return b(L)===c}function Q(L){return b(L)===a}function se(L){return b(L)===s}function ie(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function de(L){return b(L)===u}function ue(L){return b(L)===r}function pe(L){return b(L)===p}function D(L){return b(L)===f}function ce(L){return b(L)===n}function ye(L){return b(L)===i}function be(L){return b(L)===o}function H(L){return b(L)===d}Ke.AsyncMode=S,Ke.ConcurrentMode=E,Ke.ContextConsumer=x,Ke.ContextProvider=_,Ke.Element=A,Ke.ForwardRef=O,Ke.Fragment=k,Ke.Lazy=M,Ke.Memo=I,Ke.Portal=P,Ke.Profiler=F,Ke.StrictMode=z,Ke.Suspense=$,Ke.isAsyncMode=K,Ke.isConcurrentMode=R,Ke.isContextConsumer=Q,Ke.isContextProvider=se,Ke.isElement=ie,Ke.isForwardRef=de,Ke.isFragment=ue,Ke.isLazy=pe,Ke.isMemo=D,Ke.isPortal=ce,Ke.isProfiler=ye,Ke.isStrictMode=be,Ke.isSuspense=H,Ke.isValidElementType=w,Ke.typeOf=b}()),Ke}var PS;function IS(){return PS||(PS=1,process.env.NODE_ENV==="production"?gc.exports=d3():gc.exports=f3()),gc.exports}/*
|
200
|
+
object-assign
|
201
|
+
(c) Sindre Sorhus
|
202
|
+
@license MIT
|
203
|
+
*/var Qh,LS;function h3(){if(LS)return Qh;LS=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Qh=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)e.call(a,d)&&(l[d]=a[d]);if(t){c=t(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},Qh}var Zh,DS;function ep(){if(DS)return Zh;DS=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zh=t,Zh}var tp,RS;function NS(){return RS||(RS=1,tp=Function.call.bind(Object.prototype.hasOwnProperty)),tp}var np,FS;function p3(){if(FS)return np;FS=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=ep(),n={},r=NS();t=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=i[u](s,u,l,a,null,e)}catch(p){d=p}if(d&&!(d instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var f=c?c():"";t("Failed "+a+" type: "+d.message+(f??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},np=o,np}var rp,HS;function g3(){if(HS)return rp;HS=1;var t=IS(),e=h3(),n=ep(),r=NS(),o=p3(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return rp=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(R){var Q=R&&(c&&R[c]||R[u]);if(typeof Q=="function")return Q}var h="<<anonymous>>",f={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:C(),arrayOf:w,element:b(),elementType:S(),instanceOf:E,node:O(),objectOf:_,oneOf:x,oneOfType:A,shape:M,exact:I};function p(R,Q){return R===Q?R!==0||1/R===1/Q:R!==R&&Q!==Q}function g(R,Q){this.message=R,this.data=Q&&typeof Q=="object"?Q:{},this.stack=""}g.prototype=Error.prototype;function m(R){if(process.env.NODE_ENV!=="production")var Q={},se=0;function ie(ue,pe,D,ce,ye,be,H){if(ce=ce||h,be=be||D,H!==n){if(l){var L=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var He=ce+":"+D;!Q[He]&&se<3&&(i("You are manually calling a React.PropTypes validation function for the `"+be+"` prop on `"+ce+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),Q[He]=!0,se++)}}return pe[D]==null?ue?pe[D]===null?new g("The "+ye+" `"+be+"` is marked as required "+("in `"+ce+"`, but its value is `null`.")):new g("The "+ye+" `"+be+"` is marked as required in "+("`"+ce+"`, but its value is `undefined`.")):null:R(pe,D,ce,ye,be)}var de=ie.bind(null,!1);return de.isRequired=ie.bind(null,!0),de}function y(R){function Q(se,ie,de,ue,pe,D){var ce=se[ie],ye=z(ce);if(ye!==R){var be=$(ce);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+be+"` supplied to `"+de+"`, expected ")+("`"+R+"`."),{expectedType:R})}return null}return m(Q)}function C(){return m(s)}function w(R){function Q(se,ie,de,ue,pe){if(typeof R!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside arrayOf.");var D=se[ie];if(!Array.isArray(D)){var ce=z(D);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an array."))}for(var ye=0;ye<D.length;ye++){var be=R(D,ye,de,ue,pe+"["+ye+"]",n);if(be instanceof Error)return be}return null}return m(Q)}function b(){function R(Q,se,ie,de,ue){var pe=Q[se];if(!a(pe)){var D=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+D+"` supplied to `"+ie+"`, expected a single ReactElement."))}return null}return m(R)}function S(){function R(Q,se,ie,de,ue){var pe=Q[se];if(!t.isValidElementType(pe)){var D=z(pe);return new g("Invalid "+de+" `"+ue+"` of type "+("`"+D+"` supplied to `"+ie+"`, expected a single ReactElement type."))}return null}return m(R)}function E(R){function Q(se,ie,de,ue,pe){if(!(se[ie]instanceof R)){var D=R.name||h,ce=K(se[ie]);return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected ")+("instance of `"+D+"`."))}return null}return m(Q)}function x(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function Q(se,ie,de,ue,pe){for(var D=se[ie],ce=0;ce<R.length;ce++)if(p(D,R[ce]))return null;var ye=JSON.stringify(R,function(H,L){var He=$(L);return He==="symbol"?String(L):L});return new g("Invalid "+ue+" `"+pe+"` of value `"+String(D)+"` "+("supplied to `"+de+"`, expected one of "+ye+"."))}return m(Q)}function _(R){function Q(se,ie,de,ue,pe){if(typeof R!="function")return new g("Property `"+pe+"` of component `"+de+"` has invalid PropType notation inside objectOf.");var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type "+("`"+ce+"` supplied to `"+de+"`, expected an object."));for(var ye in D)if(r(D,ye)){var be=R(D,ye,de,ue,pe+"."+ye,n);if(be instanceof Error)return be}return null}return m(Q)}function A(R){if(!Array.isArray(R))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Q=0;Q<R.length;Q++){var se=R[Q];if(typeof se!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(se)+" at index "+Q+"."),s}function ie(de,ue,pe,D,ce){for(var ye=[],be=0;be<R.length;be++){var H=R[be],L=H(de,ue,pe,D,ce,n);if(L==null)return null;L.data&&r(L.data,"expectedType")&&ye.push(L.data.expectedType)}var He=ye.length>0?", expected one of type ["+ye.join(", ")+"]":"";return new g("Invalid "+D+" `"+ce+"` supplied to "+("`"+pe+"`"+He+"."))}return m(ie)}function O(){function R(Q,se,ie,de,ue){return P(Q[se])?null:new g("Invalid "+de+" `"+ue+"` supplied to "+("`"+ie+"`, expected a ReactNode."))}return m(R)}function k(R,Q,se,ie,de){return new g((R||"React class")+": "+Q+" type `"+se+"."+ie+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+de+"`.")}function M(R){function Q(se,ie,de,ue,pe){var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));for(var ye in R){var be=R[ye];if(typeof be!="function")return k(de,ue,pe,ye,$(be));var H=be(D,ye,de,ue,pe+"."+ye,n);if(H)return H}return null}return m(Q)}function I(R){function Q(se,ie,de,ue,pe){var D=se[ie],ce=z(D);if(ce!=="object")return new g("Invalid "+ue+" `"+pe+"` of type `"+ce+"` "+("supplied to `"+de+"`, expected `object`."));var ye=e({},se[ie],R);for(var be in ye){var H=R[be];if(r(R,be)&&typeof H!="function")return k(de,ue,pe,be,$(H));if(!H)return new g("Invalid "+ue+" `"+pe+"` key `"+be+"` supplied to `"+de+"`.\nBad object: "+JSON.stringify(se[ie],null," ")+`
|
204
|
+
Valid keys: `+JSON.stringify(Object.keys(R),null," "));var L=H(D,be,de,ue,pe+"."+be,n);if(L)return L}return null}return m(Q)}function P(R){switch(typeof R){case"number":case"string":case"undefined":return!0;case"boolean":return!R;case"object":if(Array.isArray(R))return R.every(P);if(R===null||a(R))return!0;var Q=d(R);if(Q){var se=Q.call(R),ie;if(Q!==R.entries){for(;!(ie=se.next()).done;)if(!P(ie.value))return!1}else for(;!(ie=se.next()).done;){var de=ie.value;if(de&&!P(de[1]))return!1}}else return!1;return!0;default:return!1}}function F(R,Q){return R==="symbol"?!0:Q?Q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Q instanceof Symbol:!1}function z(R){var Q=typeof R;return Array.isArray(R)?"array":R instanceof RegExp?"object":F(Q,R)?"symbol":Q}function $(R){if(typeof R>"u"||R===null)return""+R;var Q=z(R);if(Q==="object"){if(R instanceof Date)return"date";if(R instanceof RegExp)return"regexp"}return Q}function J(R){var Q=$(R);switch(Q){case"array":case"object":return"an "+Q;case"boolean":case"date":case"regexp":return"a "+Q;default:return Q}}function K(R){return!R.constructor||!R.constructor.name?h:R.constructor.name}return f.checkPropTypes=o,f.resetWarningCache=o.resetWarningCache,f.PropTypes=f,f},rp}var op,BS;function m3(){if(BS)return op;BS=1;var t=ep();function e(){}function n(){}return n.resetWarningCache=e,op=function(){function r(s,a,l,c,u,d){if(d!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:e};return i.PropTypes=i,i},op}if(process.env.NODE_ENV!=="production"){var y3=IS(),v3=!0;Yh.exports=g3()(y3.isElement,v3)}else Yh.exports=m3()();var b3=Yh.exports;const Qe=tm(b3);function di(t,e,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):o(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})}function fi(t,e){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function $S(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),o,i=[],s;try{for(;(e===void 0||e-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function VS(t,e,n){if(n||arguments.length===2)for(var r=0,o=e.length,i;r<o;r++)(i||!(r in e))&&(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var w3=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ls(t,e){var n=S3(t);if(typeof n.path!="string"){var r=t.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof e=="string"?e:typeof r=="string"&&r.length>0?r:t.name,writable:!1,configurable:!1,enumerable:!0})}return n}function S3(t){var e=t.name,n=e&&e.lastIndexOf(".")!==-1;if(n&&!t.type){var r=e.split(".").pop().toLowerCase(),o=w3.get(r);o&&Object.defineProperty(t,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return t}var C3=[".DS_Store","Thumbs.db"];function E3(t){return di(this,void 0,void 0,function(){return fi(this,function(e){return mc(t)&&_3(t.dataTransfer)?[2,T3(t.dataTransfer,t.type)]:x3(t)?[2,A3(t)]:Array.isArray(t)&&t.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,O3(t)]:[2,[]]})})}function _3(t){return mc(t)}function x3(t){return mc(t)&&mc(t.target)}function mc(t){return typeof t=="object"&&t!==null}function A3(t){return ip(t.target.files).map(function(e){return Ls(e)})}function O3(t){return di(this,void 0,void 0,function(){var e;return fi(this,function(n){switch(n.label){case 0:return[4,Promise.all(t.map(function(r){return r.getFile()}))];case 1:return e=n.sent(),[2,e.map(function(r){return Ls(r)})]}})})}function T3(t,e){return di(this,void 0,void 0,function(){var n,r;return fi(this,function(o){switch(o.label){case 0:return t.items?(n=ip(t.items).filter(function(i){return i.kind==="file"}),e!=="drop"?[2,n]:[4,Promise.all(n.map(k3))]):[3,2];case 1:return r=o.sent(),[2,jS(zS(r))];case 2:return[2,jS(ip(t.files).map(function(i){return Ls(i)}))]}})})}function jS(t){return t.filter(function(e){return C3.indexOf(e.name)===-1})}function ip(t){if(t===null)return[];for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(r)}return e}function k3(t){if(typeof t.webkitGetAsEntry!="function")return US(t);var e=t.webkitGetAsEntry();return e&&e.isDirectory?qS(e):US(t)}function zS(t){return t.reduce(function(e,n){return VS(VS([],$S(e),!1),$S(Array.isArray(n)?zS(n):[n]),!1)},[])}function US(t){var e=t.getAsFile();if(!e)return Promise.reject("".concat(t," is not a File"));var n=Ls(e);return Promise.resolve(n)}function M3(t){return di(this,void 0,void 0,function(){return fi(this,function(e){return[2,t.isDirectory?qS(t):P3(t)]})})}function qS(t){var e=t.createReader();return new Promise(function(n,r){var o=[];function i(){var s=this;e.readEntries(function(a){return di(s,void 0,void 0,function(){var l,c,u;return fi(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(M3)),o.push(u),i(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}i()})}function P3(t){return di(this,void 0,void 0,function(){return fi(this,function(e){return[2,new Promise(function(n,r){t.file(function(o){var i=Ls(o,t.fullPath);n(i)},function(o){r(o)})})]})})}var I3=function(t,e){if(t&&e){var n=Array.isArray(e)?e:e.split(","),r=t.name||"",o=(t.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?i===a.replace(/\/.*$/,""):o===a})}return!0};function WS(t){return R3(t)||D3(t)||XS(t)||L3()}function L3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
205
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function R3(t){if(Array.isArray(t))return sp(t)}function KS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function GS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?KS(Object(n),!0).forEach(function(r){JS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):KS(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function JS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ds(t,e){return H3(t)||F3(t,e)||XS(t,e)||N3()}function N3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
206
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XS(t,e){if(t){if(typeof t=="string")return sp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sp(t,e)}}function sp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function F3(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function H3(t){if(Array.isArray(t))return t}var B3="file-invalid-type",$3="file-too-large",V3="file-too-small",j3="too-many-files",z3=function(e){e=Array.isArray(e)&&e.length===1?e[0]:e;var n=Array.isArray(e)?"one of ".concat(e.join(", ")):e;return{code:B3,message:"File type must be ".concat(n)}},YS=function(e){return{code:$3,message:"File is larger than ".concat(e," ").concat(e===1?"byte":"bytes")}},QS=function(e){return{code:V3,message:"File is smaller than ".concat(e," ").concat(e===1?"byte":"bytes")}},U3={code:j3,message:"Too many files"};function ZS(t,e){var n=t.type==="application/x-moz-file"||I3(t,e);return[n,n?null:z3(e)]}function eC(t,e,n){if(Co(t.size))if(Co(e)&&Co(n)){if(t.size>n)return[!1,YS(n)];if(t.size<e)return[!1,QS(e)]}else{if(Co(e)&&t.size<e)return[!1,QS(e)];if(Co(n)&&t.size>n)return[!1,YS(n)]}return[!0,null]}function Co(t){return t!=null}function q3(t){var e=t.files,n=t.accept,r=t.minSize,o=t.maxSize,i=t.multiple,s=t.maxFiles,a=t.validator;return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(function(l){var c=ZS(l,n),u=Ds(c,1),d=u[0],h=eC(l,r,o),f=Ds(h,1),p=f[0],g=a?a(l):null;return d&&p&&!g})}function yc(t){return typeof t.isPropagationStopped=="function"?t.isPropagationStopped():typeof t.cancelBubble<"u"?t.cancelBubble:!1}function vc(t){return t.dataTransfer?Array.prototype.some.call(t.dataTransfer.types,function(e){return e==="Files"||e==="application/x-moz-file"}):!!t.target&&!!t.target.files}function tC(t){t.preventDefault()}function W3(t){return t.indexOf("MSIE")!==-1||t.indexOf("Trident/")!==-1}function K3(t){return t.indexOf("Edge/")!==-1}function G3(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return W3(t)||K3(t)}function Ln(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];return e.some(function(a){return!yc(r)&&a&&a.apply(void 0,[r].concat(i)),yc(r)})}}function J3(){return"showOpenFilePicker"in window}function X3(t){if(Co(t)){var e=Object.entries(t).filter(function(n){var r=Ds(n,2),o=r[0],i=r[1],s=!0;return nC(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(i)||!i.every(rC))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var o=Ds(r,2),i=o[0],s=o[1];return GS(GS({},n),{},JS({},i,s))},{});return[{description:"Files",accept:e}]}return t}function Y3(t){if(Co(t))return Object.entries(t).reduce(function(e,n){var r=Ds(n,2),o=r[0],i=r[1];return[].concat(WS(e),[o],WS(i))},[]).filter(function(e){return nC(e)||rC(e)}).join(",")}function Q3(t){return t instanceof DOMException&&(t.name==="AbortError"||t.code===t.ABORT_ERR)}function Z3(t){return t instanceof DOMException&&(t.name==="SecurityError"||t.code===t.SECURITY_ERR)}function nC(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}function rC(t){return/^.*\.[\w]+$/.test(t)}var e5=["children"],t5=["open"],n5=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],r5=["refKey","onChange","onClick"];function o5(t){return a5(t)||s5(t)||oC(t)||i5()}function i5(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
207
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s5(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function a5(t){if(Array.isArray(t))return lp(t)}function ap(t,e){return u5(t)||c5(t,e)||oC(t,e)||l5()}function l5(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
208
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oC(t,e){if(t){if(typeof t=="string")return lp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return lp(t,e)}}function lp(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c5(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(t);!(o=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function u5(t){if(Array.isArray(t))return t}function iC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function ot(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?iC(Object(n),!0).forEach(function(r){cp(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):iC(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function cp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bc(t,e){if(t==null)return{};var n=d5(t,e),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function d5(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}var up=T.forwardRef(function(t,e){var n=t.children,r=bc(t,e5),o=aC(r),i=o.open,s=bc(o,t5);return T.useImperativeHandle(e,function(){return{open:i}},[i]),T.createElement(T.Fragment,null,n(ot(ot({},s),{},{open:i})))});up.displayName="Dropzone";var sC={disabled:!1,getFilesFromEvent:E3,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};up.defaultProps=sC,up.propTypes={children:Qe.func,accept:Qe.objectOf(Qe.arrayOf(Qe.string)),multiple:Qe.bool,preventDropOnDocument:Qe.bool,noClick:Qe.bool,noKeyboard:Qe.bool,noDrag:Qe.bool,noDragEventsBubbling:Qe.bool,minSize:Qe.number,maxSize:Qe.number,maxFiles:Qe.number,disabled:Qe.bool,getFilesFromEvent:Qe.func,onFileDialogCancel:Qe.func,onFileDialogOpen:Qe.func,useFsAccessApi:Qe.bool,autoFocus:Qe.bool,onDragEnter:Qe.func,onDragLeave:Qe.func,onDragOver:Qe.func,onDrop:Qe.func,onDropAccepted:Qe.func,onDropRejected:Qe.func,onError:Qe.func,validator:Qe.func};var dp={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function aC(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=ot(ot({},sC),t),n=e.accept,r=e.disabled,o=e.getFilesFromEvent,i=e.maxSize,s=e.minSize,a=e.multiple,l=e.maxFiles,c=e.onDragEnter,u=e.onDragLeave,d=e.onDragOver,h=e.onDrop,f=e.onDropAccepted,p=e.onDropRejected,g=e.onFileDialogCancel,m=e.onFileDialogOpen,y=e.useFsAccessApi,C=e.autoFocus,w=e.preventDropOnDocument,b=e.noClick,S=e.noKeyboard,E=e.noDrag,x=e.noDragEventsBubbling,_=e.onError,A=e.validator,O=T.useMemo(function(){return Y3(n)},[n]),k=T.useMemo(function(){return X3(n)},[n]),M=T.useMemo(function(){return typeof m=="function"?m:lC},[m]),I=T.useMemo(function(){return typeof g=="function"?g:lC},[g]),P=T.useRef(null),F=T.useRef(null),z=T.useReducer(f5,dp),$=ap(z,2),J=$[0],K=$[1],R=J.isFocused,Q=J.isFileDialogActive,se=T.useRef(typeof window<"u"&&window.isSecureContext&&y&&J3()),ie=function(){!se.current&&Q&&setTimeout(function(){if(F.current){var B=F.current.files;B.length||(K({type:"closeDialog"}),I())}},300)};T.useEffect(function(){return window.addEventListener("focus",ie,!1),function(){window.removeEventListener("focus",ie,!1)}},[F,Q,I,se]);var de=T.useRef([]),ue=function(B){P.current&&P.current.contains(B.target)||(B.preventDefault(),de.current=[])};T.useEffect(function(){return w&&(document.addEventListener("dragover",tC,!1),document.addEventListener("drop",ue,!1)),function(){w&&(document.removeEventListener("dragover",tC),document.removeEventListener("drop",ue))}},[P,w]),T.useEffect(function(){return!r&&C&&P.current&&P.current.focus(),function(){}},[P,C,r]);var pe=T.useCallback(function(U){_?_(U):console.error(U)},[_]),D=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U),de.current=[].concat(o5(de.current),[U.target]),vc(U)&&Promise.resolve(o(U)).then(function(B){if(!(yc(U)&&!x)){var re=B.length,j=re>0&&q3({files:B,accept:O,minSize:s,maxSize:i,multiple:a,maxFiles:l,validator:A}),te=re>0&&!j;K({isDragAccept:j,isDragReject:te,isDragActive:!0,type:"setDraggedFiles"}),c&&c(U)}}).catch(function(B){return pe(B)})},[o,c,pe,x,O,s,i,a,l,A]),ce=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U);var B=vc(U);if(B&&U.dataTransfer)try{U.dataTransfer.dropEffect="copy"}catch{}return B&&d&&d(U),!1},[d,x]),ye=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U);var B=de.current.filter(function(j){return P.current&&P.current.contains(j)}),re=B.indexOf(U.target);re!==-1&&B.splice(re,1),de.current=B,!(B.length>0)&&(K({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),vc(U)&&u&&u(U))},[P,u,x]),be=T.useCallback(function(U,B){var re=[],j=[];U.forEach(function(te){var fe=ZS(te,O),ve=ap(fe,2),Ee=ve[0],Ve=ve[1],ze=eC(te,s,i),q=ap(ze,2),ae=q[0],ge=q[1],Me=A?A(te):null;if(Ee&&ae&&!Me)re.push(te);else{var ke=[Ve,ge];Me&&(ke=ke.concat(Me)),j.push({file:te,errors:ke.filter(function(je){return je})})}}),(!a&&re.length>1||a&&l>=1&&re.length>l)&&(re.forEach(function(te){j.push({file:te,errors:[U3]})}),re.splice(0)),K({acceptedFiles:re,fileRejections:j,type:"setFiles"}),h&&h(re,j,B),j.length>0&&p&&p(j,B),re.length>0&&f&&f(re,B)},[K,a,O,s,i,l,h,f,p,A]),H=T.useCallback(function(U){U.preventDefault(),U.persist(),Ce(U),de.current=[],vc(U)&&Promise.resolve(o(U)).then(function(B){yc(U)&&!x||be(B,U)}).catch(function(B){return pe(B)}),K({type:"reset"})},[o,be,pe,x]),L=T.useCallback(function(){if(se.current){K({type:"openDialog"}),M();var U={multiple:a,types:k};window.showOpenFilePicker(U).then(function(B){return o(B)}).then(function(B){be(B,null),K({type:"closeDialog"})}).catch(function(B){Q3(B)?(I(B),K({type:"closeDialog"})):Z3(B)?(se.current=!1,F.current?(F.current.value=null,F.current.click()):pe(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):pe(B)});return}F.current&&(K({type:"openDialog"}),M(),F.current.value=null,F.current.click())},[K,M,I,y,be,pe,k,a]),He=T.useCallback(function(U){!P.current||!P.current.isEqualNode(U.target)||(U.key===" "||U.key==="Enter"||U.keyCode===32||U.keyCode===13)&&(U.preventDefault(),L())},[P,L]),G=T.useCallback(function(){K({type:"focus"})},[]),ne=T.useCallback(function(){K({type:"blur"})},[]),X=T.useCallback(function(){b||(G3()?setTimeout(L,0):L())},[b,L]),W=function(B){return r?null:B},V=function(B){return S?null:W(B)},ee=function(B){return E?null:W(B)},Ce=function(B){x&&B.stopPropagation()},we=T.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=U.refKey,re=B===void 0?"ref":B,j=U.role,te=U.onKeyDown,fe=U.onFocus,ve=U.onBlur,Ee=U.onClick,Ve=U.onDragEnter,ze=U.onDragOver,q=U.onDragLeave,ae=U.onDrop,ge=bc(U,n5);return ot(ot(cp({onKeyDown:V(Ln(te,He)),onFocus:V(Ln(fe,G)),onBlur:V(Ln(ve,ne)),onClick:W(Ln(Ee,X)),onDragEnter:ee(Ln(Ve,D)),onDragOver:ee(Ln(ze,ce)),onDragLeave:ee(Ln(q,ye)),onDrop:ee(Ln(ae,H)),role:typeof j=="string"&&j!==""?j:"presentation"},re,P),!r&&!S?{tabIndex:0}:{}),ge)}},[P,He,G,ne,X,D,ce,ye,H,S,E,r]),Z=T.useCallback(function(U){U.stopPropagation()},[]),Se=T.useMemo(function(){return function(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},B=U.refKey,re=B===void 0?"ref":B,j=U.onChange,te=U.onClick,fe=bc(U,r5),ve=cp({accept:O,multiple:a,type:"file",style:{display:"none"},onChange:W(Ln(j,H)),onClick:W(Ln(te,Z)),tabIndex:-1},re,F);return ot(ot({},ve),fe)}},[F,n,a,H,r]);return ot(ot({},J),{},{isFocused:R&&!r,getRootProps:we,getInputProps:Se,rootRef:P,inputRef:F,open:W(L)})}function f5(t,e){switch(e.type){case"focus":return ot(ot({},t),{},{isFocused:!0});case"blur":return ot(ot({},t),{},{isFocused:!1});case"openDialog":return ot(ot({},dp),{},{isFileDialogActive:!0});case"closeDialog":return ot(ot({},t),{},{isFileDialogActive:!1});case"setDraggedFiles":return ot(ot({},t),{},{isDragActive:e.isDragActive,isDragAccept:e.isDragAccept,isDragReject:e.isDragReject});case"setFiles":return ot(ot({},t),{},{acceptedFiles:e.acceptedFiles,fileRejections:e.fileRejections});case"reset":return ot({},dp);default:return t}}function lC(){}function fp({children:t}){return v.jsx("div",{position:"absolute",top:"3",end:"3",dflex:!0,spaceX:"3",children:t})}function wc({...t}){return v.jsx(N.Button,{variant:"glass",corners:"pill",scheme:"secondary",w:"10",h:"10",...t})}function cC({...t}){return v.jsx(wc,{title:"Reset Image",...t,children:v.jsx(N.Icon,{path:bx})})}function uC({cancelable:t,onCancel:e,progress:n}){return v.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"black",bgOpacity:"50",flexCol:!0,spaceY:"5",children:[v.jsx(N.Spinner,{size:"x2",thickness:"1"}),t&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{textSize:"lg",fontWeight:"600",textColor:"white",children:[Math.round(n??0)," %"]}),v.jsxs(N.Button,{scheme:"danger",variant:"glass",corners:"pill",size:"sm",pe:"3",onClick:e,gap:"2",dflex:!0,alignItems:"center",children:[v.jsx(N.Icon,{path:Vg}),"Abort"]})]})]})}function dC({onRetry:t,msg:e,...n}){return v.jsxs("div",{dflex:!0,alignItems:"center",placeContent:"center",position:"absolute",top:"0",start:"0",w:"full",h:"full",bgColor:"#ff0000",bgOpacity:"50",flexCol:!0,spaceY:"5",...n,children:[v.jsx("div",{textColor:"white",children:e}),v.jsxs(N.Button,{onClick:t,shadow:!0,dflex:!0,alignItems:"center",gap:"3",children:[v.jsx(N.Icon,{path:Qg}),"Retry"]})]})}function h5({src:t,srcWidth:e,srcHeight:n,onReset:r,imgAspectRatio:o,children:i}){const[s,a]=T.useState(!0),[l,c]=T.useState(!1),u=T.useCallback(()=>{a(!1),c(!1)},[a,c]),d=T.useCallback(()=>{c(!0),a(!1)},[c,a]),h=T.useCallback(()=>{const f=new Image;f.onload=u,f.onerror=d,c(!1),a(!0),f.src=t},[u,d,c,a]);return v.jsxs("div",{position:"relative",aspectRatio:o,children:[!l&&v.jsx("img",{onLoad:u,onError:d,src:t,width:e,height:n,objectFit:"cover",aspectRatio:o}),s&&v.jsx(uC,{}),l&&v.jsx(dC,{msg:"Oops, couldn't load the image.",onRetry:h}),v.jsxs(fp,{children:[v.jsx(cC,{onClick:r}),i]})]})}const p5=T.memo(function({src:t,state:e,onReset:n,onCancel:r,onRetry:o,imgAspectRatio:i,children:s,...a}){return v.jsxs("div",{position:"relative",aspectRatio:i,...a,children:[v.jsx("img",{src:t,objectFit:"cover",alt:"",aspectRatio:i}),e.state=="loading"&&v.jsx(uC,{cancelable:!0,onCancel:r,progress:e.progress}),e.state=="error"&&v.jsx(dC,{onRetry:o,msg:"Oops, there was an error uploading your image, please retry."}),e.state=="error"&&v.jsxs(fp,{children:[v.jsx(cC,{onClick:n}),s]})]})});function g5(t){if(t.type.includes("image/")){if(t.size/1024/1024>7)return De.error("File size too big, max image size allowed is 7 Mb"),!1}else return De.error("Only image files are allowed"),!1;return!0}T.memo(function({type:t="image",state:e,onFileSelected:n,onResetImage:r,onCancel:o,onRetry:i,emptyStateProps:s,showMediaLibraryButton:a,onMediaLibraryButtonClick:l,children:c,...u}){const d=T.useCallback(C=>{const w=C[0];g5(w)&&n(w)},[n]),{getRootProps:h,getInputProps:f,isDragActive:p,open:g}=aC({onDrop:d,multiple:!1,accept:{"image/png":[".png"],"image/jpeg":[".jpg",".jpeg"],"image/webp":[".webp"]}}),m=T.useCallback(C=>{C.preventDefault(),C.stopPropagation(),g()},[g]),y=T.useCallback(C=>{C.preventDefault(),C.stopPropagation(),l==null||l()},[l]);return v.jsxs("div",{bgColor:"slate-500",...u,children:[e.state=="complete"&&v.jsx(h5,{src:e.src,srcWidth:e.srcWidth,srcHeight:e.srcHeight,onReset:r,imgAspectRatio:u.aspectRatio,children:c}),(e.state=="loading"||e.state=="error")&&v.jsx(p5,{src:e.src,state:e,onReset:r,onCancel:o,onRetry:i,imgAspectRatio:u.aspectRatio,children:c}),e.state=="empty"&&v.jsxs("div",{h:"100%",bgColor:p?"slate-500":void 0,w:"full",dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",id:"kqhdfbq",position:"relative",textColor:"white",...s,...h(),children:[v.jsx("input",{...f()}),v.jsxs("div",{dflex:!0,flexCol:!0,alignItems:"center",placeContent:"center",spaceY:"3",children:[v.jsx(N.Icon,{size:"x5",path:wx}),v.jsxs("p",{textTransform:"capitalize",children:["Drag and drop your ",t," here"]}),v.jsx("p",{opacity:"80",children:"— or select from —"}),v.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:m,children:"Local file"}),a&&v.jsx(N.Button,{variant:"light",size:"sm",px:"5",rounded:"full",fontWeight:"500",onClick:y,children:"Media Library"})]}),c&&v.jsx(fp,{children:c})]})]})});const m5={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};N.ComponentManager.registerComponent("Editor.Image",m5);function y5({...t}){var p,g;const e=t.editor,r=t.node.attrs,o=t.deleteNode,i=t.getPos,s=r.ychange,[a,l]=T.useState(!1),c=JE(e,i);T.useCallback(m=>{c({...r,...m})},[JE]);const u=N.useComponentConfig("Editor.Youtube",void 0,{},{}),d=T.useCallback(()=>{o()},[o]);let h=r.aspectRatio;h&&(h=="default"&&(h=void 0),h=="custom"&&(h=r.customAspectRatio));const f={};return s&&(s.type=="added"||s.type=="removed")&&(f.border="1",f.rounded="lg",f.borderColor=s.type=="added"?(p=s.color)==null?void 0:p.light:(g=s.color)==null?void 0:g.dark),v.jsx(So,{as:"div","data-drag-handle":!0,...f,...u,children:v.jsxs("div",{bgColor:"slate-700",outline:t.selected?"1":!1,outlineColor:"sky-500",position:"relative",rounded:"lg",overflow:"hidden",border:r.showBorder?"0.5":void 0,borderColor:r.showBorder?r.borderColor:void 0,aspectRatio:"16/9",children:[r.src&&v.jsx("iframe",{src:r.src,aspectRatio:"16/9",w:"full",allow:"*"}),(!r.src||a)&&v.jsx(v5,{src:r.src}),v.jsx("div",{position:"absolute",bgColor:"black",bgOpacity:"30",top:"0",bottom:"0",start:"0",end:"0"}),e.view.editable&&!a&&v.jsxs("div",{position:"absolute",dflex:!0,gap:"3",top:"3",end:"3",children:[v.jsx(wc,{title:"Settings",onClick:()=>l(!0),children:v.jsx(N.Icon,{path:sx})}),v.jsx(wc,{title:"Delete Youtube Block",onClick:m=>{m.preventDefault(),m.stopPropagation(),d()},children:v.jsx(N.Icon,{path:em})})]})]},r.src)})}function v5({src:t}){const e=T.useCallback(n=>{},[]);return v.jsx("div",{position:"absolute",top:"0",start:"0",end:"0",bottom:"0",p:"3",bgColor:"slate-100",children:v.jsxs(Ha,{position:"relative",w:"full",h:"full",children:[v.jsx(qd,{initialValues:{src:t??""},onSubmit:e,children:v.jsx(Qr,{form:z0.array(z0.url("src","Youtube URL",!1,"https://www.youtube.com/watch?v=dQw4w9WgXcQ"))})}),v.jsx(wc,{type:"submit",title:"Save",position:"absolute",variant:"default",top:"3",end:"3",children:v.jsx(N.Icon,{path:ou})})]})})}const fC={defaultProps:{mt:Y(8,16),mb:Y(8,16),sm_mt:Y(4,14),sm_mb:Y(4,14),lg_mt:Y(12,18),lg_mb:Y(12,18),xl_mt:Y(12,20),xl_mb:Y(12,20),x2_mt:Y(12,24),x2_mb:Y(12,24)}};N.ComponentManager.registerComponent("Editor.ListItem",fC);function b5({...t}){const e=N.useComponentConfig("Editor.ListItem",void 0,{},{});return v.jsx(So,{as:"li",...e,...pc(t,"List item"),children:v.jsx(Cs,{})})}const hC={defaultProps:{listStyle:"decimal",mt:Y(20,16),mb:Y(20,16),ps:Y(26,16),css:{"& li":{paddingLeft:Y(6,16)},"& li:marker":{color:"var(--tw-prose-bullets)"},"& li p":{marginTop:Y(12,16),marginBottom:Y(12,16)},"& li > *:first-of-type":{marginTop:Y(20,16)},"& li > *:last-of-type":{marginBottom:Y(20,16)},"& ul, & ol":{marginTop:Y(12,16),marginBottom:Y(12,16)}},sm_mt:Y(16,14),sm_mb:Y(16,14),sm_ps:Y(22,14),lg_mt:Y(24,18),lg_mb:Y(24,18),lg_ps:Y(28,18),xl_mt:Y(24,20),xl_mb:Y(24,20),xl_ps:Y(32,20),x2_mt:Y(32,24),x2_mb:Y(32,24),x2_ps:Y(38,24)}},w5=t=>{const e=t.as||"div",{nodeViewContentRef:n}=_S();return v.jsx(e,{...t,ref:n,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...t.style}})};N.ComponentManager.registerComponent("Editor.OrderedList",hC);function S5(){const t=N.useComponentConfig("Editor.OrderedList",void 0,{},{});return v.jsx(So,{as:"ol",...t,children:v.jsx(w5,{})})}const pC={defaultProps:{mt:Y(20,16),mb:Y(20,16),sm_mt:Y(16,14),sm_mb:Y(16,14),lg_mt:Y(24,18),lg_mb:Y(24,18),xl_mt:Y(24,20),xl_mb:Y(24,20),x2_mt:Y(32,24),x2_mb:Y(32,24),textSize:"md",textColor:"#242424",css:{"& a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all"},insert:{color:"#33FF33"},"& delete":{color:"#FF3333",textDecoration:"strike-through"}}}};N.ComponentManager.registerComponent("Editor.Paragraph",pC);function C5({...t}){const e=N.useComponentConfig("Editor.Paragraph",void 0,{},{});return v.jsx(So,{as:"p",...e,...pc(t),children:v.jsx(Cs,{as:"span"})})}const E5=["bulletList","orderedList","taskList","image"],_5=pt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new at({key:new mt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const i=t.type.createAndFill(),s=(i==null?void 0:i.sameMarkup(t))&&i.content.findDiffStart(t.content)===null;return t.descendants((a,l)=>{const c=E5.includes(a.type.name),u=r>=l&&r<=l+a.nodeSize,d=!c&&gC(a);//!node.isLeaf && !node.childCount;
|
209
|
+
if((u||!this.options.showOnlyCurrent)&&d){const h=[this.options.emptyNodeClass];s&&h.push(this.options.emptyEditorClass);const f=Ut.node(l,l+a.nodeSize,{class:h.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});o.push(f)}return c||this.options.includeChildren}),ut.create(t,o)}}})]}});function gC(t){if(t.text)return!1;const e=t.content;let n=!0;return Uy(e.content)&&e.content.forEach(o=>n=n&&gC(o)),n}const x5=Lt.create({name:"capitalize",addOptions(){return{HTMLAttributes:{style:"text-transform: capitalize"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setCapitalize:()=>({commands:t})=>t.setMark(this.name),toggleCapitalize:()=>({commands:t})=>t.toggleMark(this.name),unsetCapitalize:()=>({commands:t})=>t.unsetMark(this.name)}}}),A5=Lt.create({name:"lowercase",addOptions(){return{HTMLAttributes:{style:"text-transform: lowercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setLowercase:()=>({commands:t})=>t.setMark(this.name),toggleLowercase:()=>({commands:t})=>t.toggleMark(this.name),unsetLowercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),O5=Lt.create({name:"uppercase",addOptions(){return{HTMLAttributes:{style:"text-transform: uppercase"}}},parseHTML(){return[{style:"text-transform",consuming:!1,getAttrs:t=>t.includes("text-transform")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",rt(this.options.HTMLAttributes,t),0]},addCommands(){return{setUppercase:()=>({commands:t})=>t.setMark(this.name),toggleUppercase:()=>({commands:t})=>t.toggleMark(this.name),unsetUppercase:()=>({commands:t})=>t.unsetMark(this.name)}}}),T5=Lt.create({name:"ychange",inclusive:!1,addAttributes(){return{user:{default:null},type:{default:null},color:{default:null}}},parseHTML(){return[{tag:"ychange"}]},renderHTML({mark:t}){return["ychange",{ychange_user:t.attrs.user,ychange_type:t.attrs.type,style:k5(t.attrs),ychange_color:t.attrs.color.light}]}}),k5=t=>{switch(t.type){case"removed":return`color:${t.color.dark}; text-decoration: line-through`;case"added":return"background-color:#bef264";case null:return""}},M5=(t,e)=>[JF.configure({heading:!1,paragraph:!1,blockquote:!1,bulletList:!1,orderedList:!1,listItem:!1,codeBlock:{HTMLAttributes:{class:"rounded-sm bg-stone-100 p-5 font-mono font-medium text-stone-800"}},code:{HTMLAttributes:{class:"rounded-md bg-stone-200 px-1.5 py-1 font-mono font-medium text-stone-900",spellcheck:"false"}},horizontalRule:!1,dropcursor:{color:"#DBEAFE",width:4},gapcursor:!1,hardBreak:{keepMarks:!0},history:!1}),Ww.extend({addNodeView(){return mo(u3)},draggable:!0}),hS.extend({addAttributes(){return{ychange:{default:null}}},addNodeView(){return mo(C5)},draggable:!0}),jw.extend({addNodeView(){return mo(l3)}}),cS.extend({addNodeView(){return mo(b5)}}),qw.extend({addNodeView(){return mo(c3)}}),fS.extend({addNodeView(){return mo(S5)}}),ZN.configure({openOnClick:!1,autolink:!0,linkOnPaste:!0}),_5.configure({placeholder:({node:n})=>{switch(n.type.name){case"heading":return`Heading ${n.attrs.level}`;case"quote":return"Quote";case"listItem":return"List item";case"taskItem":return"Task item"}return(e==null?void 0:e.placeHolderText)??"Press '/' for commands"},includeChildren:!1,emptyEditorClass:"my-class"}),s3(t),CS,iF,AN,O5,A5,x5,ON,MN.configure({multicolor:!0}),oF.extend({addNodeView(){return mo(y5)},draggable:!0}),T5],Dn=typeof navigator<"u"?navigator:null,mC=typeof document<"u"?document:null,Eo=Dn&&Dn.userAgent||"",hp=/Edge\/(\d+)/.exec(Eo),yC=/MSIE \d/.exec(Eo),pp=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Eo),gp=!!(yC||pp||hp);yC?document.documentMode:pp?+pp[1]:hp&&+hp[1],!gp&&/gecko\/(\d+)/i.test(Eo)&&+(/Firefox\/(\d+)/.exec(Eo)||[0,0])[1];const vC=!gp&&/Chrome\/(\d+)/.exec(Eo);vC&&+vC[1],!gp&&!!Dn&&/Apple Computer/.test(Dn.vendor)&&(/Mobile\/\w+/.test(Eo)||!!Dn&&Dn.maxTouchPoints>2)||Dn&&/Mac/.test(Dn.platform),Dn&&/Win/.test(Dn.platform),!!mC&&"webkitFontSmoothing"in mC.documentElement.style&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];const P5={handleDOMEvents:{keydown:(t,e,...n)=>{if(["ArrowUp","ArrowDown","Enter"].includes(e.key)&&document.querySelector("#slash-command"))return!0}},handlePaste:(t,e)=>{if(e.clipboardData&&e.clipboardData.files&&e.clipboardData.files[0]){e.preventDefault();const n=e.clipboardData.files[0],r=t.state.selection.from,{schema:o}=t.state,i=o.nodes.image.create({file:n}),s=t.state.tr;return s.insert(r,i),t.dispatch(s)}return!1},handleDrop:(t,e,n,r)=>{if(!r&&e.dataTransfer&&e.dataTransfer.files&&e.dataTransfer.files[0]){e.preventDefault();const o=e.dataTransfer.files[0],i=t.posAtCoords({left:e.clientX,top:e.clientY})??{pos:0,inside:0},{schema:s}=t.state,a=s.nodes.image.create({file:o}),l=t.state.tr;return l.selection.empty||l.deleteSelection(),l.insert(i.pos,a),t.dispatch(l)}return!1}},Rn=()=>new Map,mp=t=>{const e=Rn();return t.forEach((n,r)=>{e.set(r,n)}),e},_o=(t,e,n)=>{let r=t.get(e);return r===void 0&&t.set(e,r=n()),r},I5=(t,e)=>{const n=[];for(const[r,o]of t)n.push(e(o,r));return n},L5=(t,e)=>{for(const[n,r]of t)if(e(r,n))return!0;return!1},xo=()=>new Set,yp=t=>t[t.length-1],D5=(t,e)=>{for(let n=0;n<e.length;n++)t.push(e[n])},Ao=Array.from,R5=(t,e)=>{for(let n=0;n<t.length;n++)if(e(t[n],n,t))return!0;return!1},vp=Array.isArray;class bC{constructor(){this._observers=Rn()}on(e,n){return _o(this._observers,e,xo).add(n),n}once(e,n){const r=(...o)=>{this.off(e,r),n(...o)};this.on(e,r)}off(e,n){const r=this._observers.get(e);r!==void 0&&(r.delete(n),r.size===0&&this._observers.delete(e))}emit(e,n){return Ao((this._observers.get(e)||Rn()).values()).forEach(r=>r(...n))}destroy(){this._observers=Rn()}}const Br=Math.floor,Sc=Math.abs,Cc=(t,e)=>t<e?t:e,hi=(t,e)=>t>e?t:e,N5=t=>t!==0?t<0:1/t<0,wC=1,SC=2,bp=4,wp=8,F5=32,CC=64,Rs=128,H5=31,EC=63,pi=127,B5=2147483647,$5=Number.MAX_SAFE_INTEGER,V5=Number.isInteger||(t=>typeof t=="number"&&isFinite(t)&&Br(t)===t),j5=t=>t.toLowerCase(),z5=/^\s*/g,U5=t=>t.replace(z5,""),q5=/([A-Z])/g,_C=(t,e)=>U5(t.replace(q5,n=>`${e}${j5(n)}`)),W5=t=>{const e=unescape(encodeURIComponent(t)),n=e.length,r=new Uint8Array(n);for(let o=0;o<n;o++)r[o]=e.codePointAt(o);return r},Ns=typeof TextEncoder<"u"?new TextEncoder:null,K5=Ns?t=>Ns.encode(t):W5;let Sp=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});Sp&&Sp.decode(new Uint8Array).length===1&&(Sp=null);class Fs{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}const Cp=()=>new Fs,G5=t=>{let e=t.cpos;for(let n=0;n<t.bufs.length;n++)e+=t.bufs[n].length;return e},er=t=>{const e=new Uint8Array(G5(t));let n=0;for(let r=0;r<t.bufs.length;r++){const o=t.bufs[r];e.set(o,n),n+=o.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),n),e},J5=(t,e)=>{const n=t.cbuf.length;n-t.cpos<e&&(t.bufs.push(new Uint8Array(t.cbuf.buffer,0,t.cpos)),t.cbuf=new Uint8Array(hi(n,e)*2),t.cpos=0)},Et=(t,e)=>{const n=t.cbuf.length;t.cpos===n&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(n*2),t.cpos=0),t.cbuf[t.cpos++]=e},Ep=Et,Ge=(t,e)=>{for(;e>pi;)Et(t,Rs|pi&e),e=Br(e/128);Et(t,pi&e)},_p=(t,e)=>{const n=N5(e);for(n&&(e=-e),Et(t,(e>EC?Rs:0)|(n?CC:0)|EC&e),e=Br(e/64);e>0;)Et(t,(e>pi?Rs:0)|pi&e),e=Br(e/128)},xp=new Uint8Array(3e4),X5=xp.length/3,Y5=(t,e)=>{if(e.length<X5){const n=Ns.encodeInto(e,xp).written||0;Ge(t,n);for(let r=0;r<n;r++)Et(t,xp[r])}else en(t,K5(e))},Q5=(t,e)=>{const n=unescape(encodeURIComponent(e)),r=n.length;Ge(t,r);for(let o=0;o<r;o++)Et(t,n.codePointAt(o))},gi=Ns&&Ns.encodeInto?Y5:Q5,Ap=(t,e)=>{const n=t.cbuf.length,r=t.cpos,o=Cc(n-r,e.length),i=e.length-o;t.cbuf.set(e.subarray(0,o),r),t.cpos+=o,i>0&&(t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(hi(n*2,i)),t.cbuf.set(e.subarray(o)),t.cpos=i)},en=(t,e)=>{Ge(t,e.byteLength),Ap(t,e)},Op=(t,e)=>{J5(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);return t.cpos+=e,n},Z5=(t,e)=>Op(t,4).setFloat32(0,e,!1),eH=(t,e)=>Op(t,8).setFloat64(0,e,!1),tH=(t,e)=>Op(t,8).setBigInt64(0,e,!1),xC=new DataView(new ArrayBuffer(4)),nH=t=>(xC.setFloat32(0,t),xC.getFloat32(0)===t),Hs=(t,e)=>{switch(typeof e){case"string":Et(t,119),gi(t,e);break;case"number":V5(e)&&Sc(e)<=B5?(Et(t,125),_p(t,e)):nH(e)?(Et(t,124),Z5(t,e)):(Et(t,123),eH(t,e));break;case"bigint":Et(t,122),tH(t,e);break;case"object":if(e===null)Et(t,126);else if(vp(e)){Et(t,117),Ge(t,e.length);for(let n=0;n<e.length;n++)Hs(t,e[n])}else if(e instanceof Uint8Array)Et(t,116),en(t,e);else{Et(t,118);const n=Object.keys(e);Ge(t,n.length);for(let r=0;r<n.length;r++){const o=n[r];gi(t,o),Hs(t,e[o])}}break;case"boolean":Et(t,e?120:121);break;default:Et(t,127)}};class AC extends Fs{constructor(e){super(),this.w=e,this.s=null,this.count=0}write(e){this.s===e?this.count++:(this.count>0&&Ge(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}const OC=t=>{t.count>0&&(_p(t.encoder,t.count===1?t.s:-t.s),t.count>1&&Ge(t.encoder,t.count-2))};class Ec{constructor(){this.encoder=new Fs,this.s=0,this.count=0}write(e){this.s===e?this.count++:(OC(this),this.count=1,this.s=e)}toUint8Array(){return OC(this),er(this.encoder)}}const TC=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);_p(t.encoder,e),t.count>1&&Ge(t.encoder,t.count-2)}};class Tp{constructor(){this.encoder=new Fs,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(TC(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return TC(this),er(this.encoder)}}class rH{constructor(){this.sarr=[],this.s="",this.lensE=new Ec}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){const e=new Fs;return this.sarr.push(this.s),this.s="",gi(e,this.sarr.join("")),Ap(e,this.lensE.toUint8Array()),er(e)}}const $r=t=>new Error(t),vn=()=>{throw $r("Method unimplemented")},tr=()=>{throw $r("Unexpected case")},oH=$r("Unexpected end of array"),iH=$r("Integer out of Range");class sH{constructor(e){this.arr=e,this.pos=0}}const _c=t=>new sH(t),Nn=t=>{let e=0,n=1;const r=t.arr.length;for(;t.pos<r;){const o=t.arr[t.pos++];if(e=e+(o&pi)*n,n*=128,o<Rs)return e;if(e>$5)throw iH}throw oH},aH=crypto.getRandomValues.bind(crypto),lH=Math.random,kC=()=>aH(new Uint32Array(1))[0],cH=t=>t[Br(lH()*t.length)],uH="10000000-1000-4000-8000"+-1e11,dH=()=>uH.replace(/[018]/g,t=>(t^kC()&15>>t/4).toString(16)),fH=Date.now,MC=t=>new Promise(t);Promise.all.bind(Promise);const PC=t=>t===void 0?null:t;class hH{constructor(){this.map=new Map}setItem(e,n){this.map.set(e,n)}getItem(e){return this.map.get(e)}}let IC=new hH,pH=!0;try{typeof localStorage<"u"&&localStorage&&(IC=localStorage,pH=!1)}catch{}const gH=IC,mH=Object.assign,LC=Object.keys,yH=(t,e)=>{for(const n in t)e(t[n],n)},DC=t=>LC(t).length,vH=t=>{for(const e in t)return!1;return!0},bH=(t,e)=>{for(const n in t)if(!e(t[n],n))return!1;return!0},wH=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),SH=(t,e)=>t===e||DC(t)===DC(e)&&bH(t,(n,r)=>(n!==void 0||wH(e,r))&&e[r]===n),kp=(t,e,n=0)=>{try{for(;n<t.length;n++)t[n](...e)}finally{n<t.length&&kp(t,e,n+1)}},CH=(t,e)=>e.includes(t),mi=typeof process<"u"&&process.release&&/node|io\.js/.test(process.release.name)&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]",EH=typeof window<"u"&&typeof document<"u"&&!mi;let Fn;const _H=()=>{if(Fn===void 0)if(mi){Fn=Rn();const t=process.argv;let e=null;for(let n=0;n<t.length;n++){const r=t[n];r[0]==="-"?(e!==null&&Fn.set(e,""),e=r):e!==null&&(Fn.set(e,r),e=null)}e!==null&&Fn.set(e,"")}else typeof location=="object"?(Fn=Rn(),(location.search||"?").slice(1).split("&").forEach(t=>{if(t.length!==0){const[e,n]=t.split("=");Fn.set(`--${_C(e,"-")}`,n),Fn.set(`-${_C(e,"-")}`,n)}})):Fn=Rn();return Fn},Mp=t=>_H().has(t),Pp=t=>PC(mi?process.env[t.toUpperCase().replaceAll("-","_")]:gH.getItem(t));(t=>Mp("--"+t)||Pp(t)!==null)("production");const RC=mi&&CH(process.env.FORCE_COLOR,["true","1","2"]),xH=!Mp("no-colors")&&(!mi||process.stdout.isTTY||RC)&&(!mi||Mp("color")||RC||Pp("COLORTERM")!==null||(Pp("TERM")||"").includes("color"));class AH{constructor(e,n){this.left=e,this.right=n}}const nr=(t,e)=>new AH(t,e),OH=typeof document<"u"?document:{};typeof DOMParser<"u"&&new DOMParser;const TH=t=>I5(t,(e,n)=>`${n}:${e};`).join(""),kH=(t=>class{constructor(n){this._=n}destroy(){t(this._)}})(clearTimeout),Ip=(t,e)=>new kH(setTimeout(e,t)),rr=Symbol,NC=rr(),FC=rr(),MH=rr(),PH=rr(),IH=rr(),HC=rr(),LH=rr(),Lp=rr(),DH=rr(),RH=t=>{var r;t.length===1&&((r=t[0])==null?void 0:r.constructor)===Function&&(t=t[0]());const e=[];let n=0;for(;n<t.length;n++){const o=t[n];o===void 0||o.constructor===String||o.constructor===Number||o.constructor===Object&&e.push(JSON.stringify(o))}return e},NH={[NC]:nr("font-weight","bold"),[FC]:nr("font-weight","normal"),[MH]:nr("color","blue"),[IH]:nr("color","green"),[PH]:nr("color","grey"),[HC]:nr("color","red"),[LH]:nr("color","purple"),[Lp]:nr("color","orange"),[DH]:nr("color","black")},BC=xH?t=>{var s;t.length===1&&((s=t[0])==null?void 0:s.constructor)===Function&&(t=t[0]());const e=[],n=[],r=Rn();let o=[],i=0;for(;i<t.length;i++){const a=t[i],l=NH[a];if(l!==void 0)r.set(l.left,l.right);else{if(a===void 0)break;if(a.constructor===String||a.constructor===Number){const c=TH(r);i>0||c.length>0?(e.push("%c"+a),n.push(c)):e.push(a)}else break}}for(i>0&&(o=n,o.unshift(e.join("")));i<t.length;i++){const a=t[i];a instanceof Symbol||o.push(a)}return o}:RH,FH=(...t)=>{console.log(...BC(t)),$C.forEach(e=>e.print(t))},HH=(...t)=>{console.warn(...BC(t)),t.unshift(Lp),$C.forEach(e=>e.print(t))},$C=xo(),VC=t=>({[Symbol.iterator](){return this},next:t}),BH=(t,e)=>VC(()=>{let n;do n=t.next();while(!n.done&&!e(n.value));return n}),Dp=(t,e)=>VC(()=>{const{done:n,value:r}=t.next();return{done:n,value:n?void 0:e(r)}});class Rp{constructor(e,n){this.clock=e,this.len=n}}class Bs{constructor(){this.clients=new Map}}const Vr=(t,e,n)=>e.clients.forEach((r,o)=>{const i=t.doc.store.clients.get(o);for(let s=0;s<r.length;s++){const a=r[s];YC(t,i,a.clock,a.len,n)}}),$H=(t,e)=>{let n=0,r=t.length-1;for(;n<=r;){const o=Br((n+r)/2),i=t[o],s=i.clock;if(s<=e){if(e<s+i.len)return o;n=o+1}else r=o-1}return null},Oo=(t,e)=>{const n=t.clients.get(e.client);return n!==void 0&&$H(n,e.clock)!==null},Np=t=>{t.clients.forEach(e=>{e.sort((o,i)=>o.clock-i.clock);let n,r;for(n=1,r=1;n<e.length;n++){const o=e[r-1],i=e[n];o.clock+o.len>=i.clock?o.len=hi(o.len,i.clock+i.len-o.clock):(r<n&&(e[r]=i),r++)}e.length=r})},xc=t=>{const e=new Bs;for(let n=0;n<t.length;n++)t[n].clients.forEach((r,o)=>{if(!e.clients.has(o)){const i=r.slice();for(let s=n+1;s<t.length;s++)D5(i,t[s].clients.get(o)||[]);e.clients.set(o,i)}});return Np(e),e},Fp=(t,e,n,r)=>{_o(t.clients,e,()=>[]).push(new Rp(n,r))},Ac=()=>new Bs,VH=t=>{const e=Ac();return t.clients.forEach((n,r)=>{const o=[];for(let i=0;i<n.length;i++){const s=n[i];if(s.deleted){const a=s.id.clock;let l=s.length;if(i+1<n.length)for(let c=n[i+1];i+1<n.length&&c.deleted;c=n[++i+1])l+=c.length;o.push(new Rp(a,l))}}o.length>0&&e.clients.set(r,o)}),e},Oc=(t,e)=>{Ge(t.restEncoder,e.clients.size),Ao(e.clients.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{t.resetDsCurVal(),Ge(t.restEncoder,n);const o=r.length;Ge(t.restEncoder,o);for(let i=0;i<o;i++){const s=r[i];t.writeDsClock(s.clock),t.writeDsLen(s.len)}})},Hp=t=>{const e=new Bs,n=Nn(t.restDecoder);for(let r=0;r<n;r++){t.resetDsCurVal();const o=Nn(t.restDecoder),i=Nn(t.restDecoder);if(i>0){const s=_o(e.clients,o,()=>[]);for(let a=0;a<i;a++)s.push(new Rp(t.readDsClock(),t.readDsLen()))}}return e},jC=kC;class yi extends bC{constructor({guid:e=dH(),collectionid:n=null,gc:r=!0,gcFilter:o=()=>!0,meta:i=null,autoLoad:s=!1,shouldLoad:a=!0}={}){super(),this.gc=r,this.gcFilter=o,this.clientID=jC(),this.guid=e,this.collectionid=n,this.share=new Map,this.store=new s4,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=a,this.autoLoad=s,this.meta=i,this.isLoaded=!1,this.isSynced=!1,this.whenLoaded=MC(c=>{this.on("load",()=>{this.isLoaded=!0,c(this)})});const l=()=>MC(c=>{const u=d=>{(d===void 0||d===!0)&&(this.off("sync",u),c())};this.on("sync",u)});this.on("sync",c=>{c===!1&&this.isSynced&&(this.whenSynced=l()),this.isSynced=c===void 0||c===!0,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=l()}load(){const e=this._item;e!==null&&!this.shouldLoad&&et(e.parent.doc,n=>{n.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(Ao(this.subdocs).map(e=>e.guid))}transact(e,n=null){return et(this,e,n)}get(e,n=Tt){const r=_o(this.share,e,()=>{const i=new n;return i._integrate(this,null),i}),o=r.constructor;if(n!==Tt&&o!==n)if(o===Tt){const i=new n;i._map=r._map,r._map.forEach(s=>{for(;s!==null;s=s.left)s.parent=i}),i._start=r._start;for(let s=i._start;s!==null;s=s.right)s.parent=i;return i._length=r._length,this.share.set(e,i),i._integrate(this,null),i}else throw new Error(`Type with the name ${e} has already been defined with a different constructor`);return r}getArray(e=""){return this.get(e,ko)}getText(e=""){return this.get(e,wi)}getMap(e=""){return this.get(e,Us)}getXmlElement(e=""){return this.get(e,Jt)}getXmlFragment(e=""){return this.get(e,Si)}toJSON(){const e={};return this.share.forEach((n,r)=>{e[r]=n.toJSON()}),e}destroy(){Ao(this.subdocs).forEach(n=>n.destroy());const e=this._item;if(e!==null){this._item=null;const n=e.content;n.doc=new yi({guid:this.guid,...n.opts,shouldLoad:!1}),n.doc._item=e,et(e.parent.doc,r=>{const o=n.doc;e.deleted||r.subdocsAdded.add(o),r.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class Bp{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return Nn(this.restDecoder)}readDsLen(){return Nn(this.restDecoder)}}class jH{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=Nn(this.restDecoder),this.dsCurrVal}readDsLen(){const e=Nn(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class Tc{constructor(){this.restEncoder=Cp()}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){}writeDsClock(e){Ge(this.restEncoder,e)}writeDsLen(e){Ge(this.restEncoder,e)}}class zH extends Tc{writeLeftID(e){Ge(this.restEncoder,e.client),Ge(this.restEncoder,e.clock)}writeRightID(e){Ge(this.restEncoder,e.client),Ge(this.restEncoder,e.clock)}writeClient(e){Ge(this.restEncoder,e)}writeInfo(e){Ep(this.restEncoder,e)}writeString(e){gi(this.restEncoder,e)}writeParentInfo(e){Ge(this.restEncoder,e?1:0)}writeTypeRef(e){Ge(this.restEncoder,e)}writeLen(e){Ge(this.restEncoder,e)}writeAny(e){Hs(this.restEncoder,e)}writeBuf(e){en(this.restEncoder,e)}writeJSON(e){gi(this.restEncoder,JSON.stringify(e))}writeKey(e){gi(this.restEncoder,e)}}class zC{constructor(){this.restEncoder=Cp(),this.dsCurrVal=0}toUint8Array(){return er(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(e){const n=e-this.dsCurrVal;this.dsCurrVal=e,Ge(this.restEncoder,n)}writeDsLen(e){e===0&&tr(),Ge(this.restEncoder,e-1),this.dsCurrVal+=e}}class UH extends zC{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new Tp,this.clientEncoder=new Ec,this.leftClockEncoder=new Tp,this.rightClockEncoder=new Tp,this.infoEncoder=new AC(Ep),this.stringEncoder=new rH,this.parentInfoEncoder=new AC(Ep),this.typeRefEncoder=new Ec,this.lenEncoder=new Ec}toUint8Array(){const e=Cp();return Ge(e,0),en(e,this.keyClockEncoder.toUint8Array()),en(e,this.clientEncoder.toUint8Array()),en(e,this.leftClockEncoder.toUint8Array()),en(e,this.rightClockEncoder.toUint8Array()),en(e,er(this.infoEncoder)),en(e,this.stringEncoder.toUint8Array()),en(e,er(this.parentInfoEncoder)),en(e,this.typeRefEncoder.toUint8Array()),en(e,this.lenEncoder.toUint8Array()),Ap(e,er(this.restEncoder)),er(e)}writeLeftID(e){this.clientEncoder.write(e.client),this.leftClockEncoder.write(e.clock)}writeRightID(e){this.clientEncoder.write(e.client),this.rightClockEncoder.write(e.clock)}writeClient(e){this.clientEncoder.write(e)}writeInfo(e){this.infoEncoder.write(e)}writeString(e){this.stringEncoder.write(e)}writeParentInfo(e){this.parentInfoEncoder.write(e?1:0)}writeTypeRef(e){this.typeRefEncoder.write(e)}writeLen(e){this.lenEncoder.write(e)}writeAny(e){Hs(this.restEncoder,e)}writeBuf(e){en(this.restEncoder,e)}writeJSON(e){Hs(this.restEncoder,e)}writeKey(e){const n=this.keyMap.get(e);n===void 0?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(e)):this.keyClockEncoder.write(n)}}const qH=(t,e,n,r)=>{r=hi(r,e[0].id.clock);const o=or(e,r);Ge(t.restEncoder,e.length-o),t.writeClient(n),Ge(t.restEncoder,r);const i=e[o];i.write(t,r-i.id.clock);for(let s=o+1;s<e.length;s++)e[s].write(t,0)},WH=(t,e,n)=>{const r=new Map;n.forEach((o,i)=>{Ot(e,i)>o&&r.set(i,o)}),Dc(e).forEach((o,i)=>{n.has(i)||r.set(i,0)}),Ge(t.restEncoder,r.size),Ao(r.entries()).sort((o,i)=>i[0]-o[0]).forEach(([o,i])=>{qH(t,e.clients.get(o),o,i)})},KH=(t,e)=>WH(t,e.doc.store,e.beforeState),GH=t=>{const e=new Map,n=Nn(t.restDecoder);for(let r=0;r<n;r++){const o=Nn(t.restDecoder),i=Nn(t.restDecoder);e.set(o,i)}return e},JH=(t,e)=>(Ge(t.restEncoder,e.size),Ao(e.entries()).sort((n,r)=>r[0]-n[0]).forEach(([n,r])=>{Ge(t.restEncoder,n),Ge(t.restEncoder,r)}),t);class XH{constructor(){this.l=[]}}const UC=()=>new XH,qC=(t,e)=>t.l.push(e),WC=(t,e)=>{const n=t.l,r=n.length;t.l=n.filter(o=>e!==o),r===t.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},KC=(t,e,n)=>kp(t.l,[e,n]);class kc{constructor(e,n){this.client=e,this.clock=n}}const Mc=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock,Xe=(t,e)=>new kc(t,e),$s=t=>{for(const[e,n]of t.doc.share.entries())if(n===t)return e;throw tr()},Vs=(t,e)=>{for(;e!==null;){if(e.parent===t)return!0;e=e.parent._item}return!1};class YH{constructor(e,n=e.getMap("users")){const r=new Map;this.yusers=n,this.doc=e,this.clients=new Map,this.dss=r;const o=(i,s)=>{const a=i.get("ds"),l=i.get("ids"),c=u=>this.clients.set(u,s);a.observe(u=>{u.changes.added.forEach(d=>{d.content.getContent().forEach(h=>{h instanceof Uint8Array&&this.dss.set(s,xc([this.dss.get(s)||Ac(),Hp(new Bp(_c(h)))]))})})}),this.dss.set(s,xc(a.map(u=>Hp(new Bp(_c(u)))))),l.observe(u=>u.changes.added.forEach(d=>d.content.getContent().forEach(c))),l.forEach(c)};n.observe(i=>{i.keysChanged.forEach(s=>o(n.get(s),s))}),n.forEach(o)}setUserMapping(e,n,r,{filter:o=()=>!0}={}){const i=this.yusers;let s=i.get(r);s||(s=new Us,s.set("ids",new ko),s.set("ds",new ko),i.set(r,s)),s.get("ids").push([n]),i.observe(a=>{setTimeout(()=>{const l=i.get(r);if(l!==s){s=l,this.clients.forEach((d,h)=>{r===d&&s.get("ids").push([h])});const c=new Tc,u=this.dss.get(r);u&&(Oc(c,u),s.get("ds").push([c.toUint8Array()]))}},0)}),e.on("afterTransaction",a=>{setTimeout(()=>{const l=s.get("ds"),c=a.deleteSet;if(a.local&&c.clients.size>0&&o(a,c)){const u=new Tc;Oc(u,c),l.push([u.toUint8Array()])}})})}getUserByClientId(e){return this.clients.get(e)||null}getUserByDeletedId(e){for(const[n,r]of this.dss.entries())if(Oo(r,e))return n;return null}}class Pc{constructor(e,n,r,o=0){this.type=e,this.tname=n,this.item=r,this.assoc=o}}class QH{constructor(e,n,r=0){this.type=e,this.index=n,this.assoc=r}}const ZH=(t,e,n=0)=>new QH(t,e,n),Ic=(t,e,n)=>{let r=null,o=null;return t._item===null?o=$s(t):r=Xe(t._item.id.client,t._item.id.clock),new Pc(r,o,e,n)},$p=(t,e,n=0)=>{let r=t._start;if(n<0){if(e===0)return Ic(t,null,n);e--}for(;r!==null;){if(!r.deleted&&r.countable){if(r.length>e)return Ic(t,Xe(r.id.client,r.id.clock+e),n);e-=r.length}if(r.right===null&&n<0)return Ic(t,r.lastId,n);r=r.right}return Ic(t,null,n)},e4=(t,e,n=!0)=>{const r=e.store,o=t.item,i=t.type,s=t.tname,a=t.assoc;let l=null,c=0;if(o!==null){if(Ot(r,o.client)<=o.clock)return null;const u=n?Yp(r,o):{item:vi(r,o),diff:0},d=u.item;if(!(d instanceof tt))return null;if(l=d.parent,l._item===null||!l._item.deleted){c=d.deleted||!d.countable?0:u.diff+(a>=0?0:1);let h=d.left;for(;h!==null;)!h.deleted&&h.countable&&(c+=h.length),h=h.left}}else{if(s!==null)l=e.get(s);else if(i!==null){if(Ot(r,i.client)<=i.clock)return null;const{item:u}=n?Yp(r,i):{item:vi(r,i)};if(u instanceof tt&&u.content instanceof Bn)l=u.content.type;else return null}else throw tr();a>=0?c=l._length:c=0}return ZH(l,c,t.assoc)};class Lc{constructor(e,n){this.ds=e,this.sv=n}}const t4=(t,e)=>{const n=t.ds.clients,r=e.ds.clients,o=t.sv,i=e.sv;if(o.size!==i.size||n.size!==r.size)return!1;for(const[s,a]of o.entries())if(i.get(s)!==a)return!1;for(const[s,a]of n.entries()){const l=r.get(s)||[];if(a.length!==l.length)return!1;for(let c=0;c<a.length;c++){const u=a[c],d=l[c];if(u.clock!==d.clock||u.len!==d.len)return!1}}return!0},n4=(t,e=new zC)=>(Oc(e,t.ds),JH(e,t.sv),e.toUint8Array()),r4=t=>n4(t,new Tc),o4=(t,e=new jH(_c(t)))=>new Lc(Hp(e),GH(e)),Vp=t=>o4(t,new Bp(_c(t))),jp=(t,e)=>new Lc(t,e),i4=jp(Ac(),new Map),GC=t=>jp(VH(t.store),Dc(t.store)),To=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!Oo(e.ds,t.id),zp=(t,e)=>{const n=_o(t.meta,zp,xo),r=t.doc.store;n.has(e)||(e.sv.forEach((o,i)=>{o<Ot(r,i)&&Gt(t,Xe(i,o))}),Vr(t,e.ds,o=>{}),n.add(e))};class s4{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}const Dc=t=>{const e=new Map;return t.clients.forEach((n,r)=>{const o=n[n.length-1];e.set(r,o.id.clock+o.length)}),e},Ot=(t,e)=>{const n=t.clients.get(e);if(n===void 0)return 0;const r=n[n.length-1];return r.id.clock+r.length},JC=(t,e)=>{let n=t.clients.get(e.id.client);if(n===void 0)n=[],t.clients.set(e.id.client,n);else{const r=n[n.length-1];if(r.id.clock+r.length!==e.id.clock)throw tr()}n.push(e)},or=(t,e)=>{let n=0,r=t.length-1,o=t[r],i=o.id.clock;if(i===e)return r;let s=Br(e/(i+o.length-1)*r);for(;n<=r;){if(o=t[s],i=o.id.clock,i<=e){if(e<i+o.length)return s;n=s+1}else r=s-1;s=Br((n+r)/2)}throw tr()},vi=(t,e)=>{const n=t.clients.get(e.client);return n[or(n,e.clock)]},Up=(t,e,n)=>{const r=or(e,n),o=e[r];return o.id.clock<n&&o instanceof tt?(e.splice(r+1,0,xE(t,o,n-o.id.clock)),r+1):r},Gt=(t,e)=>{const n=t.doc.store.clients.get(e.client);return n[Up(t,n,e.clock)]},XC=(t,e,n)=>{const r=e.clients.get(n.client),o=or(r,n.clock),i=r[o];return n.clock!==i.id.clock+i.length-1&&i.constructor!==zr&&r.splice(o+1,0,xE(t,i,n.clock-i.id.clock+1)),i},a4=(t,e,n)=>{const r=t.clients.get(e.id.client);r[or(r,e.id.clock)]=n},YC=(t,e,n,r,o)=>{if(r===0)return;const i=n+r;let s=Up(t,e,n),a;do a=e[s++],i<a.id.clock+a.length&&Up(t,e,i),o(a);while(s<e.length&&e[s].id.clock<i)};class l4{constructor(e,n,r){this.doc=e,this.deleteSet=new Bs,this.beforeState=Dc(e.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=n,this.meta=new Map,this.local=r,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}const QC=(t,e)=>e.deleteSet.clients.size===0&&!L5(e.afterState,(n,r)=>e.beforeState.get(r)!==n)?!1:(Np(e.deleteSet),KH(t,e),Oc(t,e.deleteSet),!0),ZC=(t,e,n)=>{const r=e._item;(r===null||r.id.clock<(t.beforeState.get(r.id.client)||0)&&!r.deleted)&&_o(t.changed,e,xo).add(n)},Rc=(t,e)=>{let n=t[e],r=t[e-1],o=e;for(;o>0;n=r,r=t[--o-1]){if(r.deleted===n.deleted&&r.constructor===n.constructor&&r.mergeWith(n)){n instanceof tt&&n.parentSub!==null&&n.parent._map.get(n.parentSub)===n&&n.parent._map.set(n.parentSub,r);continue}break}const i=e-o;return i&&t.splice(e+1-i,i),i},c4=(t,e,n)=>{for(const[r,o]of t.clients.entries()){const i=e.clients.get(r);for(let s=o.length-1;s>=0;s--){const a=o[s],l=a.clock+a.len;for(let c=or(i,a.clock),u=i[c];c<i.length&&u.id.clock<l;u=i[++c]){const d=i[c];if(a.clock+a.len<=d.id.clock)break;d instanceof tt&&d.deleted&&!d.keep&&n(d)&&d.gc(e,!1)}}}},u4=(t,e)=>{t.clients.forEach((n,r)=>{const o=e.clients.get(r);for(let i=n.length-1;i>=0;i--){const s=n[i],a=Cc(o.length-1,1+or(o,s.clock+s.len-1));for(let l=a,c=o[l];l>0&&c.id.clock>=s.clock;c=o[l])l-=1+Rc(o,l)}})},eE=(t,e)=>{if(e<t.length){const n=t[e],r=n.doc,o=r.store,i=n.deleteSet,s=n._mergeStructs;try{Np(i),n.afterState=Dc(n.doc.store),r.emit("beforeObserverCalls",[n,r]);const a=[];n.changed.forEach((l,c)=>a.push(()=>{(c._item===null||!c._item.deleted)&&c._callObserver(n,l)})),a.push(()=>{n.changedParentTypes.forEach((l,c)=>{c._dEH.l.length>0&&(c._item===null||!c._item.deleted)&&(l=l.filter(u=>u.target._item===null||!u.target._item.deleted),l.forEach(u=>{u.currentTarget=c,u._path=null}),l.sort((u,d)=>u.path.length-d.path.length),KC(c._dEH,l,n))})}),a.push(()=>r.emit("afterTransaction",[n,r])),kp(a,[]),n._needFormattingCleanup&&E4(n)}finally{r.gc&&c4(i,o,r.gcFilter),u4(i,o),n.afterState.forEach((u,d)=>{const h=n.beforeState.get(d)||0;if(h!==u){const f=o.clients.get(d),p=hi(or(f,h),1);for(let g=f.length-1;g>=p;)g-=1+Rc(f,g)}});for(let u=s.length-1;u>=0;u--){const{client:d,clock:h}=s[u].id,f=o.clients.get(d),p=or(f,h);p+1<f.length&&Rc(f,p+1)>1||p>0&&Rc(f,p)}if(!n.local&&n.afterState.get(r.clientID)!==n.beforeState.get(r.clientID)&&(FH(Lp,NC,"[yjs] ",FC,HC,"Changed the client-id because another client seems to be using it."),r.clientID=jC()),r.emit("afterTransactionCleanup",[n,r]),r._observers.has("update")){const u=new zH;QC(u,n)&&r.emit("update",[u.toUint8Array(),n.origin,r,n])}if(r._observers.has("updateV2")){const u=new UH;QC(u,n)&&r.emit("updateV2",[u.toUint8Array(),n.origin,r,n])}const{subdocsAdded:a,subdocsLoaded:l,subdocsRemoved:c}=n;(a.size>0||c.size>0||l.size>0)&&(a.forEach(u=>{u.clientID=r.clientID,u.collectionid==null&&(u.collectionid=r.collectionid),r.subdocs.add(u)}),c.forEach(u=>r.subdocs.delete(u)),r.emit("subdocs",[{loaded:l,added:a,removed:c},r,n]),c.forEach(u=>u.destroy())),t.length<=e+1?(r._transactionCleanups=[],r.emit("afterAllTransactions",[r,t])):eE(t,e+1)}}},et=(t,e,n=null,r=!0)=>{const o=t._transactionCleanups;let i=!1,s=null;t._transaction===null&&(i=!0,t._transaction=new l4(t,n,r),o.push(t._transaction),o.length===1&&t.emit("beforeAllTransactions",[t]),t.emit("beforeTransaction",[t._transaction,t]));try{s=e(t._transaction)}finally{if(i){const a=t._transaction===o[0];t._transaction=null,a&&eE(o,0)}}return s};class d4{constructor(e,n){this.insertions=n,this.deletions=e,this.meta=new Map}}const tE=(t,e,n)=>{Vr(t,n.deletions,r=>{r instanceof tt&&e.scope.some(o=>Vs(o,r))&&Qp(r,!1)})},nE=(t,e,n)=>{let r=null;const o=t.doc,i=t.scope;if(et(o,s=>{for(;e.length>0&&t.currStackItem===null;){const a=o.store,l=e.pop(),c=new Set,u=[];let d=!1;Vr(s,l.insertions,h=>{if(h instanceof tt){if(h.redone!==null){let{item:f,diff:p}=Yp(a,h.id);p>0&&(f=Gt(s,Xe(f.id.client,f.id.clock+p))),h=f}!h.deleted&&i.some(f=>Vs(f,h))&&u.push(h)}}),Vr(s,l.deletions,h=>{h instanceof tt&&i.some(f=>Vs(f,h))&&!Oo(l.insertions,h.id)&&c.add(h)}),c.forEach(h=>{d=OE(s,h,c,l.insertions,t.ignoreRemoteMapChanges,t)!==null||d});for(let h=u.length-1;h>=0;h--){const f=u[h];t.deleteFilter(f)&&(f.delete(s),d=!0)}t.currStackItem=d?l:null}s.changed.forEach((a,l)=>{a.has(null)&&l._searchMarker&&(l._searchMarker.length=0)}),r=s},t),t.currStackItem!=null){const s=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:t.currStackItem,type:n,changedParentTypes:s,origin:t},t]),t.currStackItem=null}return t.currStackItem};class rE extends bC{constructor(e,{captureTimeout:n=500,captureTransaction:r=l=>!0,deleteFilter:o=()=>!0,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:s=!1,doc:a=vp(e)?e[0].doc:e.doc}={}){super(),this.scope=[],this.doc=a,this.addToScope(e),this.deleteFilter=o,i.add(this),this.trackedOrigins=i,this.captureTransaction=r,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=s,this.captureTimeout=n,this.afterTransactionHandler=l=>{if(!this.captureTransaction(l)||!this.scope.some(m=>l.changedParentTypes.has(m))||!this.trackedOrigins.has(l.origin)&&(!l.origin||!this.trackedOrigins.has(l.origin.constructor)))return;const c=this.undoing,u=this.redoing,d=c?this.redoStack:this.undoStack;c?this.stopCapturing():u||this.clear(!1,!0);const h=new Bs;l.afterState.forEach((m,y)=>{const C=l.beforeState.get(y)||0,w=m-C;w>0&&Fp(h,y,C,w)});const f=fH();let p=!1;if(this.lastChange>0&&f-this.lastChange<this.captureTimeout&&d.length>0&&!c&&!u){const m=d[d.length-1];m.deletions=xc([m.deletions,l.deleteSet]),m.insertions=xc([m.insertions,h])}else d.push(new d4(l.deleteSet,h)),p=!0;!c&&!u&&(this.lastChange=f),Vr(l,l.deleteSet,m=>{m instanceof tt&&this.scope.some(y=>Vs(y,m))&&Qp(m,!0)});const g=[{stackItem:d[d.length-1],origin:l.origin,type:c?"redo":"undo",changedParentTypes:l.changedParentTypes},this];p?this.emit("stack-item-added",g):this.emit("stack-item-updated",g)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){e=vp(e)?e:[e],e.forEach(n=>{this.scope.every(r=>r!==n)&&(n.doc!==this.doc&&HH("[yjs#509] Not same Y.Doc"),this.scope.push(n))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,n=!0){(e&&this.canUndo()||n&&this.canRedo())&&this.doc.transact(r=>{e&&(this.undoStack.forEach(o=>tE(r,this,o)),this.undoStack=[]),n&&(this.redoStack.forEach(o=>tE(r,this,o)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:n}])})}stopCapturing(){this.lastChange=0}undo(){this.undoing=!0;let e;try{e=nE(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){this.redoing=!0;let e;try{e=nE(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}}const oE="You must not compute changes after the event-handler fired.";class Nc{constructor(e,n){this.target=e,this.currentTarget=e,this.transaction=n,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=f4(this.currentTarget,this.target))}deletes(e){return Oo(this.transaction.deleteSet,e.id)}get keys(){if(this._keys===null){if(this.transaction.doc._transactionCleanups.length===0)throw $r(oE);const e=new Map,n=this.target;this.transaction.changed.get(n).forEach(o=>{if(o!==null){const i=n._map.get(o);let s,a;if(this.adds(i)){let l=i.left;for(;l!==null&&this.adds(l);)l=l.left;if(this.deletes(i))if(l!==null&&this.deletes(l))s="delete",a=yp(l.content.getContent());else return;else l!==null&&this.deletes(l)?(s="update",a=yp(l.content.getContent())):(s="add",a=void 0)}else if(this.deletes(i))s="delete",a=yp(i.content.getContent());else return;e.set(o,{action:s,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(e===null){if(this.transaction.doc._transactionCleanups.length===0)throw $r(oE);const n=this.target,r=xo(),o=xo(),i=[];if(e={added:r,deleted:o,delta:i,keys:this.keys},this.transaction.changed.get(n).has(null)){let a=null;const l=()=>{a&&i.push(a)};for(let c=n._start;c!==null;c=c.right)c.deleted?this.deletes(c)&&!this.adds(c)&&((a===null||a.delete===void 0)&&(l(),a={delete:0}),a.delete+=c.length,o.add(c)):this.adds(c)?((a===null||a.insert===void 0)&&(l(),a={insert:[]}),a.insert=a.insert.concat(c.content.getContent()),r.add(c)):((a===null||a.retain===void 0)&&(l(),a={retain:0}),a.retain+=c.length);a!==null&&a.retain===void 0&&l()}this._changes=e}return e}}const f4=(t,e)=>{const n=[];for(;e._item!==null&&e!==t;){if(e._item.parentSub!==null)n.unshift(e._item.parentSub);else{let r=0,o=e._item.parent._start;for(;o!==e._item&&o!==null;)o.deleted||r++,o=o.right;n.unshift(r)}e=e._item.parent}return n},iE=80;let qp=0;class h4{constructor(e,n){e.marker=!0,this.p=e,this.index=n,this.timestamp=qp++}}const p4=t=>{t.timestamp=qp++},sE=(t,e,n)=>{t.p.marker=!1,t.p=e,e.marker=!0,t.index=n,t.timestamp=qp++},g4=(t,e,n)=>{if(t.length>=iE){const r=t.reduce((o,i)=>o.timestamp<i.timestamp?o:i);return sE(r,e,n),r}else{const r=new h4(e,n);return t.push(r),r}},Fc=(t,e)=>{if(t._start===null||e===0||t._searchMarker===null)return null;const n=t._searchMarker.length===0?null:t._searchMarker.reduce((i,s)=>Sc(e-i.index)<Sc(e-s.index)?i:s);let r=t._start,o=0;for(n!==null&&(r=n.p,o=n.index,p4(n));r.right!==null&&o<e;){if(!r.deleted&&r.countable){if(e<o+r.length)break;o+=r.length}r=r.right}for(;r.left!==null&&o>e;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);for(;r.left!==null&&r.left.id.client===r.id.client&&r.left.id.clock+r.left.length===r.id.clock;)r=r.left,!r.deleted&&r.countable&&(o-=r.length);return n!==null&&Sc(n.index-o)<r.parent.length/iE?(sE(n,r,o),n):g4(t._searchMarker,r,o)},js=(t,e,n)=>{for(let r=t.length-1;r>=0;r--){const o=t[r];if(n>0){let i=o.p;for(i.marker=!1;i&&(i.deleted||!i.countable);)i=i.left,i&&!i.deleted&&i.countable&&(o.index-=i.length);if(i===null||i.marker===!0){t.splice(r,1);continue}o.p=i,i.marker=!0}(e<o.index||n>0&&e===o.index)&&(o.index=hi(e,o.index+n))}},Hc=(t,e,n)=>{const r=t,o=e.changedParentTypes;for(;_o(o,t,()=>[]).push(n),t._item!==null;)t=t._item.parent;KC(r._eH,n,e)};class Tt{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=UC(),this._dEH=UC(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,n){this.doc=e,this._item=n}_copy(){throw vn()}clone(){throw vn()}_write(e){}get _first(){let e=this._start;for(;e!==null&&e.deleted;)e=e.right;return e}_callObserver(e,n){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){qC(this._eH,e)}observeDeep(e){qC(this._dEH,e)}unobserve(e){WC(this._eH,e)}unobserveDeep(e){WC(this._dEH,e)}toJSON(){}}const aE=(t,e,n)=>{e<0&&(e=t._length+e),n<0&&(n=t._length+n);let r=n-e;const o=[];let i=t._start;for(;i!==null&&r>0;){if(i.countable&&!i.deleted){const s=i.content.getContent();if(s.length<=e)e-=s.length;else{for(let a=e;a<s.length&&r>0;a++)o.push(s[a]),r--;e=0}}i=i.right}return o},lE=t=>{const e=[];let n=t._start;for(;n!==null;){if(n.countable&&!n.deleted){const r=n.content.getContent();for(let o=0;o<r.length;o++)e.push(r[o])}n=n.right}return e},cE=(t,e)=>{const n=[];let r=t._start;for(;r!==null;){if(r.countable&&To(r,e)){const o=r.content.getContent();for(let i=0;i<o.length;i++)n.push(o[i])}r=r.right}return n},zs=(t,e)=>{let n=0,r=t._start;for(;r!==null;){if(r.countable&&!r.deleted){const o=r.content.getContent();for(let i=0;i<o.length;i++)e(o[i],n++,t)}r=r.right}},uE=(t,e)=>{const n=[];return zs(t,(r,o)=>{n.push(e(r,o,t))}),n},m4=t=>{let e=t._start,n=null,r=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){for(;e!==null&&e.deleted;)e=e.right;if(e===null)return{done:!0,value:void 0};n=e.content.getContent(),r=0,e=e.right}const o=n[r++];return n.length<=r&&(n=null),{done:!1,value:o}}}},dE=(t,e)=>{const n=Fc(t,e);let r=t._start;for(n!==null&&(r=n.p,e-=n.index);r!==null;r=r.right)if(!r.deleted&&r.countable){if(e<r.length)return r.content.getContent()[e];e-=r.length}},Bc=(t,e,n,r)=>{let o=n;const i=t.doc,s=i.clientID,a=i.store,l=n===null?e._start:n.right;let c=[];const u=()=>{c.length>0&&(o=new tt(Xe(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Ei(c)),o.integrate(t,0),c=[])};r.forEach(d=>{if(d===null)c.push(d);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:c.push(d);break;default:switch(u(),d.constructor){case Uint8Array:case ArrayBuffer:o=new tt(Xe(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new zc(new Uint8Array(d))),o.integrate(t,0);break;case yi:o=new tt(Xe(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new qc(d)),o.integrate(t,0);break;default:if(d instanceof Tt)o=new tt(Xe(s,Ot(a,s)),o,o&&o.lastId,l,l&&l.id,e,null,new Bn(d)),o.integrate(t,0);else throw new Error("Unexpected content type in insert operation")}}}),u()},fE=()=>$r("Length exceeded!"),hE=(t,e,n,r)=>{if(n>e._length)throw fE();if(n===0)return e._searchMarker&&js(e._searchMarker,n,r.length),Bc(t,e,null,r);const o=n,i=Fc(e,n);let s=e._start;for(i!==null&&(s=i.p,n-=i.index,n===0&&(s=s.prev,n+=s&&s.countable&&!s.deleted?s.length:0));s!==null;s=s.right)if(!s.deleted&&s.countable){if(n<=s.length){n<s.length&&Gt(t,Xe(s.id.client,s.id.clock+n));break}n-=s.length}return e._searchMarker&&js(e._searchMarker,o,r.length),Bc(t,e,s,r)},y4=(t,e,n)=>{let o=(e._searchMarker||[]).reduce((i,s)=>s.index>i.index?s:i,{index:0,p:e._start}).p;if(o)for(;o.right;)o=o.right;return Bc(t,e,o,n)},pE=(t,e,n,r)=>{if(r===0)return;const o=n,i=r,s=Fc(e,n);let a=e._start;for(s!==null&&(a=s.p,n-=s.index);a!==null&&n>0;a=a.right)!a.deleted&&a.countable&&(n<a.length&&Gt(t,Xe(a.id.client,a.id.clock+n)),n-=a.length);for(;r>0&&a!==null;)a.deleted||(r<a.length&&Gt(t,Xe(a.id.client,a.id.clock+r)),a.delete(t),r-=a.length),a=a.right;if(r>0)throw fE();e._searchMarker&&js(e._searchMarker,o,-i+r)},$c=(t,e,n)=>{const r=e._map.get(n);r!==void 0&&r.delete(t)},Wp=(t,e,n,r)=>{const o=e._map.get(n)||null,i=t.doc,s=i.clientID;let a;if(r==null)a=new Ei([r]);else switch(r.constructor){case Number:case Object:case Boolean:case Array:case String:a=new Ei([r]);break;case Uint8Array:a=new zc(r);break;case yi:a=new qc(r);break;default:if(r instanceof Tt)a=new Bn(r);else throw new Error("Unexpected content type")}new tt(Xe(s,Ot(i.store,s)),o,o&&o.lastId,null,null,e,n,a).integrate(t,0)},Kp=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted?n.content.getContent()[n.length-1]:void 0},gE=t=>{const e={};return t._map.forEach((n,r)=>{n.deleted||(e[r]=n.content.getContent()[n.length-1])}),e},mE=(t,e)=>{const n=t._map.get(e);return n!==void 0&&!n.deleted},v4=(t,e)=>{const n={};return t._map.forEach((r,o)=>{let i=r;for(;i!==null&&(!e.sv.has(i.id.client)||i.id.clock>=(e.sv.get(i.id.client)||0));)i=i.left;i!==null&&To(i,e)&&(n[o]=i.content.getContent()[i.length-1])}),n},Vc=t=>BH(t.entries(),e=>!e[1].deleted);class b4 extends Nc{constructor(e,n){super(e,n),this._transaction=n}}class ko extends Tt{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){const n=new ko;return n.push(e),n}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new ko}clone(){const e=new ko;return e.insert(0,this.toArray().map(n=>n instanceof Tt?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(e,n){super._callObserver(e,n),Hc(this,e,new b4(this,e))}insert(e,n){this.doc!==null?et(this.doc,r=>{hE(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}push(e){this.doc!==null?et(this.doc,n=>{y4(n,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,n=1){this.doc!==null?et(this.doc,r=>{pE(r,this,e,n)}):this._prelimContent.splice(e,n)}get(e){return dE(this,e)}toArray(){return lE(this)}slice(e=0,n=this.length){return aE(this,e,n)}toJSON(){return this.map(e=>e instanceof Tt?e.toJSON():e)}map(e){return uE(this,e)}forEach(e){zs(this,e)}[Symbol.iterator](){return m4(this)}_write(e){e.writeTypeRef(T4)}}class w4 extends Nc{constructor(e,n,r){super(e,n),this.keysChanged=r}}class Us extends Tt{constructor(e){super(),this._prelimContent=null,e===void 0?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,n){super._integrate(e,n),this._prelimContent.forEach((r,o)=>{this.set(o,r)}),this._prelimContent=null}_copy(){return new Us}clone(){const e=new Us;return this.forEach((n,r)=>{e.set(r,n instanceof Tt?n.clone():n)}),e}_callObserver(e,n){Hc(this,e,new w4(this,e,n))}toJSON(){const e={};return this._map.forEach((n,r)=>{if(!n.deleted){const o=n.content.getContent()[n.length-1];e[r]=o instanceof Tt?o.toJSON():o}}),e}get size(){return[...Vc(this._map)].length}keys(){return Dp(Vc(this._map),e=>e[0])}values(){return Dp(Vc(this._map),e=>e[1].content.getContent()[e[1].length-1])}entries(){return Dp(Vc(this._map),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this._map.forEach((n,r)=>{n.deleted||e(n.content.getContent()[n.length-1],r,this)})}[Symbol.iterator](){return this.entries()}delete(e){this.doc!==null?et(this.doc,n=>{$c(n,this,e)}):this._prelimContent.delete(e)}set(e,n){return this.doc!==null?et(this.doc,r=>{Wp(r,this,e,n)}):this._prelimContent.set(e,n),n}get(e){return Kp(this,e)}has(e){return mE(this,e)}clear(){this.doc!==null?et(this.doc,e=>{this.forEach(function(n,r,o){$c(e,o,r)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(k4)}}const jr=(t,e)=>t===e||typeof t=="object"&&typeof e=="object"&&t&&e&&SH(t,e);class Gp{constructor(e,n,r,o){this.left=e,this.right=n,this.index=r,this.currentAttributes=o}forward(){switch(this.right===null&&tr(),this.right.content.constructor){case yt:this.right.deleted||bi(this.currentAttributes,this.right.content);break;default:this.right.deleted||(this.index+=this.right.length);break}this.left=this.right,this.right=this.right.right}}const yE=(t,e,n)=>{for(;e.right!==null&&n>0;){switch(e.right.content.constructor){case yt:e.right.deleted||bi(e.currentAttributes,e.right.content);break;default:e.right.deleted||(n<e.right.length&&Gt(t,Xe(e.right.id.client,e.right.id.clock+n)),e.index+=e.right.length,n-=e.right.length);break}e.left=e.right,e.right=e.right.right}return e},jc=(t,e,n,r)=>{const o=new Map,i=r?Fc(e,n):null;if(i){const s=new Gp(i.p.left,i.p,i.index,o);return yE(t,s,n-i.index)}else{const s=new Gp(null,e._start,0,o);return yE(t,s,n)}},vE=(t,e,n,r)=>{for(;n.right!==null&&(n.right.deleted===!0||n.right.content.constructor===yt&&jr(r.get(n.right.content.key),n.right.content.value));)n.right.deleted||r.delete(n.right.content.key),n.forward();const o=t.doc,i=o.clientID;r.forEach((s,a)=>{const l=n.left,c=n.right,u=new tt(Xe(i,Ot(o.store,i)),l,l&&l.lastId,c,c&&c.id,e,null,new yt(a,s));u.integrate(t,0),n.right=u,n.forward()})},bi=(t,e)=>{const{key:n,value:r}=e;r===null?t.delete(n):t.set(n,r)},bE=(t,e)=>{for(;t.right!==null;){if(!(t.right.deleted||t.right.content.constructor===yt&&jr(e[t.right.content.key]??null,t.right.content.value)))break;t.forward()}},wE=(t,e,n,r)=>{const o=t.doc,i=o.clientID,s=new Map;for(const a in r){const l=r[a],c=n.currentAttributes.get(a)??null;if(!jr(c,l)){s.set(a,c);const{left:u,right:d}=n;n.right=new tt(Xe(i,Ot(o.store,i)),u,u&&u.lastId,d,d&&d.id,e,null,new yt(a,l)),n.right.integrate(t,0),n.forward()}}return s},Jp=(t,e,n,r,o)=>{n.currentAttributes.forEach((h,f)=>{o[f]===void 0&&(o[f]=null)});const i=t.doc,s=i.clientID;bE(n,o);const a=wE(t,e,n,o),l=r.constructor===String?new Hn(r):r instanceof Tt?new Bn(r):new Ci(r);let{left:c,right:u,index:d}=n;e._searchMarker&&js(e._searchMarker,n.index,l.getLength()),u=new tt(Xe(s,Ot(i.store,s)),c,c&&c.lastId,u,u&&u.id,e,null,l),u.integrate(t,0),n.right=u,n.index=d,n.forward(),vE(t,e,n,a)},SE=(t,e,n,r,o)=>{const i=t.doc,s=i.clientID;bE(n,o);const a=wE(t,e,n,o);e:for(;n.right!==null&&(r>0||a.size>0&&(n.right.deleted||n.right.content.constructor===yt));){if(!n.right.deleted)switch(n.right.content.constructor){case yt:{const{key:l,value:c}=n.right.content,u=o[l];if(u!==void 0){if(jr(u,c))a.delete(l);else{if(r===0)break e;a.set(l,c)}n.right.delete(t)}else n.currentAttributes.set(l,c);break}default:r<n.right.length&&Gt(t,Xe(n.right.id.client,n.right.id.clock+r)),r-=n.right.length;break}n.forward()}if(r>0){let l="";for(;r>0;r--)l+=`
|
210
|
+
`;n.right=new tt(Xe(s,Ot(i.store,s)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Hn(l)),n.right.integrate(t,0),n.forward()}vE(t,e,n,a)},CE=(t,e,n,r,o)=>{let i=e;const s=Rn();for(;i&&(!i.countable||i.deleted);){if(!i.deleted&&i.content.constructor===yt){const c=i.content;s.set(c.key,c)}i=i.right}let a=0,l=!1;for(;e!==i;){if(n===e&&(l=!0),!e.deleted){const c=e.content;switch(c.constructor){case yt:{const{key:u,value:d}=c,h=r.get(u)??null;(s.get(u)!==c||h===d)&&(e.delete(t),a++,!l&&(o.get(u)??null)===d&&h!==d&&(h===null?o.delete(u):o.set(u,h))),!l&&!e.deleted&&bi(o,c);break}}}e=e.right}return a},S4=(t,e)=>{for(;e&&e.right&&(e.right.deleted||!e.right.countable);)e=e.right;const n=new Set;for(;e&&(e.deleted||!e.countable);){if(!e.deleted&&e.content.constructor===yt){const r=e.content.key;n.has(r)?e.delete(t):n.add(r)}e=e.left}},C4=t=>{let e=0;return et(t.doc,n=>{let r=t._start,o=t._start,i=Rn();const s=mp(i);for(;o;){if(o.deleted===!1)switch(o.content.constructor){case yt:bi(s,o.content);break;default:e+=CE(n,r,o,i,s),i=mp(s),r=o;break}o=o.right}}),e},E4=t=>{const e=new Set,n=t.doc;for(const[r,o]of t.afterState.entries()){const i=t.beforeState.get(r)||0;o!==i&&YC(t,n.store.clients.get(r),i,o,s=>{!s.deleted&&s.content.constructor===yt&&s.constructor!==zr&&e.add(s.parent)})}et(n,r=>{Vr(t,t.deleteSet,o=>{if(o instanceof zr||!o.parent._hasFormatting||e.has(o.parent))return;const i=o.parent;o.content.constructor===yt?e.add(i):S4(r,o)});for(const o of e)C4(o)})},EE=(t,e,n)=>{const r=n,o=mp(e.currentAttributes),i=e.right;for(;n>0&&e.right!==null;){if(e.right.deleted===!1)switch(e.right.content.constructor){case Bn:case Ci:case Hn:n<e.right.length&&Gt(t,Xe(e.right.id.client,e.right.id.clock+n)),n-=e.right.length,e.right.delete(t);break}e.forward()}i&&CE(t,i,e.right,o,e.currentAttributes);const s=(e.left||e.right).parent;return s._searchMarker&&js(s._searchMarker,e.index,-r+n),e};class _4 extends Nc{constructor(e,n,r){super(e,n),this.childListChanged=!1,this.keysChanged=new Set,r.forEach(o=>{o===null?this.childListChanged=!0:this.keysChanged.add(o)})}get changes(){if(this._changes===null){const e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(this._delta===null){const e=this.target.doc,n=[];et(e,r=>{const o=new Map,i=new Map;let s=this.target._start,a=null;const l={};let c="",u=0,d=0;const h=()=>{if(a!==null){let f=null;switch(a){case"delete":d>0&&(f={delete:d}),d=0;break;case"insert":(typeof c=="object"||c.length>0)&&(f={insert:c},o.size>0&&(f.attributes={},o.forEach((p,g)=>{p!==null&&(f.attributes[g]=p)}))),c="";break;case"retain":u>0&&(f={retain:u},vH(l)||(f.attributes=mH({},l))),u=0;break}f&&n.push(f),a=null}};for(;s!==null;){switch(s.content.constructor){case Bn:case Ci:this.adds(s)?this.deletes(s)||(h(),a="insert",c=s.content.getContent()[0],h()):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=1):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=1);break;case Hn:this.adds(s)?this.deletes(s)||(a!=="insert"&&(h(),a="insert"),c+=s.content.str):this.deletes(s)?(a!=="delete"&&(h(),a="delete"),d+=s.length):s.deleted||(a!=="retain"&&(h(),a="retain"),u+=s.length);break;case yt:{const{key:f,value:p}=s.content;if(this.adds(s)){if(!this.deletes(s)){const g=o.get(f)??null;jr(g,p)?p!==null&&s.delete(r):(a==="retain"&&h(),jr(p,i.get(f)??null)?delete l[f]:l[f]=p)}}else if(this.deletes(s)){i.set(f,p);const g=o.get(f)??null;jr(g,p)||(a==="retain"&&h(),l[f]=g)}else if(!s.deleted){i.set(f,p);const g=l[f];g!==void 0&&(jr(g,p)?g!==null&&s.delete(r):(a==="retain"&&h(),p===null?delete l[f]:l[f]=p))}s.deleted||(a==="insert"&&h(),bi(o,s.content));break}}s=s.right}for(h();n.length>0;){const f=n[n.length-1];if(f.retain!==void 0&&f.attributes===void 0)n.pop();else break}}),this._delta=n}return this._delta}}class wi extends Tt{constructor(e){super(),this._pending=e!==void 0?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this._length}_integrate(e,n){super._integrate(e,n);try{this._pending.forEach(r=>r())}catch(r){console.error(r)}this._pending=null}_copy(){return new wi}clone(){const e=new wi;return e.applyDelta(this.toDelta()),e}_callObserver(e,n){super._callObserver(e,n);const r=new _4(this,e,n);Hc(this,e,r),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){let e="",n=this._start;for(;n!==null;)!n.deleted&&n.countable&&n.content.constructor===Hn&&(e+=n.content.str),n=n.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:n=!0}={}){this.doc!==null?et(this.doc,r=>{const o=new Gp(null,this._start,0,new Map);for(let i=0;i<e.length;i++){const s=e[i];if(s.insert!==void 0){const a=!n&&typeof s.insert=="string"&&i===e.length-1&&o.right===null&&s.insert.slice(-1)===`
|
211
|
+
`?s.insert.slice(0,-1):s.insert;(typeof a!="string"||a.length>0)&&Jp(r,this,o,a,s.attributes||{})}else s.retain!==void 0?SE(r,this,o,s.retain,s.attributes||{}):s.delete!==void 0&&EE(r,o,s.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,n,r){const o=[],i=new Map,s=this.doc;let a="",l=this._start;function c(){if(a.length>0){const d={};let h=!1;i.forEach((p,g)=>{h=!0,d[g]=p});const f={insert:a};h&&(f.attributes=d),o.push(f),a=""}}const u=()=>{for(;l!==null;){if(To(l,e)||n!==void 0&&To(l,n))switch(l.content.constructor){case Hn:{const d=i.get("ychange");e!==void 0&&!To(l,e)?(d===void 0||d.user!==l.id.client||d.type!=="removed")&&(c(),i.set("ychange",r?r("removed",l.id):{type:"removed"})):n!==void 0&&!To(l,n)?(d===void 0||d.user!==l.id.client||d.type!=="added")&&(c(),i.set("ychange",r?r("added",l.id):{type:"added"})):d!==void 0&&(c(),i.delete("ychange")),a+=l.content.str;break}case Bn:case Ci:{c();const d={insert:l.content.getContent()[0]};if(i.size>0){const h={};d.attributes=h,i.forEach((f,p)=>{h[p]=f})}o.push(d);break}case yt:To(l,e)&&(c(),bi(i,l.content));break}l=l.right}c()};return e||n?et(s,d=>{e&&zp(d,e),n&&zp(d,n),u()},"cleanup"):u(),o}insert(e,n,r){if(n.length<=0)return;const o=this.doc;o!==null?et(o,i=>{const s=jc(i,this,e,!r);r||(r={},s.currentAttributes.forEach((a,l)=>{r[l]=a})),Jp(i,this,s,n,r)}):this._pending.push(()=>this.insert(e,n,r))}insertEmbed(e,n,r){const o=this.doc;o!==null?et(o,i=>{const s=jc(i,this,e,!r);Jp(i,this,s,n,r||{})}):this._pending.push(()=>this.insertEmbed(e,n,r||{}))}delete(e,n){if(n===0)return;const r=this.doc;r!==null?et(r,o=>{EE(o,jc(o,this,e,!0),n)}):this._pending.push(()=>this.delete(e,n))}format(e,n,r){if(n===0)return;const o=this.doc;o!==null?et(o,i=>{const s=jc(i,this,e,!1);s.right!==null&&SE(i,this,s,n,r)}):this._pending.push(()=>this.format(e,n,r))}removeAttribute(e){this.doc!==null?et(this.doc,n=>{$c(n,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,n){this.doc!==null?et(this.doc,r=>{Wp(r,this,e,n)}):this._pending.push(()=>this.setAttribute(e,n))}getAttribute(e){return Kp(this,e)}getAttributes(){return gE(this)}_write(e){e.writeTypeRef(M4)}}class Xp{constructor(e,n=()=>!0){this._filter=n,this._root=e,this._currentNode=e._start,this._firstCall=!0}[Symbol.iterator](){return this}next(){let e=this._currentNode,n=e&&e.content&&e.content.type;if(e!==null&&(!this._firstCall||e.deleted||!this._filter(n)))do if(n=e.content.type,!e.deleted&&(n.constructor===Jt||n.constructor===Si)&&n._start!==null)e=n._start;else for(;e!==null;)if(e.right!==null){e=e.right;break}else e.parent===this._root?e=null:e=e.parent._item;while(e!==null&&(e.deleted||!this._filter(e.content.type)));return this._firstCall=!1,e===null?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class Si extends Tt{constructor(){super(),this._prelimContent=[]}get firstChild(){const e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,n){super._integrate(e,n),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new Si}clone(){const e=new Si;return e.insert(0,this.toArray().map(n=>n instanceof Tt?n.clone():n)),e}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(e){return new Xp(this,e)}querySelector(e){e=e.toUpperCase();const r=new Xp(this,o=>o.nodeName&&o.nodeName.toUpperCase()===e).next();return r.done?null:r.value}querySelectorAll(e){return e=e.toUpperCase(),Ao(new Xp(this,n=>n.nodeName&&n.nodeName.toUpperCase()===e))}_callObserver(e,n){Hc(this,e,new x4(this,n,e))}toString(){return uE(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,n={},r){const o=e.createDocumentFragment();return r!==void 0&&r._createAssociation(o,this),zs(this,i=>{o.insertBefore(i.toDOM(e,n,r),null)}),o}insert(e,n){this.doc!==null?et(this.doc,r=>{hE(r,this,e,n)}):this._prelimContent.splice(e,0,...n)}insertAfter(e,n){if(this.doc!==null)et(this.doc,r=>{const o=e&&e instanceof Tt?e._item:e;Bc(r,this,o,n)});else{const r=this._prelimContent,o=e===null?0:r.findIndex(i=>i===e)+1;if(o===0&&e!==null)throw $r("Reference item not found");r.splice(o,0,...n)}}delete(e,n=1){this.doc!==null?et(this.doc,r=>{pE(r,this,e,n)}):this._prelimContent.splice(e,n)}toArray(){return lE(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return dE(this,e)}slice(e=0,n=this.length){return aE(this,e,n)}forEach(e){zs(this,e)}_write(e){e.writeTypeRef(I4)}}class Jt extends Si{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,n){super._integrate(e,n),this._prelimAttrs.forEach((r,o)=>{this.setAttribute(o,r)}),this._prelimAttrs=null}_copy(){return new Jt(this.nodeName)}clone(){const e=new Jt(this.nodeName),n=this.getAttributes();return yH(n,(r,o)=>{typeof r=="string"&&e.setAttribute(o,r)}),e.insert(0,this.toArray().map(r=>r instanceof Tt?r.clone():r)),e}toString(){const e=this.getAttributes(),n=[],r=[];for(const a in e)r.push(a);r.sort();const o=r.length;for(let a=0;a<o;a++){const l=r[a];n.push(l+'="'+e[l]+'"')}const i=this.nodeName.toLocaleLowerCase(),s=n.length>0?" "+n.join(" "):"";return`<${i}${s}>${super.toString()}</${i}>`}removeAttribute(e){this.doc!==null?et(this.doc,n=>{$c(n,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,n){this.doc!==null?et(this.doc,r=>{Wp(r,this,e,n)}):this._prelimAttrs.set(e,n)}getAttribute(e){return Kp(this,e)}hasAttribute(e){return mE(this,e)}getAttributes(e){return e?v4(this,e):gE(this)}toDOM(e=document,n={},r){const o=e.createElement(this.nodeName),i=this.getAttributes();for(const s in i){const a=i[s];typeof a=="string"&&o.setAttribute(s,a)}return zs(this,s=>{o.appendChild(s.toDOM(e,n,r))}),r!==void 0&&r._createAssociation(o,this),o}_write(e){e.writeTypeRef(P4),e.writeKey(this.nodeName)}}class x4 extends Nc{constructor(e,n,r){super(e,r),this.childListChanged=!1,this.attributesChanged=new Set,n.forEach(o=>{o===null?this.childListChanged=!0:this.attributesChanged.add(o)})}}class gn extends wi{get nextSibling(){const e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){const e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new gn}clone(){const e=new gn;return e.applyDelta(this.toDelta()),e}toDOM(e=document,n,r){const o=e.createTextNode(this.toString());return r!==void 0&&r._createAssociation(o,this),o}toString(){return this.toDelta().map(e=>{const n=[];for(const o in e.attributes){const i=[];for(const s in e.attributes[o])i.push({key:s,value:e.attributes[o][s]});i.sort((s,a)=>s.key<a.key?-1:1),n.push({nodeName:o,attrs:i})}n.sort((o,i)=>o.nodeName<i.nodeName?-1:1);let r="";for(let o=0;o<n.length;o++){const i=n[o];r+=`<${i.nodeName}`;for(let s=0;s<i.attrs.length;s++){const a=i.attrs[s];r+=` ${a.key}="${a.value}"`}r+=">"}r+=e.insert;for(let o=n.length-1;o>=0;o--)r+=`</${n[o].nodeName}>`;return r}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(L4)}}class _E{constructor(e,n){this.id=e,this.length=n}get deleted(){throw vn()}mergeWith(e){return!1}write(e,n,r){throw vn()}integrate(e,n){throw vn()}}const A4=0;class zr extends _E{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor!==e.constructor?!1:(this.length+=e.length,!0)}integrate(e,n){n>0&&(this.id.clock+=n,this.length-=n),JC(e.doc.store,this)}write(e,n){e.writeInfo(A4),e.writeLen(this.length-n)}getMissing(e,n){return null}}class zc{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new zc(this.content)}splice(e){throw vn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeBuf(this.content)}getRef(){return 3}}class Uc{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new Uc(this.len)}splice(e){const n=new Uc(this.len-e);return this.len=e,n}mergeWith(e){return this.len+=e.len,!0}integrate(e,n){Fp(e.deleteSet,n.id.client,n.id.clock,this.len),n.markDeleted()}delete(e){}gc(e){}write(e,n){e.writeLen(this.len-n)}getRef(){return 1}}const O4=(t,e)=>new yi({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||!1});class qc{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const n={};this.opts=n,e.gc||(n.gc=!1),e.autoLoad&&(n.autoLoad=!0),e.meta!==null&&(n.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new qc(O4(this.doc.guid,this.opts))}splice(e){throw vn()}mergeWith(e){return!1}integrate(e,n){this.doc._item=n,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,n){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class Ci{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new Ci(this.embed)}splice(e){throw vn()}mergeWith(e){return!1}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeJSON(this.embed)}getRef(){return 5}}class yt{constructor(e,n){this.key=e,this.value=n}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new yt(this.key,this.value)}splice(e){throw vn()}mergeWith(e){return!1}integrate(e,n){const r=n.parent;r._searchMarker=null,r._hasFormatting=!0}delete(e){}gc(e){}write(e,n){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class Ei{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new Ei(this.arr)}splice(e){const n=new Ei(this.arr.slice(e));return this.arr=this.arr.slice(0,e),n}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){const r=this.arr.length;e.writeLen(r-n);for(let o=n;o<r;o++){const i=this.arr[o];e.writeAny(i)}}getRef(){return 8}}class Hn{constructor(e){this.str=e}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new Hn(this.str)}splice(e){const n=new Hn(this.str.slice(e));this.str=this.str.slice(0,e);const r=this.str.charCodeAt(e-1);return r>=55296&&r<=56319&&(this.str=this.str.slice(0,e-1)+"�",n.str="�"+n.str.slice(1)),n}mergeWith(e){return this.str+=e.str,!0}integrate(e,n){}delete(e){}gc(e){}write(e,n){e.writeString(n===0?this.str:this.str.slice(n))}getRef(){return 4}}const T4=0,k4=1,M4=2,P4=3,I4=4,L4=6;class Bn{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new Bn(this.type._copy())}splice(e){throw vn()}mergeWith(e){return!1}integrate(e,n){this.type._integrate(e.doc,n)}delete(e){let n=this.type._start;for(;n!==null;)n.deleted?n.id.clock<(e.beforeState.get(n.id.client)||0)&&e._mergeStructs.push(n):n.delete(e),n=n.right;this.type._map.forEach(r=>{r.deleted?r.id.clock<(e.beforeState.get(r.id.client)||0)&&e._mergeStructs.push(r):r.delete(e)}),e.changed.delete(this.type)}gc(e){let n=this.type._start;for(;n!==null;)n.gc(e,!0),n=n.right;this.type._start=null,this.type._map.forEach(r=>{for(;r!==null;)r.gc(e,!0),r=r.left}),this.type._map=new Map}write(e,n){this.type._write(e)}getRef(){return 7}}const Yp=(t,e)=>{let n=e,r=0,o;do r>0&&(n=Xe(n.client,n.clock+r)),o=vi(t,n),r=n.clock-o.id.clock,n=o.redone;while(n!==null&&o instanceof tt);return{item:o,diff:r}},Qp=(t,e)=>{for(;t!==null&&t.keep!==e;)t.keep=e,t=t.parent._item},xE=(t,e,n)=>{const{client:r,clock:o}=e.id,i=new tt(Xe(r,o+n),e,Xe(r,o+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));return e.deleted&&i.markDeleted(),e.keep&&(i.keep=!0),e.redone!==null&&(i.redone=Xe(e.redone.client,e.redone.clock+n)),e.right=i,i.right!==null&&(i.right.left=i),t._mergeStructs.push(i),i.parentSub!==null&&i.right===null&&i.parent._map.set(i.parentSub,i),e.length=n,i},AE=(t,e)=>R5(t,n=>Oo(n.deletions,e)),OE=(t,e,n,r,o,i)=>{const s=t.doc,a=s.store,l=s.clientID,c=e.redone;if(c!==null)return Gt(t,c);let u=e.parent._item,d=null,h;if(u!==null&&u.deleted===!0){if(u.redone===null&&(!n.has(u)||OE(t,u,n,r,o,i)===null))return null;for(;u.redone!==null;)u=Gt(t,u.redone)}const f=u===null?e.parent:u.content.type;if(e.parentSub===null){for(d=e.left,h=e;d!==null;){let y=d;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Gt(t,y.redone);if(y!==null&&y.parent._item===u){d=y;break}d=d.left}for(;h!==null;){let y=h;for(;y!==null&&y.parent._item!==u;)y=y.redone===null?null:Gt(t,y.redone);if(y!==null&&y.parent._item===u){h=y;break}h=h.right}}else if(h=null,e.right&&!o){for(d=e;d!==null&&d.right!==null&&(d.right.redone||Oo(r,d.right.id)||AE(i.undoStack,d.right.id)||AE(i.redoStack,d.right.id));)for(d=d.right;d.redone;)d=Gt(t,d.redone);if(d&&d.right!==null)return null}else d=f._map.get(e.parentSub)||null;const p=Ot(a,l),g=Xe(l,p),m=new tt(g,d,d&&d.lastId,h,h&&h.id,f,e.parentSub,e.content.copy());return e.redone=g,Qp(m,!0),m.integrate(t,0),m};class tt extends _E{constructor(e,n,r,o,i,s,a,l){super(e,l.getLength()),this.origin=r,this.left=n,this.right=o,this.rightOrigin=i,this.parent=s,this.parentSub=a,this.redone=null,this.content=l,this.info=this.content.isCountable()?SC:0}set marker(e){(this.info&wp)>0!==e&&(this.info^=wp)}get marker(){return(this.info&wp)>0}get keep(){return(this.info&wC)>0}set keep(e){this.keep!==e&&(this.info^=wC)}get countable(){return(this.info&SC)>0}get deleted(){return(this.info&bp)>0}set deleted(e){this.deleted!==e&&(this.info^=bp)}markDeleted(){this.info|=bp}getMissing(e,n){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Ot(n,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Ot(n,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===kc&&this.id.client!==this.parent.client&&this.parent.clock>=Ot(n,this.parent.client))return this.parent.client;if(this.origin&&(this.left=XC(e,n,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=Gt(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===zr||this.right&&this.right.constructor===zr)this.parent=null;else if(!this.parent)this.left&&this.left.constructor===tt&&(this.parent=this.left.parent,this.parentSub=this.left.parentSub),this.right&&this.right.constructor===tt&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);else if(this.parent.constructor===kc){const r=vi(n,this.parent);r.constructor===zr?this.parent=null:this.parent=r.content.type}return null}integrate(e,n){if(n>0&&(this.id.clock+=n,this.left=XC(e,e.doc.store,Xe(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(n),this.length-=n),this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let r=this.left,o;if(r!==null)o=r.right;else if(this.parentSub!==null)for(o=this.parent._map.get(this.parentSub)||null;o!==null&&o.left!==null;)o=o.left;else o=this.parent._start;const i=new Set,s=new Set;for(;o!==null&&o!==this.right;){if(s.add(o),i.add(o),Mc(this.origin,o.origin)){if(o.id.client<this.id.client)r=o,i.clear();else if(Mc(this.rightOrigin,o.rightOrigin))break}else if(o.origin!==null&&s.has(vi(e.doc.store,o.origin)))i.has(vi(e.doc.store,o.origin))||(r=o,i.clear());else break;o=o.right}this.left=r}if(this.left!==null){const r=this.left.right;this.right=r,this.left.right=this}else{let r;if(this.parentSub!==null)for(r=this.parent._map.get(this.parentSub)||null;r!==null&&r.left!==null;)r=r.left;else r=this.parent._start,this.parent._start=this;this.right=r}this.right!==null?this.right.left=this:this.parentSub!==null&&(this.parent._map.set(this.parentSub,this),this.left!==null&&this.left.delete(e)),this.parentSub===null&&this.countable&&!this.deleted&&(this.parent._length+=this.length),JC(e.doc.store,this),this.content.integrate(e,this),ZC(e,this.parent,this.parentSub),(this.parent._item!==null&&this.parent._item.deleted||this.parentSub!==null&&this.right!==null)&&this.delete(e)}else new zr(this.id,this.length).integrate(e,0)}get next(){let e=this.right;for(;e!==null&&e.deleted;)e=e.right;return e}get prev(){let e=this.left;for(;e!==null&&e.deleted;)e=e.left;return e}get lastId(){return this.length===1?this.id:Xe(this.id.client,this.id.clock+this.length-1)}mergeWith(e){if(this.constructor===e.constructor&&Mc(e.origin,this.lastId)&&this.right===e&&Mc(this.rightOrigin,e.rightOrigin)&&this.id.client===e.id.client&&this.id.clock+this.length===e.id.clock&&this.deleted===e.deleted&&this.redone===null&&e.redone===null&&this.content.constructor===e.content.constructor&&this.content.mergeWith(e.content)){const n=this.parent._searchMarker;return n&&n.forEach(r=>{r.p===e&&(r.p=this,!this.deleted&&this.countable&&(r.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,this.right!==null&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){const n=this.parent;this.countable&&this.parentSub===null&&(n._length-=this.length),this.markDeleted(),Fp(e.deleteSet,this.id.client,this.id.clock,this.length),ZC(e,n,this.parentSub),this.content.delete(e)}}gc(e,n){if(!this.deleted)throw tr();this.content.gc(e),n?a4(e,this,new zr(this.id,this.length)):this.content=new Uc(this.length)}write(e,n){const r=n>0?Xe(this.id.client,this.id.clock+n-1):this.origin,o=this.rightOrigin,i=this.parentSub,s=this.content.getRef()&H5|(r===null?0:Rs)|(o===null?0:CC)|(i===null?0:F5);if(e.writeInfo(s),r!==null&&e.writeLeftID(r),o!==null&&e.writeRightID(o),r===null&&o===null){const a=this.parent;if(a._item!==void 0){const l=a._item;if(l===null){const c=$s(a);e.writeParentInfo(!0),e.writeString(c)}else e.writeParentInfo(!1),e.writeLeftID(l.id)}else a.constructor===String?(e.writeParentInfo(!0),e.writeString(a)):a.constructor===kc?(e.writeParentInfo(!1),e.writeLeftID(a)):tr();i!==null&&e.writeString(i)}this.content.write(e,n)}}const TE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:{},kE="__ $YJS$ __";TE[kE]===!0&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),TE[kE]=!0;const D4=()=>{let t=!0;return(e,n)=>{if(t){t=!1;try{e()}finally{t=!0}}else n!==void 0&&n()}},R4=/[\uD800-\uDBFF]/,N4=/[\uDC00-\uDFFF]/,F4=(t,e)=>{let n=0,r=0;for(;n<t.length&&n<e.length&&t[n]===e[n];)n++;for(n>0&&R4.test(t[n-1])&&n--;r+n<t.length&&r+n<e.length&&t[t.length-r-1]===e[e.length-r-1];)r++;return r>0&&N4.test(t[t.length-r])&&r--,{index:n,remove:t.length-n-r,insert:e.slice(n,e.length-r)}},dt=new mt("y-sync"),ir=new mt("y-undo");new mt("yjs-cursor");const Wc=(t,e)=>e===void 0?!t.deleted:e.sv.has(t.id.client)&&e.sv.get(t.id.client)>t.id.clock&&!Oo(e.ds,t.id),H4=[{light:"#ecd44433",dark:"#ecd444"}],B4=(t,e,n)=>{if(!t.has(n)){if(t.size<e.length){const r=xo();t.forEach(o=>r.add(o)),e=e.filter(o=>!r.has(o))}t.set(n,cH(e))}return t.get(n)},$4=(t,{colors:e=H4,colorMapping:n=new Map,permanentUserData:r=null,onFirstRender:o=()=>{}}={})=>{let i=!1,s;const a=new at({props:{editable:l=>{const c=dt.getState(l);return c.snapshot==null&&c.prevSnapshot==null}},key:dt,state:{init:(l,c)=>({type:t,doc:t.doc,binding:null,snapshot:null,prevSnapshot:null,isChangeOrigin:!1,isUndoRedoOperation:!1,addToHistory:!0,colors:e,colorMapping:n,permanentUserData:r}),apply:(l,c)=>{const u=l.getMeta(dt);if(u!==void 0){c=Object.assign({},c);for(const d in u)c[d]=u[d]}return c.addToHistory=l.getMeta("addToHistory")!==!1,c.isChangeOrigin=u!==void 0&&!!u.isChangeOrigin,c.isUndoRedoOperation=u!==void 0&&!!u.isChangeOrigin&&!!u.isUndoRedoOperation,c.binding!==null&&u!==void 0&&(u.snapshot!=null||u.prevSnapshot!=null)&&Ip(0,()=>{c.binding==null||c.binding.isDestroyed||(u.restore==null?c.binding._renderSnapshot(u.snapshot,u.prevSnapshot,c):(c.binding._renderSnapshot(u.snapshot,u.snapshot,c),delete c.restore,delete c.snapshot,delete c.prevSnapshot,c.binding.mux(()=>{c.binding._prosemirrorChanged(c.binding.prosemirrorView.state.doc)})))}),c}},view:l=>{const c=new j4(t,l);return s!=null&&s.destroy(),s=Ip(0,()=>{c._forceRerender(),l.dispatch(l.state.tr.setMeta(dt,{binding:c})),o()}),{update:()=>{const u=a.getState(l.state);if(u.snapshot==null&&u.prevSnapshot==null&&(i||l.state.doc.content.findDiffStart(l.state.doc.type.createAndFill().content)!==null)){if(i=!0,u.addToHistory===!1&&!u.isChangeOrigin){const d=ir.getState(l.state),h=d&&d.undoManager;h&&h.stopCapturing()}c.mux(()=>{u.doc.transact(d=>{d.meta.set("addToHistory",u.addToHistory),c._prosemirrorChanged(l.state.doc)},dt)})}},destroy:()=>{s.destroy(),c.destroy()}}}});return a},V4=(t,e,n)=>{if(e!==null&&e.anchor!==null&&e.head!==null){const r=NE(n.doc,n.type,e.anchor,n.mapping),o=NE(n.doc,n.type,e.head,n.mapping);r!==null&&o!==null&&(t=t.setSelection(Le.create(t.doc,r,o)))}},Zp=(t,e)=>({anchor:RE(e.selection.anchor,t.type,t.mapping),head:RE(e.selection.head,t.type,t.mapping)});class j4{constructor(e,n){this.type=e,this.prosemirrorView=n,this.mux=D4(),this.isDestroyed=!1,this.mapping=new Map,this._observeFunction=this._typeChanged.bind(this),this.doc=e.doc,this.beforeTransactionSelection=null,this.beforeAllTransactions=()=>{this.beforeTransactionSelection===null&&(this.beforeTransactionSelection=Zp(this,n.state))},this.afterAllTransactions=()=>{this.beforeTransactionSelection=null},this.doc.on("beforeAllTransactions",this.beforeAllTransactions),this.doc.on("afterAllTransactions",this.afterAllTransactions),e.observeDeep(this._observeFunction),this._domSelectionInView=null}get _tr(){return this.prosemirrorView.state.tr.setMeta("addToHistory",!1)}_isLocalCursorInView(){return this.prosemirrorView.hasFocus()?(EH&&this._domSelectionInView===null&&(Ip(0,()=>{this._domSelectionInView=null}),this._domSelectionInView=this._isDomSelectionInView()),this._domSelectionInView):!1}_isDomSelectionInView(){const e=this.prosemirrorView._root.getSelection(),n=this.prosemirrorView._root.createRange();n.setStart(e.anchorNode,e.anchorOffset),n.setEnd(e.focusNode,e.focusOffset),n.getClientRects().length===0&&n.startContainer&&n.collapsed&&n.selectNodeContents(n.startContainer);const o=n.getBoundingClientRect(),i=OH.documentElement;return o.bottom>=0&&o.right>=0&&o.left<=(window.innerWidth||i.clientWidth||0)&&o.top<=(window.innerHeight||i.clientHeight||0)}renderSnapshot(e,n){n||(n=jp(Ac(),new Map)),this.prosemirrorView.dispatch(this._tr.setMeta(dt,{snapshot:e,prevSnapshot:n}))}unrenderSnapshot(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Kc(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(e),0,0));n.setMeta(dt,{snapshot:null,prevSnapshot:null}),this.prosemirrorView.dispatch(n)})}_forceRerender(){this.mapping=new Map,this.mux(()=>{const e=this.type.toArray().map(r=>Kc(r,this.prosemirrorView.state.schema,this.mapping)).filter(r=>r!==null),n=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(e),0,0));this.prosemirrorView.dispatch(n.setMeta(dt,{isChangeOrigin:!0}))})}_renderSnapshot(e,n,r){e||(e=GC(this.doc)),this.mapping=new Map,this.mux(()=>{this.doc.transact(o=>{const i=r.permanentUserData;i&&i.dss.forEach(c=>{Vr(o,c,u=>{})});const s=(c,u)=>{const d=c==="added"?i.getUserByClientId(u.client):i.getUserByDeletedId(u);return{user:d,type:c,color:B4(r.colorMapping,r.colors,d)}},a=cE(this.type,new Lc(n.ds,e.sv)).map(c=>!c._item.deleted||Wc(c._item,e)||Wc(c._item,n)?Kc(c,this.prosemirrorView.state.schema,new Map,e,n,s):null).filter(c=>c!==null),l=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(a),0,0));this.prosemirrorView.dispatch(l.setMeta(dt,{isChangeOrigin:!0}))},dt)})}_typeChanged(e,n){const r=dt.getState(this.prosemirrorView.state);if(e.length===0||r.snapshot!=null||r.prevSnapshot!=null){this.renderSnapshot(r.snapshot,r.prevSnapshot);return}this.mux(()=>{const o=(a,l)=>this.mapping.delete(l);Vr(n,n.deleteSet,a=>{if(a.constructor===tt){const l=a.content.type;l&&this.mapping.delete(l)}}),n.changed.forEach(o),n.changedParentTypes.forEach(o);const i=this.type.toArray().map(a=>ME(a,this.prosemirrorView.state.schema,this.mapping)).filter(a=>a!==null);let s=this._tr.replace(0,this.prosemirrorView.state.doc.content.size,new me(le.from(i),0,0));V4(s,this.beforeTransactionSelection,this),s=s.setMeta(dt,{isChangeOrigin:!0,isUndoRedoOperation:n.origin instanceof rE}),this.beforeTransactionSelection!==null&&this._isLocalCursorInView()&&s.scrollIntoView(),this.prosemirrorView.dispatch(s)})}_prosemirrorChanged(e){this.doc.transact(()=>{ng(this.doc,this.type,e,this.mapping),this.beforeTransactionSelection=Zp(this,this.prosemirrorView.state)},dt)}destroy(){this.isDestroyed=!0,this.type.unobserveDeep(this._observeFunction),this.doc.off("beforeAllTransactions",this.beforeAllTransactions),this.doc.off("afterAllTransactions",this.afterAllTransactions)}}const ME=(t,e,n,r,o,i)=>{const s=n.get(t);if(s===void 0){if(t instanceof Jt)return Kc(t,e,n,r,o,i);throw vn()}return s},Kc=(t,e,n,r,o,i)=>{const s=[],a=l=>{if(l.constructor===Jt){const c=ME(l,e,n,r,o,i);c!==null&&s.push(c)}else{const c=z4(l,e,n,r,o,i);c!==null&&c.forEach(u=>{u!==null&&s.push(u)})}};r===void 0||o===void 0?t.toArray().forEach(a):cE(t,new Lc(o.ds,r.sv)).forEach(a);try{const l=t.getAttributes(r);r!==void 0&&(Wc(t._item,r)?Wc(t._item,o)||(l.ychange=i?i("added",t._item.id):{type:"added"}):l.ychange=i?i("removed",t._item.id):{type:"removed"});const c=e.node(t.nodeName,l,s);return n.set(t,c),c}catch{return t.doc.transact(c=>{t._item.delete(c)},dt),n.delete(t),null}},z4=(t,e,n,r,o,i)=>{const s=[],a=t.toDelta(r,o,i);try{for(let l=0;l<a.length;l++){const c=a[l],u=[];for(const d in c.attributes)u.push(e.mark(d,c.attributes[d]));s.push(e.text(c.insert,u))}}catch{return t.doc.transact(c=>{t._item.delete(c)},dt),null}return s},U4=(t,e)=>{const n=new gn,r=t.map(o=>({insert:o.text,attributes:DE(o.marks)}));return n.applyDelta(r),e.set(n,t),n},q4=(t,e)=>{const n=new Jt(t.type.name);for(const r in t.attrs){const o=t.attrs[r];o!==null&&r!=="ychange"&&n.setAttribute(r,o)}return n.insert(0,Gc(t).map(r=>eg(r,e))),e.set(n,t),n},eg=(t,e)=>t instanceof Array?U4(t,e):q4(t,e),PE=t=>typeof t=="object"&&t!==null,tg=(t,e)=>{const n=Object.keys(t).filter(o=>t[o]!==null);let r=n.length===Object.keys(e).filter(o=>e[o]!==null).length;for(let o=0;o<n.length&&r;o++){const i=n[o],s=t[i],a=e[i];r=i==="ychange"||s===a||PE(s)&&PE(a)&&tg(s,a)}return r},Gc=t=>{const e=t.content.content,n=[];for(let r=0;r<e.length;r++){const o=e[r];if(o.isText){const i=[];for(let s=e[r];r<e.length&&s.isText;s=e[++r])i.push(s);r--,n.push(i)}else n.push(o)}return n},IE=(t,e)=>{const n=t.toDelta();return n.length===e.length&&n.every((r,o)=>r.insert===e[o].text&&LC(r.attributes||{}).length===e[o].marks.length&&e[o].marks.every(i=>tg(r.attributes[i.type.name]||{},i.attrs)))},qs=(t,e)=>{if(t instanceof Jt&&!(e instanceof Array)&&rg(t,e)){const n=Gc(e);return t._length===n.length&&tg(t.getAttributes(),e.attrs)&&t.toArray().every((r,o)=>qs(r,n[o]))}return t instanceof gn&&e instanceof Array&&IE(t,e)},Jc=(t,e)=>t===e||t instanceof Array&&e instanceof Array&&t.length===e.length&&t.every((n,r)=>e[r]===n),LE=(t,e,n)=>{const r=t.toArray(),o=Gc(e),i=o.length,s=r.length,a=Cc(s,i);let l=0,c=0,u=!1;for(;l<a;l++){const d=r[l],h=o[l];if(Jc(n.get(d),h))u=!0;else if(!qs(d,h))break}for(;l+c<a;c++){const d=r[s-c-1],h=o[i-c-1];if(Jc(n.get(d),h))u=!0;else if(!qs(d,h))break}return{equalityFactor:l+c,foundMappedChild:u}},W4=t=>{let e="",n=t._start;const r={};for(;n!==null;)n.deleted||(n.countable&&n.content instanceof Hn?e+=n.content.str:n.content instanceof yt&&(r[n.content.key]=null)),n=n.right;return{str:e,nAttrs:r}},K4=(t,e,n)=>{n.set(t,e);const{nAttrs:r,str:o}=W4(t),i=e.map(c=>({insert:c.text,attributes:Object.assign({},r,DE(c.marks))})),{insert:s,remove:a,index:l}=F4(o,i.map(c=>c.insert).join(""));t.delete(l,a),t.insert(l,s),t.applyDelta(i.map(c=>({retain:c.insert.length,attributes:c.attributes})))},DE=t=>{const e={};return t.forEach(n=>{n.type.name!=="ychange"&&(e[n.type.name]=n.attrs)}),e},ng=(t,e,n,r)=>{if(e instanceof Jt&&e.nodeName!==n.type.name)throw new Error("node name mismatch!");if(r.set(e,n),e instanceof Jt){const d=e.getAttributes(),h=n.attrs;for(const f in h)h[f]!==null?d[f]!==h[f]&&f!=="ychange"&&e.setAttribute(f,h[f]):e.removeAttribute(f);for(const f in d)h[f]===void 0&&e.removeAttribute(f)}const o=Gc(n),i=o.length,s=e.toArray(),a=s.length,l=Cc(i,a);let c=0,u=0;for(;c<l;c++){const d=s[c],h=o[c];if(!Jc(r.get(d),h))if(qs(d,h))r.set(d,h);else break}for(;u+c+1<l;u++){const d=s[a-u-1],h=o[i-u-1];if(!Jc(r.get(d),h))if(qs(d,h))r.set(d,h);else break}t.transact(()=>{for(;a-c-u>0&&i-c-u>0;){const h=s[c],f=o[c],p=s[a-u-1],g=o[i-u-1];if(h instanceof gn&&f instanceof Array)IE(h,f)||K4(h,f,r),c+=1;else{let m=h instanceof Jt&&rg(h,f),y=p instanceof Jt&&rg(p,g);if(m&&y){const C=LE(h,f,r),w=LE(p,g,r);C.foundMappedChild&&!w.foundMappedChild?y=!1:!C.foundMappedChild&&w.foundMappedChild||C.equalityFactor<w.equalityFactor?m=!1:y=!1}m?(ng(t,h,f,r),c+=1):y?(ng(t,p,g,r),u+=1):(r.delete(e.get(c)),e.delete(c,1),e.insert(c,[eg(f,r)]),c+=1)}}const d=a-c-u;if(a===1&&i===0&&s[0]instanceof gn?(r.delete(s[0]),s[0].delete(0,s[0].length)):d>0&&(e.slice(c,c+d).forEach(h=>r.delete(h)),e.delete(c,d)),c+u<i){const h=[];for(let f=c;f<i-u;f++)h.push(eg(o[f],r));e.insert(c,h)}},dt)},rg=(t,e)=>!(e instanceof Array)&&t.nodeName===e.type.name,RE=(t,e,n)=>{if(t===0)return $p(e,0);let r=e._first===null?null:e._first.content.type;for(;r!==null&&e!==r;){if(r instanceof gn){if(r._length>=t)return $p(r,t);if(t-=r._length,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{do r=r._item===null?null:r._item.parent,t--;while(r!==e&&r!==null&&r._item!==null&&r._item.next===null);r!==null&&r!==e&&(r=r._item===null?null:r._item.next.content.type)}}else{const o=(n.get(r)||{nodeSize:0}).nodeSize;if(r._first!==null&&t<o)r=r._first.content.type,t--;else{if(t===1&&r._length===0&&o>1)return new Pc(r._item===null?null:r._item.id,r._item===null?$s(r):null,null);if(t-=o,r._item!==null&&r._item.next!==null)r=r._item.next.content.type;else{if(t===0)return r=r._item===null?r:r._item.parent,new Pc(r._item===null?null:r._item.id,r._item===null?$s(r):null,null);do r=r._item.parent,t--;while(r!==e&&r._item.next===null);r!==e&&(r=r._item.next.content.type)}}}if(r===null)throw tr();if(t===0&&r.constructor!==gn&&r!==e)return G4(r._item.parent,r._item)}return $p(e,e._length)},G4=(t,e)=>{let n=null,r=null;return t._item===null?r=$s(t):n=Xe(t._item.id.client,t._item.id.clock),new Pc(n,r,e.id)},NE=(t,e,n,r)=>{const o=e4(n,t);if(o===null||o.type!==e&&!Vs(e,o.type._item))return null;let i=o.type,s=0;if(i.constructor===gn)s=o.index;else if(i._item===null||!i._item.deleted){let a=i._first,l=0;for(;l<i._length&&l<o.index&&a!==null;){if(!a.deleted){const c=a.content.type;l++,c instanceof gn?s+=c._length:s+=r.get(c).nodeSize}a=a.right}s+=1}for(;i!==e&&i._item!==null;){const a=i._item.parent;if(a._item===null||!a._item.deleted){s+=1;let l=a._first;for(;l!==null;){const c=l.content.type;if(c===i)break;l.deleted||(c instanceof gn?s+=c._length:s+=r.get(c).nodeSize),l=l.right}}i=a}return s-1},J4=t=>{const e=ir.getState(t).undoManager;if(e!=null)return e.undo(),!0},X4=t=>{const e=ir.getState(t).undoManager;if(e!=null)return e.redo(),!0},Y4=new Set(["paragraph"]),Q4=(t,e)=>!(t instanceof tt)||!(t.content instanceof Bn)||!(t.content.type instanceof wi||t.content.type instanceof Jt&&e.has(t.content.type.nodeName))||t.content.type._length===0,Z4=({protectedNodes:t=Y4,trackedOrigins:e=[],undoManager:n=null}={})=>new at({key:ir,state:{init:(r,o)=>{const i=dt.getState(o),s=n||new rE(i.type,{trackedOrigins:new Set([dt].concat(e)),deleteFilter:a=>Q4(a,t),captureTransaction:a=>a.meta.get("addToHistory")!==!1});return{undoManager:s,prevSel:null,hasUndoOps:s.undoStack.length>0,hasRedoOps:s.redoStack.length>0}},apply:(r,o,i,s)=>{const a=dt.getState(s).binding,l=o.undoManager,c=l.undoStack.length>0,u=l.redoStack.length>0;return a?{undoManager:l,prevSel:Zp(a,i),hasUndoOps:c,hasRedoOps:u}:c!==o.hasUndoOps||u!==o.hasRedoOps?Object.assign({},o,{hasUndoOps:l.undoStack.length>0,hasRedoOps:l.redoStack.length>0}):o}},view:r=>{const o=dt.getState(r.state),i=ir.getState(r.state).undoManager;return i.on("stack-item-added",({stackItem:s})=>{const a=o.binding;a&&s.meta.set(a,ir.getState(r.state).prevSel)}),i.on("stack-item-popped",({stackItem:s})=>{const a=o.binding;a&&(a.beforeTransactionSelection=s.meta.get(a)||a.beforeTransactionSelection)}),{destroy:()=>{i.destroy()}}}}),eB=pt.create({name:"collaboration",priority:1e3,addOptions(){return{document:null,field:"default",fragment:null}},onCreate(){this.editor.extensionManager.extensions.find(t=>t.name==="history")&&console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')},addCommands(){return{undo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),ir.getState(e).undoManager.undoStack.length===0?!1:n?J4(e):!0),redo:()=>({tr:t,state:e,dispatch:n})=>(t.setMeta("preventDispatch",!0),ir.getState(e).undoManager.redoStack.length===0?!1:n?X4(e):!0)}},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo()}},addProseMirrorPlugins(){const t=this.options.fragment?this.options.fragment:this.options.document.getXmlFragment(this.options.field),e=Z4(),n=e.spec.view;e.spec.view=a=>{const{undoManager:l}=ir.getState(a.state);l.restore&&(l.restore(),l.restore=()=>{});const c=n?n(a):void 0;return{destroy:()=>{const u=l.trackedOrigins.has(l),d=l._observers;l.restore=()=>{u&&l.trackedOrigins.add(l),l.doc.on("afterTransaction",l.afterTransactionHandler),l._observers=d},c!=null&&c.destroy&&c.destroy()}}};const r=this.options.ySyncOptions,o=this.options.onFirstRender,i={...r?{...r}:{},...o?{onFirstRender:o}:{}};return[$4(t,i),e]}});function tB(t){const e=new YH(t);return e.setUserMapping(t,t.clientID,"Nathan"),e}function nB({defaultValue:t,readOnly:e,onChange:n,placeHolder:r,extensions:o=[],menuItems:i,commands:s,invalidateOnChange:a=!1,ydoc:l,useYjs:c,showDiff:u,extraProps:d,autoFocus:h=!0,...f}){const[p,g]=T.useState(!1),m=T.useCallback(b=>{n==null||n(b.editor.getJSON())},[n]),y=a?[t]:[],C=c?l??new yi:null,w=oN({extensions:M5(s,{placeHolderText:r}).concat(o??[]).concat(c?[eB.configure({document:C,ySyncOptions:{permanentUserData:tB(C),colors:[{light:"#bef264",dark:"#dc2626"}]}})]:[]),editorProps:P5,autofocus:h?"start":!1,editable:!e,onUpdate:m,content:t},y);return w&&(w.extras=d??{}),w==null||w.setOptions,T.useEffect(()=>{!u&&!p&&l&&(setTimeout(function(){const b=l.getArray("versions"),S=b.length===0?null:b.get(b.length-1),E=S===null?i4:Vp(S==null?void 0:S.snapshot),x=GC(l);S!=null&&E.sv.set(S.clientID,(E.sv.get(S.clientID)??0)+1),t4(E,x)||b.push([{date:new Date().getTime(),snapshot:r4(x),clientID:l.clientID}])},20),g(!0))},[p,g,l]),T.useEffect(()=>{if(u&&l&&w){const b=l.getArray("versions");b.length>1&&setTimeout(function(){const S=b.get(b.length-2),E=b.get(b.length-1);w==null||w.view.dispatch(w==null?void 0:w.state.tr.setMeta(dt,{snapshot:Vp(E.snapshot),prevSnapshot:Vp(S.snapshot)}))},20)}},[u,w,l]),w?v.jsxs("div",{id:"editor",onClick:()=>w.chain().focus().run(),css:{"& .ProseMirror:focus, .ProseMirror:focus-visible":{outline:"none"},"& .ProseMirror p a":{color:"#0ea5e9",textDecoration:"underline",wordBreak:"break-all",fontWeight:700},"& .ProseMirror p:first-of-type":{marginTop:0},"& .ProseMirror > :first-child":{marginTop:0},"& .ProseMirror > :last-child":{marginBottom:0}},...f,children:[w&&v.jsx(CN,{editor:w,menuItems:i}),v.jsx(GR,{editor:w,style:{outline:0}})]}):null}N.ComponentManager.registerComponent("Editor.Paragraph",pC),N.ComponentManager.registerComponent("Editor.H1",AS),N.ComponentManager.registerComponent("Editor.H2",OS),N.ComponentManager.registerComponent("Editor.H3",TS),N.ComponentManager.registerComponent("Editor.BlockQuote",ES),N.ComponentManager.registerComponent("Editor.BulletList",xS),N.ComponentManager.registerComponent("Editor.OrderedList",hC),N.ComponentManager.registerComponent("Editor.ListItem",fC);const rB={defaultProps:{mt:Y(32,16),mb:Y(32,16),sm_mt:Y(24,14),sm_mb:Y(24,14),lg_mt:Y(32,18),lg_mb:Y(32,18),xl_mt:Y(40,20),xl_mb:Y(40,20),x2_mt:Y(48,24),x2_mb:Y(48,24)}};var oB={},og={},Xc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return e}});let e=n=>{};if(process.env.NODE_ENV!=="production"){const n=new Set;e=r=>{n.has(r)||console.warn(r),n.add(r)}}})(Xc);var FE={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return e}});function e(n){let{widthInt:r,heightInt:o,blurWidth:i,blurHeight:s,blurDataURL:a,objectFit:l}=n;const c=20,u=i?i*40:r,d=s?s*40:o,h=u&&d?"viewBox='0 0 "+u+" "+d+"'":"",f=h?"none":l==="contain"?"xMidYMid":l==="cover"?"xMidYMid slice":"none";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+h+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='"+c+"'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+f+"' style='filter: url(%23b);' href='"+a+"'/%3E%3C/svg%3E"}})(FE);var Yc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,i){for(var s in i)Object.defineProperty(o,s,{enumerable:!0,get:i[s]})}e(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});const n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}})(Yc),function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return f}});const e=Xc,n=FE,r=Yc,o=["lazy","eager",void 0];function i(p){return p.default!==void 0}function s(p){return p.src!==void 0}function a(p){return typeof p=="object"&&(i(p)||s(p))}const l=new Map;let c;function u(p){return typeof p>"u"?p:typeof p=="number"?Number.isFinite(p)?p:NaN:typeof p=="string"&&/^[0-9]+$/.test(p)?parseInt(p,10):NaN}function d(p,g,m){let{deviceSizes:y,allSizes:C}=p;if(m){const b=/(^|\s)(1?\d?\d)vw/g,S=[];for(let E;E=b.exec(m);E)S.push(parseInt(E[2]));if(S.length){const E=Math.min(...S)*.01;return{widths:C.filter(x=>x>=y[0]*E),kind:"w"}}return{widths:C,kind:"w"}}return typeof g!="number"?{widths:y,kind:"w"}:{widths:[...new Set([g,g*2].map(b=>C.find(S=>S>=b)||C[C.length-1]))],kind:"x"}}function h(p){let{config:g,src:m,unoptimized:y,width:C,quality:w,sizes:b,loader:S}=p;if(y)return{src:m,srcSet:void 0,sizes:void 0};const{widths:E,kind:x}=d(g,C,b),_=E.length-1;return{sizes:!b&&x==="w"?"100vw":b,srcSet:E.map((A,O)=>S({config:g,src:m,quality:w,width:A})+" "+(x==="w"?A:O+1)+x).join(", "),src:S({config:g,src:m,quality:w,width:E[_]})}}function f(p,g){let{src:m,sizes:y,unoptimized:C=!1,priority:w=!1,loading:b,className:S,quality:E,width:x,height:_,fill:A=!1,style:O,overrideSrc:k,onLoad:M,onLoadingComplete:I,placeholder:P="empty",blurDataURL:F,fetchPriority:z,decoding:$="async",layout:J,objectFit:K,objectPosition:R,lazyBoundary:Q,lazyRoot:se,...ie}=p;const{imgConf:de,showAltText:ue,blurComplete:pe,defaultLoader:D}=g;let ce,ye=de||r.imageConfigDefault;if("allSizes"in ye)ce=ye;else{var be;const re=[...ye.deviceSizes,...ye.imageSizes].sort((fe,ve)=>fe-ve),j=ye.deviceSizes.sort((fe,ve)=>fe-ve),te=(be=ye.qualities)==null?void 0:be.sort((fe,ve)=>fe-ve);ce={...ye,allSizes:re,deviceSizes:j,qualities:te}}if(typeof D>"u")throw new Error(`images.loaderFile detected but the file is missing default export.
|
212
|
+
Read more: https://nextjs.org/docs/messages/invalid-images-config`);let H=ie.loader||D;delete ie.loader,delete ie.srcSet;const L="__next_img_default"in H;if(L){if(ce.loader==="custom")throw new Error('Image with src "'+m+`" is missing "loader" prop.
|
213
|
+
Read more: https://nextjs.org/docs/messages/next-image-missing-loader`)}else{const re=H;H=j=>{const{config:te,...fe}=j;return re(fe)}}if(J){J==="fill"&&(A=!0);const re={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}},j={responsive:"100vw",fill:"100vw"},te=re[J];te&&(O={...O,...te});const fe=j[J];fe&&!y&&(y=fe)}let He="",G=u(x),ne=u(_),X,W;if(a(m)){const re=i(m)?m.default:m;if(!re.src)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(re));if(!re.height||!re.width)throw new Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(re));if(X=re.blurWidth,W=re.blurHeight,F=F||re.blurDataURL,He=re.src,!A){if(!G&&!ne)G=re.width,ne=re.height;else if(G&&!ne){const j=G/re.width;ne=Math.round(re.height*j)}else if(!G&&ne){const j=ne/re.height;G=Math.round(re.width*j)}}}m=typeof m=="string"?m:He;let V=!w&&(b==="lazy"||typeof b>"u");(!m||m.startsWith("data:")||m.startsWith("blob:"))&&(C=!0,V=!1),ce.unoptimized&&(C=!0),L&&m.endsWith(".svg")&&!ce.dangerouslyAllowSVG&&(C=!0),w&&(z="high");const ee=u(E);if(process.env.NODE_ENV!=="production"){if(ce.output==="export"&&L&&!C)throw new Error("Image Optimization using the default loader is not compatible with `{ output: 'export' }`.\n Possible solutions:\n - Remove `{ output: 'export' }` and run \"next start\" to run server mode including the Image Optimization API.\n - Configure `{ images: { unoptimized: true } }` in `next.config.js` to disable the Image Optimization API.\n Read more: https://nextjs.org/docs/messages/export-image-api");if(!m)C=!0;else if(A){if(x)throw new Error('Image with src "'+m+'" has both "width" and "fill" properties. Only one should be used.');if(_)throw new Error('Image with src "'+m+'" has both "height" and "fill" properties. Only one should be used.');if(O!=null&&O.position&&O.position!=="absolute")throw new Error('Image with src "'+m+'" has both "fill" and "style.position" properties. Images with "fill" always use position absolute - it cannot be modified.');if(O!=null&&O.width&&O.width!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.width" properties. Images with "fill" always use width 100% - it cannot be modified.');if(O!=null&&O.height&&O.height!=="100%")throw new Error('Image with src "'+m+'" has both "fill" and "style.height" properties. Images with "fill" always use height 100% - it cannot be modified.')}else{if(typeof G>"u")throw new Error('Image with src "'+m+'" is missing required "width" property.');if(isNaN(G))throw new Error('Image with src "'+m+'" has invalid "width" property. Expected a numeric value in pixels but received "'+x+'".');if(typeof ne>"u")throw new Error('Image with src "'+m+'" is missing required "height" property.');if(isNaN(ne))throw new Error('Image with src "'+m+'" has invalid "height" property. Expected a numeric value in pixels but received "'+_+'".')}if(!o.includes(b))throw new Error('Image with src "'+m+'" has invalid "loading" property. Provided "'+b+'" should be one of '+o.map(String).join(",")+".");if(w&&b==="lazy")throw new Error('Image with src "'+m+`" has both "priority" and "loading='lazy'" properties. Only one should be used.`);if(P!=="empty"&&P!=="blur"&&!P.startsWith("data:image/"))throw new Error('Image with src "'+m+'" has invalid "placeholder" property "'+P+'".');if(P!=="empty"&&G&&ne&&G*ne<1600&&(0,e.warnOnce)('Image with src "'+m+'" is smaller than 40x40. Consider removing the "placeholder" property to improve performance.'),P==="blur"&&!F){const re=["jpeg","png","webp","avif"];throw new Error('Image with src "'+m+`" has "placeholder='blur'" property but is missing the "blurDataURL" property.
|
214
|
+
Possible solutions:
|
215
|
+
- Add a "blurDataURL" property, the contents should be a small Data URL to represent the image
|
216
|
+
- Change the "src" property to a static import with one of the supported file types: `+re.join(",")+` (animated images not supported)
|
217
|
+
- Remove the "placeholder" property, effectively no blur effect
|
218
|
+
Read more: https://nextjs.org/docs/messages/placeholder-blur-data-url`)}if("ref"in ie&&(0,e.warnOnce)('Image with src "'+m+'" is using unsupported "ref" property. Consider using the "onLoad" property instead.'),!C&&!L){const re=H({config:ce,src:m,width:G||400,quality:ee||75});let j;try{j=new URL(re)}catch{}(re===m||j&&j.pathname===m&&!j.search)&&(0,e.warnOnce)('Image with src "'+m+`" has a "loader" property that does not implement width. Please implement it or use the "unoptimized" property instead.
|
219
|
+
Read more: https://nextjs.org/docs/messages/next-image-missing-loader-width`)}I&&(0,e.warnOnce)('Image with src "'+m+'" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.');for(const[re,j]of Object.entries({layout:J,objectFit:K,objectPosition:R,lazyBoundary:Q,lazyRoot:se}))j&&(0,e.warnOnce)('Image with src "'+m+'" has legacy prop "'+re+`". Did you forget to run the codemod?
|
220
|
+
Read more: https://nextjs.org/docs/messages/next-image-upgrade-to-13`);if(typeof window<"u"&&!c&&window.PerformanceObserver){c=new PerformanceObserver(re=>{for(const te of re.getEntries()){var j;const fe=(te==null||(j=te.element)==null?void 0:j.src)||"",ve=l.get(fe);ve&&!ve.priority&&ve.placeholder==="empty"&&!ve.src.startsWith("data:")&&!ve.src.startsWith("blob:")&&(0,e.warnOnce)('Image with src "'+ve.src+`" was detected as the Largest Contentful Paint (LCP). Please add the "priority" property if this image is above the fold.
|
221
|
+
Read more: https://nextjs.org/docs/api-reference/next/image#priority`)}});try{c.observe({type:"largest-contentful-paint",buffered:!0})}catch(re){console.error(re)}}}const Ce=Object.assign(A?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:K,objectPosition:R}:{},ue?{}:{color:"transparent"},O),we=!pe&&P!=="empty"?P==="blur"?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:G,heightInt:ne,blurWidth:X,blurHeight:W,blurDataURL:F||"",objectFit:Ce.objectFit})+'")':'url("'+P+'")':null;let Z=we?{backgroundSize:Ce.objectFit||"cover",backgroundPosition:Ce.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:we}:{};process.env.NODE_ENV==="development"&&Z.backgroundImage&&P==="blur"&&F!=null&&F.startsWith("/")&&(Z.backgroundImage='url("'+F+'")');const Se=h({config:ce,src:m,unoptimized:C,width:G,quality:ee,sizes:y,loader:H});if(process.env.NODE_ENV!=="production"&&typeof window<"u"){let re;try{re=new URL(Se.src)}catch{re=new URL(Se.src,window.location.href)}l.set(re.href,{src:m,priority:w,placeholder:P})}return{props:{...ie,loading:V?"lazy":b,fetchPriority:z,width:G,height:ne,decoding:$,className:S,style:{...Ce,...Z},sizes:Se.sizes,srcSet:Se.srcSet,src:k||Se.src},meta:{unoptimized:C,priority:w,placeholder:P,fill:A}}}}(og);var ig={exports:{}},Qc={exports:{}},sg={},HE;function iB(){return HE||(HE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});const e=T,n=typeof window>"u",r=n?()=>{}:e.useLayoutEffect,o=n?()=>{}:e.useEffect;function i(s){const{headManager:a,reduceComponentsToState:l}=s;function c(){if(a&&a.mountedInstances){const d=e.Children.toArray(Array.from(a.mountedInstances).filter(Boolean));a.updateHead(l(d,s))}}if(n){var u;a==null||(u=a.mountedInstances)==null||u.add(s.children),c()}return r(()=>{var d;return a==null||(d=a.mountedInstances)==null||d.add(s.children),()=>{var h;a==null||(h=a.mountedInstances)==null||h.delete(s.children)}}),r(()=>(a&&(a._pendingUpdate=c),()=>{a&&(a._pendingUpdate=c)})),o(()=>(a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null),()=>{a&&a._pendingUpdate&&(a._pendingUpdate(),a._pendingUpdate=null)})),null}}(sg)),sg}var ag={},BE;function sB(){return BE||(BE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});const r=Nt._(T).default.createContext({});process.env.NODE_ENV!=="production"&&(r.displayName="AmpStateContext")}(ag)),ag}var lg={},$E;function aB(){return $E||($E=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return e}});function e(n){let{ampFirst:r=!1,hybrid:o=!1,hasQuery:i=!1}=n===void 0?{}:n;return r||o&&i}}(lg)),lg}var VE;function lB(){return VE||(VE=1,function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0});function n(w,b){for(var S in b)Object.defineProperty(w,S,{enumerable:!0,get:b[S]})}n(e,{default:function(){return C},defaultHead:function(){return h}});const r=Nt,o=ki(),i=Ti,s=o._(T),a=r._(iB()),l=sB(),c=Qy(),u=aB(),d=Xc;function h(w){w===void 0&&(w=!1);const b=[(0,i.jsx)("meta",{charSet:"utf-8"})];return w||b.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"})),b}function f(w,b){return typeof b=="string"||typeof b=="number"?w:b.type===s.default.Fragment?w.concat(s.default.Children.toArray(b.props.children).reduce((S,E)=>typeof E=="string"||typeof E=="number"?S:S.concat(E),[])):w.concat(b)}const p=["name","httpEquiv","charSet","itemProp"];function g(){const w=new Set,b=new Set,S=new Set,E={};return x=>{let _=!0,A=!1;if(x.key&&typeof x.key!="number"&&x.key.indexOf("$")>0){A=!0;const O=x.key.slice(x.key.indexOf("$")+1);w.has(O)?_=!1:w.add(O)}switch(x.type){case"title":case"base":b.has(x.type)?_=!1:b.add(x.type);break;case"meta":for(let O=0,k=p.length;O<k;O++){const M=p[O];if(x.props.hasOwnProperty(M))if(M==="charSet")S.has(M)?_=!1:S.add(M);else{const I=x.props[M],P=E[M]||new Set;(M!=="name"||!A)&&P.has(I)?_=!1:(P.add(I),E[M]=P)}}break}return _}}function m(w,b){const{inAmpMode:S}=b;return w.reduce(f,[]).reverse().concat(h(S).reverse()).filter(g()).reverse().map((E,x)=>{const _=E.key||x;if(process.env.NODE_ENV!=="development"&&process.env.__NEXT_OPTIMIZE_FONTS&&!S&&E.type==="link"&&E.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(A=>E.props.href.startsWith(A))){const A={...E.props||{}};return A["data-href"]=A.href,A.href=void 0,A["data-optimized-fonts"]=!0,s.default.cloneElement(E,A)}if(process.env.NODE_ENV==="development")if(E.type==="script"&&E.props.type!=="application/ld+json"){const A=E.props.src?'<script> tag with src="'+E.props.src+'"':"inline <script>";(0,d.warnOnce)("Do not add <script> tags using next/head (see "+A+`). Use next/script instead.
|
222
|
+
See more info here: https://nextjs.org/docs/messages/no-script-tags-in-head-component`)}else E.type==="link"&&E.props.rel==="stylesheet"&&(0,d.warnOnce)('Do not add stylesheets using next/head (see <link rel="stylesheet"> tag with href="'+E.props.href+`"). Use Document instead.
|
223
|
+
See more info here: https://nextjs.org/docs/messages/no-stylesheets-in-head-component`);return s.default.cloneElement(E,{key:_})})}function y(w){let{children:b}=w;const S=(0,s.useContext)(l.AmpStateContext),E=(0,s.useContext)(c.HeadManagerContext);return(0,i.jsx)(a.default,{reduceComponentsToState:m,headManager:E,inAmpMode:(0,u.isInAmpMode)(S),children:b})}const C=y;(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)}(Qc,Qc.exports)),Qc.exports}var cg={},jE;function cB(){return jE||(jE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});const n=Nt._(T),r=Yc,o=n.default.createContext(r.imageConfigDefault);process.env.NODE_ENV!=="production"&&(o.displayName="ImageConfigContext")}(cg)),cg}var ug={},dg={},fg={exports:{}},zE;function UE(){return zE||(zE=1,(()=>{var t={170:(o,i,s)=>{const a=s(510),l=()=>{if(typeof navigator<"u"&&navigator.platform){const u=navigator.platform.toLowerCase();return u==="win32"||u==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};function c(u,d,h=!1){return d&&(d.windows===null||d.windows===void 0)&&(d={...d,windows:l()}),a(u,d,h)}Object.assign(c,a),o.exports=c},154:o=>{const i="\\\\/",s=`[^${i}]`,a="\\.",l="\\+",c="\\?",u="\\/",d="(?=.)",h="[^/]",f=`(?:${u}|$)`,p=`(?:^|${u})`,g=`${a}{1,2}${f}`,m=`(?!${a})`,y=`(?!${p}${g})`,C=`(?!${a}{0,1}${f})`,w=`(?!${g})`,b=`[^.${u}]`,S=`${h}*?`,x={DOT_LITERAL:a,PLUS_LITERAL:l,QMARK_LITERAL:c,SLASH_LITERAL:u,ONE_CHAR:d,QMARK:h,END_ANCHOR:f,DOTS_SLASH:g,NO_DOT:m,NO_DOTS:y,NO_DOT_SLASH:C,NO_DOTS_SLASH:w,QMARK_NO_DOT:b,STAR:S,START_ANCHOR:p,SEP:"/"},_={...x,SLASH_LITERAL:`[${i}]`,QMARK:s,STAR:`${s}*?`,DOTS_SLASH:`${a}{1,2}(?:[${i}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${i}])${a}{1,2}(?:[${i}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${i}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${i}]|$))`,QMARK_NO_DOT:`[^.${i}]`,START_ANCHOR:`(?:^|[${i}])`,END_ANCHOR:`(?:[${i}]|$)`,SEP:"\\"},A={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};o.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:A,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(O){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${O.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(O){return O===!0?_:x}}},697:(o,i,s)=>{const a=s(154),l=s(96),{MAX_LENGTH:c,POSIX_REGEX_SOURCE:u,REGEX_NON_SPECIAL_CHARS:d,REGEX_SPECIAL_CHARS_BACKREF:h,REPLACEMENTS:f}=a,p=(y,C)=>{if(typeof C.expandRange=="function")return C.expandRange(...y,C);y.sort();const w=`[${y.join("-")}]`;try{new RegExp(w)}catch{return y.map(S=>l.escapeRegex(S)).join("..")}return w},g=(y,C)=>`Missing ${y}: "${C}" - use "\\\\${C}" to match literal characters`,m=(y,C)=>{if(typeof y!="string")throw new TypeError("Expected a string");y=f[y]||y;const w={...C},b=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c;let S=y.length;if(S>b)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${b}`);const E={type:"bos",value:"",output:w.prepend||""},x=[E],_=w.capture?"":"?:",A=a.globChars(w.windows),O=a.extglobChars(A),{DOT_LITERAL:k,PLUS_LITERAL:M,SLASH_LITERAL:I,ONE_CHAR:P,DOTS_SLASH:F,NO_DOT:z,NO_DOT_SLASH:$,NO_DOTS_SLASH:J,QMARK:K,QMARK_NO_DOT:R,STAR:Q,START_ANCHOR:se}=A,ie=B=>`(${_}(?:(?!${se}${B.dot?F:k}).)*?)`,de=w.dot?"":z,ue=w.dot?K:R;let pe=w.bash===!0?ie(w):Q;w.capture&&(pe=`(${pe})`),typeof w.noext=="boolean"&&(w.noextglob=w.noext);const D={input:y,index:-1,start:0,dot:w.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};y=l.removePrefix(y,D),S=y.length;const ce=[],ye=[],be=[];let H=E,L;const He=()=>D.index===S-1,G=D.peek=(B=1)=>y[D.index+B],ne=D.advance=()=>y[++D.index]||"",X=()=>y.slice(D.index+1),W=(B="",re=0)=>{D.consumed+=B,D.index+=re},V=B=>{D.output+=B.output!=null?B.output:B.value,W(B.value)},ee=()=>{let B=1;for(;G()==="!"&&(G(2)!=="("||G(3)==="?");)ne(),D.start++,B++;return B%2===0?!1:(D.negated=!0,D.start++,!0)},Ce=B=>{D[B]++,be.push(B)},we=B=>{D[B]--,be.pop()},Z=B=>{if(H.type==="globstar"){const re=D.braces>0&&(B.type==="comma"||B.type==="brace"),j=B.extglob===!0||ce.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!re&&!j&&(D.output=D.output.slice(0,-H.output.length),H.type="star",H.value="*",H.output=pe,D.output+=H.output)}if(ce.length&&B.type!=="paren"&&(ce[ce.length-1].inner+=B.value),(B.value||B.output)&&V(B),H&&H.type==="text"&&B.type==="text"){H.output=(H.output||H.value)+B.value,H.value+=B.value;return}B.prev=H,x.push(B),H=B},Se=(B,re)=>{const j={...O[re],conditions:1,inner:""};j.prev=H,j.parens=D.parens,j.output=D.output;const te=(w.capture?"(":"")+j.open;Ce("parens"),Z({type:B,value:re,output:D.output?"":P}),Z({type:"paren",extglob:!0,value:ne(),output:te}),ce.push(j)},U=B=>{let re=B.close+(w.capture?")":""),j;if(B.type==="negate"){let te=pe;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(te=ie(w)),(te!==pe||He()||/^\)+$/.test(X()))&&(re=B.close=`)$))${te}`),B.inner.includes("*")&&(j=X())&&/^\.[^\\/.]+$/.test(j)){const fe=m(j,{...C,fastpaths:!1}).output;re=B.close=`)${fe})${te})`}B.prev.type==="bos"&&(D.negatedExtglob=!0)}Z({type:"paren",extglob:!0,value:L,output:re}),we("parens")};if(w.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(y)){let B=!1,re=y.replace(h,(j,te,fe,ve,Ee,Ve)=>ve==="\\"?(B=!0,j):ve==="?"?te?te+ve+(Ee?K.repeat(Ee.length):""):Ve===0?ue+(Ee?K.repeat(Ee.length):""):K.repeat(fe.length):ve==="."?k.repeat(fe.length):ve==="*"?te?te+ve+(Ee?pe:""):pe:te?j:`\\${j}`);return B===!0&&(w.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,j=>j.length%2===0?"\\\\":j?"\\":"")),re===y&&w.contains===!0?(D.output=y,D):(D.output=l.wrapOutput(re,D,C),D)}for(;!He();){if(L=ne(),L==="\0")continue;if(L==="\\"){const j=G();if(j==="/"&&w.bash!==!0||j==="."||j===";")continue;if(!j){L+="\\",Z({type:"text",value:L});continue}const te=/^\\+/.exec(X());let fe=0;if(te&&te[0].length>2&&(fe=te[0].length,D.index+=fe,fe%2!==0&&(L+="\\")),w.unescape===!0?L=ne():L+=ne(),D.brackets===0){Z({type:"text",value:L});continue}}if(D.brackets>0&&(L!=="]"||H.value==="["||H.value==="[^")){if(w.posix!==!1&&L===":"){const j=H.value.slice(1);if(j.includes("[")&&(H.posix=!0,j.includes(":"))){const te=H.value.lastIndexOf("["),fe=H.value.slice(0,te),ve=H.value.slice(te+2),Ee=u[ve];if(Ee){H.value=fe+Ee,D.backtrack=!0,ne(),!E.output&&x.indexOf(H)===1&&(E.output=P);continue}}}(L==="["&&G()!==":"||L==="-"&&G()==="]")&&(L=`\\${L}`),L==="]"&&(H.value==="["||H.value==="[^")&&(L=`\\${L}`),w.posix===!0&&L==="!"&&H.value==="["&&(L="^"),H.value+=L,V({value:L});continue}if(D.quotes===1&&L!=='"'){L=l.escapeRegex(L),H.value+=L,V({value:L});continue}if(L==='"'){D.quotes=D.quotes===1?0:1,w.keepQuotes===!0&&Z({type:"text",value:L});continue}if(L==="("){Ce("parens"),Z({type:"paren",value:L});continue}if(L===")"){if(D.parens===0&&w.strictBrackets===!0)throw new SyntaxError(g("opening","("));const j=ce[ce.length-1];if(j&&D.parens===j.parens+1){U(ce.pop());continue}Z({type:"paren",value:L,output:D.parens?")":"\\)"}),we("parens");continue}if(L==="["){if(w.nobracket===!0||!X().includes("]")){if(w.nobracket!==!0&&w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));L=`\\${L}`}else Ce("brackets");Z({type:"bracket",value:L});continue}if(L==="]"){if(w.nobracket===!0||H&&H.type==="bracket"&&H.value.length===1){Z({type:"text",value:L,output:`\\${L}`});continue}if(D.brackets===0){if(w.strictBrackets===!0)throw new SyntaxError(g("opening","["));Z({type:"text",value:L,output:`\\${L}`});continue}we("brackets");const j=H.value.slice(1);if(H.posix!==!0&&j[0]==="^"&&!j.includes("/")&&(L=`/${L}`),H.value+=L,V({value:L}),w.literalBrackets===!1||l.hasRegexChars(j))continue;const te=l.escapeRegex(H.value);if(D.output=D.output.slice(0,-H.value.length),w.literalBrackets===!0){D.output+=te,H.value=te;continue}H.value=`(${_}${te}|${H.value})`,D.output+=H.value;continue}if(L==="{"&&w.nobrace!==!0){Ce("braces");const j={type:"brace",value:L,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};ye.push(j),Z(j);continue}if(L==="}"){const j=ye[ye.length-1];if(w.nobrace===!0||!j){Z({type:"text",value:L,output:L});continue}let te=")";if(j.dots===!0){const fe=x.slice(),ve=[];for(let Ee=fe.length-1;Ee>=0&&(x.pop(),fe[Ee].type!=="brace");Ee--)fe[Ee].type!=="dots"&&ve.unshift(fe[Ee].value);te=p(ve,w),D.backtrack=!0}if(j.comma!==!0&&j.dots!==!0){const fe=D.output.slice(0,j.outputIndex),ve=D.tokens.slice(j.tokensIndex);j.value=j.output="\\{",L=te="\\}",D.output=fe;for(const Ee of ve)D.output+=Ee.output||Ee.value}Z({type:"brace",value:L,output:te}),we("braces"),ye.pop();continue}if(L==="|"){ce.length>0&&ce[ce.length-1].conditions++,Z({type:"text",value:L});continue}if(L===","){let j=L;const te=ye[ye.length-1];te&&be[be.length-1]==="braces"&&(te.comma=!0,j="|"),Z({type:"comma",value:L,output:j});continue}if(L==="/"){if(H.type==="dot"&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",x.pop(),H=E;continue}Z({type:"slash",value:L,output:I});continue}if(L==="."){if(D.braces>0&&H.type==="dot"){H.value==="."&&(H.output=k);const j=ye[ye.length-1];H.type="dots",H.output+=L,H.value+=L,j.dots=!0;continue}if(D.braces+D.parens===0&&H.type!=="bos"&&H.type!=="slash"){Z({type:"text",value:L,output:k});continue}Z({type:"dot",value:L,output:k});continue}if(L==="?"){if(!(H&&H.value==="(")&&w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("qmark",L);continue}if(H&&H.type==="paren"){const te=G();let fe=L;(H.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(X()))&&(fe=`\\${L}`),Z({type:"text",value:L,output:fe});continue}if(w.dot!==!0&&(H.type==="slash"||H.type==="bos")){Z({type:"qmark",value:L,output:R});continue}Z({type:"qmark",value:L,output:K});continue}if(L==="!"){if(w.noextglob!==!0&&G()==="("&&(G(2)!=="?"||!/[!=<:]/.test(G(3)))){Se("negate",L);continue}if(w.nonegate!==!0&&D.index===0){ee();continue}}if(L==="+"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Se("plus",L);continue}if(H&&H.value==="("||w.regex===!1){Z({type:"plus",value:L,output:M});continue}if(H&&(H.type==="bracket"||H.type==="paren"||H.type==="brace")||D.parens>0){Z({type:"plus",value:L});continue}Z({type:"plus",value:M});continue}if(L==="@"){if(w.noextglob!==!0&&G()==="("&&G(2)!=="?"){Z({type:"at",extglob:!0,value:L,output:""});continue}Z({type:"text",value:L});continue}if(L!=="*"){(L==="$"||L==="^")&&(L=`\\${L}`);const j=d.exec(X());j&&(L+=j[0],D.index+=j[0].length),Z({type:"text",value:L});continue}if(H&&(H.type==="globstar"||H.star===!0)){H.type="star",H.star=!0,H.value+=L,H.output=pe,D.backtrack=!0,D.globstar=!0,W(L);continue}let B=X();if(w.noextglob!==!0&&/^\([^?]/.test(B)){Se("star",L);continue}if(H.type==="star"){if(w.noglobstar===!0){W(L);continue}const j=H.prev,te=j.prev,fe=j.type==="slash"||j.type==="bos",ve=te&&(te.type==="star"||te.type==="globstar");if(w.bash===!0&&(!fe||B[0]&&B[0]!=="/")){Z({type:"star",value:L,output:""});continue}const Ee=D.braces>0&&(j.type==="comma"||j.type==="brace"),Ve=ce.length&&(j.type==="pipe"||j.type==="paren");if(!fe&&j.type!=="paren"&&!Ee&&!Ve){Z({type:"star",value:L,output:""});continue}for(;B.slice(0,3)==="/**";){const ze=y[D.index+4];if(ze&&ze!=="/")break;B=B.slice(3),W("/**",3)}if(j.type==="bos"&&He()){H.type="globstar",H.value+=L,H.output=ie(w),D.output=H.output,D.globstar=!0,W(L);continue}if(j.type==="slash"&&j.prev.type!=="bos"&&!ve&&He()){D.output=D.output.slice(0,-(j.output+H.output).length),j.output=`(?:${j.output}`,H.type="globstar",H.output=ie(w)+(w.strictSlashes?")":"|$)"),H.value+=L,D.globstar=!0,D.output+=j.output+H.output,W(L);continue}if(j.type==="slash"&&j.prev.type!=="bos"&&B[0]==="/"){const ze=B[1]!==void 0?"|$":"";D.output=D.output.slice(0,-(j.output+H.output).length),j.output=`(?:${j.output}`,H.type="globstar",H.output=`${ie(w)}${I}|${I}${ze})`,H.value+=L,D.output+=j.output+H.output,D.globstar=!0,W(L+ne()),Z({type:"slash",value:"/",output:""});continue}if(j.type==="bos"&&B[0]==="/"){H.type="globstar",H.value+=L,H.output=`(?:^|${I}|${ie(w)}${I})`,D.output=H.output,D.globstar=!0,W(L+ne()),Z({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-H.output.length),H.type="globstar",H.output=ie(w),H.value+=L,D.output+=H.output,D.globstar=!0,W(L);continue}const re={type:"star",value:L,output:pe};if(w.bash===!0){re.output=".*?",(H.type==="bos"||H.type==="slash")&&(re.output=de+re.output),Z(re);continue}if(H&&(H.type==="bracket"||H.type==="paren")&&w.regex===!0){re.output=L,Z(re);continue}(D.index===D.start||H.type==="slash"||H.type==="dot")&&(H.type==="dot"?(D.output+=$,H.output+=$):w.dot===!0?(D.output+=J,H.output+=J):(D.output+=de,H.output+=de),G()!=="*"&&(D.output+=P,H.output+=P)),Z(re)}for(;D.brackets>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","]"));D.output=l.escapeLast(D.output,"["),we("brackets")}for(;D.parens>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing",")"));D.output=l.escapeLast(D.output,"("),we("parens")}for(;D.braces>0;){if(w.strictBrackets===!0)throw new SyntaxError(g("closing","}"));D.output=l.escapeLast(D.output,"{"),we("braces")}if(w.strictSlashes!==!0&&(H.type==="star"||H.type==="bracket")&&Z({type:"maybe_slash",value:"",output:`${I}?`}),D.backtrack===!0){D.output="";for(const B of D.tokens)D.output+=B.output!=null?B.output:B.value,B.suffix&&(D.output+=B.suffix)}return D};m.fastpaths=(y,C)=>{const w={...C},b=typeof w.maxLength=="number"?Math.min(c,w.maxLength):c,S=y.length;if(S>b)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${b}`);y=f[y]||y;const{DOT_LITERAL:E,SLASH_LITERAL:x,ONE_CHAR:_,DOTS_SLASH:A,NO_DOT:O,NO_DOTS:k,NO_DOTS_SLASH:M,STAR:I,START_ANCHOR:P}=a.globChars(w.windows),F=w.dot?k:O,z=w.dot?M:O,$=w.capture?"":"?:",J={negated:!1,prefix:""};let K=w.bash===!0?".*?":I;w.capture&&(K=`(${K})`);const R=de=>de.noglobstar===!0?K:`(${$}(?:(?!${P}${de.dot?A:E}).)*?)`,Q=de=>{switch(de){case"*":return`${F}${_}${K}`;case".*":return`${E}${_}${K}`;case"*.*":return`${F}${K}${E}${_}${K}`;case"*/*":return`${F}${K}${x}${_}${z}${K}`;case"**":return F+R(w);case"**/*":return`(?:${F}${R(w)}${x})?${z}${_}${K}`;case"**/*.*":return`(?:${F}${R(w)}${x})?${z}${K}${E}${_}${K}`;case"**/.*":return`(?:${F}${R(w)}${x})?${E}${_}${K}`;default:{const ue=/^(.*?)\.(\w+)$/.exec(de);if(!ue)return;const pe=Q(ue[1]);return pe?pe+E+ue[2]:void 0}}},se=l.removePrefix(y,J);let ie=Q(se);return ie&&w.strictSlashes!==!0&&(ie+=`${x}?`),ie},o.exports=m},510:(o,i,s)=>{const a=s(716),l=s(697),c=s(96),u=s(154),d=f=>f&&typeof f=="object"&&!Array.isArray(f),h=(f,p,g=!1)=>{if(Array.isArray(f)){const x=f.map(A=>h(A,p,g));return A=>{for(const O of x){const k=O(A);if(k)return k}return!1}}const m=d(f)&&f.tokens&&f.input;if(f===""||typeof f!="string"&&!m)throw new TypeError("Expected pattern to be a non-empty string");const y=p||{},C=y.windows,w=m?h.compileRe(f,p):h.makeRe(f,p,!1,!0),b=w.state;delete w.state;let S=()=>!1;if(y.ignore){const x={...p,ignore:null,onMatch:null,onResult:null};S=h(y.ignore,x,g)}const E=(x,_=!1)=>{const{isMatch:A,match:O,output:k}=h.test(x,w,p,{glob:f,posix:C}),M={glob:f,state:b,regex:w,posix:C,input:x,output:k,match:O,isMatch:A};return typeof y.onResult=="function"&&y.onResult(M),A===!1?(M.isMatch=!1,_?M:!1):S(x)?(typeof y.onIgnore=="function"&&y.onIgnore(M),M.isMatch=!1,_?M:!1):(typeof y.onMatch=="function"&&y.onMatch(M),_?M:!0)};return g&&(E.state=b),E};h.test=(f,p,g,{glob:m,posix:y}={})=>{if(typeof f!="string")throw new TypeError("Expected input to be a string");if(f==="")return{isMatch:!1,output:""};const C=g||{},w=C.format||(y?c.toPosixSlashes:null);let b=f===m,S=b&&w?w(f):f;return b===!1&&(S=w?w(f):f,b=S===m),(b===!1||C.capture===!0)&&(C.matchBase===!0||C.basename===!0?b=h.matchBase(f,p,g,y):b=p.exec(S)),{isMatch:!!b,match:b,output:S}},h.matchBase=(f,p,g)=>(p instanceof RegExp?p:h.makeRe(p,g)).test(c.basename(f)),h.isMatch=(f,p,g)=>h(p,g)(f),h.parse=(f,p)=>Array.isArray(f)?f.map(g=>h.parse(g,p)):l(f,{...p,fastpaths:!1}),h.scan=(f,p)=>a(f,p),h.compileRe=(f,p,g=!1,m=!1)=>{if(g===!0)return f.output;const y=p||{},C=y.contains?"":"^",w=y.contains?"":"$";let b=`${C}(?:${f.output})${w}`;f&&f.negated===!0&&(b=`^(?!${b}).*$`);const S=h.toRegex(b,p);return m===!0&&(S.state=f),S},h.makeRe=(f,p={},g=!1,m=!1)=>{if(!f||typeof f!="string")throw new TypeError("Expected a non-empty string");let y={negated:!1,fastpaths:!0};return p.fastpaths!==!1&&(f[0]==="."||f[0]==="*")&&(y.output=l.fastpaths(f,p)),y.output||(y=l(f,p)),h.compileRe(y,p,g,m)},h.toRegex=(f,p)=>{try{const g=p||{};return new RegExp(f,g.flags||(g.nocase?"i":""))}catch(g){if(p&&p.debug===!0)throw g;return/$^/}},h.constants=u,o.exports=h},716:(o,i,s)=>{const a=s(96),{CHAR_ASTERISK:l,CHAR_AT:c,CHAR_BACKWARD_SLASH:u,CHAR_COMMA:d,CHAR_DOT:h,CHAR_EXCLAMATION_MARK:f,CHAR_FORWARD_SLASH:p,CHAR_LEFT_CURLY_BRACE:g,CHAR_LEFT_PARENTHESES:m,CHAR_LEFT_SQUARE_BRACKET:y,CHAR_PLUS:C,CHAR_QUESTION_MARK:w,CHAR_RIGHT_CURLY_BRACE:b,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:E}=s(154),x=O=>O===p||O===u,_=O=>{O.isPrefix!==!0&&(O.depth=O.isGlobstar?1/0:1)},A=(O,k)=>{const M=k||{},I=O.length-1,P=M.parts===!0||M.scanToEnd===!0,F=[],z=[],$=[];let J=O,K=-1,R=0,Q=0,se=!1,ie=!1,de=!1,ue=!1,pe=!1,D=!1,ce=!1,ye=!1,be=!1,H=!1,L=0,He,G,ne={value:"",depth:0,isGlob:!1};const X=()=>K>=I,W=()=>J.charCodeAt(K+1),V=()=>(He=G,J.charCodeAt(++K));for(;K<I;){G=V();let Se;if(G===u){ce=ne.backslashes=!0,G=V(),G===g&&(D=!0);continue}if(D===!0||G===g){for(L++;X()!==!0&&(G=V());){if(G===u){ce=ne.backslashes=!0,V();continue}if(G===g){L++;continue}if(D!==!0&&G===h&&(G=V())===h){if(se=ne.isBrace=!0,de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(D!==!0&&G===d){if(se=ne.isBrace=!0,de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===b&&(L--,L===0)){D=!1,se=ne.isBrace=!0,H=!0;break}}if(P===!0)continue;break}if(G===p){if(F.push(K),z.push(ne),ne={value:"",depth:0,isGlob:!1},H===!0)continue;if(He===h&&K===R+1){R+=2;continue}Q=K+1;continue}if(M.noext!==!0&&(G===C||G===c||G===l||G===w||G===f)===!0&&W()===m){if(de=ne.isGlob=!0,ue=ne.isExtglob=!0,H=!0,G===f&&K===R&&(be=!0),P===!0){for(;X()!==!0&&(G=V());){if(G===u){ce=ne.backslashes=!0,G=V();continue}if(G===S){de=ne.isGlob=!0,H=!0;break}}continue}break}if(G===l){if(He===l&&(pe=ne.isGlobstar=!0),de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===w){if(de=ne.isGlob=!0,H=!0,P===!0)continue;break}if(G===y){for(;X()!==!0&&(Se=V());){if(Se===u){ce=ne.backslashes=!0,V();continue}if(Se===E){ie=ne.isBracket=!0,de=ne.isGlob=!0,H=!0;break}}if(P===!0)continue;break}if(M.nonegate!==!0&&G===f&&K===R){ye=ne.negated=!0,R++;continue}if(M.noparen!==!0&&G===m){if(de=ne.isGlob=!0,P===!0){for(;X()!==!0&&(G=V());){if(G===m){ce=ne.backslashes=!0,G=V();continue}if(G===S){H=!0;break}}continue}break}if(de===!0){if(H=!0,P===!0)continue;break}}M.noext===!0&&(ue=!1,de=!1);let ee=J,Ce="",we="";R>0&&(Ce=J.slice(0,R),J=J.slice(R),Q-=R),ee&&de===!0&&Q>0?(ee=J.slice(0,Q),we=J.slice(Q)):de===!0?(ee="",we=J):ee=J,ee&&ee!==""&&ee!=="/"&&ee!==J&&x(ee.charCodeAt(ee.length-1))&&(ee=ee.slice(0,-1)),M.unescape===!0&&(we&&(we=a.removeBackslashes(we)),ee&&ce===!0&&(ee=a.removeBackslashes(ee)));const Z={prefix:Ce,input:O,start:R,base:ee,glob:we,isBrace:se,isBracket:ie,isGlob:de,isExtglob:ue,isGlobstar:pe,negated:ye,negatedExtglob:be};if(M.tokens===!0&&(Z.maxDepth=0,x(G)||z.push(ne),Z.tokens=z),M.parts===!0||M.tokens===!0){let Se;for(let U=0;U<F.length;U++){const B=Se?Se+1:R,re=F[U],j=O.slice(B,re);M.tokens&&(U===0&&R!==0?(z[U].isPrefix=!0,z[U].value=Ce):z[U].value=j,_(z[U]),Z.maxDepth+=z[U].depth),(U!==0||j!=="")&&$.push(j),Se=re}if(Se&&Se+1<O.length){const U=O.slice(Se+1);$.push(U),M.tokens&&(z[z.length-1].value=U,_(z[z.length-1]),Z.maxDepth+=z[z.length-1].depth)}Z.slashes=F,Z.parts=$}return Z};o.exports=A},96:(o,i,s)=>{const{REGEX_BACKSLASH:a,REGEX_REMOVE_BACKSLASH:l,REGEX_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_GLOBAL:u}=s(154);i.isObject=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),i.hasRegexChars=d=>c.test(d),i.isRegexChar=d=>d.length===1&&i.hasRegexChars(d),i.escapeRegex=d=>d.replace(u,"\\$1"),i.toPosixSlashes=d=>d.replace(a,"/"),i.removeBackslashes=d=>d.replace(l,h=>h==="\\"?"":h),i.escapeLast=(d,h,f)=>{const p=d.lastIndexOf(h,f);return p===-1?d:d[p-1]==="\\"?i.escapeLast(d,h,p-1):`${d.slice(0,p)}\\${d.slice(p)}`},i.removePrefix=(d,h={})=>{let f=d;return f.startsWith("./")&&(f=f.slice(2),h.prefix="./"),f},i.wrapOutput=(d,h={},f={})=>{const p=f.contains?"":"^",g=f.contains?"":"$";let m=`${p}(?:${d})${g}`;return h.negated===!0&&(m=`(?:^(?!${m}).*$)`),m},i.basename=(d,{windows:h}={})=>{const f=d.split(h?/[\\/]/:"/"),p=f[f.length-1];return p===""?f[f.length-2]:p}}},e={};function n(o){var i=e[o];if(i!==void 0)return i.exports;var s=e[o]={exports:{}},a=!0;try{t[o](s,s.exports,n),a=!1}finally{a&&delete e[o]}return s.exports}typeof n<"u"&&(n.ab=__dirname+"/");var r=n(170);fg.exports=r})()),fg.exports}var qE;function uB(){return qE||(qE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{hasLocalMatch:function(){return o},matchLocalPattern:function(){return r}});const n=UE();function r(i,s){if(i.search!==void 0&&i.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=i.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function o(i,s){if(!i)return!0;const a=new URL(s,"http://n");return i.some(l=>r(l,a))}}(dg)),dg}var hg={},WE;function dB(){return WE||(WE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(i,s){for(var a in s)Object.defineProperty(i,a,{enumerable:!0,get:s[a]})}e(t,{hasRemoteMatch:function(){return o},matchRemotePattern:function(){return r}});const n=UE();function r(i,s){if(i.protocol!==void 0){const l=s.protocol.slice(0,-1);if(i.protocol!==l)return!1}if(i.port!==void 0&&i.port!==s.port)return!1;if(i.hostname===void 0)throw new Error(`Pattern should define hostname but found
|
224
|
+
`+JSON.stringify(i));if(!(0,n.makeRe)(i.hostname).test(s.hostname)||i.search!==void 0&&i.search!==s.search)return!1;var a;return!!(0,n.makeRe)((a=i.pathname)!=null?a:"**",{dot:!0}).test(s.pathname)}function o(i,s,a){return i.some(l=>a.hostname===l)||s.some(l=>r(l,a))}}(hg)),hg}var KE;function GE(){return KE||(KE=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const e=75;function n(o){let{config:i,src:s,width:a,quality:l}=o;var c;if(process.env.NODE_ENV!=="production"){const d=[];if(s||d.push("src"),a||d.push("width"),d.length>0)throw new Error("Next Image Optimization requires "+d.join(", ")+" to be provided. Make sure you pass them as props to the `next/image` component. Received: "+JSON.stringify({src:s,width:a,quality:l}));if(s.startsWith("//"))throw new Error('Failed to parse src "'+s+'" on `next/image`, protocol-relative URL (//) must be changed to an absolute URL (http:// or https://)');if(s.startsWith("/")&&i.localPatterns&&process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasLocalMatch:h}=uB();if(!h(i.localPatterns,s))throw new Error("Invalid src prop ("+s+") on `next/image` does not match `images.localPatterns` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns")}if(!s.startsWith("/")&&(i.domains||i.remotePatterns)){let h;try{h=new URL(s)}catch(f){throw console.error(f),new Error('Failed to parse src "'+s+'" on `next/image`, if using relative image it must start with a leading slash "/" or be an absolute URL (http:// or https://)')}if(process.env.NODE_ENV!=="test"&&process.env.NEXT_RUNTIME!=="edge"){const{hasRemoteMatch:f}=dB();if(!f(i.domains,i.remotePatterns,h))throw new Error("Invalid src prop ("+s+') on `next/image`, hostname "'+h.hostname+'" is not configured under images in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-host')}}if(l&&i.qualities&&!i.qualities.includes(l))throw new Error("Invalid quality prop ("+l+") on `next/image` does not match `images.qualities` configured in your `next.config.js`\nSee more info: https://nextjs.org/docs/messages/next-image-unconfigured-qualities")}const u=l||((c=i.qualities)==null?void 0:c.reduce((d,h)=>Math.abs(h-e)<Math.abs(d-e)?h:d))||e;return i.path+"?url="+encodeURIComponent(s)+"&w="+a+"&q="+u+(process.env.NEXT_DEPLOYMENT_ID?"&dpl="+process.env.NEXT_DEPLOYMENT_ID:"")}n.__next_img_default=!0;const r=n}(ug)),ug}(function(t,e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Image",{enumerable:!0,get:function(){return w}});const n=Nt,r=ki(),o=Ti,i=r._(T),s=n._(Lo),a=n._(lB()),l=og,c=Yc,u=cB(),d=Xc,h=Nu(),f=n._(GE()),p=process.env.__NEXT_IMAGE_OPTS;typeof window>"u"&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);function g(b,S,E,x,_,A,O){const k=b==null?void 0:b.src;if(!b||b["data-loaded-src"]===k)return;b["data-loaded-src"]=k,("decode"in b?b.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(!(!b.parentElement||!b.isConnected)){if(S!=="empty"&&_(!0),E!=null&&E.current){const I=new Event("load");Object.defineProperty(I,"target",{writable:!1,value:b});let P=!1,F=!1;E.current({...I,nativeEvent:I,currentTarget:b,target:b,isDefaultPrevented:()=>P,isPropagationStopped:()=>F,persist:()=>{},preventDefault:()=>{P=!0,I.preventDefault()},stopPropagation:()=>{F=!0,I.stopPropagation()}})}if(x!=null&&x.current&&x.current(b),process.env.NODE_ENV!=="production"){const I=new URL(k,"http://n").searchParams.get("url")||k;if(b.getAttribute("data-nimg")==="fill"){if(!A&&(!O||O==="100vw")&&b.getBoundingClientRect().width/window.innerWidth<.6&&(O==="100vw"?(0,d.warnOnce)('Image with src "'+I+'" has "fill" prop and "sizes" prop of "100vw", but image is not rendered at full viewport width. Please adjust "sizes" to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes'):(0,d.warnOnce)('Image with src "'+I+'" has "fill" but is missing "sizes" prop. Please add it to improve page performance. Read more: https://nextjs.org/docs/api-reference/next/image#sizes')),b.parentElement){const{position:z}=window.getComputedStyle(b.parentElement),$=["absolute","fixed","relative"];$.includes(z)||(0,d.warnOnce)('Image with src "'+I+'" has "fill" and parent element with invalid "position". Provided "'+z+'" should be one of '+$.map(String).join(",")+".")}b.height===0&&(0,d.warnOnce)('Image with src "'+I+'" has "fill" and a height value of 0. This is likely because the parent element of the image has not been styled to have a set height.')}const P=b.height.toString()!==b.getAttribute("height"),F=b.width.toString()!==b.getAttribute("width");(P&&!F||!P&&F)&&(0,d.warnOnce)('Image with src "'+I+`" has either width or height modified, but not the other. If you use CSS to change the size of your image, also include the styles 'width: "auto"' or 'height: "auto"' to maintain the aspect ratio.`)}}})}function m(b){return i.use?{fetchPriority:b}:{fetchpriority:b}}const y=(0,i.forwardRef)((b,S)=>{let{src:E,srcSet:x,sizes:_,height:A,width:O,decoding:k,className:M,style:I,fetchPriority:P,placeholder:F,loading:z,unoptimized:$,fill:J,onLoadRef:K,onLoadingCompleteRef:R,setBlurComplete:Q,setShowAltText:se,sizesInput:ie,onLoad:de,onError:ue,...pe}=b;return(0,o.jsx)("img",{...pe,...m(P),loading:z,width:O,height:A,decoding:k,"data-nimg":J?"fill":"1",className:M,style:I,sizes:_,srcSet:x,src:E,ref:(0,i.useCallback)(D=>{S&&(typeof S=="function"?S(D):typeof S=="object"&&(S.current=D)),D&&(ue&&(D.src=D.src),process.env.NODE_ENV!=="production"&&(E||console.error('Image is missing required "src" property:',D),D.getAttribute("alt")===null&&console.error('Image is missing required "alt" property. Please add Alternative Text to describe the image for screen readers and search engines.')),D.complete&&g(D,F,K,R,Q,$,ie))},[E,F,K,R,Q,ue,$,ie,S]),onLoad:D=>{const ce=D.currentTarget;g(ce,F,K,R,Q,$,ie)},onError:D=>{se(!0),F!=="empty"&&Q(!0),ue&&ue(D)}})});function C(b){let{isAppRouter:S,imgAttributes:E}=b;const x={as:"image",imageSrcSet:E.srcSet,imageSizes:E.sizes,crossOrigin:E.crossOrigin,referrerPolicy:E.referrerPolicy,...m(E.fetchPriority)};return S&&s.default.preload?(s.default.preload(E.src,x),null):(0,o.jsx)(a.default,{children:(0,o.jsx)("link",{rel:"preload",href:E.srcSet?void 0:E.src,...x},"__nimg-"+E.src+E.srcSet+E.sizes)})}const w=(0,i.forwardRef)((b,S)=>{const x=!(0,i.useContext)(h.RouterContext),_=(0,i.useContext)(u.ImageConfigContext),A=(0,i.useMemo)(()=>{var R;const Q=p||_||c.imageConfigDefault,se=[...Q.deviceSizes,...Q.imageSizes].sort((ue,pe)=>ue-pe),ie=Q.deviceSizes.sort((ue,pe)=>ue-pe),de=(R=Q.qualities)==null?void 0:R.sort((ue,pe)=>ue-pe);return{...Q,allSizes:se,deviceSizes:ie,qualities:de}},[_]),{onLoad:O,onLoadingComplete:k}=b,M=(0,i.useRef)(O);(0,i.useEffect)(()=>{M.current=O},[O]);const I=(0,i.useRef)(k);(0,i.useEffect)(()=>{I.current=k},[k]);const[P,F]=(0,i.useState)(!1),[z,$]=(0,i.useState)(!1),{props:J,meta:K}=(0,l.getImgProps)(b,{defaultLoader:f.default,imgConf:A,blurComplete:P,showAltText:z});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y,{...J,unoptimized:K.unoptimized,placeholder:K.placeholder,fill:K.fill,onLoadRef:M,onLoadingCompleteRef:I,setBlurComplete:F,setShowAltText:$,sizesInput:b.sizes,ref:S}),K.priority?(0,o.jsx)(C,{isAppRouter:x,imgAttributes:J}):null]})});(typeof e.default=="function"||typeof e.default=="object"&&e.default!==null)&&typeof e.default.__esModule>"u"&&(Object.defineProperty(e.default,"__esModule",{value:!0}),Object.assign(e.default,e),t.exports=e.default)})(ig,ig.exports);var fB=ig.exports;(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{default:function(){return a},getImageProps:function(){return s}});const n=Nt,r=og,o=fB,i=n._(GE());function s(l){const{props:c}=(0,r.getImgProps)(l,{defaultLoader:i.default,imgConf:process.env.__NEXT_IMAGE_OPTS});for(const[u,d]of Object.entries(c))d===void 0&&delete c[u];return{props:c}}const a=o.Image})(oB),N.ComponentManager.registerComponent("Editor.Image",rB);function JE(t,e){return T.useCallback(r=>{const o=t.view;o.dispatch(o.state.tr.setNodeMarkup(e(),void 0,{...r})),t.commands.focus()},[t,e])}function hB({name:t,placeholder:e,...n}){return v.jsx(Je.Field,{name:t,children:({field:r,meta:o})=>v.jsx(nB,{...n,defaultValue:o.initialValue,onChange:i=>r.onChange({target:{name:t,value:i}})})})}function XE({children:t,...e}){return v.jsx(N.Tile,{scheme:"light",p:"5",...e,children:t})}function YE({name:t,...e}){return v.jsx(XE,{h:"min",...e,children:v.jsx(hB,{minH:"128",minW:"144",name:t,placeHolder:"Write here..."})})}function pB({queryId:t,api:e,children:n,...r}){const{data:o,isLoading:i,isError:s}=Sn(e.queryKey,e.get,t),a=No(e.queryKey,t);return i?v.jsx(gr,{w:"full",h:"100%"}):s?v.jsx(Yr,{p:"0",onClick:a}):v.jsx(ja,{...r,children:n(o)})}const pg=T.forwardRef(pB);function QE({children:t,...e}){return v.jsx("div",{w:"112",minW:"112",minH:"100%",gap:"8",dflex:!0,flexCol:!0,...e,children:t})}function ZE({title:t,children:e,...n}){return v.jsxs("div",{w:"full",bgColor:"white",rounded:!0,p:"5",textSize:"sm",...n,children:[t&&v.jsx(N_,{children:t}),e]})}function gg({children:t,...e}){return v.jsx("div",{trait:"typo.h5",children:t})}function mg({title:t,breadcrumbs:e,children:n,...r}){return v.jsxs(Ha,{gap:"3",minH:"9",...r,children:[t&&v.jsx(gg,{children:t}),e&&v.jsx(Vu,{breadcrumbs:e}),v.jsx("div",{flexGrow:!0}),n]})}const[gB,e_]=Be.createContext();function t_({children:t}){const[e,n]=T.useState(null);return T.createRef(),v.jsx(gB,{value:{containerEl:e,setContainerEl:n},children:t})}function n_({title:t,breadcrumbs:e,children:n,...r}){const o=T.createRef(),{setContainerEl:i}=e_(),[s,a]=T.useState(!1);return T.useEffect(()=>(!s&&o.current&&(i(o.current),a(!0)),()=>i(null)),[]),v.jsx(Ha,{gap:"3",minH:"9",...r,children:v.jsxs(v.Fragment,{children:[t&&v.jsx(gg,{children:t}),e&&v.jsx(Vu,{breadcrumbs:e}),v.jsx("div",{flexGrow:!0}),v.jsx("div",{ref:o,dflex:!0,flexRow:!0,gap:"3"}),n]})})}function r_({trackingRef:t,children:e}){const{containerEl:n}=e_(),[r,o]=T.useState(!1),i=T.useMemo(()=>n,[n]),s=n??(typeof window<"u"?document.body:void 0);T.useLayoutEffect(()=>{if(!(!i||!s)){try{r?s.appendChild(i):s.removeChild(i)}catch{}return()=>{try{s.removeChild(i)}catch{}}}},[r,i,s]);const a=T.useCallback(l=>{o(l[0].isVisible)},[e]);return T.useEffect(()=>{const l={root:null,rootMargin:"0px",threshold:0,trackVisibility:!0,delay:100},c=new IntersectionObserver(a,l);return t&&c.observe(t),()=>c.disconnect()},[t,a,e]),s&&i?Lo.createPortal(e,i):null}function mB({tabbed:t,breadcrumbs:e,api:n,item:r,isLoading:o,buttonBar:i,trackingRef:s}){return v.jsxs(v.Fragment,{children:[t&&v.jsx(r_,{trackingRef:s,children:v.jsx(o_,{api:n,item:r,isLoading:o,buttonBar:i})}),!t&&v.jsx(mg,{breadcrumbs:e,children:v.jsx(o_,{api:n,item:r,isLoading:o,buttonBar:i})})]})}function o_({api:t,item:e,isLoading:n,buttonBar:r}){return v.jsxs(v.Fragment,{children:[r==null?void 0:r.map((o,i)=>v.jsxs(T.Fragment,{children:[o.type==="link"&&v.jsx(Z0,{path:o.path,icon:o.icon}),o.type==="invalidate"&&v.jsx(ld,{pathOrPermalink:o.pathOrPermalink}),o.type=="custom"&&o.render(e)]},i)),v.jsx($y,{api:t,queryId:e.id,status:e.status,disabled:n}),v.jsx(Q0,{disabled:n})]})}function yB({queryField:t,api:e,processInput:n,screen:r,tabbed:o,...i}){const{[t]:s}=wn.useParams(),a=T.useRef(null);return v.jsx(pg,{api:e,queryId:s,ref:a,p:"5",...i,children:l=>v.jsx(vB,{item:l,screen:r,api:e,tabbed:o,processInput:n,containerRef:a})})}function vB({item:t,screen:e,api:n,processInput:r,tabbed:o,containerRef:i}){const{breadcrumbs:s,schema:a,initialValues:l,header:c,editorFooter:u,sections:d,buttonBar:h,editor:f,type:p,invalidateParentQueryKey:g}=Be.runIfFn(e,t),m=Gr(n.update,g??n.queryKey,{networkMode:"always"}),y=ya(m,{processInput:r,successMsg:w=>`${w.title} updated.`,errorMsg:(w,b)=>`Error updating ${b.title}: ${w}`});let C;return p=="post"?C="calc(1280px - 30rem)":p=="section"&&(C="calc(1280px - 22rem)"),v.jsxs(qd,{initialValues:Be.runIfFn(l,t),validationSchema:a,onSubmit:y,enableReinitialize:!0,children:[v.jsx(mB,{tabbed:o,api:n,breadcrumbs:s,buttonBar:h,item:t,isLoading:m.isLoading,trackingRef:i==null?void 0:i.current}),v.jsxs(ja,{w:C?"auto":"full",size:"x2",id:"pagecontainer",children:[c,v.jsxs("div",{dflex:!0,gap:"8",children:[v.jsxs("div",{dflex:!0,flexCol:!0,gap:"8",flexGrow:!0,children:[(f==null?void 0:f.type)!="textarea"&&v.jsx(YE,{name:"content",maxW:C,minW:"144"}),(f==null?void 0:f.type)=="textarea"&&v.jsx(dd,{name:f==null?void 0:f.name,maxW:C,minW:C,minH:"128",rows:25,bgColor:"white",border:"0",p:"5",textColor:"slate-800"}),u]}),v.jsx(QE,{children:d==null?void 0:d.map((w,b)=>v.jsx(bB,{section:w,item:t},b))})]})]})]})}function bB({section:t,item:e}){return t.type==="section"?v.jsx(ZE,{title:t.title,children:v.jsx(Qr,{form:Be.runIfFn(t.form,e)})}):t.type==="custom"?Be.runIfFn(t.component,e):null}function wB(t,e){const n=wn.useParams();if(e===void 0)return{id:void 0,api:t};const{[e]:r}=n;return{id:r,api:Be.runIfFn(t,r)}}function SB({api:t,queryField:e,fn:n,transformFn:r,config:o,tabbed:i,...s}){const{id:a,api:l}=wB(t,e),{data:c}=Sn(l.queryKey,n==="get"||n==="getTransformed"?l.get:l.getAll,Be.isFunction(t)?void 0:a),u=T.useMemo(()=>c&&(n==="getTransformed"||n==="getAllTransformed")?(r||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${n}`),r==null?void 0:r(c)):c,[c]);return c?v.jsx(ru,{config:o(u),tabbed:i,...s}):null}function CB({queryField:t,api:e,screen:n,...r}){const{[t]:o}=wn.useParams();return v.jsx(pg,{queryId:o,api:e,p:"5",children:i=>{const{breadcrumbs:s,tabs:a}=Be.runIfFn(n,i);return v.jsxs(t_,{children:[v.jsx(n_,{breadcrumbs:s,mb:"-3"}),v.jsx(wk,{tabs:a.map(l=>l.label),saveKey:`tab-${o}`,mt:"-3",mb:"3",id:"fff",children:a.map((l,c)=>v.jsx(EB,{tab:l},c))})]})}})}function EB({tab:t}){if(!t.component&&!t.config)throw new Error(`Screen config for tabbed view: one of your tabs does not have a component or config declared: ${t.label}`);return t.component?t.component():v.jsx(ru,{config:t.config,tabbed:!0,p:"0"})}/**
|
225
|
+
* table-core
|
226
|
+
*
|
227
|
+
* Copyright (c) TanStack
|
228
|
+
*
|
229
|
+
* This source code is licensed under the MIT license found in the
|
230
|
+
* LICENSE.md file in the root directory of this source tree.
|
231
|
+
*
|
232
|
+
* @license MIT
|
233
|
+
*/function _B(){return{accessor:(t,e)=>typeof t=="function"?{...e,accessorFn:t}:{...e,accessorKey:t},display:t=>t,group:t=>t}}function Ur(t,e){return typeof t=="function"?t(e):t}function tn(t,e){return n=>{e.setState(r=>({...r,[t]:Ur(n,r[t])}))}}function Zc(t){return t instanceof Function}function xB(t){return Array.isArray(t)&&t.every(e=>typeof e=="number")}function AB(t,e){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=e(i);s!=null&&s.length&&r(s)})};return r(t),n}function Pe(t,e,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=t(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=e(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,h=d/16,f=(p,g)=>{for(p=String(p);p.length<g;)p=" "+p;return p};console.info(`%c⏱ ${f(d,5)} /${f(u,5)} ms`,`
|
234
|
+
font-size: .6rem;
|
235
|
+
font-weight: bold;
|
236
|
+
color: hsl(${Math.max(0,Math.min(120-120*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Ie(t,e,n,r){return{debug:()=>{var o;return(o=t==null?void 0:t.debugAll)!=null?o:t[e]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function OB(t,e,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:t.options.renderFallbackValue},i={id:`${e.id}_${n.id}`,row:e,column:n,getValue:()=>e.getValue(r),renderValue:o,getContext:Pe(()=>[t,n,e,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ie(t.options,"debugCells","cell.getContext"))};return t._features.forEach(s=>{s.createCell==null||s.createCell(i,n,e,t)},{}),i}function TB(t,e,n,r){var o,i;const a={...t._getDefaultColumnDef(),...e},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=h=>{let f=h;for(const g of l.split(".")){var p;f=(p=f)==null?void 0:p[g],process.env.NODE_ENV!=="production"&&f===void 0&&console.warn(`"${g}" in deeply nested key "${l}" returned undefined.`)}return f}:u=h=>h[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:Pe(()=>[!0],()=>{var h;return[d,...(h=d.columns)==null?void 0:h.flatMap(f=>f.getFlatColumns())]},Ie(t.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Pe(()=>[t._getOrderColumnsFn()],h=>{var f;if((f=d.columns)!=null&&f.length){let p=d.columns.flatMap(g=>g.getLeafColumns());return h(p)}return[d]},Ie(t.options,"debugColumns","column.getLeafColumns"))};for(const h of t._features)h.createColumn==null||h.createColumn(d,t);return d}const Rt="debugHeaders";function i_(t,e,n){var r;let i={id:(r=n.id)!=null?r:e.id,column:e,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:t,header:i,column:e})};return t._features.forEach(s=>{s.createHeader==null||s.createHeader(i,t)}),i}const kB={createTable:t=>{t.getHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(h=>h.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return eu(e,[...a,...c,...l],t)},Ie(t.options,Rt,"getHeaderGroups")),t.getCenterHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),eu(e,n,t,"center")),Ie(t.options,Rt,"getCenterHeaderGroups")),t.getLeftHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.left],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return eu(e,i,t,"left")},Ie(t.options,Rt,"getLeftHeaderGroups")),t.getRightHeaderGroups=Pe(()=>[t.getAllColumns(),t.getVisibleLeafColumns(),t.getState().columnPinning.right],(e,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return eu(e,i,t,"right")},Ie(t.options,Rt,"getRightHeaderGroups")),t.getFooterGroups=Pe(()=>[t.getHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getFooterGroups")),t.getLeftFooterGroups=Pe(()=>[t.getLeftHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getLeftFooterGroups")),t.getCenterFooterGroups=Pe(()=>[t.getCenterHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getCenterFooterGroups")),t.getRightFooterGroups=Pe(()=>[t.getRightHeaderGroups()],e=>[...e].reverse(),Ie(t.options,Rt,"getRightFooterGroups")),t.getFlatHeaders=Pe(()=>[t.getHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getFlatHeaders")),t.getLeftFlatHeaders=Pe(()=>[t.getLeftHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getLeftFlatHeaders")),t.getCenterFlatHeaders=Pe(()=>[t.getCenterHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getCenterFlatHeaders")),t.getRightFlatHeaders=Pe(()=>[t.getRightHeaderGroups()],e=>e.map(n=>n.headers).flat(),Ie(t.options,Rt,"getRightFlatHeaders")),t.getCenterLeafHeaders=Pe(()=>[t.getCenterFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getCenterLeafHeaders")),t.getLeftLeafHeaders=Pe(()=>[t.getLeftFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getLeftLeafHeaders")),t.getRightLeafHeaders=Pe(()=>[t.getRightFlatHeaders()],e=>e.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Ie(t.options,Rt,"getRightLeafHeaders")),t.getLeafHeaders=Pe(()=>[t.getLeftHeaderGroups(),t.getCenterHeaderGroups(),t.getRightHeaderGroups()],(e,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=e[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},Ie(t.options,Rt,"getLeafHeaders"))}};function eu(t,e,n,r){var o,i;let s=0;const a=function(h,f){f===void 0&&(f=1),s=Math.max(s,f),h.filter(p=>p.getIsVisible()).forEach(p=>{var g;(g=p.columns)!=null&&g.length&&a(p.columns,f+1)},0)};a(t);let l=[];const c=(h,f)=>{const p={depth:f,id:[r,`${f}`].filter(Boolean).join("_"),headers:[]},g=[];h.forEach(m=>{const y=[...g].reverse()[0],C=m.column.depth===p.depth;let w,b=!1;if(C&&m.column.parent?w=m.column.parent:(w=m.column,b=!0),y&&(y==null?void 0:y.column)===w)y.subHeaders.push(m);else{const S=i_(n,w,{id:[r,f,w.id,m==null?void 0:m.id].filter(Boolean).join("_"),isPlaceholder:b,placeholderId:b?`${g.filter(E=>E.column===w).length}`:void 0,depth:f,index:g.length});S.subHeaders.push(m),g.push(S)}p.headers.push(m),m.headerGroup=p}),l.push(p),f>0&&c(g,f-1)},u=e.map((h,f)=>i_(n,h,{depth:s,index:f}));c(u,s-1),l.reverse();const d=h=>h.filter(p=>p.column.getIsVisible()).map(p=>{let g=0,m=0,y=[0];p.subHeaders&&p.subHeaders.length?(y=[],d(p.subHeaders).forEach(w=>{let{colSpan:b,rowSpan:S}=w;g+=b,y.push(S)})):g=1;const C=Math.min(...y);return m=m+C,p.colSpan=g,p.rowSpan=m,{colSpan:g,rowSpan:m}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const yg=(t,e,n,r,o,i,s)=>{let a={id:e,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=t.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:t.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>AB(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?t.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:Pe(()=>[t.getAllLeafColumns()],l=>l.map(c=>OB(t,a,c,c.id)),Ie(t.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Pe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Ie(t.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<t._features.length;l++){const c=t._features[l];c==null||c.createRow==null||c.createRow(a,t)}return a},MB={createColumn:(t,e)=>{t._getFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,t.id),t.getFacetedRowModel=()=>t._getFacetedRowModel?t._getFacetedRowModel():e.getPreFilteredRowModel(),t._getFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,t.id),t.getFacetedUniqueValues=()=>t._getFacetedUniqueValues?t._getFacetedUniqueValues():new Map,t._getFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,t.id),t.getFacetedMinMaxValues=()=>{if(t._getFacetedMinMaxValues)return t._getFacetedMinMaxValues()}}},s_=(t,e,n)=>{var r;const o=n.toLowerCase();return!!(!((r=t.getValue(e))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};s_.autoRemove=t=>bn(t);const a_=(t,e,n)=>{var r;return!!(!((r=t.getValue(e))==null||(r=r.toString())==null)&&r.includes(n))};a_.autoRemove=t=>bn(t);const l_=(t,e,n)=>{var r;return((r=t.getValue(e))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};l_.autoRemove=t=>bn(t);const c_=(t,e,n)=>{var r;return(r=t.getValue(e))==null?void 0:r.includes(n)};c_.autoRemove=t=>bn(t)||!(t!=null&&t.length);const u_=(t,e,n)=>!n.some(r=>{var o;return!((o=t.getValue(e))!=null&&o.includes(r))});u_.autoRemove=t=>bn(t)||!(t!=null&&t.length);const d_=(t,e,n)=>n.some(r=>{var o;return(o=t.getValue(e))==null?void 0:o.includes(r)});d_.autoRemove=t=>bn(t)||!(t!=null&&t.length);const f_=(t,e,n)=>t.getValue(e)===n;f_.autoRemove=t=>bn(t);const h_=(t,e,n)=>t.getValue(e)==n;h_.autoRemove=t=>bn(t);const vg=(t,e,n)=>{let[r,o]=n;const i=t.getValue(e);return i>=r&&i<=o};vg.resolveFilterValue=t=>{let[e,n]=t,r=typeof e!="number"?parseFloat(e):e,o=typeof n!="number"?parseFloat(n):n,i=e===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]},vg.autoRemove=t=>bn(t)||bn(t[0])&&bn(t[1]);const sr={includesString:s_,includesStringSensitive:a_,equalsString:l_,arrIncludes:c_,arrIncludesAll:u_,arrIncludesSome:d_,equals:f_,weakEquals:h_,inNumberRange:vg};function bn(t){return t==null||t===""}const PB={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:t=>({columnFilters:[],...t}),getDefaultOptions:t=>({onColumnFiltersChange:tn("columnFilters",t),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(t,e)=>{t.getAutoFilterFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);return typeof r=="string"?sr.includesString:typeof r=="number"?sr.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?sr.equals:Array.isArray(r)?sr.arrIncludes:sr.weakEquals},t.getFilterFn=()=>{var n,r;return Zc(t.columnDef.filterFn)?t.columnDef.filterFn:t.columnDef.filterFn==="auto"?t.getAutoFilterFn():(n=(r=e.options.filterFns)==null?void 0:r[t.columnDef.filterFn])!=null?n:sr[t.columnDef.filterFn]},t.getCanFilter=()=>{var n,r,o;return((n=t.columnDef.enableColumnFilter)!=null?n:!0)&&((r=e.options.enableColumnFilters)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&!!t.accessorFn},t.getIsFiltered=()=>t.getFilterIndex()>-1,t.getFilterValue=()=>{var n;return(n=e.getState().columnFilters)==null||(n=n.find(r=>r.id===t.id))==null?void 0:n.value},t.getFilterIndex=()=>{var n,r;return(n=(r=e.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.setFilterValue=n=>{e.setColumnFilters(r=>{const o=t.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===t.id),s=Ur(n,i?i.value:void 0);if(p_(o,s,t)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==t.id))!=null?a:[]}const l={id:t.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===t.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(t,e)=>{t.columnFilters={},t.columnFiltersMeta={}},createTable:t=>{t.setColumnFilters=e=>{const n=t.getAllLeafColumns(),r=o=>{var i;return(i=Ur(e,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(p_(l,s.value,a))return!1}return!0})};t.options.onColumnFiltersChange==null||t.options.onColumnFiltersChange(r)},t.resetColumnFilters=e=>{var n,r;t.setColumnFilters(e?[]:(n=(r=t.initialState)==null?void 0:r.columnFilters)!=null?n:[])},t.getPreFilteredRowModel=()=>t.getCoreRowModel(),t.getFilteredRowModel=()=>(!t._getFilteredRowModel&&t.options.getFilteredRowModel&&(t._getFilteredRowModel=t.options.getFilteredRowModel(t)),t.options.manualFiltering||!t._getFilteredRowModel?t.getPreFilteredRowModel():t._getFilteredRowModel())}};function p_(t,e,n){return(t&&t.autoRemove?t.autoRemove(e,n):!1)||typeof e>"u"||typeof e=="string"&&!e}const bg={sum:(t,e,n)=>n.reduce((r,o)=>{const i=o.getValue(t);return r+(typeof i=="number"?i:0)},0),min:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},max:(t,e,n)=>{let r;return n.forEach(o=>{const i=o.getValue(t);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},extent:(t,e,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(t);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},mean:(t,e)=>{let n=0,r=0;if(e.forEach(o=>{let i=o.getValue(t);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(t,e)=>{if(!e.length)return;const n=e.map(i=>i.getValue(t));if(!xB(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},unique:(t,e)=>Array.from(new Set(e.map(n=>n.getValue(t))).values()),uniqueCount:(t,e)=>new Set(e.map(n=>n.getValue(t))).size,count:(t,e)=>e.length},IB={getDefaultColumnDef:()=>({aggregatedCell:t=>{var e,n;return(e=(n=t.getValue())==null||n.toString==null?void 0:n.toString())!=null?e:null},aggregationFn:"auto"}),getInitialState:t=>({grouping:[],...t}),getDefaultOptions:t=>({onGroupingChange:tn("grouping",t),groupedColumnMode:"reorder"}),createColumn:(t,e)=>{t.toggleGrouping=()=>{e.setGrouping(n=>n!=null&&n.includes(t.id)?n.filter(r=>r!==t.id):[...n??[],t.id])},t.getCanGroup=()=>{var n,r;return((n=t.columnDef.enableGrouping)!=null?n:!0)&&((r=e.options.enableGrouping)!=null?r:!0)&&(!!t.accessorFn||!!t.columnDef.getGroupingValue)},t.getIsGrouped=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.includes(t.id)},t.getGroupedIndex=()=>{var n;return(n=e.getState().grouping)==null?void 0:n.indexOf(t.id)},t.getToggleGroupingHandler=()=>{const n=t.getCanGroup();return()=>{n&&t.toggleGrouping()}},t.getAutoAggregationFn=()=>{const n=e.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(t.id);if(typeof r=="number")return bg.sum;if(Object.prototype.toString.call(r)==="[object Date]")return bg.extent},t.getAggregationFn=()=>{var n,r;if(!t)throw new Error;return Zc(t.columnDef.aggregationFn)?t.columnDef.aggregationFn:t.columnDef.aggregationFn==="auto"?t.getAutoAggregationFn():(n=(r=e.options.aggregationFns)==null?void 0:r[t.columnDef.aggregationFn])!=null?n:bg[t.columnDef.aggregationFn]}},createTable:t=>{t.setGrouping=e=>t.options.onGroupingChange==null?void 0:t.options.onGroupingChange(e),t.resetGrouping=e=>{var n,r;t.setGrouping(e?[]:(n=(r=t.initialState)==null?void 0:r.grouping)!=null?n:[])},t.getPreGroupedRowModel=()=>t.getFilteredRowModel(),t.getGroupedRowModel=()=>(!t._getGroupedRowModel&&t.options.getGroupedRowModel&&(t._getGroupedRowModel=t.options.getGroupedRowModel(t)),t.options.manualGrouping||!t._getGroupedRowModel?t.getPreGroupedRowModel():t._getGroupedRowModel())},createRow:(t,e)=>{t.getIsGrouped=()=>!!t.groupingColumnId,t.getGroupingValue=n=>{if(t._groupingValuesCache.hasOwnProperty(n))return t._groupingValuesCache[n];const r=e.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(t._groupingValuesCache[n]=r.columnDef.getGroupingValue(t.original),t._groupingValuesCache[n]):t.getValue(n)},t._groupingValuesCache={}},createCell:(t,e,n,r)=>{t.getIsGrouped=()=>e.getIsGrouped()&&e.id===n.groupingColumnId,t.getIsPlaceholder=()=>!t.getIsGrouped()&&e.getIsGrouped(),t.getIsAggregated=()=>{var o;return!t.getIsGrouped()&&!t.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function LB(t,e,n){if(!(e!=null&&e.length)||!n)return t;const r=t.filter(i=>!e.includes(i.id));return n==="remove"?r:[...e.map(i=>t.find(s=>s.id===i)).filter(Boolean),...r]}const DB={getInitialState:t=>({columnOrder:[],...t}),getDefaultOptions:t=>({onColumnOrderChange:tn("columnOrder",t)}),createColumn:(t,e)=>{t.getIndex=Pe(n=>[Ws(e,n)],n=>n.findIndex(r=>r.id===t.id),Ie(e.options,"debugColumns","getIndex")),t.getIsFirstColumn=n=>{var r;return((r=Ws(e,n)[0])==null?void 0:r.id)===t.id},t.getIsLastColumn=n=>{var r;const o=Ws(e,n);return((r=o[o.length-1])==null?void 0:r.id)===t.id}},createTable:t=>{t.setColumnOrder=e=>t.options.onColumnOrderChange==null?void 0:t.options.onColumnOrderChange(e),t.resetColumnOrder=e=>{var n;t.setColumnOrder(e?[]:(n=t.initialState.columnOrder)!=null?n:[])},t._getOrderColumnsFn=Pe(()=>[t.getState().columnOrder,t.getState().grouping,t.options.groupedColumnMode],(e,n,r)=>o=>{let i=[];if(!(e!=null&&e.length))i=o;else{const s=[...e],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return LB(i,n,r)},Ie(t.options,"debugTable","_getOrderColumnsFn"))}},wg=()=>({left:[],right:[]}),RB={getInitialState:t=>({columnPinning:wg(),...t}),getDefaultOptions:t=>({onColumnPinningChange:tn("columnPinning",t)}),createColumn:(t,e)=>{t.pin=n=>{const r=t.getLeafColumns().map(o=>o.id).filter(Boolean);e.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},t.getCanPin=()=>t.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=e.options.enableColumnPinning)!=null?s:e.options.enablePinning)!=null?i:!0)}),t.getIsPinned=()=>{const n=t.getLeafColumns().map(a=>a.id),{left:r,right:o}=e.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();return o?(n=(r=e.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(t.id))!=null?n:-1:0}},createRow:(t,e)=>{t.getCenterVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},Ie(e.options,"debugRows","getCenterVisibleCells")),t.getLeftVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Ie(e.options,"debugRows","getLeftVisibleCells")),t.getRightVisibleCells=Pe(()=>[t._getAllVisibleCells(),e.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Ie(e.options,"debugRows","getRightVisibleCells"))},createTable:t=>{t.setColumnPinning=e=>t.options.onColumnPinningChange==null?void 0:t.options.onColumnPinningChange(e),t.resetColumnPinning=e=>{var n,r;return t.setColumnPinning(e?wg():(n=(r=t.initialState)==null?void 0:r.columnPinning)!=null?n:wg())},t.getIsSomeColumnsPinned=e=>{var n;const r=t.getState().columnPinning;if(!e){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t.getLeftLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ie(t.options,"debugColumns","getLeftLeafColumns")),t.getRightLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.right],(e,n)=>(n??[]).map(r=>e.find(o=>o.id===r)).filter(Boolean),Ie(t.options,"debugColumns","getRightLeafColumns")),t.getCenterLeafColumns=Pe(()=>[t.getAllLeafColumns(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,n,r)=>{const o=[...n??[],...r??[]];return e.filter(i=>!o.includes(i.id))},Ie(t.options,"debugColumns","getCenterLeafColumns"))}},tu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Sg=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),NB={getDefaultColumnDef:()=>tu,getInitialState:t=>({columnSizing:{},columnSizingInfo:Sg(),...t}),getDefaultOptions:t=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:tn("columnSizing",t),onColumnSizingInfoChange:tn("columnSizingInfo",t)}),createColumn:(t,e)=>{t.getSize=()=>{var n,r,o;const i=e.getState().columnSizing[t.id];return Math.min(Math.max((n=t.columnDef.minSize)!=null?n:tu.minSize,(r=i??t.columnDef.size)!=null?r:tu.size),(o=t.columnDef.maxSize)!=null?o:tu.maxSize)},t.getStart=Pe(n=>[n,Ws(e,n),e.getState().columnSizing],(n,r)=>r.slice(0,t.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Ie(e.options,"debugColumns","getStart")),t.getAfter=Pe(n=>[n,Ws(e,n),e.getState().columnSizing],(n,r)=>r.slice(t.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Ie(e.options,"debugColumns","getAfter")),t.resetSize=()=>{e.setColumnSizing(n=>{let{[t.id]:r,...o}=n;return o})},t.getCanResize=()=>{var n,r;return((n=t.columnDef.enableResizing)!=null?n:!0)&&((r=e.options.enableColumnResizing)!=null?r:!0)},t.getIsResizing=()=>e.getState().columnSizingInfo.isResizingColumn===t.id},createHeader:(t,e)=>{t.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(t),n},t.getStart=()=>{if(t.index>0){const n=t.headerGroup.headers[t.index-1];return n.getStart()+n.getSize()}return 0},t.getResizeHandler=n=>{const r=e.getColumn(t.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Cg(i)&&i.touches&&i.touches.length>1))return;const s=t.getSize(),a=t?t.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=Cg(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(y,C)=>{typeof C=="number"&&(e.setColumnSizingInfo(w=>{var b,S;const E=e.options.columnResizeDirection==="rtl"?-1:1,x=(C-((b=w==null?void 0:w.startOffset)!=null?b:0))*E,_=Math.max(x/((S=w==null?void 0:w.startSize)!=null?S:0),-.999999);return w.columnSizingStart.forEach(A=>{let[O,k]=A;c[O]=Math.round(Math.max(k+k*_,0)*100)/100}),{...w,deltaOffset:x,deltaPercentage:_}}),(e.options.columnResizeMode==="onChange"||y==="end")&&e.setColumnSizing(w=>({...w,...c})))},d=y=>u("move",y),h=y=>{u("end",y),e.setColumnSizingInfo(C=>({...C,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},f=n||typeof document<"u"?document:null,p={moveHandler:y=>d(y.clientX),upHandler:y=>{f==null||f.removeEventListener("mousemove",p.moveHandler),f==null||f.removeEventListener("mouseup",p.upHandler),h(y.clientX)}},g={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var C;f==null||f.removeEventListener("touchmove",g.moveHandler),f==null||f.removeEventListener("touchend",g.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),h((C=y.touches[0])==null?void 0:C.clientX)}},m=FB()?{passive:!1}:!1;Cg(i)?(f==null||f.addEventListener("touchmove",g.moveHandler,m),f==null||f.addEventListener("touchend",g.upHandler,m)):(f==null||f.addEventListener("mousemove",p.moveHandler,m),f==null||f.addEventListener("mouseup",p.upHandler,m)),e.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:t=>{t.setColumnSizing=e=>t.options.onColumnSizingChange==null?void 0:t.options.onColumnSizingChange(e),t.setColumnSizingInfo=e=>t.options.onColumnSizingInfoChange==null?void 0:t.options.onColumnSizingInfoChange(e),t.resetColumnSizing=e=>{var n;t.setColumnSizing(e?{}:(n=t.initialState.columnSizing)!=null?n:{})},t.resetHeaderSizeInfo=e=>{var n;t.setColumnSizingInfo(e?Sg():(n=t.initialState.columnSizingInfo)!=null?n:Sg())},t.getTotalSize=()=>{var e,n;return(e=(n=t.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getLeftTotalSize=()=>{var e,n;return(e=(n=t.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getCenterTotalSize=()=>{var e,n;return(e=(n=t.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0},t.getRightTotalSize=()=>{var e,n;return(e=(n=t.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?e:0}}};let nu=null;function FB(){if(typeof nu=="boolean")return nu;let t=!1;try{const e={get passive(){return t=!0,!1}},n=()=>{};window.addEventListener("test",n,e),window.removeEventListener("test",n)}catch{t=!1}return nu=t,nu}function Cg(t){return t.type==="touchstart"}const HB={getInitialState:t=>({columnVisibility:{},...t}),getDefaultOptions:t=>({onColumnVisibilityChange:tn("columnVisibility",t)}),createColumn:(t,e)=>{t.toggleVisibility=n=>{t.getCanHide()&&e.setColumnVisibility(r=>({...r,[t.id]:n??!t.getIsVisible()}))},t.getIsVisible=()=>{var n,r;const o=t.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=e.getState().columnVisibility)==null?void 0:r[t.id])!=null?n:!0},t.getCanHide=()=>{var n,r;return((n=t.columnDef.enableHiding)!=null?n:!0)&&((r=e.options.enableHiding)!=null?r:!0)},t.getToggleVisibilityHandler=()=>n=>{t.toggleVisibility==null||t.toggleVisibility(n.target.checked)}},createRow:(t,e)=>{t._getAllVisibleCells=Pe(()=>[t.getAllCells(),e.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Ie(e.options,"debugRows","_getAllVisibleCells")),t.getVisibleCells=Pe(()=>[t.getLeftVisibleCells(),t.getCenterVisibleCells(),t.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Ie(e.options,"debugRows","getVisibleCells"))},createTable:t=>{const e=(n,r)=>Pe(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Ie(t.options,"debugColumns",n));t.getVisibleFlatColumns=e("getVisibleFlatColumns",()=>t.getAllFlatColumns()),t.getVisibleLeafColumns=e("getVisibleLeafColumns",()=>t.getAllLeafColumns()),t.getLeftVisibleLeafColumns=e("getLeftVisibleLeafColumns",()=>t.getLeftLeafColumns()),t.getRightVisibleLeafColumns=e("getRightVisibleLeafColumns",()=>t.getRightLeafColumns()),t.getCenterVisibleLeafColumns=e("getCenterVisibleLeafColumns",()=>t.getCenterLeafColumns()),t.setColumnVisibility=n=>t.options.onColumnVisibilityChange==null?void 0:t.options.onColumnVisibilityChange(n),t.resetColumnVisibility=n=>{var r;t.setColumnVisibility(n?{}:(r=t.initialState.columnVisibility)!=null?r:{})},t.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!t.getIsAllColumnsVisible(),t.setColumnVisibility(t.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},t.getIsAllColumnsVisible=()=>!t.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),t.getIsSomeColumnsVisible=()=>t.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),t.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;t.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Ws(t,e){return e?e==="center"?t.getCenterVisibleLeafColumns():e==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns()}const BB={createTable:t=>{t._getGlobalFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,"__global__"),t.getGlobalFacetedRowModel=()=>t.options.manualFiltering||!t._getGlobalFacetedRowModel?t.getPreFilteredRowModel():t._getGlobalFacetedRowModel(),t._getGlobalFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,"__global__"),t.getGlobalFacetedUniqueValues=()=>t._getGlobalFacetedUniqueValues?t._getGlobalFacetedUniqueValues():new Map,t._getGlobalFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,"__global__"),t.getGlobalFacetedMinMaxValues=()=>{if(t._getGlobalFacetedMinMaxValues)return t._getGlobalFacetedMinMaxValues()}}},$B={getInitialState:t=>({globalFilter:void 0,...t}),getDefaultOptions:t=>({onGlobalFilterChange:tn("globalFilter",t),globalFilterFn:"auto",getColumnCanGlobalFilter:e=>{var n;const r=(n=t.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[e.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(t,e)=>{t.getCanGlobalFilter=()=>{var n,r,o,i;return((n=t.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=e.options.enableGlobalFilter)!=null?r:!0)&&((o=e.options.enableFilters)!=null?o:!0)&&((i=e.options.getColumnCanGlobalFilter==null?void 0:e.options.getColumnCanGlobalFilter(t))!=null?i:!0)&&!!t.accessorFn}},createTable:t=>{t.getGlobalAutoFilterFn=()=>sr.includesString,t.getGlobalFilterFn=()=>{var e,n;const{globalFilterFn:r}=t.options;return Zc(r)?r:r==="auto"?t.getGlobalAutoFilterFn():(e=(n=t.options.filterFns)==null?void 0:n[r])!=null?e:sr[r]},t.setGlobalFilter=e=>{t.options.onGlobalFilterChange==null||t.options.onGlobalFilterChange(e)},t.resetGlobalFilter=e=>{t.setGlobalFilter(e?void 0:t.initialState.globalFilter)}}},VB={getInitialState:t=>({expanded:{},...t}),getDefaultOptions:t=>({onExpandedChange:tn("expanded",t),paginateExpandedRows:!0}),createTable:t=>{let e=!1,n=!1;t._autoResetExpanded=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetExpanded)!=null?r:!t.options.manualExpanding){if(n)return;n=!0,t._queue(()=>{t.resetExpanded(),n=!1})}},t.setExpanded=r=>t.options.onExpandedChange==null?void 0:t.options.onExpandedChange(r),t.toggleAllRowsExpanded=r=>{r??!t.getIsAllRowsExpanded()?t.setExpanded(!0):t.setExpanded({})},t.resetExpanded=r=>{var o,i;t.setExpanded(r?{}:(o=(i=t.initialState)==null?void 0:i.expanded)!=null?o:{})},t.getCanSomeRowsExpand=()=>t.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),t.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),t.toggleAllRowsExpanded()},t.getIsSomeRowsExpanded=()=>{const r=t.getState().expanded;return r===!0||Object.values(r).some(Boolean)},t.getIsAllRowsExpanded=()=>{const r=t.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||t.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},t.getExpandedDepth=()=>{let r=0;return(t.getState().expanded===!0?Object.keys(t.getRowModel().rowsById):Object.keys(t.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},t.getPreExpandedRowModel=()=>t.getSortedRowModel(),t.getExpandedRowModel=()=>(!t._getExpandedRowModel&&t.options.getExpandedRowModel&&(t._getExpandedRowModel=t.options.getExpandedRowModel(t)),t.options.manualExpanding||!t._getExpandedRowModel?t.getPreExpandedRowModel():t._getExpandedRowModel())},createRow:(t,e)=>{t.toggleExpanded=n=>{e.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[t.id]);let s={};if(r===!0?Object.keys(e.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[t.id]:!0};if(i&&!n){const{[t.id]:a,...l}=s;return l}return r})},t.getIsExpanded=()=>{var n;const r=e.getState().expanded;return!!((n=e.options.getIsRowExpanded==null?void 0:e.options.getIsRowExpanded(t))!=null?n:r===!0||r!=null&&r[t.id])},t.getCanExpand=()=>{var n,r,o;return(n=e.options.getRowCanExpand==null?void 0:e.options.getRowCanExpand(t))!=null?n:((r=e.options.enableExpanding)!=null?r:!0)&&!!((o=t.subRows)!=null&&o.length)},t.getIsAllParentsExpanded=()=>{let n=!0,r=t;for(;n&&r.parentId;)r=e.getRow(r.parentId,!0),n=r.getIsExpanded();return n},t.getToggleExpandedHandler=()=>{const n=t.getCanExpand();return()=>{n&&t.toggleExpanded()}}}},Eg=0,_g=10,xg=()=>({pageIndex:Eg,pageSize:_g}),jB={getInitialState:t=>({...t,pagination:{...xg(),...t==null?void 0:t.pagination}}),getDefaultOptions:t=>({onPaginationChange:tn("pagination",t)}),createTable:t=>{let e=!1,n=!1;t._autoResetPageIndex=()=>{var r,o;if(!e){t._queue(()=>{e=!0});return}if((r=(o=t.options.autoResetAll)!=null?o:t.options.autoResetPageIndex)!=null?r:!t.options.manualPagination){if(n)return;n=!0,t._queue(()=>{t.resetPageIndex(),n=!1})}},t.setPagination=r=>{const o=i=>Ur(r,i);return t.options.onPaginationChange==null?void 0:t.options.onPaginationChange(o)},t.resetPagination=r=>{var o;t.setPagination(r?xg():(o=t.initialState.pagination)!=null?o:xg())},t.setPageIndex=r=>{t.setPagination(o=>{let i=Ur(r,o.pageIndex);const s=typeof t.options.pageCount>"u"||t.options.pageCount===-1?Number.MAX_SAFE_INTEGER:t.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},t.resetPageIndex=r=>{var o,i;t.setPageIndex(r?Eg:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Eg)},t.resetPageSize=r=>{var o,i;t.setPageSize(r?_g:(o=(i=t.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:_g)},t.setPageSize=r=>{t.setPagination(o=>{const i=Math.max(1,Ur(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},t.setPageCount=r=>t.setPagination(o=>{var i;let s=Ur(r,(i=t.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),t.getPageOptions=Pe(()=>[t.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Ie(t.options,"debugTable","getPageOptions")),t.getCanPreviousPage=()=>t.getState().pagination.pageIndex>0,t.getCanNextPage=()=>{const{pageIndex:r}=t.getState().pagination,o=t.getPageCount();return o===-1?!0:o===0?!1:r<o-1},t.previousPage=()=>t.setPageIndex(r=>r-1),t.nextPage=()=>t.setPageIndex(r=>r+1),t.firstPage=()=>t.setPageIndex(0),t.lastPage=()=>t.setPageIndex(t.getPageCount()-1),t.getPrePaginationRowModel=()=>t.getExpandedRowModel(),t.getPaginationRowModel=()=>(!t._getPaginationRowModel&&t.options.getPaginationRowModel&&(t._getPaginationRowModel=t.options.getPaginationRowModel(t)),t.options.manualPagination||!t._getPaginationRowModel?t.getPrePaginationRowModel():t._getPaginationRowModel()),t.getPageCount=()=>{var r;return(r=t.options.pageCount)!=null?r:Math.ceil(t.getRowCount()/t.getState().pagination.pageSize)},t.getRowCount=()=>{var r;return(r=t.options.rowCount)!=null?r:t.getPrePaginationRowModel().rows.length}}},Ag=()=>({top:[],bottom:[]}),zB={getInitialState:t=>({rowPinning:Ag(),...t}),getDefaultOptions:t=>({onRowPinningChange:tn("rowPinning",t)}),createRow:(t,e)=>{t.pin=(n,r,o)=>{const i=r?t.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?t.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,t.id,...i]);e.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,h;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(g=>!(a!=null&&a.has(g))),bottom:[...((h=l==null?void 0:l.bottom)!=null?h:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)]}}if(n==="top"){var f,p;return{top:[...((f=l==null?void 0:l.top)!=null?f:[]).filter(g=>!(a!=null&&a.has(g))),...Array.from(a)],bottom:((p=l==null?void 0:l.bottom)!=null?p:[]).filter(g=>!(a!=null&&a.has(g)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(g=>!(a!=null&&a.has(g))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(g=>!(a!=null&&a.has(g)))}})},t.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=e.options;return typeof r=="function"?r(t):(n=r??o)!=null?n:!0},t.getIsPinned=()=>{const n=[t.id],{top:r,bottom:o}=e.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},t.getPinnedIndex=()=>{var n,r;const o=t.getIsPinned();if(!o)return-1;const i=(n=e._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(t.id))!=null?r:-1}},createTable:t=>{t.setRowPinning=e=>t.options.onRowPinningChange==null?void 0:t.options.onRowPinningChange(e),t.resetRowPinning=e=>{var n,r;return t.setRowPinning(e?Ag():(n=(r=t.initialState)==null?void 0:r.rowPinning)!=null?n:Ag())},t.getIsSomeRowsPinned=e=>{var n;const r=t.getState().rowPinning;if(!e){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[e])!=null&&n.length)},t._getPinnedRows=Pe(e=>[t.getRowModel().rows,t.getState().rowPinning[e],e],(e,n,r)=>{var o;return((o=t.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=t.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>e.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},Ie(t.options,"debugRows","_getPinnedRows")),t.getTopRows=()=>t._getPinnedRows("top"),t.getBottomRows=()=>t._getPinnedRows("bottom"),t.getCenterRows=Pe(()=>[t.getRowModel().rows,t.getState().rowPinning.top,t.getState().rowPinning.bottom],(e,n,r)=>{const o=new Set([...n??[],...r??[]]);return e.filter(i=>!o.has(i.id))},Ie(t.options,"debugRows","getCenterRows"))}},UB={getInitialState:t=>({rowSelection:{},...t}),getDefaultOptions:t=>({onRowSelectionChange:tn("rowSelection",t),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:t=>{t.setRowSelection=e=>t.options.onRowSelectionChange==null?void 0:t.options.onRowSelectionChange(e),t.resetRowSelection=e=>{var n;return t.setRowSelection(e?{}:(n=t.initialState.rowSelection)!=null?n:{})},t.toggleAllRowsSelected=e=>{t.setRowSelection(n=>{e=typeof e<"u"?e:!t.getIsAllRowsSelected();const r={...n},o=t.getPreGroupedRowModel().flatRows;return e?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},t.toggleAllPageRowsSelected=e=>t.setRowSelection(n=>{const r=typeof e<"u"?e:!t.getIsAllPageRowsSelected(),o={...n};return t.getRowModel().rows.forEach(i=>{Og(o,i.id,r,!0,t)}),o}),t.getPreSelectedRowModel=()=>t.getCoreRowModel(),t.getSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getCoreRowModel()],(e,n)=>Object.keys(e).length?Tg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getSelectedRowModel")),t.getFilteredSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getFilteredRowModel()],(e,n)=>Object.keys(e).length?Tg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getFilteredSelectedRowModel")),t.getGroupedSelectedRowModel=Pe(()=>[t.getState().rowSelection,t.getSortedRowModel()],(e,n)=>Object.keys(e).length?Tg(t,n):{rows:[],flatRows:[],rowsById:{}},Ie(t.options,"debugTable","getGroupedSelectedRowModel")),t.getIsAllRowsSelected=()=>{const e=t.getFilteredRowModel().flatRows,{rowSelection:n}=t.getState();let r=!!(e.length&&Object.keys(n).length);return r&&e.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},t.getIsAllPageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=t.getState();let r=!!e.length;return r&&e.some(o=>!n[o.id])&&(r=!1),r},t.getIsSomeRowsSelected=()=>{var e;const n=Object.keys((e=t.getState().rowSelection)!=null?e:{}).length;return n>0&&n<t.getFilteredRowModel().flatRows.length},t.getIsSomePageRowsSelected=()=>{const e=t.getPaginationRowModel().flatRows;return t.getIsAllPageRowsSelected()?!1:e.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},t.getToggleAllRowsSelectedHandler=()=>e=>{t.toggleAllRowsSelected(e.target.checked)},t.getToggleAllPageRowsSelectedHandler=()=>e=>{t.toggleAllPageRowsSelected(e.target.checked)}},createRow:(t,e)=>{t.toggleSelected=(n,r)=>{const o=t.getIsSelected();e.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,t.getCanSelect()&&o===n)return i;const a={...i};return Og(a,t.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,e),a})},t.getIsSelected=()=>{const{rowSelection:n}=e.getState();return kg(t,n)},t.getIsSomeSelected=()=>{const{rowSelection:n}=e.getState();return Mg(t,n)==="some"},t.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=e.getState();return Mg(t,n)==="all"},t.getCanSelect=()=>{var n;return typeof e.options.enableRowSelection=="function"?e.options.enableRowSelection(t):(n=e.options.enableRowSelection)!=null?n:!0},t.getCanSelectSubRows=()=>{var n;return typeof e.options.enableSubRowSelection=="function"?e.options.enableSubRowSelection(t):(n=e.options.enableSubRowSelection)!=null?n:!0},t.getCanMultiSelect=()=>{var n;return typeof e.options.enableMultiRowSelection=="function"?e.options.enableMultiRowSelection(t):(n=e.options.enableMultiRowSelection)!=null?n:!0},t.getToggleSelectedHandler=()=>{const n=t.getCanSelect();return r=>{var o;n&&t.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Og=(t,e,n,r,o)=>{var i;const s=o.getRow(e,!0);n?(s.getCanMultiSelect()||Object.keys(t).forEach(a=>delete t[a]),s.getCanSelect()&&(t[e]=!0)):delete t[e],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Og(t,a.id,n,r,o))};function Tg(t,e){const n=t.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=kg(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(e.rows),flatRows:r,rowsById:o}}function kg(t,e){var n;return(n=e[t.id])!=null?n:!1}function Mg(t,e,n){var r;if(!((r=t.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return t.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(kg(s,e)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Mg(s,e);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Pg=/([0-9]+)/gm,qB=(t,e,n)=>g_(qr(t.getValue(n)).toLowerCase(),qr(e.getValue(n)).toLowerCase()),WB=(t,e,n)=>g_(qr(t.getValue(n)),qr(e.getValue(n))),KB=(t,e,n)=>Ig(qr(t.getValue(n)).toLowerCase(),qr(e.getValue(n)).toLowerCase()),GB=(t,e,n)=>Ig(qr(t.getValue(n)),qr(e.getValue(n))),JB=(t,e,n)=>{const r=t.getValue(n),o=e.getValue(n);return r>o?1:r<o?-1:0},XB=(t,e,n)=>Ig(t.getValue(n),e.getValue(n));function Ig(t,e){return t===e?0:t>e?1:-1}function qr(t){return typeof t=="number"?isNaN(t)||t===1/0||t===-1/0?"":String(t):typeof t=="string"?t:""}function g_(t,e){const n=t.split(Pg).filter(Boolean),r=e.split(Pg).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Ks={alphanumeric:qB,alphanumericCaseSensitive:WB,text:KB,textCaseSensitive:GB,datetime:JB,basic:XB},YB=[kB,HB,DB,RB,MB,PB,BB,$B,{getInitialState:t=>({sorting:[],...t}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:t=>({onSortingChange:tn("sorting",t),isMultiSortEvent:e=>e.shiftKey}),createColumn:(t,e)=>{t.getAutoSortingFn=()=>{const n=e.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(t.id);if(Object.prototype.toString.call(i)==="[object Date]")return Ks.datetime;if(typeof i=="string"&&(r=!0,i.split(Pg).length>1))return Ks.alphanumeric}return r?Ks.text:Ks.basic},t.getAutoSortDir=()=>{const n=e.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(t.id))=="string"?"asc":"desc"},t.getSortingFn=()=>{var n,r;if(!t)throw new Error;return Zc(t.columnDef.sortingFn)?t.columnDef.sortingFn:t.columnDef.sortingFn==="auto"?t.getAutoSortingFn():(n=(r=e.options.sortingFns)==null?void 0:r[t.columnDef.sortingFn])!=null?n:Ks[t.columnDef.sortingFn]},t.toggleSorting=(n,r)=>{const o=t.getNextSortingOrder(),i=typeof n<"u"&&n!==null;e.setSorting(s=>{const a=s==null?void 0:s.find(f=>f.id===t.id),l=s==null?void 0:s.findIndex(f=>f.id===t.id);let c=[],u,d=i?n:o==="desc";if(s!=null&&s.length&&t.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var h;c=[...s,{id:t.id,desc:d}],c.splice(0,c.length-((h=e.options.maxMultiSortColCount)!=null?h:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(f=>f.id===t.id?{...f,desc:d}:f):u==="remove"?c=s.filter(f=>f.id!==t.id):c=[{id:t.id,desc:d}];return c})},t.getFirstSortDir=()=>{var n,r;return((n=(r=t.columnDef.sortDescFirst)!=null?r:e.options.sortDescFirst)!=null?n:t.getAutoSortDir()==="desc")?"desc":"asc"},t.getNextSortingOrder=n=>{var r,o;const i=t.getFirstSortDir(),s=t.getIsSorted();return s?s!==i&&((r=e.options.enableSortingRemoval)==null||r)&&(!(n&&(o=e.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},t.getCanSort=()=>{var n,r;return((n=t.columnDef.enableSorting)!=null?n:!0)&&((r=e.options.enableSorting)!=null?r:!0)&&!!t.accessorFn},t.getCanMultiSort=()=>{var n,r;return(n=(r=t.columnDef.enableMultiSort)!=null?r:e.options.enableMultiSort)!=null?n:!!t.accessorFn},t.getIsSorted=()=>{var n;const r=(n=e.getState().sorting)==null?void 0:n.find(o=>o.id===t.id);return r?r.desc?"desc":"asc":!1},t.getSortIndex=()=>{var n,r;return(n=(r=e.getState().sorting)==null?void 0:r.findIndex(o=>o.id===t.id))!=null?n:-1},t.clearSorting=()=>{e.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==t.id):[])},t.getToggleSortingHandler=()=>{const n=t.getCanSort();return r=>{n&&(r.persist==null||r.persist(),t.toggleSorting==null||t.toggleSorting(void 0,t.getCanMultiSort()?e.options.isMultiSortEvent==null?void 0:e.options.isMultiSortEvent(r):!1))}}},createTable:t=>{t.setSorting=e=>t.options.onSortingChange==null?void 0:t.options.onSortingChange(e),t.resetSorting=e=>{var n,r;t.setSorting(e?[]:(n=(r=t.initialState)==null?void 0:r.sorting)!=null?n:[])},t.getPreSortedRowModel=()=>t.getGroupedRowModel(),t.getSortedRowModel=()=>(!t._getSortedRowModel&&t.options.getSortedRowModel&&(t._getSortedRowModel=t.options.getSortedRowModel(t)),t.options.manualSorting||!t._getSortedRowModel?t.getPreSortedRowModel():t._getSortedRowModel())}},IB,VB,jB,zB,UB,NB];function QB(t){var e,n;process.env.NODE_ENV!=="production"&&(t.debugAll||t.debugTable)&&console.info("Creating Table Instance...");const r=[...YB,...(e=t._features)!=null?e:[]];let o={_features:r};const i=o._features.reduce((h,f)=>Object.assign(h,f.getDefaultOptions==null?void 0:f.getDefaultOptions(o)),{}),s=h=>o.options.mergeOptions?o.options.mergeOptions(i,h):{...i,...h};let l={...{},...(n=t.initialState)!=null?n:{}};o._features.forEach(h=>{var f;l=(f=h.getInitialState==null?void 0:h.getInitialState(l))!=null?f:l});const c=[];let u=!1;const d={_features:r,options:{...i,...t},initialState:l,_queue:h=>{c.push(h),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{o.setState(o.initialState)},setOptions:h=>{const f=Ur(h,o.options);o.options=s(f)},getState:()=>o.options.state,setState:h=>{o.options.onStateChange==null||o.options.onStateChange(h)},_getRowId:(h,f,p)=>{var g;return(g=o.options.getRowId==null?void 0:o.options.getRowId(h,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(h,f)=>{let p=(f?o.getPrePaginationRowModel():o.getRowModel()).rowsById[h];if(!p&&(p=o.getCoreRowModel().rowsById[h],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${h}`):new Error;return p},_getDefaultColumnDef:Pe(()=>[o.options.defaultColumn],h=>{var f;return h=(f=h)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,m;return(g=(m=p.renderValue())==null||m.toString==null?void 0:m.toString())!=null?g:null},...o._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...h}},Ie(t,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Pe(()=>[o._getColumnDefs()],h=>{const f=function(p,g,m){return m===void 0&&(m=0),p.map(y=>{const C=TB(o,y,m,g),w=y;return C.columns=w.columns?f(w.columns,C,m+1):[],C})};return f(h)},Ie(t,"debugColumns","getAllColumns")),getAllFlatColumns:Pe(()=>[o.getAllColumns()],h=>h.flatMap(f=>f.getFlatColumns()),Ie(t,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Pe(()=>[o.getAllFlatColumns()],h=>h.reduce((f,p)=>(f[p.id]=p,f),{}),Ie(t,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Pe(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(h,f)=>{let p=h.flatMap(g=>g.getLeafColumns());return f(p)},Ie(t,"debugColumns","getAllLeafColumns")),getColumn:h=>{const f=o._getAllFlatColumnsById()[h];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${h}' does not exist.`),f}};Object.assign(o,d);for(let h=0;h<o._features.length;h++){const f=o._features[h];f==null||f.createTable==null||f.createTable(o)}return o}function ZB(){return t=>Pe(()=>[t.options.data],e=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=yg(t,t._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),t.options.getSubRows){var l;u.originalSubRows=t.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(e),n},Ie(t.options,"debugTable","getRowModel",()=>t._autoResetPageIndex()))}function e$(t,e,n){return n.options.filterFromLeafRows?t$(t,e,n):n$(t,e,n)}function t$(t,e,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){var d;let f=l[h];const p=yg(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,(d=f.subRows)!=null&&d.length&&c<s){if(p.subRows=a(f.subRows,c+1),f=p,e(f)&&!p.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}if(e(f)||p.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}}else f=p,e(f)&&(u.push(f),i[f.id]=f,o.push(f))}return u};return{rows:a(t),flatRows:o,rowsById:i}}function n$(t,e,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,c){c===void 0&&(c=0);const u=[];for(let h=0;h<l.length;h++){let f=l[h];if(e(f)){var d;if((d=f.subRows)!=null&&d.length&&c<s){const g=yg(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);g.subRows=a(f.subRows,c+1),f=g}u.push(f),o.push(f),i[f.id]=f}}return u};return{rows:a(t),flatRows:o,rowsById:i}}function r$(){return t=>Pe(()=>[t.getPreFilteredRowModel(),t.getState().columnFilters,t.getState().globalFilter],(e,n,r)=>{if(!e.rows.length||!(n!=null&&n.length)&&!r){for(let h=0;h<e.flatRows.length;h++)e.flatRows[h].columnFilters={},e.flatRows[h].columnFiltersMeta={};return e}const o=[],i=[];(n??[]).forEach(h=>{var f;const p=t.getColumn(h.id);if(!p)return;const g=p.getFilterFn();if(!g){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${p.id}.`);return}o.push({id:h.id,filterFn:g,resolvedValue:(f=g.resolveFilterValue==null?void 0:g.resolveFilterValue(h.value))!=null?f:h.value})});const s=(n??[]).map(h=>h.id),a=t.getGlobalFilterFn(),l=t.getAllLeafColumns().filter(h=>h.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(h=>{var f;i.push({id:h.id,filterFn:a,resolvedValue:(f=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?f:r})}));let c,u;for(let h=0;h<e.flatRows.length;h++){const f=e.flatRows[h];if(f.columnFilters={},o.length)for(let p=0;p<o.length;p++){c=o[p];const g=c.id;f.columnFilters[g]=c.filterFn(f,g,c.resolvedValue,m=>{f.columnFiltersMeta[g]=m})}if(i.length){for(let p=0;p<i.length;p++){u=i[p];const g=u.id;if(u.filterFn(f,g,u.resolvedValue,m=>{f.columnFiltersMeta[g]=m})){f.columnFilters.__global__=!0;break}}f.columnFilters.__global__!==!0&&(f.columnFilters.__global__=!1)}}const d=h=>{for(let f=0;f<s.length;f++)if(h.columnFilters[s[f]]===!1)return!1;return!0};return e$(e.rows,d,t)},Ie(t.options,"debugTable","getFilteredRowModel",()=>t._autoResetPageIndex()))}/**
|
237
|
+
* react-table
|
238
|
+
*
|
239
|
+
* Copyright (c) TanStack
|
240
|
+
*
|
241
|
+
* This source code is licensed under the MIT license found in the
|
242
|
+
* LICENSE.md file in the root directory of this source tree.
|
243
|
+
*
|
244
|
+
* @license MIT
|
245
|
+
*/function m_(t,e){return t?o$(t)?Kr.createElement(t,e):t:null}function o$(t){return i$(t)||typeof t=="function"||s$(t)}function i$(t){return typeof t=="function"&&(()=>{const e=Object.getPrototypeOf(t);return e.prototype&&e.prototype.isReactComponent})()}function s$(t){return typeof t=="object"&&typeof t.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(t.$$typeof.description)}function a$(t){const e={state:{},onStateChange:()=>{},renderFallbackValue:null,...t},[n]=Kr.useState(()=>({current:QB(e)})),[r,o]=Kr.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...t,state:{...r,...t.state},onStateChange:s=>{o(s),t.onStateChange==null||t.onStateChange(s)}})),n.current}function _i(t,e,n){let r=n.initialDeps??[],o;function i(){var s,a,l,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const d=t();if(!(d.length!==r.length||d.some((p,g)=>r[g]!==p)))return o;r=d;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),o=e(...d),n.key&&((l=n.debug)!=null&&l.call(n))){const p=Math.round((Date.now()-u)*100)/100,g=Math.round((Date.now()-f)*100)/100,m=g/16,y=(C,w)=>{for(C=String(C);C.length<w;)C=" "+C;return C};console.info(`%c⏱ ${y(g,5)} /${y(p,5)} ms`,`
|
246
|
+
font-size: .6rem;
|
247
|
+
font-weight: bold;
|
248
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(c=n==null?void 0:n.onChange)==null||c.call(n,o),o}return i.updateDeps=s=>{r=s},i}function Lg(t,e){if(t===void 0)throw new Error(`Unexpected undefined${e?`: ${e}`:""}`);return t}const l$=(t,e)=>Math.abs(t-e)<1,c$=(t,e,n)=>{let r;return function(...o){t.clearTimeout(r),r=t.setTimeout(()=>e.apply(this,o),n)}},u$=t=>t,d$=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),r=[];for(let o=e;o<=n;o++)r.push(o);return r},f$=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;e({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};t.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},y_={passive:!0},v_=typeof window>"u"?!0:"onscrollend"in window,h$=(t,e)=>{const n=t.scrollElement;if(!n)return;const r=t.targetWindow;if(!r)return;let o=0;const i=t.options.useScrollendEvent&&v_?()=>{}:c$(r,()=>{e(o,!1)},t.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:h}=t.options;o=d?n.scrollLeft*(h&&-1||1):n.scrollTop,i(),e(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,y_);const c=t.options.useScrollendEvent&&v_;return c&&n.addEventListener("scrollend",l,y_),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},p$=(t,e,n)=>{if(e!=null&&e.borderBoxSize){const r=e.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},g$=(t,{adjustments:e=0,behavior:n},r)=>{var o,i;const s=t+e;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class m${constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:u$,rangeExtractor:d$,onChange:()=>{},measureElement:p$,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=_i(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",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(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},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=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=_i(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=_i(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),h=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),f=h?h.end+this.options.gap:r+o,p=a.get(d),g=typeof p=="number"?p:this.options.estimateSize(u),m=f+g,y=h?h.lane:u%this.options.lanes;c[u]={index:u,start:f,size:g,end:m,key:d,lane:y}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=_i(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?y$({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=_i(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=_i(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Lg(r[b_(0,r.length-1,o=>Lg(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Lg(this.getOffsetForIndex(n,a));l$(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;if(r.length===0)o=this.options.paddingStart;else if(this.options.lanes===1)o=((n=r[r.length-1])==null?void 0:n.end)??0;else{const i=Array(this.options.lanes).fill(null);let s=r.length-1;for(;s>0&&i.some(a=>a===null);){const a=r[s];i[a.lane]===null&&(i[a.lane]=a.end),s--}o=Math.max(...i.filter(a=>a!==null))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const b_=(t,e,n,r)=>{for(;t<=e;){const o=(t+e)/2|0,i=n(o);if(i<r)t=o+1;else if(i>r)e=o-1;else return o}return t>0?t-1:0};function y$({measurements:t,outerSize:e,scrollOffset:n,lanes:r}){const o=t.length-1;let s=b_(0,o,l=>t[l].start,n),a=s;if(r===1)for(;a<o&&t[a].end<n+e;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<o&&l.some(u=>u<n+e);){const u=t[a];l[u.lane]=u.end,a++}const c=Array(r).fill(n+e);for(;s>0&&c.some(u=>u>=n);){const u=t[s];c[u.lane]=u.start,s--}s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))}return{startIndex:s,endIndex:a}}const w_=typeof document<"u"?Kr.useLayoutEffect:Kr.useEffect;function v$(t){const e=Kr.useReducer(()=>({}),{})[1],n={...t,onChange:(o,i)=>{var s;i?Lo.flushSync(e):e(),(s=t.onChange)==null||s.call(t,o,i)}},[r]=Kr.useState(()=>new m$(n));return r.setOptions(n),w_(()=>r._didMount(),[]),w_(()=>r._willUpdate()),r}function b$(t){return v$({observeElementRect:f$,observeElementOffset:h$,scrollToFn:g$,...t})}function w$(t,e){const{rows:n}=t.getRowModel(),r=b$({getScrollElement:()=>e,count:n.length,estimateSize:()=>35,overscan:10});return{rows:n,virtualRows:r.getVirtualItems(),totalSize:r.getTotalSize(),virtualizer:r}}function S$(t,e){const n=t.getIsPinned(),r=n==="left"&&t.getIsLastColumn("left"),o=n==="right"&&t.getIsFirstColumn("right");return{shadow:r?"-2px 0 2px -2px gray inset":o?"2px 0 2px -2px gray inset":void 0,start:n==="left"?`${t.getStart("left")}px`:void 0,end:n==="right"?`${t.getAfter("right")}px`:void 0,position:n?"sticky":"relative",w:t.getSize(),z:n?1:0,bgColor:n?e?"gray.50":"white":e?"gray.50":void 0}}function C$({table:t,containerRef:e,onRowClick:n,disabledRow:r}){var u,d;const{rows:o,virtualRows:i,totalSize:s,virtualizer:a}=w$(t,e),l=i.length>0&&((u=i==null?void 0:i[0])==null?void 0:u.start)||0,c=i.length>0?s-(((d=i==null?void 0:i[i.length-1])==null?void 0:d.end)||0):0;return v.jsxs("tbody",{children:[l>0&&v.jsx("tr",{children:v.jsx("td",{h:`${l}px`})}),i.map(h=>{const f=o[h.index],p=E$(f.original,r);return v.jsx("tr",{borderB:"px",borderBColor:"#F4F4F4",borderStyle:"dashed",hover_bgColor:"slate-50",cursor:n?"pointer":"default",onClick:n?()=>n(f.original):void 0,w:"fit-content",group:!0,children:f.getVisibleCells().map((g,m)=>v.jsx("td",{px:"3",py:"2",textSize:"sm",textColor:p?"gray.400":"gray.700",fontWeight:"500",borderTColor:"--bg-3",borderT:"0.5",cursor:n&&!p?"pointer":"default",w:`${g.column.getSize()}px`,groupHover_bgColor:p?void 0:"gray.100",...S$(g.column,p),children:m_(g.column.columnDef.cell,g.getContext())},g.id))},f.id)}),c>0&&v.jsx("tr",{children:v.jsx("td",{h:`${c}px`})})]})}function E$(t,e){return e?typeof e=="string"?t[e]:e(t):!1}function _$({headers:t}){const e=Be.useThemeAwareColor("slate-500","slate-700");return v.jsx("thead",{children:t.map(n=>v.jsx("tr",{w:"fit",children:n.headers.map(r=>v.jsx("th",{position:"relative",colSpan:r.colSpan,textAlign:"start",fontWeight:"600",textColor:e,px:"3",py:"2",textSize:"sm",w:`${r.getSize()}px`,children:v.jsxs("div",{dflex:!0,flexRow:!0,children:[r.isPlaceholder?null:v.jsxs(v.Fragment,{children:[m_(r.column.columnDef.header,r.getContext()),v.jsx("span",{cursor:r.column.getCanSort()?"pointer":"default",onClick:r.column.getToggleSortingHandler(),opacity:"0",hover_opacity:"100",flexGrow:!0,textAlign:"end",children:{asc:v.jsx(v.Fragment,{children:" ▲"}),desc:v.jsx(v.Fragment,{children:" ▼"})}[r.column.getIsSorted()]??v.jsx(v.Fragment,{children:" ▲"})})]}),v.jsx("div",{onMouseDown:r.getResizeHandler(),onTouchStart:r.getResizeHandler(),onClick:o=>{o.preventDefault(),o.stopPropagation()},position:"absolute",end:"0",top:"0",h:"full",w:"2",bgColor:r.column.getIsResizing()?"primary-500":"slate-900",bgOpacity:r.column.getIsResizing()?"70":"30",cursor:"col-resize",userSelect:"none",style:{touchAction:"none"},opacity:r.column.getIsResizing()?"100":"0",hover_opacity:"100"})]})},r.id))},n.id))})}const[ej,Dg]=Be.createContext();function S_({page:t,...e}){const{pageSize:n,pageIndex:r,setPagination:o}=Dg(),i=T.useCallback(()=>o({pageIndex:1,pageSize:n}),[n,o]);return v.jsxs("div",{dflex:!0,flexCol:!0,gap:"10",w:"full",h:"full",alignItems:"center",placeContent:"center",py:"16",...e,children:[v.jsx(N.Icon,{path:ux,w:"24",h:"24",textColor:"gray.400"}),v.jsx("div",{textSize:"xl",textColor:"gray.600",children:"No Data"}),t>1&&v.jsx(N.Button,{onClick:i,children:"Back To First Page"})]})}function x$({table:t,isLoading:e}){const n=t.getPageCount(),r=t.getState().pagination.pageIndex+1,o=A$(r,n,5);return v.jsxs(v.Fragment,{children:[n<2&&v.jsx(v.Fragment,{}),n>1&&v.jsx(v.Fragment,{children:v.jsxs("div",{dflex:!0,flexRow:!0,spaceX:"2",py:"2",children:[v.jsx(xi,{onClick:()=>t.setPageIndex(0),disabled:e||r==1,children:v.jsx(N.Icon,{path:Z_})}),v.jsx(xi,{onClick:()=>t.previousPage(),disabled:e||r==1,children:v.jsx(N.Icon,{path:nx})}),o.length>0&&o[0]>1&&v.jsx("a",{children:"..."}),o.map(i=>v.jsx(xi,{onClick:()=>t.setPageIndex(i-1),disabled:e,variant:r==i?"default":"glass",scheme:"secondary",children:i},i)),o.length>0&&o[o.length-1]<n&&v.jsx(xi,{disabled:e,children:"..."}),v.jsx(xi,{onClick:()=>t.nextPage(),disabled:e||!t.getCanNextPage(),children:v.jsx(N.Icon,{path:rx})}),v.jsx(xi,{onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:e||!t.getCanNextPage(),children:v.jsx(N.Icon,{path:ex})})]})})]})}function xi({...t}){return v.jsx(N.Button,{scheme:"secondary",variant:"glass",corners:"pill",w:"8",h:"8",p:"0",dflex:!0,alignItems:"center",placeContent:"center",...t})}function A$(t,e,n){const r=[];if(!t)return r;if(e===1)return r.push(1),r;if(e<t)return r;if(e<n+1){for(let i=1;i<e+1;i++)r.push(i);return r}if(t===1){for(let i=1;i<n+1;i++)i<e&&r.push(i);return r}if(t===e){for(let i=e-n+1;i<=e;i++)i<=e&&r.push(i);return r}const o=Math.floor(n/2);if(o<1)return r.push(t),r;if(t<o+2){for(let i=1;i<n+1;i++)r.push(i);return r}if(e-t<o+2){for(let i=e-n;i<e+1;i++)r.push(i);return r}for(let i=t-o;i<t;i++)i>0&&r.push(i);r.push(t);for(let i=t+1;i<t+o+1;i++)i<=e&&r.push(i);return r}const O$=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100}];function T$({table:t,total:e,isLoading:n,reverseOrder:r,sizePerPageList:o}){const i=t.getState().pagination.pageIndex,s=t.getState().pagination.pageSize;return v.jsxs("div",{dflex:!0,flexDirection:r?"row-reverse":"row",alignItems:"center",py:"3",spaceX:"3",children:[v.jsx(N.Select,{disabled:e===0||n,onChange:a=>t.setPageSize(Number(a.target.value)),value:s,w:"20",children:(o??O$).map(a=>{const l=s===a.value;return v.jsx("option",{value:a.value,className:`btn ${l?"active":""}`,children:a.label},a.label)})}),v.jsxs("div",{children:["Showing rows ",1+i*s," to ",Math.min((i+1)*s,e)," of ",e]}),n&&v.jsx(N.Spinner,{size:"sm"})]})}function C_({isLoading:t,table:e,total:n,show:r,toolbarPosition:o="both",reverseOrder:i=!1,sizePerPageList:s,children:a,...l}){return v.jsxs("div",{...l,children:[r&&["top","both"].includes(o)&&v.jsx(E_,{isLoading:t,table:e,total:n,reverseOrder:i,sizePerPageList:s}),a,r&&["bottom","both"].includes(o)&&v.jsx(E_,{isLoading:t,table:e,total:n,reverseOrder:i,sizePerPageList:s})]})}function E_({isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:o}){return v.jsxs("div",{dflex:!0,justifyContent:"between",alignItems:"center",flexWrap:!0,flexDirection:r?"row-reverse":"row",children:[v.jsx(T$,{isLoading:t,table:e,total:n,reverseOrder:r,sizePerPageList:o}),v.jsx("div",{className:"d-flex flex-wrap"}),v.jsx(x$,{isLoading:t,table:e})]})}const[tj,__]=Be.createContext();function k$(t,e,n){const{setPagination:r}=Dg(),{sortBy:o,sortDir:i,setSorting:s}=__(),[a,l]=T.useState((n==null?void 0:n.rowSelection)??{}),c=T.useCallback(h=>{var f;l(h),(f=n==null?void 0:n.onSelectionChange)==null||f.call(n,Be.runIfFn(h,a))},[l,a]),u=T.useCallback(h=>{var f;if(n!=null&&n.enableSelection&&(n!=null&&n.enableSelectOnRowClick)){h.toggleSelected();return}(f=n==null?void 0:n.onRowClick)==null||f.call(n,h.original)},[]);return{table:a$(Hi({data:t??[],getRowId:h=>h.id,columns:e,columnResizeMode:"onChange",enableColumnResizing:!0,enableSortingRemoval:!1,defaultColumn:{size:150,minSize:40,maxSize:1e3},state:{sorting:[{id:o,desc:i==="desc"}],rowSelection:a},filterFns:{},enableRowSelection:n==null?void 0:n.enableSelection,onRowSelectionChange:c,onSortingChange:s,getCoreRowModel:ZB(),getFilteredRowModel:r$(),onPaginationChange:r},n==null?void 0:n.tableOptions)),onRowClick:u}}const M$=T.createContext({});function P$(){return T.useContext(M$)}function I$(t,e,n){const r=No(t),o=T.useMemo(()=>({onError:()=>De.error((n==null?void 0:n.errorMessage)??"Oops, something went wrong :("),refetchOnWindowFocus:!1,keepPreviousData:!0,retry:!1,staleTime:1e8}),[n]),{pageIndex:i,pageSize:s,setPagination:a}=Dg(),{sortBy:l,sortDir:c}=__(),{getFilters:u}=P$(),d={pageSize:s,pageNumber:i,sortBy:l,sortDir:c,...n!=null&&n.transformFilters?n.transformFilters(u()):u()},h=T.useMemo(()=>({...o,...n==null?void 0:n.queryOptions}),[n]),{data:f,isError:p,isFetching:g,isLoading:m}=Sn(t,e,d,h),y=T.useCallback(r,[r]),{data:C}=f??{data:{data:void 0,meta:void 0}},{data:w,meta:b}=C;return{data:w&&(n!=null&&n.transformResponse)?n.transformResponse(w):w,response:C,retry:y,isError:p,isLoading:m,isFetching:g,page:(b==null?void 0:b.current_page)??1??i,pageSize:(b==null?void 0:b.per_page)??s,total:(b==null?void 0:b.total)??0,onPaginationChange:a}}function L$({columns:t,keyField:e="id",queryKey:n,queryFn:r,queryOptions:o,errorMessage:i,transformFilters:s,transformResponse:a,defaultSorted:l="name",defaultSortOrder:c="desc",nonSelectable:u,enableFilters:d=!1,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,onRowClick:g,onSelectionChange:m,sizePerPageList:y,paginationPosition:C,reversePaginationTools:w,containerEl:b,emptyMessage:S,title:E,disabledRow:x,pinnedColumnsLeft:_,pinnedColumnsRight:A,...O}){const k=T.useRef(null),{data:M,response:I,retry:P,isError:F,isLoading:z,isFetching:$,page:J,pageSize:K,total:R,onPaginationChange:Q}=I$(n,r,{errorMessage:i,queryOptions:o,transformResponse:a,transformFilters:s}),ie=k$(M??[],N$(t,h),{defaultSorted:l,defaultSortOrder:c,enableSelection:h,enableSelectOnRowClick:f,selectMode:p,nonSelectable:u,onRowClick:g,onSelectionChange:m,tableOptions:{enableColumnFilters:d,initialState:{columnPinning:{left:_??[],right:A??[]}},state:{pagination:{pageIndex:J,pageSize:K}},autoResetPageIndex:!1,pageCount:Math.ceil(R/K),onPaginationChange:Q}}).table;return v.jsxs("div",{px:"8",pt:"8",ref:k,h:"100%",children:[F&&v.jsx(Yr,{onClick:P,label:i}),(z||$&&(!M||(M==null?void 0:M.length)==0))&&v.jsx(gr,{}),!F&&!z&&M&&v.jsxs("div",{children:[E&&(Be.isFunction(E)?E(I):E),O.mode=="table"&&v.jsx(D$,{table:ie,total:R??0,data:M,isLoading:$,containerEl:b??k.current,onRowClick:g,sizePerPageList:y,disabledRow:x}),O.mode=="grid"&&v.jsx(R$,{table:ie,total:R??0,data:M,isLoading:$,onRowClick:g,sizePerPageList:y,gridCols:O.gridCols,renderGridItem:O.renderGridItem})]})]})}function D$({table:t,total:e,data:n,isLoading:r,onRowClick:o,containerEl:i,sizePerPageList:s,disabledRow:a}){return v.jsxs(C_,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:s,children:[n.length==0&&v.jsx(S_,{page:t.getState().pagination.pageIndex}),n.length>0&&v.jsx("div",{w:"full",border:"2px",borderColor:"#F4F4F4",rounded:"base",my:"3",overflowX:"auto",children:v.jsxs("table",{style:{width:"max(1400px, 100%)",tableLayout:"fixed"},children:[v.jsx(_$,{headers:t.getHeaderGroups()}),v.jsx(C$,{table:t,containerRef:i,onRowClick:o,disabledRow:a})]})})]})}function R$({table:t,total:e,data:n,isLoading:r,onRowClick:o,sizePerPageList:i,gridCols:s,renderGridItem:a}){return v.jsxs(C_,{table:t,total:e??0,show:n&&n.length>0,isLoading:r,sizePerPageList:i,children:[n.length==0&&v.jsx(S_,{page:t.getState().pagination.pageIndex}),n.length>0&&v.jsx("div",{w:"full",children:v.jsx("div",{grid:!0,gridCols:`${s??3}`,gap:"5",w:"full",children:n.map(l=>a==null?void 0:a(l,o))})})]})}function N$(t,e){return e?[{id:"select-col",header:({table:n})=>v.jsx(N.Checkbox,{checked:n.getIsAllRowsSelected(),onChange:n.getToggleAllRowsSelectedHandler()}),cell:({row:n})=>v.jsx(N.Checkbox,{checked:n.getIsSelected(),disabled:!n.getCanSelect(),onChange:n.getToggleSelectedHandler()}),size:10,maxSize:1,enableResizing:!1}].concat(t):t}function x_({children:t,...e}){return v.jsx(N.Tile,{scheme:"light",px:"0",py:"4",h:"100%",...e,children:t})}function A_({children:t,...e}){return v.jsx(ua,{scheme:"default",corners:"pill",h:"10",variant:"glass",...e,children:t??v.jsx(N.Icon,{path:Cx})})}function O_({...t}){return v.jsxs(N.Popover,{side:"bottom-end",modal:!0,children:[v.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",...t,children:v.jsx(N.Icon,{path:cx})}),v.jsxs("div",{bgColor:"white",rounded:!0,shadow:!0,children:[v.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"First Item"}),v.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Second Item"}),v.jsx("div",{py:"3",hover_bgColor:"#ff0000",px:"5",hover_textColor:"white",children:"Third Item"})]})]})}function T_({title:t,queryKey:e,children:n,...r}){const o=No(e);return Y0("ctrl+r",()=>o(),{preventDefault:!0},[o]),v.jsxs("div",{dflex:!0,flexRow:!0,pb:"4",alignItems:"center",gap:"3",px:"8",borderB:"0.5",borderBColor:"--bg-2",...r,children:[t&&v.jsx("h2",{textSize:"x3",fontWeight:"600",textColor:"#3f4254",textTransform:"capitalize",children:t}),v.jsx("div",{flexGrow:!0,children:" "}),v.jsxs("div",{spaceX:"2",dflex:!0,alignItems:"center",children:[v.jsx(N.Button,{scheme:"default",corners:"pill",w:"10",h:"10",variant:"glass",onClick:o,children:v.jsx(N.Icon,{path:Qg})}),n]})]})}const k_="Oops, something went wrong...";function M_(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function Rg({initialValues:t,itemLabel:e,queryId:n="",api:r,queryFetchOptions:o,querySaveOptions:i,onSuccess:s,onFetchError:a,fetchErrorMsg:l=k_,onSaveError:c,saveErrorMsg:u=k_,fetchToFormData:d,formToQueryData:h,invalidateQueriesOnSuccess:f=!0,invalidateQueryKey:p,retryText:g="Retry",cancelLabel:m="Cancel",saveLabel:y,size:C="lg",title:w,form:b,show:S,onClose:E,formikProps:x,..._}){const{isInitialLoading:A,isFetching:O,data:k,isError:M,error:I,refetch:P}=Sn(r.queryKey,r.get,n,{enabled:!(n==""||n==null||n==null),onError:a,...o}),F=f?Gr(r.upsert,p??r.queryKey,i):Fo(r.upsert,r.queryKey,n,i),z=T.useCallback(()=>P(),[P]),$=T.useCallback((J,K)=>{F.reset();const R=h?h(J):{...J};F.mutateAsync(R).then(Q=>{s?s(R,Q):De.success(`${w?w(R):R.name??R.title} ${n?"saved":"created"}`),E==null||E()}).catch(Q=>{console.error("on error",Q),c?c(J):De.error(`Couldn't save ${w?w(R):R.name??R.title}`),K.setSubmitting(!1)})},[F,h,s,c,E]);return v.jsxs(N.Modal,{size:C,show:S,onClose:E,scheme:"light",transition:!0,..._,children:[v.jsxs(N.Modal.Header,{children:[!A&&n&&`Edit ${w?w(k):(k==null?void 0:k.name)??(k==null?void 0:k.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(b)&&v.jsx(v.Fragment,{})]}),A&&v.jsx(N.Modal.Body,{children:v.jsx(gr,{minW:"72"})}),M&&v.jsx(N.Modal.Body,{children:v.jsx(Yr,{label:`${l} ${I}`,onClick:z})}),!A&&!M&&v.jsx(v.Fragment,{children:v.jsx(Je.Formik,{initialValues:d&&n&&k?d(M_(k)):M_(t(k))??{},onSubmit:$,...x,children:({setFieldValue:J,dirty:K,handleSubmit:R,isValid:Q,values:se})=>v.jsxs(v.Fragment,{children:[v.jsx(N.Modal.Body,{pb:"6",children:v.jsxs(Je.Form,{children:[T.isValidElement(b)&&b,Array.isArray(b)&&v.jsx(Qr,{form:b}),Be.isFunction(b)&&v.jsx(Qr,{form:b(k??se)})]})}),v.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[v.jsx(N.Button,{disabled:F.isLoading,onClick:E,variant:"borderless",me:"2",children:m}),v.jsx(N.Button,{type:"submit",disabled:!K||F.isLoading,onClick:()=>R(),children:y||(n?"Update":"Create")})]})]})})}),F.isLoading&&v.jsx(ji,{})]})}function F$({api:t,fn:e,transformFn:n,config:r,onClose:o,queryId:i,invalidateQueryKey:s}){const{data:a,isFetching:l}=Sn(t.queryKey,e==="get"||e==="getTransformed"?t.get:t.getAll,void 0,{retryOnMount:!1,refetchOnMount:!1,refetchOnWindowFocus:!1}),c=T.useMemo(()=>a&&(e==="getTransformed"||e==="getAllTransformed")?(n||console.warn(`QueryWrapperDialog: you forgot to pass transformFn as parameter for fn ${e}`),n==null?void 0:n(a)):a,[a,e,n]);return l?null:v.jsx(Rg,{...r(c),queryId:i,invalidateQueryKey:s,show:!0,onClose:o})}function H$({queries:t,config:e,onClose:n,queryId:r,invalidateQueryKey:o}){const{data:i,isFetching:s,isError:a}=Qm(t.map(c=>({queryKey:c.api.queryKey,queryFn:c.fn=="get"?c.api.get:c.api.getAll,queryOptions:{cacheTime:c.cache===!1?0:void 0,staleTime:c.cache===!1?0:void 0}}))),l=T.useMemo(()=>i==null?void 0:i.map((c,u)=>{var d,h;return t[u].transformFn?(h=(d=t[u])==null?void 0:d.transformFn)==null?void 0:h.call(d,c):c}),[i,t]);return v.jsx(Rg,{isPreloading:s,...e(...l),queryId:r,invalidateQueryKey:o,show:!0,onClose:n})}function P_({config:t,onClose:e,invalidateQueryKey:n,queryId:r}){const{type:o,...i}=t;return t.type==="dialog"?v.jsx(Rg,{...i,queryId:r,invalidateQueryKey:n,show:!0,onClose:e}):t.type==="query"?v.jsx(F$,{...i,queryId:r,invalidateQueryKey:n,onClose:e}):t.type==="multiQuery"?v.jsx(H$,{...i,queryId:r,invalidateQueryKey:n,onClose:e}):null}function B$({itemLabel:t,queryId:e="",api:n,invalidateQueriesOnSuccess:r=!0,invalidateQueryKey:o,size:i="lg",show:s,onClose:a,...l}){const c=r?Gr(n.delete,o??n.queryKey):Fo(n.upsert,n.queryKey),u=ya(c,{onSuccess:()=>a==null?void 0:a()}),d=T.useCallback(()=>u(e),[u,e]);return v.jsxs(N.Modal,{size:i,show:s,onClose:a,scheme:"danger",variant:"glass",transition:!0,...l,children:[v.jsx(N.Modal.Header,{children:`Delete ${t}`}),v.jsxs(N.Modal.Body,{pb:"6",children:["Do you really want to delete ",t,"?"]}),v.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[v.jsx(N.Button,{disabled:c.isLoading,onClick:a,variant:"borderless",scheme:"secondary",me:"2",children:"Cancel"}),v.jsx(N.Button,{scheme:"danger",disabled:c.isLoading,onClick:d,children:"Delete"})]}),c.isLoading&&v.jsx(ji,{})]})}const[$$,I_]=Be.createContext();function V$({editView:t,deleteItem:e,queryKey:n,children:r}){const o=Wy(),i=wn.useNavigate(),[s,a]=T.useState(null),l=T.useCallback(()=>a(null),[a]),c=T.useCallback((h,f)=>{switch(h.type){case"view":{i(Be.runIfFn(h.path,f));break}case"link":{o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${Be.runIfFn(h.path,f)}`);break}case"edit":{t.type=="customDialog"?a(t.render({show:!0,onClose:l})):a(v.jsx(P_,{onClose:l,config:t,queryId:f.id,invalidateQueryKey:n}));break}case"delete":{a(v.jsx(B$,{show:!0,onClose:l,queryId:f.id,invalidateQueryKey:n,...e,itemLabel:Be.runIfFn(e.itemLabel,f)}));break}}},[i,t,e]),u=$$,d={dialog:s,onAction:c};return v.jsx(u,{value:d,children:r})}function j$({id:t,api:e,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=Gr(i?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=T.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>De.success(i?"Published!":"Unpublished!")).catch(c=>De.error(`Error: ${c}`))},[s,t]);return v.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:v.jsx(N.Icon,{path:i?Xg:Yg})})}function z$({row:t,onAction:e,rowActions:n,api:r,queryKey:o}){const i=t.original;return v.jsx("div",{dflex:!0,spaceX:"1",placeContent:"end",children:n==null?void 0:n.map((s,a)=>v.jsxs(T.Fragment,{children:[s.type==="publish"&&v.jsx(j$,{id:i.id,api:r,status:i.status,invalidateQueryKey:o}),s.type=="custom"&&v.jsx(v.Fragment,{children:s.component(i,o,s.icon,s.label)}),!["publish","custom"].includes(s.type)&&v.jsx(U$,{onClick:()=>e(s,i),scheme:W$[s.type],children:v.jsx(N.Icon,{path:q$[s.type]})})]},a))})}function U$({onClick:t,...e}){const n=T.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),t==null||t(r)},[t]);return v.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",onClick:n,...e})}const q$={link:au,view:su,edit:Jg,delete:iu,publish:iu,custom:""},W$={link:"dark",view:"secondary",edit:"warning",delete:"danger",publish:"warning",custom:"default"};function K$(t,e,n){const r=wn.useNavigate(),o=Wy(),{onAction:i}=I_(),{onRowClick:s,columns:a,...l}=e,c=T.useCallback(h=>{(s==null?void 0:s.type)==="navigate"?r(Be.runIfFn(s.path,h)):(s==null?void 0:s.type)=="link"&&o(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${Be.runIfFn(s.path,h)}`)},[r,s]),u=T.useMemo(()=>{const h=e.columns.concat([]);return n&&h.push(_B().display({id:"actions",header:"Actions",cell:f=>v.jsx(z$,{row:f.row,onAction:i,rowActions:n,api:t,queryKey:t.queryKey})})),h},[e]),d={...l};return d.columns=u,d.onRowClick=c,d.queryKey=t.queryKey,d.queryFn=t.search,d}function G$(t){const e=wn.useParams();if(t===void 0)return;const{[t]:n}=e;return n}function J$({title:t,queryField:e,screen:n,...r}){const o=G$(e),{api:i,table:s,filters:a,buttonBar:l,rowActions:c,editView:u,deleteItem:d,breadcrumbs:h}=Be.runIfFn(n,o),f=Be.runIfFn(i,o);return v.jsxs(ja,{p:"5",...r,children:[h&&v.jsx(mg,{breadcrumbs:h}),v.jsxs(x_,{children:[v.jsxs(T_,{title:t,queryKey:f.queryKey,children:[a&&v.jsx(O_,{}),v.jsx(X$,{buttonBar:l,editView:u,api:f})]}),v.jsxs(V$,{queryKey:f.queryKey,editView:u,deleteItem:d,children:[v.jsx(Y$,{table:s,rowActions:c,api:f}),v.jsx(Q$,{})]})]})]})}function X$({buttonBar:t,editView:e,api:n}){const r=T.useCallback(o=>e.type=="customDialog"?e.render({show:!0,onClose:o}):v.jsx(P_,{config:e,onClose:o,invalidateQueryKey:n.queryKey}),[e,n]);return v.jsx(v.Fragment,{children:t&&t.map((o,i)=>v.jsxs("div",{children:[o.type==="create"&&e&&v.jsx(A_,{buildDialog:r}),o.type==="invalidate"&&v.jsx(ld,{pathOrPermalink:o.pathOrPermalink}),o.type==="custom"&&o.render()]},i))})}function Y$({table:t,rowActions:e,api:n}){const r=K$(n,t,e);return v.jsx(L$,{...r})}function Q$(){const{dialog:t}=I_();return t}function Z$(t){const e=wn.useParams(),{data:n,isFetching:r,isError:o}=Qm(t.map(s=>{if(!s.queryField||!Be.isFunction(s.api)){const c=s.api;return{queryKey:c.queryKey,queryFn:s.fn=="get"?c.get:c.getAll,queryParam:s.params}}const a=e[s.queryField],l=Be.runIfFn(s.api,a);return{queryKey:l.queryKey,queryFn:s.fn=="get"?l.get:l.getAll,queryParam:s.fn=="getAll"?s.params:Be.isFunction(s.api)?void 0:a}}));let i;return!r&&!o&&(i=n==null?void 0:n.map((s,a)=>{var l,c;return t[a].transformFn?(c=(l=t[a]).transformFn)==null?void 0:c.call(l,s):s})),{data:i,isFetching:r,isError:o}}function eV(t){const e=ur.useQueryClient(),n=wn.useParams();return T.useCallback(()=>{const o=[];t.forEach(i=>{if(!i.queryField||!Be.isFunction(i.api))o.push(i.api.queryKey);else{const s=n[i.queryField],a=Be.runIfFn(i.api,s);o.push(a.queryKey)}}),e.invalidateQueries({predicate:i=>o.includes(i.queryKey)})},[t,e,n])}function tV({queries:t,config:e,tabbed:n,...r}){const{data:o,isFetching:i,isError:s}=Z$(t),a=eV(t);return i?v.jsx(gr,{w:"full",h:"100vh"}):s||!o?v.jsx(Yr,{p:"0",w:"full",h:"100vh",onClick:a}):v.jsx(ru,{config:e(...o),tabbed:n,...r})}function ru({config:t,tabbed:e,...n}){return t.type==="table"?v.jsx(J$,{...t,...n}):t.type==="tabbed"?v.jsx(CB,{...t,...n}):t.type==="details"?v.jsx(yB,{...t,tabbed:e,...n}):t.type==="query"?v.jsx(SB,{...t,tabbed:e,...n}):t.type==="multiQuery"?v.jsx(tV,{...t,tabbed:e,...n}):v.jsx(v.Fragment,{})}const L_="Oops, something went wrong...";function nV({queryId:t,queryKey:e,queryFetchFn:n,queryFetchAllKey:r,queryFetchAllFn:o,querySaveFn:i,matchKey:s,size:a="lg",show:l,onClose:c,itemLabel:u,onSuccess:d,onFetchError:h,fetchErrorMsg:f=L_,onSaveError:p,saveErrorMsg:g=L_,invalidateQueriesOnSuccess:m=!0,retryText:y="Retry",cancelLabel:C="Cancel",saveLabel:w,formikProps:b,getItemName:S,...E}){const x=ur.useQueryClient(),{data:_,isInitialLoading:A,isError:O,refetch:k,error:M}=Sn(e,n),{data:I,isInitialLoading:P,isError:F,refetch:z,error:$}=Sn(r,o),[J,K]=T.useState([]),R=A||P,Q=O||F,se=Fo(i,e,t),ie=T.useCallback(D=>{const ce=(D==null?void 0:D.currentTarget.dataset.id)??"",ye=J.concat([]),be=J.indexOf(ce);be!=-1?ye.splice(be,1):ye.push(ce),K(ye)},[J,K]),de=T.useCallback(()=>{O&&k(),F&&z()},[k,z,O,F]),ue=T.useCallback(()=>{se.reset(),se.mutateAsync({resources:J}).then(D=>{d?d(D):De.success(`${u} saved`),m&&x.invalidateQueries({queryKey:e}),c==null||c()}).catch(D=>{console.error("on error",D),p?p():De.error(`Error adding ${u}`)})},[se,t,d,x,p,c]),pe=T.useMemo(()=>{let D=[];return _&&I&&(D=[].concat(I),_.forEach(ce=>D.splice(D.findIndex(ye=>ye.id==ce[s]),1)),S&&(D=D.map(ce=>({...ce,name:S(ce)}))),D=tT(D,["name"])),D},[_,I]);return v.jsxs(N.Modal,{size:a,show:l,onClose:c,scheme:"light",transition:!0,...E,children:[v.jsx(N.Modal.Header,{children:`Add ${u}`}),R&&v.jsx(N.Modal.Body,{children:v.jsx(gr,{minW:"72"})}),Q&&v.jsx(N.Modal.Body,{children:v.jsx(Yr,{label:`${f} ${M}`,onClick:de})}),!R&&!Q&&v.jsxs(v.Fragment,{children:[v.jsx(N.Modal.Body,{px:"0",pb:"6",maxH:"750px",overflow:"auto",children:v.jsx("div",{dflex:!0,flexCol:!0,overflow:"auto",children:pe.map(D=>v.jsx(rV,{label:D.name,value:D.id,"data-id":D.id,checked:J.includes(`${D.id}`),onClick:ie},D.id))})}),v.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[v.jsx(N.Button,{disabled:se.isLoading,onClick:c,variant:"borderless",me:"2",children:C}),v.jsx(N.Button,{type:"submit",disabled:J.length==0||se.isLoading,onClick:ue,children:w||(t?"Update":"Create")})]})]}),se.isLoading&&v.jsx(ji,{})]})}function rV({label:t,value:e,checked:n,...r}){return v.jsxs("div",{dflex:!0,alignItems:"center",hover_bgColor:"slate-100",px:"5",py:"2",cursor:"pointer",...r,children:[v.jsx("span",{flexGrow:!0,children:t}),v.jsx(N.Checkbox,{name:`resources.${e}`,value:e,checked:n})]})}function oV({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFn:o,queryOptions:i,onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h,invalidateQueriesOnSuccess:f=!0,cancelLabel:p="Cancel",saveLabel:g="Send",size:m="lg",title:y,form:C,show:w,onClose:b,formikProps:S,...E}){const x=f?Gr(o,r,i):Fo(o,r,n,i),_=ya(x,{onSuccess:s,successMsg:a,showSuccessMsg:l,onError:c,errorMsg:u,showErrorMsg:d,processInput:h});return v.jsxs(N.Modal,{size:m,show:w,onClose:b,scheme:"light",transition:!0,...E,children:[v.jsx(N.Modal.Header,{children:y}),v.jsxs(qd,{initialValues:t??{},onSubmit:_,...S,children:[v.jsxs(N.Modal.Body,{pb:"6",children:[T.isValidElement(C)&&C,Array.isArray(C)&&v.jsx(Qr,{form:C})]}),v.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[v.jsx(N.Button,{disabled:x.isLoading,onClick:b,variant:"borderless",me:"2",children:p}),v.jsx(U0,{disabled:x.isLoading,children:g})]})]}),x.isLoading&&v.jsx(ji,{})]})}const D_="Oops, something went wrong...";function R_(t){if(t){const e={...t};for(const n in t)e[n]=e[n]??"";return e}return t}function iV({initialValues:t,itemLabel:e,queryId:n="",queryKey:r,queryFetchFn:o,queryFetchOptions:i,querySaveFn:s,querySaveOptions:a,onSuccess:l,onFetchError:c,fetchErrorMsg:u=D_,onSaveError:d,saveErrorMsg:h=D_,fetchToFormData:f,formToQueryData:p,invalidateQueriesOnSuccess:g=!0,invalidateQueryKey:m,retryText:y="Retry",cancelLabel:C="Cancel",saveLabel:w,size:b="lg",title:S,form:E,show:x,onClose:_,formikProps:A,...O}){const{isInitialLoading:k,isFetching:M,data:I,isError:P,error:F,refetch:z}=Sn(r,o,n,{enabled:!(n==""||n==null||n==null),onError:c,...i}),$=g?Gr(s,m??r,a):Fo(s,r,n,a),J=T.useCallback(()=>z(),[z]),K=T.useCallback((R,Q)=>{$.reset();const se=p?p(R):{...R};$.mutateAsync(se).then(ie=>{l?l(se,ie):De.success(`${S?S(se):se.name??se.title} ${n?"saved":"created"}`),_==null||_()}).catch(ie=>{console.error("on error",ie),d?d(R):De.error(`Couldn't save ${S?S(se):se.name??se.title}`),Q.setSubmitting(!1)})},[$,p,l,d,_]);return v.jsxs(N.Modal,{size:b,show:x,onClose:_,scheme:"light",transition:!0,...O,children:[v.jsxs(N.Modal.Header,{children:[!k&&n&&`Edit ${S?S(I):(I==null?void 0:I.name)??(I==null?void 0:I.title)??""}`,!n&&`Create new ${e??"item"}`,Array.isArray(E)&&v.jsx(v.Fragment,{})]}),k&&v.jsx(N.Modal.Body,{children:v.jsx(gr,{minW:"72"})}),P&&v.jsx(N.Modal.Body,{children:v.jsx(Yr,{label:`${u} ${F}`,onClick:J})}),!k&&!P&&v.jsx(v.Fragment,{children:v.jsx(Je.Formik,{initialValues:f&&n&&I?f(R_(I)):R_(I)??t??{},onSubmit:K,...A,children:({setFieldValue:R,dirty:Q,handleSubmit:se,isValid:ie,values:de})=>v.jsxs(v.Fragment,{children:[v.jsx(N.Modal.Body,{pb:"6",children:v.jsxs(Je.Form,{children:[T.isValidElement(E)&&E,Array.isArray(E)&&v.jsx(Qr,{form:E}),Be.isFunction(E)&&v.jsx(Qr,{form:E(I??de)})]})}),v.jsxs(N.Modal.Footer,{dflex:!0,placeContent:"end",spaceX:"3",children:[v.jsx(N.Button,{disabled:$.isLoading,onClick:_,variant:"borderless",me:"2",children:C}),v.jsx(N.Button,{type:"submit",disabled:!Q||$.isLoading,onClick:()=>se(),children:w||(n?"Update":"Create")})]})]})})}),$.isLoading&&v.jsx(ji,{})]})}function N_({children:t,...e}){return v.jsx("div",{trait:"typo.h6",mb:"5",...e,children:t})}const sV=T.forwardRef(({loading:t=!1,children:e,...n},r)=>v.jsxs(v.Fragment,{children:[t&&v.jsx(gr,{w:"full",h:"100%"}),!t&&v.jsx(N.Container,{ref:r,center:!0,size:"x2",dflex:!0,flexCol:!0,gap:"8",...n,children:e})]}));function aV({children:t,...e}){return v.jsx("div",{trait:"typo.h6",mb:"3",...e,children:t})}const lV={draft:"Draft",published:"Published",pending:"Pending",approved:"Approved",partially_approved:"Partially Approved",rejected:"Rejected"},cV={draft:"warning",published:"success",pending:"secondary",approved:"success",partially_approved:"warning",rejected:"danger"};function uV({status:t,...e}){return v.jsx(N.Badge,{size:"sm",variant:"glass",whiteSpace:"nowrap",rounded:"full",px:"3",scheme:cV[t],...e,children:lV[t]})}function F_({path:t,...e}){const n=T.useCallback(r=>{r==null||r.preventDefault(),r==null||r.stopPropagation(),window.open(`${process.env.NEXT_PUBLIC_WEBSITE_URL}/${t}`,"_blank")},[t]);return v.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"dark",onClick:n,...e,children:v.jsx(N.Icon,{path:au})})}function H_({path:t,...e}){const n=wn.useNavigate(),r=T.useCallback(o=>{o==null||o.preventDefault(),o==null||o.stopPropagation(),n(`${t}`)},[n,t]);return v.jsx(N.Button,{scheme:"secondary",w:"10",h:"10",variant:"borderless",corners:"pill",onClick:r,...e,children:v.jsx(N.Icon,{path:su})})}function B_({children:t,...e}){return v.jsx(ua,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"warning",...e,children:t??v.jsx(N.Icon,{path:Jg})})}function $_({children:t,...e}){return v.jsx(ua,{w:"10",h:"10",scheme:"danger",variant:"borderless",corners:"pill",...e,children:t??v.jsx(N.Icon,{path:iu})})}function dV({publishId:t,viewPath:e,navigatePath:n,editDialog:r,deleteDialog:o,children:i,...s}){return v.jsxs("div",{dflex:!0,spaceX:"1",placeContent:"end",...s,children:[e&&v.jsx(F_,{path:e}),n&&v.jsx(H_,{path:n}),r&&v.jsx(B_,{buildDialog:r}),o&&v.jsx($_,{buildDialog:o}),i]})}function fV({id:t,api:e,status:n,invalidateQueryKey:r,...o}){const i=n=="draft",s=Gr(i?e.publish:e.unpublish,r??e.queryKey,{networkMode:"always"}),a=T.useCallback(l=>{l==null||l.preventDefault(),l==null||l.stopPropagation(),s.reset(),s.mutateAsync(t).then(()=>De.success(i?"Published!":"Unpublished!")).catch(c=>De.error(`Error: ${c}`))},[s,t]);return v.jsx(N.Button,{w:"10",h:"10",variant:"borderless",corners:"pill",scheme:"default",onClick:a,...o,children:v.jsx(N.Icon,{path:i?Xg:Yg})})}Oe.AttachDialog=nV,Oe.Breadcrumbs=Vu,Oe.DialogButton=ua,Oe.FormActionDialog=oV,Oe.IconButton=qx,Oe.InvalidateButton=ld,Oe.ItemEditDialog=iV,Oe.NavigateButton=hO,Oe.OrderCell=fM,Oe.PageContainer=ja,Oe.PageContentEditor=YE,Oe.PageMain=XE,Oe.PageQueryStateContainer=pg,Oe.PageSectionTitle=N_,Oe.PageSidebar=QE,Oe.PageSidebarSection=ZE,Oe.PageStateContainer=sV,Oe.PageSubSectionTitle=aV,Oe.PageTabbedTopBar=n_,Oe.PageTabbedTopBarProvider=t_,Oe.PageTitle=gg,Oe.PageTopBar=mg,Oe.PageTopBarToolbar=r_,Oe.PublishButton=$y,Oe.ScreenRenderer=ru,Oe.SectionTitle=X_,Oe.StatusBadge=uV,Oe.TableContainer=x_,Oe.TableCreateButton=A_,Oe.TableFilterButton=O_,Oe.TableRowActionBar=dV,Oe.TableRowDeleteButton=$_,Oe.TableRowEditButton=B_,Oe.TableRowNavigateButton=H_,Oe.TableRowPublishPostButton=fV,Oe.TableRowViewButton=F_,Oe.TableTopBar=T_,Oe.UpdateButton=Q0,Oe.ViewButton=Z0,Object.defineProperty(Oe,Symbol.toStringTag,{value:"Module"})});
|