@quoreadmin/ui 0.24.21 → 0.24.22
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/dist/index.js +6 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/assets/scss/transitions.scss +14 -0
package/dist/index.js
CHANGED
|
@@ -34781,6 +34781,11 @@ const cK = /* @__PURE__ */ we(uF, [["render", hF], ["__scopeId", "data-v-fda7354
|
|
|
34781
34781
|
type: Boolean,
|
|
34782
34782
|
default: !1
|
|
34783
34783
|
},
|
|
34784
|
+
// 'component-slide-right' or 'component-slide-top' for mobile
|
|
34785
|
+
transitionClass: {
|
|
34786
|
+
type: String,
|
|
34787
|
+
default: "component-slide-right"
|
|
34788
|
+
},
|
|
34784
34789
|
closeButton: {
|
|
34785
34790
|
type: Boolean,
|
|
34786
34791
|
default: !1
|
|
@@ -34802,7 +34807,7 @@ const cK = /* @__PURE__ */ we(uF, [["render", hF], ["__scopeId", "data-v-fda7354
|
|
|
34802
34807
|
), o = j(
|
|
34803
34808
|
() => t.position ? "toast-fixed " + t.position : ""
|
|
34804
34809
|
), s = j(
|
|
34805
|
-
() => t.withTransition &&
|
|
34810
|
+
() => t.withTransition && t.transitionClass
|
|
34806
34811
|
), a = () => {
|
|
34807
34812
|
e(Sm);
|
|
34808
34813
|
}, l = () => {
|
package/dist/index.umd.cjs
CHANGED
|
@@ -255,7 +255,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
`);this.responsiveStyleElement.innerHTML=i}},destroyResponsiveStyle:function(){this.responsiveStyleElement&&(document.head.removeChild(this.responsiveStyleElement),this.responsiveStyleElement=null)},destroyStyleElement:function(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},dataToRender:function(e){var n=e||this.processedData;if(n&&this.paginator){var r=this.lazy?0:this.d_first;return n.slice(r,r+this.d_rows)}return n},getVirtualScrollerRef:function(){return this.$refs.virtualScroller},hasSpacerStyle:function(e){return I.isNotEmpty(e)}},computed:{columns:function(){var e=this.d_columns.get(this);if(this.reorderableColumns&&this.d_columnOrder){var n=[],r=Gs(this.d_columnOrder),o;try{for(r.s();!(o=r.n()).done;){var i=o.value,a=this.findColumnByKey(e,i);a&&!this.columnProp(a,"hidden")&&n.push(a)}}catch(l){r.e(l)}finally{r.f()}return[].concat(n,we(e.filter(function(l){return n.indexOf(l)<0})))}return e},columnGroups:function(){return this.d_columnGroups.get(this)},headerColumnGroup:function(){var e,n=this;return(e=this.columnGroups)===null||e===void 0?void 0:e.find(function(r){return n.columnProp(r,"type")==="header"})},footerColumnGroup:function(){var e,n=this;return(e=this.columnGroups)===null||e===void 0?void 0:e.find(function(r){return n.columnProp(r,"type")==="footer"})},hasFilters:function(){return this.filters&&Object.keys(this.filters).length>0&&this.filters.constructor===Object},processedData:function(){var e,n=this.value||[];return!this.lazy&&!((e=this.virtualScrollerOptions)!==null&&e!==void 0&&e.lazy)&&n&&n.length&&(this.hasFilters&&(n=this.filter(n)),this.sorted&&(this.sortMode==="single"?n=this.sortSingle(n):this.sortMode==="multiple"&&(n=this.sortMultiple(n)))),n},totalRecordsLength:function(){if(this.lazy)return this.totalRecords;var e=this.processedData;return e?e.length:0},empty:function(){var e=this.processedData;return!e||e.length===0},paginatorTop:function(){return this.paginator&&(this.paginatorPosition!=="bottom"||this.paginatorPosition==="both")},paginatorBottom:function(){return this.paginator&&(this.paginatorPosition!=="top"||this.paginatorPosition==="both")},sorted:function(){return this.d_sortField||this.d_multiSortMeta&&this.d_multiSortMeta.length>0},allRowsSelected:function(){var e=this;if(this.selectAll!==null)return this.selectAll;var n=this.frozenValue?[].concat(we(this.frozenValue),we(this.processedData)):this.processedData;return I.isNotEmpty(n)&&this.selection&&Array.isArray(this.selection)&&n.every(function(r){return e.selection.some(function(o){return e.equals(o,r)})})},attributeSelector:function(){return Qt()},groupRowSortField:function(){return this.sortMode==="single"?this.sortField:this.d_groupRowsSortMeta?this.d_groupRowsSortMeta.field:null},virtualScrollerDisabled:function(){return I.isEmpty(this.virtualScrollerOptions)||!this.scrollable}},components:{DTPaginator:u3,DTTableHeader:F3,DTTableBody:T3,DTTableFooter:B3,DTVirtualScroller:Iu,ArrowDownIcon:A5,ArrowUpIcon:D5,SpinnerIcon:Is}};function qs(t){"@babel/helpers - typeof";return qs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qs(t)}function Z3(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 U3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Z3(Object(n),!0).forEach(function(r){oR(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Z3(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function oR(t,e,n){return e=iR(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iR(t){var e=sR(t,"string");return qs(e)=="symbol"?e:String(e)}function sR(t,e){if(qs(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(qs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function aR(t,e,n,r,o,i){var a=s.resolveComponent("SpinnerIcon"),l=s.resolveComponent("DTPaginator"),c=s.resolveComponent("DTTableHeader"),u=s.resolveComponent("DTTableBody"),d=s.resolveComponent("DTTableFooter"),f=s.resolveComponent("DTVirtualScroller");return s.openBlock(),s.createElementBlock("div",s.mergeProps({class:t.cx("root"),"data-scrollselectors":".p-datatable-wrapper"},t.ptmi("root")),[s.renderSlot(t.$slots,"default"),t.loading?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:0,class:t.cx("loadingOverlay")},t.ptm("loadingOverlay")),[t.$slots.loading?s.renderSlot(t.$slots,"loading",{key:0}):(s.openBlock(),s.createElementBlock(s.Fragment,{key:1},[t.$slots.loadingicon?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.$slots.loadingicon),{key:0,class:s.normalizeClass(t.cx("loadingIcon"))},null,8,["class"])):t.loadingIcon?(s.openBlock(),s.createElementBlock("i",s.mergeProps({key:1,class:[t.cx("loadingIcon"),"pi-spin",t.loadingIcon]},t.ptm("loadingIcon")),null,16)):(s.openBlock(),s.createBlock(a,s.mergeProps({key:2,spin:"",class:t.cx("loadingIcon")},t.ptm("loadingIcon")),null,16,["class"]))],64))],16)):s.createCommentVNode("",!0),t.$slots.header?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:1,class:t.cx("header")},t.ptm("header")),[s.renderSlot(t.$slots,"header")],16)):s.createCommentVNode("",!0),i.paginatorTop?(s.openBlock(),s.createBlock(l,{key:2,rows:o.d_rows,first:o.d_first,totalRecords:i.totalRecordsLength,pageLinkSize:t.pageLinkSize,template:t.paginatorTemplate,rowsPerPageOptions:t.rowsPerPageOptions,currentPageReportTemplate:t.currentPageReportTemplate,class:s.normalizeClass(t.cx("paginator")),onPage:e[0]||(e[0]=function(p){return i.onPage(p)}),alwaysShow:t.alwaysShowPaginator,unstyled:t.unstyled,pt:t.ptm("paginator")},s.createSlots({_:2},[t.$slots.paginatorstart?{name:"start",fn:s.withCtx(function(){return[s.renderSlot(t.$slots,"paginatorstart")]}),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:s.withCtx(function(){return[s.renderSlot(t.$slots,"paginatorend")]}),key:"1"}:void 0,t.$slots.paginatorfirstpagelinkicon?{name:"firstpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorfirstpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"2"}:void 0,t.$slots.paginatorprevpagelinkicon?{name:"prevpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorprevpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"3"}:void 0,t.$slots.paginatornextpagelinkicon?{name:"nextpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatornextpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"4"}:void 0,t.$slots.paginatorlastpagelinkicon?{name:"lastpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorlastpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"5"}:void 0,t.$slots.paginatorjumptopagedropdownicon?{name:"jumptopagedropdownicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorjumptopagedropdownicon",{class:s.normalizeClass(p.class)})]}),key:"6"}:void 0,t.$slots.paginatorrowsperpagedropdownicon?{name:"rowsperpagedropdownicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorrowsperpagedropdownicon",{class:s.normalizeClass(p.class)})]}),key:"7"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","class","alwaysShow","unstyled","pt"])):s.createCommentVNode("",!0),s.createElementVNode("div",s.mergeProps({class:t.cx("wrapper"),style:[t.sx("wrapper"),{maxHeight:i.virtualScrollerDisabled?t.scrollHeight:""}]},t.ptm("wrapper")),[s.createVNode(f,s.mergeProps({ref:"virtualScroller"},t.virtualScrollerOptions,{items:i.processedData,columns:i.columns,style:t.scrollHeight!=="flex"?{height:t.scrollHeight}:void 0,scrollHeight:t.scrollHeight!=="flex"?void 0:"100%",disabled:i.virtualScrollerDisabled,loaderDisabled:"",inline:"",autoSize:"",showSpacer:!1,pt:t.ptm("virtualScroller")}),{content:s.withCtx(function(p){return[s.createElementVNode("table",s.mergeProps({ref:"table",role:"table",class:[t.cx("table"),t.tableClass],style:[t.tableStyle,p.spacerStyle]},U3(U3({},t.tableProps),t.ptm("table"))),[s.createVNode(c,{columnGroup:i.headerColumnGroup,columns:p.columns,rowGroupMode:t.rowGroupMode,groupRowsBy:t.groupRowsBy,groupRowSortField:i.groupRowSortField,reorderableColumns:t.reorderableColumns,resizableColumns:t.resizableColumns,allRowsSelected:i.allRowsSelected,empty:i.empty,sortMode:t.sortMode,sortField:o.d_sortField,sortOrder:o.d_sortOrder,multiSortMeta:o.d_multiSortMeta,filters:o.d_filters,filtersStore:t.filters,filterDisplay:t.filterDisplay,filterInputProps:t.filterInputProps,onColumnClick:e[1]||(e[1]=function(h){return i.onColumnHeaderClick(h)}),onColumnMousedown:e[2]||(e[2]=function(h){return i.onColumnHeaderMouseDown(h)}),onFilterChange:i.onFilterChange,onFilterApply:i.onFilterApply,onColumnDragstart:e[3]||(e[3]=function(h){return i.onColumnHeaderDragStart(h)}),onColumnDragover:e[4]||(e[4]=function(h){return i.onColumnHeaderDragOver(h)}),onColumnDragleave:e[5]||(e[5]=function(h){return i.onColumnHeaderDragLeave(h)}),onColumnDrop:e[6]||(e[6]=function(h){return i.onColumnHeaderDrop(h)}),onColumnResizestart:e[7]||(e[7]=function(h){return i.onColumnResizeStart(h)}),onCheckboxChange:e[8]||(e[8]=function(h){return i.toggleRowsWithCheckbox(h)}),unstyled:t.unstyled,pt:t.pt},null,8,["columnGroup","columns","rowGroupMode","groupRowsBy","groupRowSortField","reorderableColumns","resizableColumns","allRowsSelected","empty","sortMode","sortField","sortOrder","multiSortMeta","filters","filtersStore","filterDisplay","filterInputProps","onFilterChange","onFilterApply","unstyled","pt"]),t.frozenValue?(s.openBlock(),s.createBlock(u,{key:0,ref:"frozenBodyRef",value:t.frozenValue,frozenRow:!0,columns:p.columns,first:o.d_first,dataKey:t.dataKey,selection:t.selection,selectionKeys:o.d_selectionKeys,selectionMode:t.selectionMode,contextMenu:t.contextMenu,contextMenuSelection:t.contextMenuSelection,rowGroupMode:t.rowGroupMode,groupRowsBy:t.groupRowsBy,expandableRowGroups:t.expandableRowGroups,rowClass:t.rowClass,rowStyle:t.rowStyle,editMode:t.editMode,compareSelectionBy:t.compareSelectionBy,scrollable:t.scrollable,expandedRowIcon:t.expandedRowIcon,collapsedRowIcon:t.collapsedRowIcon,expandedRows:t.expandedRows,expandedRowGroups:t.expandedRowGroups,editingRows:t.editingRows,editingRowKeys:o.d_editingRowKeys,templates:t.$slots,responsiveLayout:t.responsiveLayout,isVirtualScrollerDisabled:!0,onRowgroupToggle:i.toggleRowGroup,onRowClick:e[9]||(e[9]=function(h){return i.onRowClick(h)}),onRowDblclick:e[10]||(e[10]=function(h){return i.onRowDblClick(h)}),onRowRightclick:e[11]||(e[11]=function(h){return i.onRowRightClick(h)}),onRowTouchend:i.onRowTouchEnd,onRowKeydown:i.onRowKeyDown,onRowMousedown:i.onRowMouseDown,onRowDragstart:e[12]||(e[12]=function(h){return i.onRowDragStart(h)}),onRowDragover:e[13]||(e[13]=function(h){return i.onRowDragOver(h)}),onRowDragleave:e[14]||(e[14]=function(h){return i.onRowDragLeave(h)}),onRowDragend:e[15]||(e[15]=function(h){return i.onRowDragEnd(h)}),onRowDrop:e[16]||(e[16]=function(h){return i.onRowDrop(h)}),onRowToggle:e[17]||(e[17]=function(h){return i.toggleRow(h)}),onRadioChange:e[18]||(e[18]=function(h){return i.toggleRowWithRadio(h)}),onCheckboxChange:e[19]||(e[19]=function(h){return i.toggleRowWithCheckbox(h)}),onCellEditInit:e[20]||(e[20]=function(h){return i.onCellEditInit(h)}),onCellEditComplete:e[21]||(e[21]=function(h){return i.onCellEditComplete(h)}),onCellEditCancel:e[22]||(e[22]=function(h){return i.onCellEditCancel(h)}),onRowEditInit:e[23]||(e[23]=function(h){return i.onRowEditInit(h)}),onRowEditSave:e[24]||(e[24]=function(h){return i.onRowEditSave(h)}),onRowEditCancel:e[25]||(e[25]=function(h){return i.onRowEditCancel(h)}),editingMeta:o.d_editingMeta,onEditingMetaChange:i.onEditingMetaChange,unstyled:t.unstyled,pt:t.pt},null,8,["value","columns","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange","unstyled","pt"])):s.createCommentVNode("",!0),s.createVNode(u,{ref:"bodyRef",value:i.dataToRender(p.rows),class:s.normalizeClass(p.styleClass),columns:p.columns,empty:i.empty,first:o.d_first,dataKey:t.dataKey,selection:t.selection,selectionKeys:o.d_selectionKeys,selectionMode:t.selectionMode,contextMenu:t.contextMenu,contextMenuSelection:t.contextMenuSelection,rowGroupMode:t.rowGroupMode,groupRowsBy:t.groupRowsBy,expandableRowGroups:t.expandableRowGroups,rowClass:t.rowClass,rowStyle:t.rowStyle,editMode:t.editMode,compareSelectionBy:t.compareSelectionBy,scrollable:t.scrollable,expandedRowIcon:t.expandedRowIcon,collapsedRowIcon:t.collapsedRowIcon,expandedRows:t.expandedRows,expandedRowGroups:t.expandedRowGroups,editingRows:t.editingRows,editingRowKeys:o.d_editingRowKeys,templates:t.$slots,responsiveLayout:t.responsiveLayout,virtualScrollerContentProps:p,isVirtualScrollerDisabled:i.virtualScrollerDisabled,onRowgroupToggle:i.toggleRowGroup,onRowClick:e[26]||(e[26]=function(h){return i.onRowClick(h)}),onRowDblclick:e[27]||(e[27]=function(h){return i.onRowDblClick(h)}),onRowRightclick:e[28]||(e[28]=function(h){return i.onRowRightClick(h)}),onRowTouchend:i.onRowTouchEnd,onRowKeydown:function(m){return i.onRowKeyDown(m,p)},onRowMousedown:i.onRowMouseDown,onRowDragstart:e[29]||(e[29]=function(h){return i.onRowDragStart(h)}),onRowDragover:e[30]||(e[30]=function(h){return i.onRowDragOver(h)}),onRowDragleave:e[31]||(e[31]=function(h){return i.onRowDragLeave(h)}),onRowDragend:e[32]||(e[32]=function(h){return i.onRowDragEnd(h)}),onRowDrop:e[33]||(e[33]=function(h){return i.onRowDrop(h)}),onRowToggle:e[34]||(e[34]=function(h){return i.toggleRow(h)}),onRadioChange:e[35]||(e[35]=function(h){return i.toggleRowWithRadio(h)}),onCheckboxChange:e[36]||(e[36]=function(h){return i.toggleRowWithCheckbox(h)}),onCellEditInit:e[37]||(e[37]=function(h){return i.onCellEditInit(h)}),onCellEditComplete:e[38]||(e[38]=function(h){return i.onCellEditComplete(h)}),onCellEditCancel:e[39]||(e[39]=function(h){return i.onCellEditCancel(h)}),onRowEditInit:e[40]||(e[40]=function(h){return i.onRowEditInit(h)}),onRowEditSave:e[41]||(e[41]=function(h){return i.onRowEditSave(h)}),onRowEditCancel:e[42]||(e[42]=function(h){return i.onRowEditCancel(h)}),editingMeta:o.d_editingMeta,onEditingMetaChange:i.onEditingMetaChange,unstyled:t.unstyled,pt:t.pt},null,8,["value","class","columns","empty","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","virtualScrollerContentProps","isVirtualScrollerDisabled","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange","unstyled","pt"]),i.hasSpacerStyle(p.spacerStyle)?(s.openBlock(),s.createElementBlock("tbody",s.mergeProps({key:1,class:t.cx("virtualScrollerSpacer"),style:{height:"calc(".concat(p.spacerStyle.height," - ").concat(p.rows.length*p.itemSize,"px)")}},t.ptm("virtualScrollerSpacer")),null,16)):s.createCommentVNode("",!0),s.createVNode(d,{columnGroup:i.footerColumnGroup,columns:p.columns,pt:t.pt},null,8,["columnGroup","columns","pt"])],16)]}),_:1},16,["items","columns","style","scrollHeight","disabled","pt"])],16),t.$slots.footer?(s.openBlock(),s.createElementBlock("div",s.mergeProps({key:3,class:t.cx("footer")},t.ptm("footer")),[s.renderSlot(t.$slots,"footer")],16)):s.createCommentVNode("",!0),i.paginatorBottom?(s.openBlock(),s.createBlock(l,{key:4,rows:o.d_rows,first:o.d_first,totalRecords:i.totalRecordsLength,pageLinkSize:t.pageLinkSize,template:t.paginatorTemplate,rowsPerPageOptions:t.rowsPerPageOptions,currentPageReportTemplate:t.currentPageReportTemplate,class:s.normalizeClass(t.cx("paginator")),onPage:e[43]||(e[43]=function(p){return i.onPage(p)}),alwaysShow:t.alwaysShowPaginator,unstyled:t.unstyled,pt:t.ptm("paginator")},s.createSlots({_:2},[t.$slots.paginatorstart?{name:"start",fn:s.withCtx(function(){return[s.renderSlot(t.$slots,"paginatorstart")]}),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:s.withCtx(function(){return[s.renderSlot(t.$slots,"paginatorend")]}),key:"1"}:void 0,t.$slots.paginatorfirstpagelinkicon?{name:"firstpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorfirstpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"2"}:void 0,t.$slots.paginatorprevpagelinkicon?{name:"prevpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorprevpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"3"}:void 0,t.$slots.paginatornextpagelinkicon?{name:"nextpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatornextpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"4"}:void 0,t.$slots.paginatorlastpagelinkicon?{name:"lastpagelinkicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorlastpagelinkicon",{class:s.normalizeClass(p.class)})]}),key:"5"}:void 0,t.$slots.paginatorjumptopagedropdownicon?{name:"jumptopagedropdownicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorjumptopagedropdownicon",{class:s.normalizeClass(p.class)})]}),key:"6"}:void 0,t.$slots.paginatorrowsperpagedropdownicon?{name:"rowsperpagedropdownicon",fn:s.withCtx(function(p){return[s.renderSlot(t.$slots,"paginatorrowsperpagedropdownicon",{class:s.normalizeClass(p.class)})]}),key:"7"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","class","alwaysShow","unstyled","pt"])):s.createCommentVNode("",!0),s.createElementVNode("div",s.mergeProps({ref:"resizeHelper",class:t.cx("resizeHelper"),style:{display:"none"}},t.ptm("resizeHelper")),null,16),t.reorderableColumns?(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:5,ref:"reorderIndicatorUp",class:t.cx("reorderIndicatorUp"),style:{position:"absolute",display:"none"}},t.ptm("reorderIndicatorUp")),[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.$slots.reorderindicatorupicon||"ArrowDownIcon")))],16)):s.createCommentVNode("",!0),t.reorderableColumns?(s.openBlock(),s.createElementBlock("span",s.mergeProps({key:6,ref:"reorderIndicatorDown",class:t.cx("reorderIndicatorDown"),style:{position:"absolute",display:"none"}},t.ptm("reorderIndicatorDown")),[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(t.$slots.reorderindicatordownicon||"ArrowUpIcon")))],16)):s.createCommentVNode("",!0)],16)}j3.render=aR;var lR={},cR={name:"BaseColumn",extends:J,props:{columnKey:{type:null,default:null},field:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},filterField:{type:[String,Function],default:null},dataType:{type:String,default:"text"},sortable:{type:Boolean,default:!1},header:{type:null,default:null},footer:{type:null,default:null},style:{type:null,default:null},class:{type:String,default:null},headerStyle:{type:null,default:null},headerClass:{type:String,default:null},bodyStyle:{type:null,default:null},bodyClass:{type:String,default:null},footerStyle:{type:null,default:null},footerClass:{type:String,default:null},showFilterMenu:{type:Boolean,default:!0},showFilterOperator:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showApplyButton:{type:Boolean,default:!0},showFilterMatchModes:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},filterMatchModeOptions:{type:Array,default:null},maxConstraints:{type:Number,default:2},excludeGlobalFilter:{type:Boolean,default:!1},filterHeaderClass:{type:String,default:null},filterHeaderStyle:{type:null,default:null},filterMenuClass:{type:String,default:null},filterMenuStyle:{type:null,default:null},selectionMode:{type:String,default:null},expander:{type:Boolean,default:!1},colspan:{type:Number,default:null},rowspan:{type:Number,default:null},rowReorder:{type:Boolean,default:!1},rowReorderIcon:{type:String,default:void 0},reorderableColumn:{type:Boolean,default:!0},rowEditor:{type:Boolean,default:!1},frozen:{type:Boolean,default:!1},alignFrozen:{type:String,default:"left"},exportable:{type:Boolean,default:!0},exportHeader:{type:String,default:null},exportFooter:{type:String,default:null},filterMatchMode:{type:String,default:null},hidden:{type:Boolean,default:!1}},style:lR,provide:function(){return{$parentInstance:this}}},uR={name:"Column",extends:cR,inheritAttrs:!1,inject:["$columns"],mounted:function(){var e;(e=this.$columns)===null||e===void 0||e.add(this.$)},unmounted:function(){var e;(e=this.$columns)===null||e===void 0||e.delete(this.$)},render:function(){return null}},dR={},fR={name:"BaseColumnGroup",extends:J,props:{type:{type:String,default:null}},style:dR,provide:function(){return{$parentInstance:this}}},pR={name:"ColumnGroup",extends:fR,inheritAttrs:!1,inject:["$columnGroups"],mounted:function(){var e;(e=this.$columnGroups)===null||e===void 0||e.add(this.$)},unmounted:function(){var e;(e=this.$columnGroups)===null||e===void 0||e.delete(this.$)},render:function(){return null}},hR={name:"Row",extends:J,inject:["$rows"],mounted:function(){var e;(e=this.$rows)===null||e===void 0||e.add(this.$)},unmounted:function(){var e;(e=this.$rows)===null||e===void 0||e.delete(this.$)},render:function(){return null}};const mR=s.defineComponent({name:"QTooltip",props:{id:{type:String,default:"tooltip"},color:{type:String,default:"inkwell-30"},noWrap:{type:Boolean,default:!0},position:{type:String,default:"bottom"},relative:{type:Boolean,default:!1}}}),gR=["aria-describedby"],yR=["id"];function bR(t,e,n,r,o,i){return s.openBlock(),s.createElementBlock("div",{class:"tooltip-container","aria-describedby":t.id},[s.renderSlot(t.$slots,"trigger",{},void 0,!0),s.createElementVNode("div",{id:t.id,class:s.normalizeClass(["tooltip",t.color?"bg-"+t.color+" border-"+t.color:"",t.position,t.noWrap?"no-wrap":"",t.relative?"relative":""]),role:"tooltip"},[s.renderSlot(t.$slots,"content",{},void 0,!0)],10,yR)],8,gR)}const W3=oe(mR,[["render",bR],["__scopeId","data-v-9d861ae7"]]),wR="data:image/svg+xml,%3csvg%20width='118'%20height='99'%20viewBox='0%200%20118%2099'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M104.165%2059.815C107.107%2062.7762%20108.893%2066.692%20109.201%2070.8549C109.508%2075.0179%20108.317%2079.1536%20105.842%2082.515L105.642%2082.782L105.412%2083.082L117.521%2095.245C117.828%2095.5546%20118%2095.973%20118%2096.409C118%2096.845%20117.828%2097.2634%20117.521%2097.573C117.232%2097.8651%20116.844%2098.0376%20116.434%2098.0561C116.023%2098.0746%20115.621%2097.9378%20115.307%2097.673L115.207%2097.573L103.122%2085.438L102.822%2085.682C99.4939%2088.3942%2095.2763%2089.772%2090.9889%2089.5476C86.7016%2089.3233%2082.6508%2087.5127%2079.624%2084.468C76.3686%2081.1921%2074.5414%2076.7614%2074.5414%2072.143C74.5414%2067.5247%2076.3686%2063.0939%2079.624%2059.818C81.2316%2058.2001%2083.1433%2056.916%2085.2491%2056.0397C87.3548%2055.1634%2089.6131%2054.7121%2091.8939%2054.7118C94.1747%2054.7115%2096.4331%2055.1622%2098.539%2056.0381C100.645%2056.9139%20102.557%2058.1975%20104.165%2059.815ZM81.935%2062.131C79.2951%2064.7964%2077.8142%2068.3961%2077.8142%2072.1475C77.8142%2075.8989%2079.2951%2079.4986%2081.935%2082.164C83.2368%2083.4792%2084.7865%2084.5233%2086.4944%2085.2358C88.2022%2085.9484%2090.0344%2086.3153%2091.885%2086.3153C93.7355%2086.3153%2095.5678%2085.9484%2097.2756%2085.2358C98.9835%2084.5233%20100.533%2083.4792%20101.835%2082.164C104.475%2079.4986%20105.956%2075.8989%20105.956%2072.1475C105.956%2068.3961%20104.475%2064.7964%20101.835%2062.131C100.533%2060.8158%2098.9835%2059.7717%2097.2756%2059.0592C95.5678%2058.3466%2093.7355%2057.9797%2091.885%2057.9797C90.0344%2057.9797%2088.2022%2058.3466%2086.4944%2059.0592C84.7865%2059.7717%2083.2368%2060.8158%2081.935%2062.131ZM31.4%2075.042V76.442C31.4001%2076.5544%2031.4224%2076.6656%2031.4656%2076.7694C31.5087%2076.8731%2031.5719%2076.9673%2031.6515%2077.0466C31.7311%2077.126%2031.8255%2077.1888%2031.9294%2077.2316C32.0333%2077.2744%2032.1446%2077.2963%2032.257%2077.296H72.357C72.5818%2078.1673%2072.8638%2079.0228%2073.201%2079.857H32.258C31.3506%2079.8589%2030.4796%2079.5003%2029.8366%2078.86C29.1935%2078.2198%2028.8311%2077.3504%2028.829%2076.443V75.043L31.4%2075.042ZM86.162%2022C87.0694%2021.9981%2087.9404%2022.3568%2088.5834%2022.997C89.2265%2023.6372%2089.5889%2024.5066%2089.591%2025.414V51.808C88.7243%2051.9101%2087.8652%2052.0684%2087.019%2052.282V25.414C87.0189%2025.3016%2086.9966%2025.1904%2086.9534%2025.0867C86.9103%2024.9829%2086.8471%2024.8887%2086.7675%2024.8094C86.6879%2024.7301%2086.5935%2024.6672%2086.4896%2024.6244C86.3857%2024.5816%2086.2744%2024.5597%2086.162%2024.56H25.429C25.3166%2024.5597%2025.2053%2024.5816%2025.1014%2024.6244C24.9975%2024.6672%2024.9031%2024.7301%2024.8235%2024.8094C24.7439%2024.8887%2024.6807%2024.9829%2024.6376%2025.0867C24.5944%2025.1904%2024.5721%2025.3016%2024.572%2025.414V69.587C24.5721%2069.6994%2024.5944%2069.8106%2024.6376%2069.9144C24.6807%2070.0181%2024.7439%2070.1123%2024.8235%2070.1916C24.9031%2070.271%2024.9975%2070.3338%2025.1014%2070.3766C25.2053%2070.4194%2025.3166%2070.4413%2025.429%2070.441H71.766C71.697%2071.2932%2071.6806%2072.1488%2071.717%2073.003H25.429C24.5216%2073.0049%2023.6506%2072.6463%2023.0076%2072.006C22.3645%2071.3658%2022.0021%2070.4964%2022%2069.589V25.414C22.0021%2024.5066%2022.3645%2023.6372%2023.0076%2022.997C23.6506%2022.3568%2024.5216%2021.9981%2025.429%2022H86.162ZM77.701%2054.948C77.8695%2054.9484%2078.0362%2054.982%2078.1918%2055.0468C78.3473%2055.1117%2078.4885%2055.2065%2078.6073%2055.3259C78.7262%2055.4453%2078.8204%2055.587%2078.8845%2055.7428C78.9486%2055.8986%2078.9814%2056.0655%2078.981%2056.234C78.9811%2056.2983%2078.9764%2056.3624%2078.967%2056.426C78.557%2056.7693%2078.159%2057.1327%2077.773%2057.516H77.701H34.374C34.0329%2057.516%2033.7058%2057.3805%2033.4647%2057.1393C33.2235%2056.8982%2033.088%2056.5711%2033.088%2056.23C33.088%2055.8889%2033.2235%2055.5618%2033.4647%2055.3207C33.7058%2055.0795%2034.0329%2054.944%2034.374%2054.944L77.701%2054.948ZM92.991%2028.859C93.8984%2028.8571%2094.7694%2029.2158%2095.4124%2029.856C96.0555%2030.4962%2096.4179%2031.3656%2096.42%2032.273V52.168C95.5725%2051.9753%2094.7133%2051.8377%2093.848%2051.756V32.273C93.8479%2032.1606%2093.8256%2032.0494%2093.7824%2031.9457C93.7393%2031.8419%2093.6761%2031.7477%2093.5965%2031.6684C93.5169%2031.5891%2093.4225%2031.5262%2093.3186%2031.4834C93.2147%2031.4406%2093.1034%2031.4187%2092.991%2031.419H91.291V28.858L92.991%2028.859ZM77.701%2046.375C78.0421%2046.375%2078.3692%2046.5105%2078.6103%2046.7517C78.8515%2046.9928%2078.987%2047.3199%2078.987%2047.661C78.987%2048.0021%2078.8515%2048.3292%2078.6103%2048.5703C78.3692%2048.8115%2078.0421%2048.947%2077.701%2048.947H34.374C34.0329%2048.947%2033.7058%2048.8115%2033.4647%2048.5703C33.2235%2048.3292%2033.088%2048.0021%2033.088%2047.661C33.088%2047.3199%2033.2235%2046.9928%2033.4647%2046.7517C33.7058%2046.5105%2034.0329%2046.375%2034.374%2046.375H77.701ZM59.983%2037.801C60.3241%2037.801%2060.6512%2037.9365%2060.8923%2038.1777C61.1335%2038.4188%2061.269%2038.7459%2061.269%2039.087C61.269%2039.4281%2061.1335%2039.7552%2060.8923%2039.9963C60.6512%2040.2375%2060.3241%2040.373%2059.983%2040.373H34.374C34.0329%2040.373%2033.7058%2040.2375%2033.4647%2039.9963C33.2235%2039.7552%2033.088%2039.4281%2033.088%2039.087C33.088%2038.7459%2033.2235%2038.4188%2033.4647%2038.1777C33.7058%2037.9365%2034.0329%2037.801%2034.374%2037.801H59.983Z'%20fill='%238D9AA5'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4%200C4.2066%200%204.40475%200.0820729%204.55084%200.228164C4.69693%200.374255%204.779%200.572397%204.779%200.779V3.221H7.221C7.41393%203.221%207.6%203.29258%207.74317%203.4219C7.88634%203.55122%207.97643%203.72907%207.996%203.921V4.001C7.996%204.2076%207.91393%204.40575%207.76784%204.55184C7.62175%204.69793%207.4236%204.78%207.217%204.78H4.779V7.222C4.779%207.41493%204.70742%207.601%204.5781%207.74417C4.44878%207.88734%204.27093%207.97744%204.079%207.997H3.999C3.7924%207.997%203.59425%207.91493%203.44816%207.76884C3.30207%207.62275%203.22%207.4246%203.22%207.218V4.779H0.779C0.585538%204.78002%200.398617%204.70902%200.254623%204.57981C0.110629%204.45061%200.0198653%204.27244%200%204.08V4C0%203.7934%200.082073%203.59526%200.228164%203.44916C0.374255%203.30307%200.572396%203.221%200.779%203.221H3.221V0.779C3.221%200.586071%203.29258%200.400004%203.4219%200.256831C3.55122%200.113658%203.72907%200.023565%203.921%200.00399971L4%200Z'%20fill='%238D9AA5'/%3e%3cpath%20d='M11%2099C11.5304%2099%2012.0391%2098.7893%2012.4142%2098.4142C12.7893%2098.0391%2013%2097.5304%2013%2097C13%2096.4696%2012.7893%2095.9609%2012.4142%2095.5858C12.0391%2095.2107%2011.5304%2095%2011%2095C10.4696%2095%209.96086%2095.2107%209.58579%2095.5858C9.21071%2095.9609%209%2096.4696%209%2097C9%2097.5304%209.21071%2098.0391%209.58579%2098.4142C9.96086%2098.7893%2010.4696%2099%2011%2099Z'%20fill='%238D9AA5'/%3e%3cpath%20d='M104.518%2015.035C103.055%2015.035%20101.651%2014.4538%20100.617%2013.4192C99.5817%2012.3846%2099.0003%2010.9813%2099%209.518C99%208.05454%2099.5814%206.65101%20100.616%205.61619C101.651%204.58136%20103.055%204%20104.518%204C105.981%204%20107.385%204.58136%20108.42%205.61619C109.455%206.65101%20110.036%208.05454%20110.036%209.518C110.036%2010.9813%20109.454%2012.3846%20108.419%2013.4192C107.385%2014.4538%20105.981%2015.035%20104.518%2015.035ZM104.518%2013.035C105.451%2013.035%20106.346%2012.6645%20107.005%2012.005C107.665%2011.3454%20108.036%2010.4509%20108.036%209.518C108.036%209.05601%20107.945%208.59854%20107.768%208.17172C107.591%207.7449%20107.332%207.35707%20107.006%207.0304C106.679%206.70372%20106.291%206.44459%20105.864%206.26779C105.437%206.091%20104.98%206%20104.518%206C103.585%206%20102.69%206.37065%20102.03%207.0304C101.371%207.69015%20101%208.58497%20101%209.518C101%2010.4509%20101.371%2011.3454%20102.031%2012.005C102.69%2012.6645%20103.585%2013.035%20104.518%2013.035Z'%20fill='%238D9AA5'/%3e%3c/svg%3e",vR=s.defineComponent({name:"QTable",components:{Column:uR,ColumnGroup:pR,DataTable:j3,Row:hR,QBadge:Hr,QTooltip:W3},props:{id:{type:String,default:""},modelValue:{type:Array,default:()=>[]},columns:{type:Array,default:()=>[]},hasSearch:{type:Boolean,default:!0},sortBy:{type:String,default:""},itemsPerPage:{type:Number,default:20},currentPage:{type:Number,default:1},searchPlaceholder:{type:String,default:""},filters:{type:Object,default:()=>({})},filtersAction:{type:Function,default:()=>{}},filtersCount:{type:Number,default:0},globalFilters:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},isMultiSort:{type:Boolean,default:!1},isMultiSelect:{type:Boolean,default:!1},rowSelect:{type:Function,default:()=>{}},rowUnselect:{type:Function,default:()=>{}},fixedTopOffset:{type:Number,default:0},skeletonRows:{type:Number,default:6}},emits:["is-empty"],setup(t,{emit:e}){const n=s.ref(),r=s.ref(!1),o=s.ref(!1),i=s.ref(!1),a=s.ref(!0),l=s.ref(wR),c=s.ref(),u=s.ref(""),d=s.ref([]),f=s.ref(),p=s.ref(0),h=s.ref({global:{matchMode:Ve.CONTAINS,value:null},...t.filters}),m=s.computed(()=>{var S;const C=!t.loading&&((S=n.value)==null?void 0:S.empty);return e("is-empty",C),C}),y=s.computed(()=>{const C=[],S={};let O=0;return t.columns.forEach(T=>{S[T.key]=""}),[...Array(t.skeletonRows)].forEach(()=>{C.push({...S,shimmer:O%2?"bg-gray-10":"bg-gray-30"}),O++}),C}),g=()=>{var C,S;c.value.scrollWidth>c.value.clientWidth?(r.value=!0,(C=c.value)==null||C.classList.add("is-scrolled")):(r.value=!1,(S=c.value)==null||S.classList.remove("is-scrolled")),M()},b=C=>{t.rowSelect(C)},v=C=>{t.rowUnselect(C)},k=()=>{var T,B;const C=f.value.offsetTop-t.fixedTopOffset,S=document.querySelector('div[data-pc-section="header"]'),O=(T=c.value)==null?void 0:T.querySelector("thead");if(o.value=!!t.fixedTopOffset&&f.value&&window.scrollY>=C,o.value){if(S.style.top=t.fixedTopOffset+"px",!r.value){const A=t.fixedTopOffset+S.clientHeight+1;O.style.top=A+"px"}}else S.style.top="",r.value||(O.style.top="");if(o.value&&r.value){const A=document.querySelector('div[data-pc-section="header"] > div[data-pc-section="wrapper"]');(B=A==null?void 0:A.querySelectorAll("th"))==null||B.forEach((D,F)=>{var Z;const W=(Z=c.value)==null?void 0:Z.querySelector(`th:nth-child(${F+1})`),V=W==null?void 0:W.getAttribute("aria-sort");D==null||D.setAttribute("aria-sort",V),D.classList.contains("actions")&&(D.style.minWidth=(W==null?void 0:W.clientWidth)+"px")})}M()},w=()=>{var S,O,T,B;const C=(S=c.value)==null?void 0:S.cloneNode(!0);if(C){const A=document.querySelector('div[data-pc-section="header"]');A==null||A.append(C);const D=A==null?void 0:A.querySelector('div[data-pc-section="wrapper"]');(O=D==null?void 0:D.querySelector("tbody"))==null||O.remove(),D==null||D.addEventListener("scroll",()=>{c.value.scrollLeft=D.scrollLeft;const F=c.value.scrollWidth-c.value.clientWidth;a.value=c.value.scrollLeft===0,i.value=c.value.scrollLeft===F}),(T=c.value)==null||T.addEventListener("scroll",()=>{D.scrollLeft=c.value.scrollLeft;const F=c.value.scrollWidth-c.value.clientWidth;a.value=c.value.scrollLeft===0,i.value=c.value.scrollLeft===F}),(B=D==null?void 0:D.querySelectorAll("th"))==null||B.forEach((F,W)=>{F==null||F.addEventListener("click",async()=>{var V;if(o.value&&r.value){const Z=(V=c.value)==null?void 0:V.querySelector(`th:nth-child(${W+1})`);await(Z==null?void 0:Z.click());const Y=Z==null?void 0:Z.getAttribute("aria-sort");F==null||F.setAttribute("aria-sort",Y)}})})}},M=()=>{const C=c.value.clientWidth+"px",S=document.querySelector('div[data-pc-section="header"]'),O=S.querySelector('div[data-pc-section="wrapper"] thead');S.style.width=C,c.value.querySelector("thead").style.width=C,O&&(O.style.width=C)};return s.onMounted(()=>{c.value=document.querySelector('div[data-pc-section="wrapper"]'),g(),window.addEventListener("resize",g),window.addEventListener("scroll",k),w()}),s.onUnmounted(()=>{window.removeEventListener("resize",g),window.removeEventListener("scroll",k)}),{dataTableRef:n,horizontalScroll:r,isFixed:o,isScrolledToEnd:i,isScrolledToStart:a,noResultsPath:l,scrollableElement:c,search:u,selectedRows:d,tableContainer:f,tableFilters:h,tableHeight:p,isEmpty:m,skeletonData:y,onPageResizeOrLoad:g,onSelectRow:b,onUnselectRow:v,mq:rn}}}),CR=["id"],kR={class:"search-and-filters"},SR={class:"inspections-search"},ER={for:"search",class:"search-label"},OR={key:0,class:"inspection-actions"},TR={class:"flex relative"},MR={key:0},IR={key:1},xR={key:0,class:"table-empty flex flex-col items-center justify-center"},PR=["src"];function BR(t,e,n,r,o,i){const a=s.resolveComponent("q-icon"),l=s.resolveComponent("q-input"),c=s.resolveComponent("q-badge"),u=s.resolveComponent("q-tooltip"),d=s.resolveComponent("column"),f=s.resolveComponent("data-table");return s.openBlock(),s.createElementBlock("div",{id:t.id,class:s.normalizeClass(["table-container",{"is-fixed":t.isFixed},{"using-scroll":t.horizontalScroll},{"is-loading":t.loading},{"scroll-start":t.isScrolledToStart},{"scroll-end":t.isScrolledToEnd},{"is-empty":t.isEmpty}]),ref:"tableContainer"},[s.createVNode(f,{filters:t.tableFilters,"onUpdate:filters":e[1]||(e[1]=p=>t.tableFilters=p),selection:t.selectedRows,"onUpdate:selection":e[2]||(e[2]=p=>t.selectedRows=p),"global-filter-fields":t.globalFilters,loading:t.loading,"meta-key-selection":!1,"scroll-height":t.horizontalScroll&&t.tableHeight?`${t.tableHeight}px`:"","selection-mode":t.isMultiSelect?"multiple":"single","sort-mode":t.isMultiSort?"multiple":"single",value:t.loading?t.skeletonData:t.modelValue,"data-key":"id","filter-display":"menu",ref:"dataTableRef","removable-sort":"",scrollable:"",onRowSelect:t.onSelectRow,onRowUnselect:t.onUnselectRow},{header:s.withCtx(()=>[t.hasSearch?s.renderSlot(t.$slots,"search-and-filters",{key:0},()=>[s.createElementVNode("div",kR,[s.createElementVNode("div",SR,[t.hasSearch?s.renderSlot(t.$slots,"search",{key:0},()=>[s.createElementVNode("label",ER,[s.createVNode(a,{class:"mr-2",color:"gray-40",icon:"search",size:"md",type:""}),s.createVNode(l,{id:"search",modelValue:t.tableFilters.global.value,"onUpdate:modelValue":e[0]||(e[0]=p=>t.tableFilters.global.value=p),"hide-clear":!!t.mq.md,placeholder:t.searchPlaceholder||t.$t("HC_SEARCH"),class:"text-base","control-class":"!border-0 !px-0"},null,8,["modelValue","hide-clear","placeholder"])])],!0):s.createCommentVNode("",!0)]),Object.keys(t.tableFilters).length||t.$slots.tableActions?(s.openBlock(),s.createElementBlock("div",OR,[Object.keys(t.tableFilters).length?s.renderSlot(t.$slots,"filters",{key:0},()=>[s.createVNode(u,{class:"z-[45] ml-2"},{trigger:s.withCtx(()=>[s.createElementVNode("div",TR,[s.createVNode(a,{class:"filters-icon ml-0",color:"gray-40",icon:"filter",size:"md",onClick:t.filtersAction},null,8,["onClick"]),t.filtersCount?(s.openBlock(),s.createBlock(c,{key:0,class:"filters-count",color:"white"},{text:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.filtersCount),1)]),_:1})):s.createCommentVNode("",!0)])]),content:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(t.$t("HC_FILTERS")),1)]),_:1})],!0):s.createCommentVNode("",!0),t.$slots.tableActions?s.renderSlot(t.$slots,"tableActions",{key:1},void 0,!0):s.createCommentVNode("",!0)])):s.createCommentVNode("",!0)])],!0):s.createCommentVNode("",!0)]),empty:s.withCtx(()=>[]),default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(t.columns,p=>(s.openBlock(),s.createBlock(d,{field:p.key,"filter-field":p.key,header:p.name,sortable:p.sortable,frozen:p.frozen,class:s.normalizeClass([p.key,p.size?`cell-${p.size}`:"",{"text-right":p.key==="actions"}])},{body:s.withCtx(({data:h})=>[t.loading?t.loading?(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["animate-shimmer",h.shimmer])}," ",2)):s.createCommentVNode("",!0):s.renderSlot(t.$slots,p.key,s.normalizeProps(s.mergeProps({key:0},h)),()=>[p.key.match(/\./)?(s.openBlock(),s.createElementBlock("div",IR,s.toDisplayString(h[p.key.split(".")[0]][p.key.split(".")[1]]),1)):(s.openBlock(),s.createElementBlock("div",MR,s.toDisplayString(h[p.key]),1))],!0)]),_:2},1032,["field","filter-field","header","sortable","frozen","class"]))),256))]),_:3},8,["filters","selection","global-filter-fields","loading","scroll-height","selection-mode","sort-mode","value","onRowSelect","onRowUnselect"]),t.isEmpty?(s.openBlock(),s.createElementBlock("div",xR,[s.renderSlot(t.$slots,"no-results-illustration",{},()=>[s.createElementVNode("img",{class:"mb-5",src:t.noResultsPath},null,8,PR)],!0),s.renderSlot(t.$slots,"no-results-text",s.normalizeProps(s.guardReactiveProps({tableFilters:t.tableFilters})),void 0,!0)])):s.createCommentVNode("",!0)],10,CR)}const AR=oe(vR,[["render",BR],["__scopeId","data-v-96fd84f5"]]),DR=s.defineComponent({name:"QTag",components:{},props:{tagClass:{type:String,default:""},bgColor:{type:String,default:"bg-green-0"},textColor:{type:String,default:"text-green-20"},shape:{type:String,default:"square"}},setup(t,{slots:e}){return{hasIcon:!!e.icon}}});function NR(t,e,n,r,o,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["tag flex items-center",[t.tagClass,t.bgColor,t.textColor,"tag-"+t.shape,{"has-icon":t.hasIcon}]])},[t.hasIcon?s.renderSlot(t.$slots,"icon",{key:0},void 0,!0):s.createCommentVNode("",!0),s.renderSlot(t.$slots,"default",{},void 0,!0)],2)}const LR=oe(DR,[["render",NR],["__scopeId","data-v-1a01844c"]]),K3="update:model-value",RR=s.defineComponent({name:"QTextarea",inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:""},controlClass:{type:String,default:""},persistentPlaceholder:{type:Boolean,default:!1},placeholder:{type:String,default:""},rows:{type:Number,default:2},status:{type:String,default:""},textareaClass:{type:String,default:""},isDisabled:{type:Boolean,default:!1}},emits:[K3],setup(t,{attrs:e,emit:n,slots:r}){const o=s.ref(!1),i=s.ref(),a=s.computed(()=>!!r.actions),l=s.computed(()=>!!e.disabled||!!t.isDisabled),c=s.computed(()=>[{[`has-${t.status}`]:t.status&&!l.value},{"is-focused":o.value},{"is-disabled":l.value}]),u=s.computed(()=>["textarea",t.textareaClass,{[t.status]:t.status&&!l.value},{populated:!!t.modelValue&&t.persistentPlaceholder},{"is-focused":o.value&&t.persistentPlaceholder}]),d=()=>{i.value.style.height="auto",i.value.style.height=i.value.scrollHeight+"px"},f=p=>{n(K3,p.target.value)};return s.onMounted(()=>{d()}),{focused:o,disabled:l,rootClasses:c,textarea:i,textareaClasses:u,hasActions:a,resizeTextarea:d,updateValue:f}}}),VR=["id","disabled","placeholder","rows","value"],$R={key:0,class:"action flex items-end py-2 pr-4"},FR=["for"];function HR(t,e,n,r,o,i){return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass([[t.rootClasses,t.controlClass],"control flex"])},[s.createElementVNode("textarea",s.mergeProps({id:String(t.$attrs.id),ref:"textarea",disabled:t.isDisabled,class:[t.textareaClasses],placeholder:t.persistentPlaceholder?"":t.placeholder,rows:t.rows,value:t.modelValue},t.$attrs,{onInput:e[0]||(e[0]=(...a)=>t.updateValue&&t.updateValue(...a)),onFocusin:e[1]||(e[1]=a=>t.focused=!t.focused),onFocusout:e[2]||(e[2]=a=>t.focused=!t.focused),onKeyup:e[3]||(e[3]=(...a)=>t.resizeTextarea&&t.resizeTextarea(...a))}),`
|
|
258
|
-
`,16,VR),t.hasActions?(s.openBlock(),s.createElementBlock("div",$R,[s.renderSlot(t.$slots,"actions",{},void 0,!0)])):s.createCommentVNode("",!0),t.persistentPlaceholder?(s.openBlock(),s.createElementBlock("label",{key:1,for:String(t.$attrs.id),class:"placeholder"},s.toDisplayString(t.placeholder),9,FR)):s.createCommentVNode("",!0)],2)}const zR=oe(RR,[["render",HR],["__scopeId","data-v-fda73545"]]),G3="update:modelValue",q3="undo-action",Y3="timeout-done",_R=s.defineComponent({name:"QToast",props:{modelValue:{type:Boolean,default:!1,required:!0},icon:{type:String,default:""},message:{type:String,default:""},variant:{type:String,default:""},duration:{type:Number,default:null,required:!1},position:{type:[String,Array],default:null,required:!1},withTransition:{type:Boolean,default:!1},closeButton:{type:Boolean,default:!1},undoButton:{type:Boolean,default:!1}},emits:[G3,q3,Y3],setup(t,{emit:e}){const n=s.ref(null),r=s.computed({get:()=>t.modelValue,set:u=>{e(G3,u)}}),o=s.computed(()=>t.variant?"is-"+t.variant:""),i=s.computed(()=>t.position?"toast-fixed "+t.position:""),a=s.computed(()=>t.withTransition&&"component-slide-right"),l=()=>{e(q3)},c=()=>{n.value=setTimeout(()=>{r.value=!1,e(Y3)},t.duration)};return s.onBeforeUnmount(()=>{n.value&&(clearTimeout(n.value),n.value=null)}),s.watchEffect(()=>{r.value&&t.duration?c():n.value&&(clearTimeout(n.value),n.value=null)}),{show:r,statusClass:o,positionClass:i,computedTransition:a,startTimeout:c,undoAction:l}}}),jR=["aria-live"],ZR={class:"message flex-grow"},UR=["aria-label"];function WR(t,e,n,r,o,i){const a=s.resolveComponent("q-icon");return s.openBlock(),s.createBlock(s.Transition,{name:String(t.computedTransition),appear:""},{default:s.withCtx(()=>[t.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["toast flex",t.statusClass,t.positionClass,t.undoButton?"gap-2":"gap-3"]),role:"alert","aria-live":t.variant=="error"?"assertive":"polite","aria-atomic":"true"},[t.icon?(s.openBlock(),s.createBlock(a,{key:0,icon:t.icon,class:"status-icon",type:"fill","aria-hidden":"true"},null,8,["icon"])):s.createCommentVNode("",!0),s.createElementVNode("span",ZR,[s.renderSlot(t.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(t.message),1)],!0)]),t.undoButton?(s.openBlock(),s.createElementBlock("button",{key:1,class:"button-link",onClick:e[0]||(e[0]=l=>t.undoAction())},[s.renderSlot(t.$slots,"undo-message",{},()=>[s.createTextVNode(s.toDisplayString(t.$t("HC_UNDO")),1)],!0)])):s.createCommentVNode("",!0),t.closeButton?(s.openBlock(),s.createElementBlock("button",{key:2,class:"close-icon",onClick:e[1]||(e[1]=l=>t.show=!t.show),"aria-label":t.$t("HC_CLOSE")},[s.createVNode(a,{icon:"close",type:"line",color:"inkwell-30",class:"close","aria-hidden":"true"})],8,UR)):s.createCommentVNode("",!0)],10,jR)):s.createCommentVNode("",!0)]),_:3},8,["name"])}const KR=oe(_R,[["render",WR],["__scopeId","data-v-3862f72b"]]);function Ke(t){this.content=t}Ke.prototype={constructor:Ke,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 Ke(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 Ke(n)},addToStart:function(t,e){return new Ke([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ke(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 Ke(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=Ke.from(t),t.size?new Ke(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ke.from(t),t.size?new Ke(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ke.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}},Ke.from=function(t){if(t instanceof Ke)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ke(e)};function J3(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 a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){let a=J3(o.content,i.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function Q3(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 a=t.child(--o),l=e.child(--i),c=a.nodeSize;if(a==l){n-=c,r-=c;continue}if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let u=0,d=Math.min(a.text.length,l.text.length);for(;u<d&&a.text[a.text.length-u-1]==l.text[l.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let u=Q3(a.content,l.content,n-1,r-1);if(u)return u}n-=c,r-=c}}class N{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 a=0,l=0;l<n;a++){let c=this.content[a],u=l+c.nodeSize;if(u>e&&r(c,o+l,i||null,a)!==!1&&c.content.size){let d=l+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,n-d),r,o+d)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let u=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(a?a=!1:i+=r),i+=u},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 N(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,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l=l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),r.push(l),o+=l.nodeSize),a=c}return new N(r,o)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(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 N(o,i)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(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 J3(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Q3(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Fl(0,e);if(e==this.size)return Fl(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),a=o+i.nodeSize;if(a>=e)return a==e||n>0?Fl(r+1,a):Fl(r,o);o=a}}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 N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.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 N(n||e,r)}static from(e){if(!e)return N.empty;if(e instanceof N)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new N([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}N.empty=new N([],0);const _u={index:0,offset:0};function Fl(t,e){return _u.index=t,_u.offset=e,_u}function Hl(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(!Hl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class Rf{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&&Hl(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`);return r.create(n.attrs)}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 Rf.none;if(e instanceof Rf)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ge.none=[];class zl extends Error{}class H{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=ey(this.content,e+this.openStart,n);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(X3(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 H.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 H(N.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 H(e,r,o)}}H.empty=new H(N.empty,0,0);function X3(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:a,offset:l}=t.findIndex(n);if(o==e||i.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(X3(i.content,e-o-1,n-o-1)))}function ey(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),a=t.maybeChild(o);if(i==e||a.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=ey(a.content,e-i-1,n);return l&&t.replaceChild(o,a.copy(l))}function GR(t,e,n){if(n.openStart>t.depth)throw new zl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zl("Inconsistent open depths");return ty(t,e,n,0)}function ty(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=ty(t,e,n,r+1);return i.copy(i.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,l=a.content;return lo(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:a,end:l}=qR(n,t);return lo(i,ry(t,a,l,e,r))}else return lo(i,_l(t,e,r))}function ny(t,e){if(!e.type.compatibleContent(t.type))throw new zl("Cannot join "+e.type.name+" onto "+t.type.name)}function ju(t,e,n){let r=t.node(n);return ny(r,e.node(n)),r}function ao(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 Ys(t,e,n,r){let o=(e||t).node(n),i=0,a=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ao(t.nodeAfter,r),i++));for(let l=i;l<a;l++)ao(o.child(l),r);e&&e.depth==n&&e.textOffset&&ao(e.nodeBefore,r)}function lo(t,e){return t.type.checkContent(e),t.copy(e)}function ry(t,e,n,r,o){let i=t.depth>o&&ju(t,e,o+1),a=r.depth>o&&ju(n,r,o+1),l=[];return Ys(null,t,o,l),i&&a&&e.index(o)==n.index(o)?(ny(i,a),ao(lo(i,ry(t,e,n,r,o+1)),l)):(i&&ao(lo(i,_l(t,e,o+1)),l),Ys(e,n,o,l),a&&ao(lo(a,_l(n,r,o+1)),l)),Ys(r,null,o,l),new N(l)}function _l(t,e,n){let r=[];if(Ys(null,t,n,r),t.depth>n){let o=ju(t,e,n+1);ao(lo(o,_l(t,e,n+1)),r)}return Ys(e,null,n,r),new N(r)}function qR(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(N.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Js{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 ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!o||!i[a].isInSet(o.marks))&&(i=i[a--].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 jl(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 a=e;;){let{index:l,offset:c}=a.content.findIndex(i),u=i-c;if(r.push(a,l,o+c),!u||(a=a.child(l),a.isText))break;i=u-1,o+=c+1}return new Js(n,r,i)}static resolveCached(e,n){for(let o=0;o<Zu.length;o++){let i=Zu[o];if(i.pos==n&&i.doc==e)return i}let r=Zu[Uu]=Js.resolve(e,n);return Uu=(Uu+1)%YR,r}}let Zu=[],Uu=0,YR=12;class jl{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 JR=Object.create(null);let co=class Vf{constructor(e,n,r,o=ge.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||N.empty}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&&Hl(this.attrs,n||e.defaultAttrs||JR)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new Vf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vf(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 H.empty;let o=this.resolve(e),i=this.resolve(n),a=r?0:o.sharedDepth(n),l=o.start(a),u=o.node(a).content.cut(o.pos-l,i.pos-l);return new H(u,o.depth-a,i.depth-a)}replace(e,n,r){return GR(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 Js.resolveCached(this,e)}resolveNoCache(e){return Js.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()+")"),oy(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=N.empty,o=0,i=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,i),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=o;c<i;c++)if(!this.type.allowsMarks(r.child(c).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),a=i&&i.matchFragment(this.content,n);return a?a.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);let e=ge.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!ge.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=null;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=N.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};co.prototype.text=void 0;class Zl extends co{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):oy(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 Zl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zl(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 oy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class uo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new QR(e,n);if(r.next==null)return uo.empty;let o=iy(r);r.next&&r.err("Unexpected trailing text");let i=iV(oV(o));return sV(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(a,l){let c=a.matchFragment(e,r);if(c&&(!n||c.validEnd))return N.from(l.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:d,next:f}=a.next[u];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let p=i(f,l.concat(d));if(p)return p}}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 a=[];for(let l=o;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.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 a=0;a<r.next.length;a++)i+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return i}).join(`
|
|
258
|
+
`,16,VR),t.hasActions?(s.openBlock(),s.createElementBlock("div",$R,[s.renderSlot(t.$slots,"actions",{},void 0,!0)])):s.createCommentVNode("",!0),t.persistentPlaceholder?(s.openBlock(),s.createElementBlock("label",{key:1,for:String(t.$attrs.id),class:"placeholder"},s.toDisplayString(t.placeholder),9,FR)):s.createCommentVNode("",!0)],2)}const zR=oe(RR,[["render",HR],["__scopeId","data-v-fda73545"]]),G3="update:modelValue",q3="undo-action",Y3="timeout-done",_R=s.defineComponent({name:"QToast",props:{modelValue:{type:Boolean,default:!1,required:!0},icon:{type:String,default:""},message:{type:String,default:""},variant:{type:String,default:""},duration:{type:Number,default:null,required:!1},position:{type:[String,Array],default:null,required:!1},withTransition:{type:Boolean,default:!1},transitionClass:{type:String,default:"component-slide-right"},closeButton:{type:Boolean,default:!1},undoButton:{type:Boolean,default:!1}},emits:[G3,q3,Y3],setup(t,{emit:e}){const n=s.ref(null),r=s.computed({get:()=>t.modelValue,set:u=>{e(G3,u)}}),o=s.computed(()=>t.variant?"is-"+t.variant:""),i=s.computed(()=>t.position?"toast-fixed "+t.position:""),a=s.computed(()=>t.withTransition&&t.transitionClass),l=()=>{e(q3)},c=()=>{n.value=setTimeout(()=>{r.value=!1,e(Y3)},t.duration)};return s.onBeforeUnmount(()=>{n.value&&(clearTimeout(n.value),n.value=null)}),s.watchEffect(()=>{r.value&&t.duration?c():n.value&&(clearTimeout(n.value),n.value=null)}),{show:r,statusClass:o,positionClass:i,computedTransition:a,startTimeout:c,undoAction:l}}}),jR=["aria-live"],ZR={class:"message flex-grow"},UR=["aria-label"];function WR(t,e,n,r,o,i){const a=s.resolveComponent("q-icon");return s.openBlock(),s.createBlock(s.Transition,{name:String(t.computedTransition),appear:""},{default:s.withCtx(()=>[t.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["toast flex",t.statusClass,t.positionClass,t.undoButton?"gap-2":"gap-3"]),role:"alert","aria-live":t.variant=="error"?"assertive":"polite","aria-atomic":"true"},[t.icon?(s.openBlock(),s.createBlock(a,{key:0,icon:t.icon,class:"status-icon",type:"fill","aria-hidden":"true"},null,8,["icon"])):s.createCommentVNode("",!0),s.createElementVNode("span",ZR,[s.renderSlot(t.$slots,"default",{},()=>[s.createTextVNode(s.toDisplayString(t.message),1)],!0)]),t.undoButton?(s.openBlock(),s.createElementBlock("button",{key:1,class:"button-link",onClick:e[0]||(e[0]=l=>t.undoAction())},[s.renderSlot(t.$slots,"undo-message",{},()=>[s.createTextVNode(s.toDisplayString(t.$t("HC_UNDO")),1)],!0)])):s.createCommentVNode("",!0),t.closeButton?(s.openBlock(),s.createElementBlock("button",{key:2,class:"close-icon",onClick:e[1]||(e[1]=l=>t.show=!t.show),"aria-label":t.$t("HC_CLOSE")},[s.createVNode(a,{icon:"close",type:"line",color:"inkwell-30",class:"close","aria-hidden":"true"})],8,UR)):s.createCommentVNode("",!0)],10,jR)):s.createCommentVNode("",!0)]),_:3},8,["name"])}const KR=oe(_R,[["render",WR],["__scopeId","data-v-3862f72b"]]);function Ke(t){this.content=t}Ke.prototype={constructor:Ke,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 Ke(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 Ke(n)},addToStart:function(t,e){return new Ke([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Ke(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 Ke(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=Ke.from(t),t.size?new Ke(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ke.from(t),t.size?new Ke(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ke.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}},Ke.from=function(t){if(t instanceof Ke)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Ke(e)};function J3(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 a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){let a=J3(o.content,i.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function Q3(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 a=t.child(--o),l=e.child(--i),c=a.nodeSize;if(a==l){n-=c,r-=c;continue}if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let u=0,d=Math.min(a.text.length,l.text.length);for(;u<d&&a.text[a.text.length-u-1]==l.text[l.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let u=Q3(a.content,l.content,n-1,r-1);if(u)return u}n-=c,r-=c}}class N{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 a=0,l=0;l<n;a++){let c=this.content[a],u=l+c.nodeSize;if(u>e&&r(c,o+l,i||null,a)!==!1&&c.content.size){let d=l+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,n-d),r,o+d)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let i="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let u=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&r&&(a?a=!1:i+=r),i+=u},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 N(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,a=0;a<n;i++){let l=this.content[i],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l.isText?l=l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l=l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),r.push(l),o+=l.nodeSize),a=c}return new N(r,o)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(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 N(o,i)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(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 J3(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Q3(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Fl(0,e);if(e==this.size)return Fl(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),a=o+i.nodeSize;if(a>=e)return a==e||n>0?Fl(r+1,a):Fl(r,o);o=a}}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 N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.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 N(n||e,r)}static from(e){if(!e)return N.empty;if(e instanceof N)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new N([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}N.empty=new N([],0);const _u={index:0,offset:0};function Fl(t,e){return _u.index=t,_u.offset=e,_u}function Hl(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(!Hl(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Hl(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class Rf{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&&Hl(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`);return r.create(n.attrs)}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 Rf.none;if(e instanceof Rf)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};ge.none=[];class zl extends Error{}class H{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=ey(this.content,e+this.openStart,n);return r&&new H(r,this.openStart,this.openEnd)}removeBetween(e,n){return new H(X3(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 H.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 H(N.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 H(e,r,o)}}H.empty=new H(N.empty,0,0);function X3(t,e,n){let{index:r,offset:o}=t.findIndex(e),i=t.maybeChild(r),{index:a,offset:l}=t.findIndex(n);if(o==e||i.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,i.copy(X3(i.content,e-o-1,n-o-1)))}function ey(t,e,n,r){let{index:o,offset:i}=t.findIndex(e),a=t.maybeChild(o);if(i==e||a.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=ey(a.content,e-i-1,n);return l&&t.replaceChild(o,a.copy(l))}function GR(t,e,n){if(n.openStart>t.depth)throw new zl("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new zl("Inconsistent open depths");return ty(t,e,n,0)}function ty(t,e,n,r){let o=t.index(r),i=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=ty(t,e,n,r+1);return i.copy(i.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,l=a.content;return lo(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:a,end:l}=qR(n,t);return lo(i,ry(t,a,l,e,r))}else return lo(i,_l(t,e,r))}function ny(t,e){if(!e.type.compatibleContent(t.type))throw new zl("Cannot join "+e.type.name+" onto "+t.type.name)}function ju(t,e,n){let r=t.node(n);return ny(r,e.node(n)),r}function ao(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 Ys(t,e,n,r){let o=(e||t).node(n),i=0,a=e?e.index(n):o.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(ao(t.nodeAfter,r),i++));for(let l=i;l<a;l++)ao(o.child(l),r);e&&e.depth==n&&e.textOffset&&ao(e.nodeBefore,r)}function lo(t,e){return t.type.checkContent(e),t.copy(e)}function ry(t,e,n,r,o){let i=t.depth>o&&ju(t,e,o+1),a=r.depth>o&&ju(n,r,o+1),l=[];return Ys(null,t,o,l),i&&a&&e.index(o)==n.index(o)?(ny(i,a),ao(lo(i,ry(t,e,n,r,o+1)),l)):(i&&ao(lo(i,_l(t,e,o+1)),l),Ys(e,n,o,l),a&&ao(lo(a,_l(n,r,o+1)),l)),Ys(r,null,o,l),new N(l)}function _l(t,e,n){let r=[];if(Ys(null,t,n,r),t.depth>n){let o=ju(t,e,n+1);ao(lo(o,_l(t,e,n+1)),r)}return Ys(e,null,n,r),new N(r)}function qR(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(N.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class Js{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 ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let i=r.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!o||!i[a].isInSet(o.marks))&&(i=i[a--].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 jl(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 a=e;;){let{index:l,offset:c}=a.content.findIndex(i),u=i-c;if(r.push(a,l,o+c),!u||(a=a.child(l),a.isText))break;i=u-1,o+=c+1}return new Js(n,r,i)}static resolveCached(e,n){for(let o=0;o<Zu.length;o++){let i=Zu[o];if(i.pos==n&&i.doc==e)return i}let r=Zu[Uu]=Js.resolve(e,n);return Uu=(Uu+1)%YR,r}}let Zu=[],Uu=0,YR=12;class jl{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 JR=Object.create(null);let co=class Vf{constructor(e,n,r,o=ge.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||N.empty}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&&Hl(this.attrs,n||e.defaultAttrs||JR)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new Vf(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Vf(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 H.empty;let o=this.resolve(e),i=this.resolve(n),a=r?0:o.sharedDepth(n),l=o.start(a),u=o.node(a).content.cut(o.pos-l,i.pos-l);return new H(u,o.depth-a,i.depth-a)}replace(e,n,r){return GR(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 Js.resolveCached(this,e)}resolveNoCache(e){return Js.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()+")"),oy(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=N.empty,o=0,i=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,i),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=o;c<i;c++)if(!this.type.allowsMarks(r.child(c).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),a=i&&i.matchFragment(this.content,n);return a?a.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);let e=ge.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!ge.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=null;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=N.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,o,r)}};co.prototype.text=void 0;class Zl extends co{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):oy(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 Zl(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Zl(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 oy(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class uo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new QR(e,n);if(r.next==null)return uo.empty;let o=iy(r);r.next&&r.err("Unexpected trailing text");let i=iV(oV(o));return sV(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(a,l){let c=a.matchFragment(e,r);if(c&&(!n||c.validEnd))return N.from(l.map(u=>u.createAndFill()));for(let u=0;u<a.next.length;u++){let{type:d,next:f}=a.next[u];if(!(d.isText||d.hasRequiredAttrs())&&o.indexOf(f)==-1){o.push(f);let p=i(f,l.concat(d));if(p)return p}}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 a=[];for(let l=o;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),n[l.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 a=0;a<r.next.length;a++)i+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return i}).join(`
|
|
259
259
|
`)}}uo.empty=new uo(!0);class QR{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 iy(t){let e=[];do e.push(XR(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function XR(t){let e=[];do e.push(eV(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function eV(t){let e=rV(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=tV(t,e);else break;return e}function sy(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function tV(t,e){let n=sy(t),r=n;return t.eat(",")&&(t.next!="}"?r=sy(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function nV(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let i in n){let a=n[i];a.groups.indexOf(e)>-1&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function rV(t){if(t.eat("(")){let e=iy(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=nV(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 oV(t){let e=[[]];return o(i(t,0),n()),e;function n(){return e.push([])-1}function r(a,l,c){let u={term:c,to:l};return e[a].push(u),u}function o(a,l){a.forEach(c=>c.to=l)}function i(a,l){if(a.type=="choice")return a.exprs.reduce((c,u)=>c.concat(i(u,l)),[]);if(a.type=="seq")for(let c=0;;c++){let u=i(a.exprs[c],l);if(c==a.exprs.length-1)return u;o(u,l=n())}else if(a.type=="star"){let c=n();return r(l,c),o(i(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=n();return o(i(a.expr,l),c),o(i(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(l)].concat(i(a.expr,l));if(a.type=="range"){let c=l;for(let u=0;u<a.min;u++){let d=n();o(i(a.expr,c),d),c=d}if(a.max==-1)o(i(a.expr,c),c);else for(let u=a.min;u<a.max;u++){let d=n();r(c,d),o(i(a.expr,c),d),c=d}return[r(c)]}else{if(a.type=="name")return[r(l,void 0,a.value)];throw new Error("Unknown expr type")}}}}function ay(t,e){return e-t}function ly(t,e){let n=[];return r(e),n.sort(ay);function r(o){let i=t[o];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(o);for(let a=0;a<i.length;a++){let{term:l,to:c}=i[a];!l&&n.indexOf(c)==-1&&r(c)}}}function iV(t){let e=Object.create(null);return n(ly(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let d=0;d<o.length;d++)o[d][0]==l&&(u=o[d][1]);ly(t,c).forEach(d=>{u||o.push([l,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[r.join(",")]=new uo(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let l=o[a][1].sort(ay);i.next.push({type:o[a][0],next:e[l.join(",")]||n(l)})}return i}}function sV(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],i=!o.validEnd,a=[];for(let l=0;l<o.next.length;l++){let{type:c,next:u}=o.next[l];a.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),r.indexOf(u)==-1&&r.push(u)}i&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function cy(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 uy(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 dy(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new aV(t[n]);return e}let fy=class Hb{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=dy(r.attrs),this.defaultAttrs=cy(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==uo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}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:uy(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new co(this,this.computeAttrs(e),N.from(n),ge.setFrom(r))}createChecked(e=null,n,r){return n=N.from(n),this.checkContent(n),new co(this,this.computeAttrs(e),n,ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=N.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),i=o&&o.fillBefore(N.empty,!0);return i?new co(this,e,n.append(i),ge.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)}`)}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:ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((i,a)=>r[i]=new Hb(i,n,a));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}};class aV{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Ul{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=dy(o.attrs),this.excluded=null;let i=cy(this.attrs);this.instance=i?new ge(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,uy(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((i,a)=>r[i]=new Ul(i,o++,n,a)),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]}excludes(e){return this.excluded.indexOf(e)>-1}}class lV{constructor(e){this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Ke.from(e.nodes),n.marks=Ke.from(e.marks||{}),this.nodes=fy.compile(this.spec.nodes,this),this.marks=Ul.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],a=i.spec.content||"",l=i.spec.marks;i.contentMatch=r[a]||(r[a]=uo.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=l=="_"?null:l?py(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let o in this.marks){let i=this.marks[o],a=i.spec.excludes;i.excluded=a==null?[i]:a==""?[]:py(this,a.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 fy){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 Zl(r,r.defaultAttrs,e,ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return co.fromJSON(this,e)}markFromJSON(e){return ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function py(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],i=t.marks[o],a=i;if(i)n.push(i);else for(let l in t.marks){let c=t.marks[l];(o=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}class Jo{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let o=e.nodes[r.node];return o.contentMatch.matchType(o)})}parse(e,n={}){let r=new yy(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new yy(this,n,!0);return r.addAll(e,n.from,n.to),H.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(dV(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let a=i.getAttrs(e);if(a===!1)continue;i.attrs=a||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 a=this.styles[i],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let i=o.priority==null?50:o.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<i)break}n.splice(a,0,o)}for(let o in e.marks){let i=e.marks[o].spec.parseDOM;i&&i.forEach(a=>{r(a=by(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let i=e.nodes[o].spec.parseDOM;i&&i.forEach(a=>{r(a=by(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Jo(e,Jo.schemaRules(e)))}}const hy={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},cV={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},my={ol:!0,ul:!0},Wl=1,Kl=2,Qs=4;function gy(t,e,n){return e!=null?(e?Wl:0)|(e==="full"?Kl:0):t&&t.whitespace=="pre"?Wl|Kl:n&~Qs}class Gl{constructor(e,n,r,o,i,a,l){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=o,this.solid=i,this.options=l,this.content=[],this.activeMarks=ge.none,this.stashMarks=[],this.match=a||(l&Qs?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(N.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&Wl)){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=N.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(N.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let o=r[n];(this.type?this.type.allowsMarkType(o.type):pV(o.type,e))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!hy.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class yy{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let o=n.topNode,i,a=gy(null,n.preserveWhitespace,0)|(r?Qs:0);o?i=new Gl(o.type,o.attrs,ge.none,ge.none,!0,n.topMatch||o.type.contentMatch,a):r?i=new Gl(null,null,ge.none,ge.none,!0,null,a):i=new Gl(e.schema.topNodeType,null,ge.none,ge.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.getAttribute("style");if(!r)return n();let o=this.readStyles(fV(r));if(!o)return;let[i,a]=o,l=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],l);for(let c=0;c<i.length;c++)this.addPendingMark(i[c]);n();for(let c=0;c<i.length;c++)this.removePendingMark(i[c],l);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Kl||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&Wl)r.options&Kl?n=n.replace(/\r\n?/g,`
|
|
260
260
|
`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=r.content[r.content.length-1],i=e.previousSibling;(!o||i&&i.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),o;my.hasOwnProperty(r)&&this.parser.normalizeLists&&uV(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));if(i?i.ignore:cV.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let a,l=this.top,c=this.needsBlock;if(hy.hasOwnProperty(r))l.content.length&&l.content[0].isInline&&this.open&&(this.open--,l=this.top),a=!0,l.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}i&&i.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),a&&this.sync(l),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,i,i.consuming===!1?o:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
261
261
|
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ge.none,r=ge.none;for(let o=0;o<e.length;o+=2)for(let i=void 0;;){let a=this.parser.matchStyle(e[o],e[o+1],this,i);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(l=>{a.clearMark(l)&&(r=l.addToSet(r))}):n=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(n),a.consuming===!1)i=a;else break}return[n,r]}addElementByRule(e,n,r){let o,i,a;n.node?(i=this.parser.schema.nodes[n.node],i.isLeaf?this.insertNode(i.create(n.attrs))||this.leafFallback(e):o=this.enter(i,n.attrs||null,n.preserveWhitespace)):(a=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(a));let l=this.top;if(i&&i.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c)}o&&this.sync(l)&&this.open--,a&&this.removePendingMark(a,l)}addAll(e,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,a=r==null?null:e.childNodes[r];i!=a;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i);this.findAtPoint(e,o)}findPlace(e){let n,r;for(let o=this.open;o>=0;o--){let i=this.nodes[o],a=i.findWrapping(e);if(a&&(!n||n.length>a.length)&&(n=a,r=i,!a.length)||i.solid)break}if(!n)return!1;this.sync(r);for(let o=0;o<n.length;o++)this.enterInner(n[o],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let o=0;o<e.marks.length;o++)(!n.type||n.type.allowsMarkType(e.marks[o].type))&&(r=e.marks[o].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let o=this.findPlace(e.create(n));return o&&this.enterInner(e,n,!0,r),o}enterInner(e,n=null,r=!1,o){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let a=gy(e,o,i.options);i.options&Qs&&i.content.length==0&&(a|=Qs),this.nodes.push(new Gl(e,n,i.activeMarks,i.pendingMarks,r,null,a)),this.open++}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;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),a=(l,c)=>{for(;l>=0;l--){let u=n[l];if(u==""){if(l==n.length-1||l==0)continue;for(;c>=i;c--)if(a(l-1,c))return!0;return!1}else{let d=c>0||c==0&&o?this.nodes[c].type:r&&c>=i?r.node(c-i).type:null;if(!d||d.name!=u&&d.groups.indexOf(u)==-1)return!1;c--}}return!0};return a(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}}addPendingMark(e){let n=hV(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let o=this.nodes[r];if(o.pendingMarks.lastIndexOf(e)>-1)o.pendingMarks=e.removeFromSet(o.pendingMarks);else{o.activeMarks=e.removeFromSet(o.activeMarks);let a=o.popFromStashMark(e);a&&o.type&&o.type.allowsMarkType(a.type)&&(o.activeMarks=a.addToSet(o.activeMarks))}if(o==n)break}}}function uV(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&my.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function dV(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function fV(t){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,n,r=[];for(;n=e.exec(t);)r.push(n[1],n[2].trim());return r}function by(t){let e={};for(let n in t)e[n]=t[n];return e}function pV(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let i=[],a=l=>{i.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:d}=l.edge(c);if(u==e||i.indexOf(d)<0&&a(d))return!0}};if(a(o.contentMatch))return!0}}function hV(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class yn{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=Wu(n).createDocumentFragment());let o=r,i=[];return e.forEach(a=>{if(i.length||a.marks.length){let l=0,c=0;for(;l<i.length&&c<a.marks.length;){let u=a.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(i[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<i.length;)o=i.pop()[1];for(;c<a.marks.length;){let u=a.marks[c++],d=this.serializeMark(u,a.isInline,n);d&&(i.push([u,o]),o.appendChild(d.dom),o=d.contentDOM||d.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=yn.renderSpec(Wu(n),this.nodes[e.type.name](e));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&&yn.renderSpec(Wu(r),o(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let o=n[0],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let a,l=r?e.createElementNS(r,o):e.createElement(o),c=n[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 f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):l.setAttribute(d,c[d])}}for(let d=u;d<n.length;d++){let f=n[d];if(f===0){if(d<n.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:p,contentDOM:h}=yn.renderSpec(e,f,r);if(l.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:l,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=wy(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return wy(e.marks)}}function wy(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Wu(t){return t.document||window.document}const vy=65535,Cy=Math.pow(2,16);function mV(t,e){return t+e*Cy}function ky(t){return t&vy}function gV(t){return(t-(t&vy))/Cy}const Sy=1,Ey=2,ql=4,Oy=8;class Ku{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Oy)>0}get deletedBefore(){return(this.delInfo&(Sy|ql))>0}get deletedAfter(){return(this.delInfo&(Ey|ql))>0}get deletedAcross(){return(this.delInfo&ql)>0}}class xt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&xt.empty)return xt.empty}recover(e){let n=0,r=ky(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+gV(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,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let u=this.ranges[l+i],d=this.ranges[l+a],f=c+u;if(e<=f){let p=u?e==c?-1:e==f?1:n:n,h=c+o+(p<0?0:d);if(r)return h;let m=e==(n<0?c:f)?null:mV(l/3,e-c),y=e==c?Ey:e==f?Sy:ql;return(n<0?e!=c:e!=f)&&(y|=Oy),new Ku(h,y,m)}o+=d-u}return r?e+o:new Ku(e+o,0,null)}touches(e,n){let r=0,o=ky(n),i=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>e)break;let u=this.ranges[l+i],d=c+u;if(e<=d&&l==o*3)return!0;r+=this.ranges[l+a]-u}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 a=this.ranges[o],l=a-(this.inverted?i:0),c=a+(this.inverted?0:i),u=this.ranges[o+n],d=this.ranges[o+r];e(l,l+u,c,c+d),i+=d-u}}invert(){return new xt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?xt.empty:new xt(e<0?[0,-e,0]:[0,0,e])}}xt.empty=new xt([]);class Qo{constructor(e=[],n,r=0,o=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=o}slice(e=0,n=this.maps.length){return new Qo(this.maps,this.mirror,e,n)}copy(){return new Qo(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){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 Qo;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 a=this.maps[i],l=a.mapResult(e,n);if(l.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this.maps[c].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new Ku(e,o,null)}}const Gu=Object.create(null);class et{getMap(){return xt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Gu[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 Gu)throw new RangeError("Duplicate use of step JSON ID "+e);return Gu[e]=n,n.prototype.jsonID=e,n}}class Le{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Le(e,null)}static fail(e){return new Le(null,e)}static fromReplace(e,n,r,o){try{return Le.ok(e.replace(n,r,o))}catch(i){if(i instanceof zl)return Le.fail(i.message);throw i}}}function qu(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let i=t.child(o);i.content.size&&(i=i.copy(qu(i.content,e,i))),i.isInline&&(i=e(i,n,o)),r.push(i)}return N.fromArray(r)}class yr extends et{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 H(qu(n.content,(a,l)=>!a.isAtom||!l.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return Le.fromReplace(e,this.from,this.to,i)}invert(){return new bn(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 yr(n.pos,r.pos,this.mark)}merge(e){return e instanceof yr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yr(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 yr(n.from,n.to,e.markFromJSON(n.mark))}}et.jsonID("addMark",yr);class bn extends et{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 H(qu(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return Le.fromReplace(e,this.from,this.to,r)}invert(){return new yr(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 bn(n.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"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 bn(n.from,n.to,e.markFromJSON(n.mark))}}et.jsonID("removeMark",bn);class br extends et{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Le.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Le.fromReplace(e,this.pos,this.pos+1,new H(N.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 br(this.pos,n.marks[o]);return new br(this.pos,this.mark)}}return new Xo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new br(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 br(n.pos,e.markFromJSON(n.mark))}}et.jsonID("addNodeMark",br);class Xo extends et{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Le.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Le.fromReplace(e,this.pos,this.pos+1,new H(N.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new br(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Xo(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 Xo(n.pos,e.markFromJSON(n.mark))}}et.jsonID("removeNodeMark",Xo);class He extends et{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&Yu(e,this.from,this.to)?Le.fail("Structure replace would overwrite content"):Le.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xt([this.from,this.to-this.from,this.slice.size])}invert(e){return new He(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 He(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof He)||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?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new He(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?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new He(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 He(n.from,n.to,H.fromJSON(e,n.slice),!!n.structure)}}et.jsonID("replace",He);class ze extends et{constructor(e,n,r,o,i,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=i,this.insert=a,this.structure=l}apply(e){if(this.structure&&(Yu(e,this.from,this.gapFrom)||Yu(e,this.gapTo,this.to)))return Le.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Le.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Le.fromReplace(e,this.from,this.to,r):Le.fail("Content does not fit in gap")}getMap(){return new xt([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 ze(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=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||i>r.pos?null:new ze(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 ze(n.from,n.to,n.gapFrom,n.gapTo,H.fromJSON(e,n.slice),n.insert,!!n.structure)}}et.jsonID("replaceAround",ze);function Yu(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 a=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function yV(t,e,n,r){let o=[],i=[],a,l;t.doc.nodesBetween(e,n,(c,u,d)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&d.type.allowsMarkType(r.type)){let p=Math.max(u,e),h=Math.min(u+c.nodeSize,n),m=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(m)||(a&&a.to==p&&a.mark.eq(f[y])?a.to=h:o.push(a=new bn(p,h,f[y])));l&&l.to==p?l.to=h:i.push(l=new yr(p,h,r))}}),o.forEach(c=>t.step(c)),i.forEach(c=>t.step(c))}function bV(t,e,n,r){let o=[],i=0;t.doc.nodesBetween(e,n,(a,l)=>{if(!a.isInline)return;i++;let c=null;if(r instanceof Ul){let u=a.marks,d;for(;d=r.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let u=Math.min(l+a.nodeSize,n);for(let d=0;d<c.length;d++){let f=c[d],p;for(let h=0;h<o.length;h++){let m=o[h];m.step==i-1&&f.eq(o[h].style)&&(p=m)}p?(p.to=u,p.step=i):o.push({style:f,from:Math.max(l,e),to:u,step:i})}}}),o.forEach(a=>t.step(new bn(a.from,a.to,a.style)))}function wV(t,e,n,r=n.contentMatch){let o=t.doc.nodeAt(e),i=[],a=e+1;for(let l=0;l<o.childCount;l++){let c=o.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)i.push(new He(a,u,H.empty));else{r=d;for(let f=0;f<c.marks.length;f++)n.allowsMarkType(c.marks[f].type)||t.step(new bn(a,u,c.marks[f]));if(c.isText&&!n.spec.code){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new H(N.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),i.push(new He(a+f.index,a+f.index+f[0].length,h))}}a=u}if(!r.validEnd){let l=r.fillBefore(N.empty,!0);t.replace(a,a,new H(l,0,0))}for(let l=i.length-1;l>=0;l--)t.step(i[l])}function vV(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ei(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),a=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(i,a,n))return r;if(r==0||o.type.spec.isolating||!vV(o,i,a))break}return null}function CV(t,e,n){let{$from:r,$to:o,depth:i}=e,a=r.before(i+1),l=o.after(i+1),c=a,u=l,d=N.empty,f=0;for(let m=i,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,d=N.from(r.node(m).copy(d)),f++):c--;let p=N.empty,h=0;for(let m=i,y=!1;m>n;m--)y||o.after(m+1)<o.end(m)?(y=!0,p=N.from(o.node(m).copy(p)),h++):u++;t.step(new ze(c,u,a,l,new H(d.append(p),f,h),d.size-f,!0))}function Ju(t,e,n=null,r=t){let o=kV(t,e),i=o&&SV(r,e);return i?o.map(Ty).concat({type:e,attrs:n}).concat(i.map(Ty)):null}function Ty(t){return{type:t,attrs:null}}function kV(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.contentMatchAt(r).findWrapping(e);if(!i)return null;let a=i.length?i[0]:e;return n.canReplaceWith(r,o,a)?i:null}function SV(t,e){let{parent:n,startIndex:r,endIndex:o}=t,i=n.child(r),a=e.contentMatch.findWrapping(i.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let u=r;c&&u<o;u++)c=c.matchType(n.child(u).type);return!c||!c.validEnd?null:a}function EV(t,e,n){let r=N.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let l=n[a].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=N.from(n[a].type.create(n[a].attrs,r))}let o=e.start,i=e.end;t.step(new ze(o,i,o,i,new H(r,0,0),n.length,!0))}function OV(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,(a,l)=>{if(a.isTextblock&&!a.hasMarkup(r,o)&&TV(t.doc,t.mapping.slice(i).map(l),r)){t.clearIncompatible(t.mapping.slice(i).map(l,1),r);let c=t.mapping.slice(i),u=c.map(l,1),d=c.map(l+a.nodeSize,1);return t.step(new ze(u,d,u+1,d-1,new H(N.from(r.create(o,null,a.marks)),0,0),1,!0)),!1}})}function TV(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function MV(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 a=n.create(r,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,a);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new ze(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new H(N.from(a),0,0),1,!0))}function ti(t,e,n=1,r){let o=t.resolve(e),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let u=o.depth-1,d=n-2;u>i;u--,d--){let f=o.node(u),p=o.index(u);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[d+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[d]||f;if(!f.canReplace(p+1,f.childCount)||!y.type.validContent(h))return!1}let l=o.indexAfter(i),c=r&&r[0];return o.node(i).canReplaceWith(l,l,c?c.type:o.node(i+1).type)}function IV(t,e,n=1,r){let o=t.doc.resolve(e),i=N.empty,a=N.empty;for(let l=o.depth,c=o.depth-n,u=n-1;l>c;l--,u--){i=N.from(o.node(l).copy(i));let d=r&&r[u];a=N.from(d?d.type.create(d.attrs,a):o.node(l).copy(a))}t.step(new He(e,e,new H(i.append(a),n,n),!0))}function wr(t,e){let n=t.resolve(e),r=n.index();return My(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function My(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Yl(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let i,a,l=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),l++,a=r.node(o).maybeChild(l)):(i=r.node(o).maybeChild(l-1),a=r.node(o+1)),i&&!i.isTextblock&&My(i,a)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function xV(t,e,n){let r=new He(e-n,e+n,H.empty,!0);t.step(r)}function PV(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 Iy(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 a=r.depth;a>=0;a--){let l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(l>0?1:0),u=r.node(a),d=!1;if(i==1)d=u.canReplace(c,c,o);else{let f=u.contentMatchAt(c).findWrapping(o.firstChild.type);d=f&&u.canReplaceWith(c,c,f[0])}if(d)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function Jl(t,e,n=e,r=H.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),i=t.resolve(n);return xy(o,i,r)?new He(e,n,r):new BV(o,i,r).fit()}function xy(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class BV{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=N.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=N.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):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,a=r.depth,l=o.depth;for(;a&&l&&i.childCount==1;)i=i.firstChild.content,a--,l--;let c=new H(i,a,l);return e>-1?new ze(r.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new He(r.pos,o.pos,c):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=Qu(this.unplaced.content,r-1).firstChild,o=i.content):o=this.unplaced.content;let a=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],d,f=null;if(n==1&&(a?u.matchType(a.type)||(f=u.fillBefore(N.from(a),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:r,frontierDepth:l,parent:i,inject:f};if(n==2&&a&&(d=u.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:l,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=Qu(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new H(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=Qu(e,n);if(o.childCount<=1&&n>0){let i=e.size-n<=n+o.size;this.unplaced=new H(Xs(e,n-1,1),n-1,i?n-1:r)}else this.unplaced=new H(Xs(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 y=0;y<i.length;y++)this.openFrontierNode(i[y]);let a=this.unplaced,l=r?r.content:a.content,c=a.openStart-e,u=0,d=[],{match:f,type:p}=this.frontier[n];if(o){for(let y=0;y<o.childCount;y++)d.push(o.child(y));f=f.matchFragment(o)}let h=l.size+e-(a.content.size-a.openEnd);for(;u<l.childCount;){let y=l.child(u),g=f.matchType(y.type);if(!g)break;u++,(u>1||c==0||y.content.size)&&(f=g,d.push(Py(y.mark(p.allowedMarks(y.marks)),u==1?c:0,u==l.childCount?h:-1)))}let m=u==l.childCount;m||(h=-1),this.placed=ea(this.placed,n,N.from(d)),this.frontier[n].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,g=l;y<h;y++){let b=g.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),g=b.content}this.unplaced=m?e==0?H.empty:new H(Xs(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new H(Xs(a.content,e,u),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Xu(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)),a=Xu(e,n,o,r,i);if(a){for(let l=n-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],d=Xu(e,l,u,c,!0);if(!d||d.childCount)continue e}return{depth:n,fit:a,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=ea(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=ea(this.placed,this.depth,N.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(N.empty,!0);n.childCount&&(this.placed=ea(this.placed,this.frontier.length,n))}}function Xs(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Xs(t.firstChild.content,e-1,n)))}function ea(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(ea(t.lastChild.content,e-1,n)))}function Qu(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Py(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Py(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(N.empty,!0)))),t.copy(r)}function Xu(t,e,n,r,o){let i=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,a);return l&&!AV(n,i.content,a)?l:null}function AV(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function DV(t){return t.spec.defining||t.spec.definingForContent}function NV(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),i=t.doc.resolve(n);if(xy(o,i,r))return t.step(new He(e,n,r));let a=Ay(o,t.doc.resolve(n));a[a.length-1]==0&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let p=o.depth,h=o.pos-1;p>0;p--,h--){let m=o.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?l=p:o.before(p)==h&&a.splice(1,0,-p)}let c=a.indexOf(l),u=[],d=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(u.push(m),h==r.openStart)break;p=m.content}for(let p=d-1;p>=0;p--){let h=u[p],m=DV(h.type);if(m&&!h.sameMarkup(o.node(Math.abs(l)-1)))d=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+d+1)%(r.openStart+1),m=u[h];if(m)for(let y=0;y<a.length;y++){let g=a[(y+c)%a.length],b=!0;g<0&&(b=!1,g=-g);let v=o.node(g-1),k=o.index(g-1);if(v.canReplaceWith(k,k,m.type,m.marks))return t.replace(o.before(g),b?i.after(g):n,new H(By(r.content,0,r.openStart,h),h,r.openEnd))}}let f=t.steps.length;for(let p=a.length-1;p>=0&&(t.replace(e,n,r),!(t.steps.length>f));p--){let h=a[p];h<0||(e=o.before(h),n=i.after(h))}}function By(t,e,n,r,o){if(e<n){let i=t.firstChild;t=t.replaceChild(0,i.copy(By(i.content,e+1,n,r,i)))}if(e>r){let i=o.contentMatchAt(0),a=i.fillBefore(t).append(t);t=a.append(i.matchFragment(a).fillBefore(N.empty,!0))}return t}function LV(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=PV(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new H(N.from(r),0,0))}function RV(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),i=Ay(r,o);for(let a=0;a<i.length;a++){let l=i[a],c=a==i.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a)return t.delete(r.before(a),n);t.delete(e,n)}function Ay(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 ni extends et{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 Le.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 Le.fromReplace(e,this.pos,this.pos+1,new H(N.from(o),0,n.isLeaf?0:1))}getMap(){return xt.empty}invert(e){return new ni(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 ni(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 ni(n.pos,n.attr,n.value)}}et.jsonID("attr",ni);class ta extends et{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 Le.ok(r)}getMap(){return xt.empty}invert(e){return new ta(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 ta(n.attr,n.value)}}et.jsonID("docAttr",ta);let ri=class extends Error{};ri=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},ri.prototype=Object.create(Error.prototype),ri.prototype.constructor=ri,ri.prototype.name="TransformError";class Dy{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qo}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new ri(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=H.empty){let o=Jl(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new H(N.from(r),0,0))}delete(e,n){return this.replace(e,n,H.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return NV(this,e,n,r),this}replaceRangeWith(e,n,r){return LV(this,e,n,r),this}deleteRange(e,n){return RV(this,e,n),this}lift(e,n){return CV(this,e,n),this}join(e,n=1){return xV(this,e,n),this}wrap(e,n){return EV(this,e,n),this}setBlockType(e,n=e,r,o=null){return OV(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return MV(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new ni(e,n,r)),this}setDocAttribute(e,n){return this.step(new ta(e,n)),this}addNodeMark(e,n){return this.step(new br(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ge)){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 Xo(e,n)),this}split(e,n=1,r){return IV(this,e,n,r),this}addMark(e,n,r){return yV(this,e,n,r),this}removeMark(e,n,r){return bV(this,e,n,r),this}clearIncompatible(e,n,r){return wV(this,e,n,r),this}}const ed=Object.create(null);class ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new VV(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=H.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let i=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:c,$to:u}=a[l],d=e.mapping.slice(i);e.replaceRange(d.map(c.pos),d.map(u.pos),l?H.empty:n),l==0&&Ry(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:a,$to:l}=o[i],c=e.mapping.slice(r),u=c.map(a.pos),d=c.map(l.pos);i?e.deleteRange(u,d):(e.replaceRangeWith(u,d,n),Ry(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Q(e):oi(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 a=n<0?oi(e.node(0),e.node(i),e.before(i+1),e.index(i),n,r):oi(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new on(e.node(0))}static atStart(e){return oi(e,e,0,0,1)||new on(e)}static atEnd(e){return oi(e,e,e.content.size,e.childCount,-1)||new on(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ed[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 ed)throw new RangeError("Duplicate use of selection JSON ID "+e);return ed[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Q.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class VV{constructor(e,n){this.$from=e,this.$to=n}}let Ny=!1;function Ly(t){!Ny&&!t.parent.inlineContent&&(Ny=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Q extends ee{constructor(e,n=e){Ly(e),Ly(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 ee.near(r);let o=e.resolve(n.map(this.anchor));return new Q(o.parent.inlineContent?o:r,r)}replace(e,n=H.empty){if(super.replace(e,n),n==H.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Q&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ql(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 Q(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=ee.findFrom(n,r,!0)||ee.findFrom(n,-r,!0);if(i)n=i.$head;else return ee.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Q(e,n)}}ee.jsonID("text",Q);class Ql{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ql(e.map(this.anchor),e.map(this.head))}resolve(e){return Q.between(e.resolve(this.anchor),e.resolve(this.head))}}class U extends ee{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?ee.near(i):new U(i)}content(){return new H(N.from(this.node),0,0)}eq(e){return e instanceof U&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new td(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new U(e.resolve(n.anchor))}static create(e,n){return new U(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}U.prototype.visible=!1,ee.jsonID("node",U);class td{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ql(r,r):new td(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&U.isSelectable(r)?new U(n):ee.near(n)}}class on extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=H.empty){if(n==H.empty){e.delete(0,e.doc.content.size);let r=ee.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new on(e)}map(e){return new on(e)}eq(e){return e instanceof on}getBookmark(){return $V}}ee.jsonID("all",on);const $V={map(){return this},resolve(t){return new on(t)}};function oi(t,e,n,r,o,i=!1){if(e.inlineContent)return Q.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let l=e.child(a);if(l.isAtom){if(!i&&U.isSelectable(l))return U.create(t,n-(o<0?l.nodeSize:0))}else{let c=oi(t,l,n+o,o<0?l.childCount:0,o,i);if(c)return c}n+=l.nodeSize*o}return null}function Ry(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof He||o instanceof ze))return;let i=t.mapping.maps[r],a;i.forEach((l,c,u,d)=>{a==null&&(a=d)}),t.setSelection(ee.near(t.doc.resolve(a),n))}const Vy=1,Xl=2,$y=4;class FV extends Dy{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|Vy)&~Xl,this.storedMarks=null,this}get selectionSet(){return(this.updated&Vy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Xl,this}ensureMarks(e){return ge.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&Xl)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Xl,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)||ge.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 a=this.doc.resolve(n);i=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,i)),this.selection.empty||this.setSelection(ee.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|=$y,this}get scrolledIntoView(){return(this.updated&$y)>0}}function Fy(t,e){return!e||!t?t:t.bind(e)}class na{constructor(e,n,r){this.name=e,this.init=Fy(n.init,r),this.apply=Fy(n.apply,r)}}const HV=[new na("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new na("selection",{init(t,e){return t.selection||ee.atStart(e.doc)},apply(t){return t.selection}}),new na("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new na("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class nd{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=HV.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 na(r.key,r.spec.state,r))})}}class ii{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 a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let c=o?o[a].n:0,u=o?o[a].state:this,d=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,u,r);if(d&&r.filterTransaction(d,a)){if(d.setMeta("appendedTransaction",e),!o){o=[];for(let f=0;f<this.config.plugins.length;f++)o.push(f<a?{state:r,n:n.length}:{state:this,n:0})}n.push(d),r=r.applyInner(d),i=!0}o&&(o[a]={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 ii(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 FV(this)}static create(e){let n=new nd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ii(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 nd(this.schema,e.plugins),r=n.fields,o=new ii(n);for(let i=0;i<r.length;i++){let a=r[i].name;o[a]=this.hasOwnProperty(a)?this[a]: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 nd(e.schema,e.plugins),i=new ii(o);return o.fields.forEach(a=>{if(a.name=="doc")i.doc=co.fromJSON(e.schema,n.doc);else if(a.name=="selection")i.selection=ee.fromJSON(i.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],u=c.spec.state;if(c.key==a.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){i[a.name]=u.fromJSON.call(c,e,n[l],i);return}}i[a.name]=a.init(e,i)}}),i}}function Hy(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=Hy(o,e,{})),n[r]=o}return n}class Ge{constructor(e){this.spec=e,this.props={},e.props&&Hy(e.props,this,this.props),this.key=e.key?e.key.key:zy("plugin")}getState(e){return e[this.key]}}const rd=Object.create(null);function zy(t){return t in rd?t+"$"+ ++rd[t]:(rd[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=zy(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const dt=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},ra=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _y=null;const zn=function(t,e,n){let r=_y||(_y=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},fo=function(t,e,n,r){return n&&(jy(t,e,n,r,-1)||jy(t,e,n,r,1))},zV=/^(img|br|input|textarea|hr)$/i;function jy(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:wn(t))){let i=t.parentNode;if(!i||i.nodeType!=1||od(t)||zV.test(t.nodeName)||t.contentEditable=="false")return!1;e=dt(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?wn(t):0}else return!1}}function wn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function _V(t,e,n){for(let r=e==0,o=e==wn(t);r||o;){if(t==n)return!0;let i=dt(t);if(t=t.parentNode,!t)return!1;r=r&&i==0,o=o&&i==wn(t)}}function od(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 e0=function(t){return t.focusNode&&fo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function po(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function jV(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function ZV(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const vn=typeof navigator<"u"?navigator:null,Zy=typeof document<"u"?document:null,vr=vn&&vn.userAgent||"",id=/Edge\/(\d+)/.exec(vr),Uy=/MSIE \d/.exec(vr),sd=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vr),kt=!!(Uy||sd||id),Cr=Uy?document.documentMode:sd?+sd[1]:id?+id[1]:0,sn=!kt&&/gecko\/(\d+)/i.test(vr);sn&&+(/Firefox\/(\d+)/.exec(vr)||[0,0])[1];const ad=!kt&&/Chrome\/(\d+)/.exec(vr),tt=!!ad,UV=ad?+ad[1]:0,ft=!kt&&!!vn&&/Apple Computer/.test(vn.vendor),si=ft&&(/Mobile\/\w+/.test(vr)||!!vn&&vn.maxTouchPoints>2),jt=si||(vn?/Mac/.test(vn.platform):!1),WV=vn?/Win/.test(vn.platform):!1,an=/Android \d/.test(vr),oa=!!Zy&&"webkitFontSmoothing"in Zy.documentElement.style,KV=oa?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function GV(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function _n(t,e){return typeof t=="number"?t:t[e]}function qV(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 Wy(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let a=n||t.dom;a;a=ra(a)){if(a.nodeType!=1)continue;let l=a,c=l==i.body,u=c?GV(i):qV(l),d=0,f=0;if(e.top<u.top+_n(r,"top")?f=-(u.top-e.top+_n(o,"top")):e.bottom>u.bottom-_n(r,"bottom")&&(f=e.bottom-e.top>u.bottom-u.top?e.top+_n(o,"top")-u.top:e.bottom-u.bottom+_n(o,"bottom")),e.left<u.left+_n(r,"left")?d=-(u.left-e.left+_n(o,"left")):e.right>u.right-_n(r,"right")&&(d=e.right-u.right+_n(o,"right")),d||f)if(c)i.defaultView.scrollBy(d,f);else{let p=l.scrollLeft,h=l.scrollTop;f&&(l.scrollTop+=f),d&&(l.scrollLeft+=d);let m=l.scrollLeft-p,y=l.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function YV(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let i=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let l=t.root.elementFromPoint(i,a);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,o=c.top;break}}return{refDOM:r,refTop:o,stack:Ky(t.dom)}}function Ky(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=ra(r));return e}function JV({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Gy(n,r==0?0:r-e)}function Gy(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 ai=null;function QV(t){if(t.setActive)return t.setActive();if(ai)return t.focus(ai);let e=Ky(t);t.focus(ai==null?{get preventScroll(){return ai={preventScroll:!0},!0}}:void 0),ai||(ai=!1,Gy(e,0))}function qy(t,e){let n,r=2e8,o,i=0,a=e.top,l=e.top,c,u;for(let d=t.firstChild,f=0;d;d=d.nextSibling,f++){let p;if(d.nodeType==1)p=d.getClientRects();else if(d.nodeType==3)p=zn(d).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=a&&m.bottom>=l){a=Math.max(m.bottom,a),l=Math.min(m.top,l);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){n=d,r=y,o=y&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,d.nodeType==1&&y&&(i=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=d,u={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(i=f+1)}}return!n&&c&&(n=c,o=u,r=0),n&&n.nodeType==3?XV(n,o):!n||r&&n.nodeType==1?{node:t,offset:i}:qy(n,o)}function XV(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=kr(r,1);if(i.top!=i.bottom&&ld(e,i))return{node:t,offset:o+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}function ld(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function e$(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function t$(t,e,n){let{node:r,offset:o}=qy(e,n),i=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();i=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,i)}function n$(t,e,n,r){let o=-1;for(let i=e,a=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!a||!l.contentDOM)){let c=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?o=l.posBefore:(c.right<r.left||c.bottom<r.top)&&(o=l.posAfter)),!l.contentDOM&&o<0&&!l.node.isText)return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter}i=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function Yy(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 a=t.childNodes[i];if(a.nodeType==1){let l=a.getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(ld(e,u))return Yy(a,e,u)}}if((i=(i+1)%r)==o)break}return t}function r$(t,e){let n=t.dom.ownerDocument,r,o=0,i=ZV(n,e.left,e.top);i&&({node:r,offset:o}=i);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=t.dom.getBoundingClientRect();if(!ld(e,u)||(a=Yy(t.dom,e,u),!a))return null}if(ft)for(let u=a;r&&u;u=ra(u))u.draggable&&(r=void 0);if(a=e$(a,e),r){if(sn&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let d=r.childNodes[o],f;d.nodeName=="IMG"&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}let u;oa&&o&&r.nodeType==1&&(u=r.childNodes[o-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=n$(t,r,o,e))}l==null&&(l=t$(t,a,e));let c=t.docView.nearestDesc(a,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function Jy(t){return t.top<t.bottom||t.left<t.right}function kr(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Jy(r))return r}return Array.prototype.find.call(n,Jy)||t.getBoundingClientRect()}const o$=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Qy(t,e,n){let{node:r,offset:o,atom:i}=t.docView.domFromPos(e,n<0?-1:1),a=oa||sn;if(r.nodeType==3)if(a&&(o$.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let c=kr(zn(r,o,o),n);if(sn&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let u=kr(zn(r,o-1,o-1),-1);if(u.top==c.top){let d=kr(zn(r,o,o+1),-1);if(d.top!=c.top)return ia(d,d.left<u.left)}}return c}else{let c=o,u=o,d=n<0?1:-1;return n<0&&!o?(u++,d=-1):n>=0&&o==r.nodeValue.length?(c--,d=1):n<0?c--:u++,ia(kr(zn(r,c,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&o&&(n<0||o==wn(r))){let c=r.childNodes[o-1];if(c.nodeType==1)return cd(c.getBoundingClientRect(),!1)}if(i==null&&o<wn(r)){let c=r.childNodes[o];if(c.nodeType==1)return cd(c.getBoundingClientRect(),!0)}return cd(r.getBoundingClientRect(),n>=0)}if(i==null&&o&&(n<0||o==wn(r))){let c=r.childNodes[o-1],u=c.nodeType==3?zn(c,wn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return ia(kr(u,1),!1)}if(i==null&&o<wn(r)){let c=r.childNodes[o];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?zn(c,0,a?0:1):c.nodeType==1?c:null:null;if(u)return ia(kr(u,-1),!0)}return ia(kr(r.nodeType==3?zn(r):r,-n),n>=0)}function ia(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 cd(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 Xy(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 i$(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return Xy(t,e,()=>{let{node:i}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let a=Qy(t,o.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=zn(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(n=="up"?a.top-d.top>(d.bottom-a.top)*2:d.bottom-a.bottom>(a.bottom-d.top)*2))return!1}}return!0})}const s$=/[\u0590-\u08ac]/;function a$(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=!o,a=o==r.parent.content.size,l=t.domSelection();return!s$.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?i:a:Xy(t,e,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:f}=t.domSelectionRange(),p=l.caretBidiLevel;l.modify("move",n,"character");let h=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:y}=t.domSelectionRange(),g=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&u==y;try{l.collapse(d,f),c&&(c!=d||u!=f)&&l.extend&&l.extend(c,u)}catch{}return p!=null&&(l.caretBidiLevel=p),g})}let e4=null,t4=null,n4=!1;function l$(t,e,n){return e4==e&&t4==n?n4:(e4=e,t4=n,n4=n=="up"||n=="down"?i$(t,e,n):a$(t,e,n))}const Zt=0,r4=1,ho=2,Cn=3;class sa{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Zt,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,a;if(e==this.contentDOM)i=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(a)+a.size:this.posAtStart}else{let i,a;if(e==this.contentDOM)i=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((a=i.pmViewDesc)&&a.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}let o;if(e==this.dom&&this.contentDOM)o=n>dt(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),a;if(i&&(!n||i.node))if(r&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==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;)o=o.children[0];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 a=this.children[r],l=i+a.size;if(l>e||a instanceof s4){o=e-i;break}i=l}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 o4&&i.side>=0;r--);if(n<=0){let i,a=!0;for(;i=r?this.children[r-1]:null,!(!i||i.dom.parentNode==this.contentDOM);r--,a=!1);return i&&n&&a&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?dt(i.dom)+1:0}}else{let i,a=!0;for(;i=r<this.children.length?this.children[r]:null,!(!i||i.dom.parentNode==this.contentDOM);r++,a=!1);return i&&a&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?dt(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 a=r,l=0;;l++){let c=this.children[l],u=a+c.size;if(o==-1&&e<=u){let d=a+c.border;if(e>=d&&n<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,d);e=a;for(let f=l;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){o=dt(p.dom)+1;break}e-=p.size}o==-1&&(o=0)}if(o>-1&&(u>n||l==this.children.length-1)){n=u;for(let d=l+1;d<this.children.length;d++){let f=this.children[d];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){i=dt(f.dom);break}n+=f.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=u}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),a=Math.max(e,n);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],y=h+m.size;if(i>h&&a<y)return m.setSelection(e-h-m.border,n-h-m.border,r,o);h=y}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),u=r.getSelection(),d=!1;if((sn||ft)&&e==n){let{node:p,offset:h}=l;if(p.nodeType==3){if(d=!!(h&&p.nodeValue[h-1]==`
|