/*! For license information please see vendors.js.LICENSE.txt */ (self.webpackChunk_nextcloud_text=self.webpackChunk_nextcloud_text||[]).push([["vendors"],{42302:(e,t,n)=>{"use strict";n.d(t,{Cr:()=>oe,G3:()=>ke,II:()=>de,I_:()=>Z,JX:()=>ie,Le:()=>_,Lw:()=>g,SZ:()=>b,VH:()=>ge,WQ:()=>he,Xc:()=>C,dO:()=>ue,dl:()=>te,e2:()=>J,eA:()=>X,nA:()=>ce,qK:()=>ae,tp:()=>W,wb:()=>se,z2:()=>ee});var a=n(2376),r=n(87823),i=n(7327),o=n(84348),s=n(16560);let l,u;if("undefined"!=typeof WeakMap){let e=new WeakMap;l=t=>e.get(t),u=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;l=t=>{for(let n=0;n(n==t&&(n=0),e[n++]=a,e[n++]=r)}class d{constructor(e,t,n,a){this.left=e,this.top=t,this.right=n,this.bottom=a}}class c{constructor(e,t,n,a){this.width=e,this.height=t,this.map=n,this.problems=a}findCell(e){for(let t=0;ta&&(i+=r.attrs.colspan)}}for(let e=0;e1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,a=[],r=0,i=null,o=[];for(let e=0,r=t*n;e=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:h-e});break}let u=r+e*t;for(let e=0;e0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function g(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function _(e){let t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:p(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let a=t.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let a=t.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function F(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function b(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function y(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function v(e,t,n){let a=e.start(-1),r=c.get(e.node(-1)).nextCell(e.pos-a,t,n);return null==r?null:e.node(0).resolve(a+r)}function k(e,t,n){let a={};for(let t in e)a[t]=e[t];return a[t]=n,a}function w(e,t,n=1){let a=k(e,"colspan",e.colspan-n);return a.colwidth&&(a.colwidth=a.colwidth.slice(),a.colwidth.splice(t,n),a.colwidth.some((e=>e>0))||(a.colwidth=null)),a}function A(e,t,n=1){let a=k(e,"colspan",e.colspan+n);if(a.colwidth){a.colwidth=a.colwidth.slice();for(let e=0;ee!=t.pos-i));l.unshift(t.pos-i);let u=l.map((e=>{let t=n.nodeAt(e),r=e+i+1;return new a.xm(s.resolve(r),s.resolve(r+t.content.size))}));super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(F(n)&&F(r)&&y(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?C.rowSelection(n,r):e&&this.isColSelection()?C.colSelection(n,r):new C(n,r)}return a.Bs.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=c.get(e),n=this.$anchorCell.start(-1),a=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=a.top;n0||u>0){let e=o.attrs;l>0&&(e=w(e,0,l)),u>0&&(e=w(e,e.colspan-u,u)),o=r.lefta.bottom){let e=k(o.attrs,"rowspan",Math.min(r.bottom,a.bottom)-Math.max(r.top,a.top));o=r.top0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,a=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,a)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=c.get(e.node(-1)),a=e.start(-1),r=n.findCell(e.pos-a),i=n.findCell(t.pos-a),o=e.node(0);return r.top<=i.top?(r.top>0&&(e=o.resolve(a+n.map[r.left])),i.bottom0&&(t=o.resolve(a+n.map[i.left])),r.bottom0)return!1;let r=n+this.$anchorCell.nodeAfter.attrs.colspan,i=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(r,i)==e.width}eq(e){return e instanceof C&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=c.get(e.node(-1)),a=e.start(-1),r=n.findCell(e.pos-a),i=n.findCell(t.pos-a),o=e.node(0);return r.left<=i.left?(r.left>0&&(e=o.resolve(a+n.map[r.top*n.width])),i.right0&&(t=o.resolve(a+n.map[i.top*n.width])),r.right{t.push(o.p.node(n,n+e.nodeSize,{class:"selectedCell"}))})),o.EH.create(e.doc,t)}function E(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:a}=e;for(;1==t.childCount&&(n>0&&a>0||"table"==t.firstChild.type.spec.tableRole);)n--,a--,t=t.firstChild.content;let i=t.firstChild,o=i.type.spec.tableRole,s=i.type.schema,l=[];if("row"==o)for(let e=0;e=0;t--){let{rowspan:r,colspan:i}=a.child(t).attrs;for(let t=e;t=t.length&&t.push(r.HY.empty),n[i]t.width)for(let r=0,o=0;rt.height){let c=[];for(let e=0,a=(t.height-1)*t.width;e=t.width)&&n.nodeAt(t.map[a+e]).type==d.header_cell;c.push(r?u||(u=d.header_cell.createAndFill()):l||(l=d.cell.createAndFill()))}let h=d.row.create(null,r.HY.from(c)),f=[];for(let e=t.height;e{let o=n.selection;if(o instanceof C)return L(n,r,a.Y1.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let s=H(i,e,t);if(null==s)return!1;if("horiz"==e)return L(n,r,a.Y1.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(s),l=v(o,e,t);return i=l?a.Y1.near(l,1):t<0?a.Y1.near(n.doc.resolve(o.before(-1)),-1):a.Y1.near(n.doc.resolve(o.after(-1)),1),L(n,r,i)}}}function P(e,t){return(n,a,r)=>{let i=n.selection;if(!(i instanceof C)){let a=H(r,e,t);if(null==a)return!1;i=new C(n.doc.resolve(a))}let o=v(i.$headCell,e,t);return!!o&&L(n,a,new C(i.$anchorCell,o))}}function N(e,t){let n=e.selection;if(!(n instanceof C))return!1;if(t){let a=e.tr,i=f(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(i)||a.replace(a.mapping.map(t+1),a.mapping.map(t+e.nodeSize-1),new r.p2(i,0,0))})),a.docChanged&&t(a)}return!0}function z(e,t){let n=p(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new C(n))),!0)}function Y(e,t,n){if(!g(e.state))return!1;let a=E(n),i=e.state.selection;if(i instanceof C){a||(a={width:1,height:1,rows:[r.HY.from(S(f(e.state.schema).cell,n))]});let t=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=c.get(t).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return a=function({width:e,height:t,rows:n},a,i){if(e!=a){let t=[],i=[];for(let e=0;ea&&(i=i.type.create(w(i.attrs,i.attrs.colspan,n+i.attrs.colspan-a),i.content)),s.push(i),n+=i.attrs.colspan;for(let n=1;ni&&(t=t.type.create(k(t.attrs,"rowspan",Math.max(1,i-t.attrs.rowspan)),t.content)),s.push(t)}e.push(r.HY.from(s))}n=e,t=i}return{width:e,height:t,rows:n}}(a,s.right-s.left,s.bottom-s.top),B(e.state,e.dispatch,o,s,a),!0}if(a){let t=_(e.state),n=t.start(-1);return B(e.state,e.dispatch,n,c.get(t.node(-1)).findCell(t.pos-n),a),!0}return!1}function q(e,t){if(t.ctrlKey||t.metaKey)return;let n,a=I(e,t.target);if(t.shiftKey&&e.state.selection instanceof C)r(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&a&&null!=(n=p(e.state.selection.$anchor))&&R(e,t).pos!=n.pos)r(n,t),t.preventDefault();else if(!a)return;function r(t,n){let a=R(e,n),r=null==m.getState(e.state);if(!a||!y(t,a)){if(!r)return;a=t}let i=new C(t,a);if(r||!e.state.selection.eq(i)){let n=e.state.tr.setSelection(i);r&&n.setMeta(m,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",o),null!=m.getState(e.state)&&e.dispatch(e.state.tr.setMeta(m,-1))}function o(n){let o,s=m.getState(e.state);if(null!=s)o=e.state.doc.resolve(s);else if(I(e,n.target)!=a&&(o=R(e,t),!o))return i();o&&r(o,n)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",o)}function H(e,t,n){if(!(e.state.selection instanceof a.Bs))return null;let{$head:r}=e.state.selection;for(let a=r.depth-1;a>=0;a--){let i=r.node(a);if((n<0?r.index(a):r.indexAfter(a))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=r.before(a),o="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(o)?i:null}}return null}function I(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function R(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?p(e.state.doc.resolve(n.pos)):null}const $=new a.H$("fix-tables");function U(e,t,n,a){let r=e.childCount,i=t.childCount;e:for(let o=0,s=0;o{"table"==t.type.spec.tableRole&&(n=function(e,t,n,a){let r=c.get(t);if(!r.problems)return a;a||(a=e.tr);let i,o,s=[];for(let e=0;e0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let s=[];for(let n=0;n0?-1:0;(function(e,t,n){let a=f(t.type.schema).header_cell;for(let r=0;r0&&r0&&t.map[s-1]==l||r0?-1:0;(function(e,t,n){let a=f(t.type.schema).header_cell;for(let r=0;r0&&r0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+a),null,k(t,"rowspan",t.rowspan-1)),i+=t.colspan-1}else if(r0&&n[i]==n[i-1]||a.right0&&n[r]==n[r-e]||a.bottomn[e.type.spec.tableRole],(e,t)=>{let n,r,i=e.selection;if(i instanceof C){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;n=i.$anchorCell.nodeAfter,r=i.$anchorCell.pos}else{if(n=function(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from),!n)return!1;r=p(i.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let o=n.attrs,s=[],l=o.colwidth;o.rowspan>1&&(o=k(o,"rowspan",1)),o.colspan>1&&(o=k(o,"colspan",1));let u,d=V(e),c=e.tr;for(let e=0;e{n.attrs[e]!==t&&i.setNodeMarkup(a,null,k(n.attrs,e,t))})):i.setNodeMarkup(r.pos,null,k(r.nodeAfter.attrs,e,t)),a(i)}return!0}}function le(e,t,n){const a=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;er.table.nodeAt(e)));for(let e=0;e{const t=e+r.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,c,n.attrs)})),n(i)}return!0}}ue("row",{useDeprecatedLogic:!0}),ue("column",{useDeprecatedLogic:!0});let de=ue("cell",{useDeprecatedLogic:!0});function ce(e){return function(t,n){if(!g(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let a=e.node(-1).child(t);if(a.childCount)return n-1-a.lastChild.nodeSize;n-=a.nodeSize}}else{if(e.index()0;a--){if("table"==n.node(a).type.spec.tableRole)return t&&t(e.tr.delete(n.before(a),n.after(a)).scrollIntoView()),!0}return!1}class fe{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),me(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,me(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}}function me(e,t,n,a,r,i){let o=0,s=!0,l=t.firstChild,u=e.firstChild;for(let e=0,n=0;enew n(e,t,a),new _e(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>pe.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,a,r){let i=pe.getState(e.state);if(!i.dragging){let a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Fe(e,t,"left"):i-t.clientX<=n&&(o=Fe(e,t,"right"))}if(o!=i.activeHandle){if(!r&&-1!==o){let t=e.state.doc.resolve(o),n=t.node(-1),a=c.get(n),r=t.start(-1);if(a.colCount(t.pos-r)+t.nodeAfter.attrs.colspan-1==a.width-1)return}ye(e,o)}}}(t,n,e,0,r)},mouseleave(e){!function(e){let t=pe.getState(e.state);t.activeHandle>-1&&!t.dragging&&ye(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let a=pe.getState(e.state);if(-1==a.activeHandle||a.dragging)return!1;let r=e.state.doc.nodeAt(a.activeHandle),i=function(e,t,{colspan:n,colwidth:a}){let r=a&&a[a.length-1];if(r)return r;let i=e.domAtPos(t),o=i.node.childNodes[i.offset].offsetWidth,s=n;if(a)for(let e=0;e-1)return function(e,t){let n=[],a=e.doc.resolve(t),r=a.node(-1),i=c.get(r),s=a.start(-1),l=i.colCount(a.pos-s)+a.nodeAfter.attrs.colspan;for(let e=0;e-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);F(e.doc.resolve(n))||(n=null),t=new _e(n,t.dragging)}return t}}function Fe(e,t,n){let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a)return-1;let{pos:r}=a,i=p(e.state.doc.resolve(r));if(!i)return-1;if("right"==n)return i.pos;let o=c.get(i.node(-1)),s=i.start(-1),l=o.map.indexOf(i.pos-s);return l%o.width==0?-1:s+o.map[l-1]}function be(e,t,n){let a=t.clientX-e.startX;return Math.max(n,e.startWidth+a)}function ye(e,t){e.dispatch(e.state.tr.setMeta(pe,{setHandle:t}))}function ve(e){let t=[];for(let n=0;nnull,apply(e,t){let n=e.getMeta(m);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:a,pos:r}=e.mapping.mapResult(t);return a?null:r}},props:{decorations:D,handleDOMEvents:{mousedown:q},createSelectionBetween(e){if(null!=m.getState(e.state))return e.state.selection},handleTripleClick:z,handleKeyDown:T,handlePaste:Y},appendTransaction:(t,n,r)=>function(e,t,n){let r,i,o=(t||e).selection,s=(t||e).doc;if(o instanceof a.qv&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=C.create(s,o.from);else if("row"==i){let e=s.resolve(o.from+1);r=C.rowSelection(e,e)}else if(!n){let e=c.get(o.node),t=o.from+1,n=t+e.map[e.width*e.height-1];r=C.create(s,t+1,n)}}else o instanceof a.Bs&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(r+1)=0&&!(t.before(e+1)>t.start(e));e--,a--);return n==a&&/row|table/.test(e.node(r).type.spec.tableRole)}(o)?r=a.Bs.create(s,o.from):o instanceof a.Bs&&function({$from:e,$to:t}){let n,a;for(let t=e.depth;t>0;t--){let a=e.node(t);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){n=a;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){a=n;break}}return n!==a&&0===t.parentOffset}(o)&&(r=a.Bs.create(s,o.$from.start(),o.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,W(r,n),e)})}},11066:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(75872)),i=/^ *\[([\sx])] /i;function o(e,t){for(var n=e[t].level-1,a=t-1;a>=0;a--)if(e[a].level===n)return e[a]}function s(e,t){return"inline"===e[t].type&&function(e){return"paragraph_open"===e.type}(e[t-1])&&function(e){return"list_item_open"===e.type}(e[t-2])&&function(e){return i.test(e.content)}(e[t])}function l(e,t){if(null!=e.children){var n=function(e){return e.map?"task-item-".concat(e.map[0]):"task-item-".concat(Math.ceil(1e7*Math.random()-1e3))}(e);e.children.splice(0,0,function(e,t,n){var a=new r.default("taskListItemCheckbox","",0);t||a.attrSet("disabled","true");e.map&&a.attrSet("line",e.map[0].toString());a.attrSet("id",n);var o=i.exec(e.content);"x"===(null==o?void 0:o[1].toLowerCase())&&a.attrSet("checked","true");return a}(e,t.enabled,n)),e.children[1].content=e.children[1].content.replace(i,""),t.label&&(e.children.splice(1,0,function(e){var t=new r.default("taskListItemLabel_open","",1);return t.attrSet("id",e),t}(n)),e.children.push(new r.default("taskListItemLabel_close","",-1)))}}t.default=function(e,t){void 0===t&&(t={enabled:!1,label:!1,lineNumber:!1}),e.core.ruler.after("inline","task-lists",(function(e){return function(e,t){for(var n=e.tokens,a=2;a")},e.renderer.rules.taskListItemLabel_close=function(){return""},e.renderer.rules.taskListItemLabel_open=function(e){var t=e[0].attrGet("id");return'