/*! 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:()=>Te,II:()=>ce,I_:()=>W,JX:()=>ie,Le:()=>_,Lw:()=>g,SZ:()=>F,VH:()=>ge,WQ:()=>he,Xc:()=>E,dO:()=>ue,dl:()=>te,e2:()=>J,eA:()=>K,nA:()=>de,qK:()=>re,tp:()=>G,wb:()=>se,z2:()=>ee});var r=n(2376),a=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++]=r,e[n++]=a)}class c{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class d{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;tr&&(i+=a.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,r=[],a=0,i=null,o=[];for(let e=0,a=t*n;e=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:h-e});break}let u=a+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:m(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function A(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function F(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function b(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function y(e,t,n){let r=e.start(-1),a=d.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==a?null:e.node(0).resolve(r+a)}function T(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}function v(e,t,n=1){let r=T(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((e=>e>0))||(r.colwidth=null)),r}function D(e,t,n=1){let r=T(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.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),a=e+i+1;return new r.xm(s.resolve(a),s.resolve(a+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)),a=e.resolve(t.map(this.$headCell.pos));if(A(n)&&A(a)&&b(n,a)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?E.rowSelection(n,a):e&&this.isColSelection()?E.colSelection(n,a):new E(n,a)}return r.Bs.between(n,a)}content(){let e=this.$anchorCell.node(-1),t=d.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n0||u>0){let e=o.attrs;l>0&&(e=v(e,0,l)),u>0&&(e=v(e,e.colspan-u,u)),o=a.leftr.bottom){let e=T(o.attrs,"rowspan",Math.min(a.bottom,r.bottom)-Math.max(a.top,r.top));o=a.top0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=d.get(e.node(-1)),r=e.start(-1),a=n.findCell(e.pos-r),i=n.findCell(t.pos-r),o=e.node(0);return a.top<=i.top?(a.top>0&&(e=o.resolve(r+n.map[a.left])),i.bottom0&&(t=o.resolve(r+n.map[i.left])),a.bottom0)return!1;let a=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,i)==e.width}eq(e){return e instanceof E&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=d.get(e.node(-1)),r=e.start(-1),a=n.findCell(e.pos-r),i=n.findCell(t.pos-r),o=e.node(0);return a.left<=i.left?(a.left>0&&(e=o.resolve(r+n.map[a.top*n.width])),i.right0&&(t=o.resolve(r+n.map[i.top*n.width])),a.right{t.push(o.p.node(n,n+e.nodeSize,{class:"selectedCell"}))})),o.EH.create(e.doc,t)}function w(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,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:a,colspan:i}=r.child(t).attrs;for(let t=e;t=t.length&&t.push(a.HY.empty),n[i]t.width)for(let a=0,o=0;at.height){let d=[];for(let e=0,r=(t.height-1)*t.width;e=t.width)&&n.nodeAt(t.map[r+e]).type==c.header_cell;d.push(a?u||(u=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}let h=c.row.create(null,a.HY.from(d)),f=[];for(let e=t.height;e{let o=n.selection;if(o instanceof E)return R(n,a,r.Y1.near(o.$headCell,t));if("horiz"!=e&&!o.empty)return!1;let s=Z(i,e,t);if(null==s)return!1;if("horiz"==e)return R(n,a,r.Y1.near(n.doc.resolve(o.head+t),t));{let i,o=n.doc.resolve(s),l=y(o,e,t);return i=l?r.Y1.near(l,1):t<0?r.Y1.near(n.doc.resolve(o.before(-1)),-1):r.Y1.near(n.doc.resolve(o.after(-1)),1),R(n,a,i)}}}function L(e,t){return(n,r,a)=>{let i=n.selection;if(!(i instanceof E)){let r=Z(a,e,t);if(null==r)return!1;i=new E(n.doc.resolve(r))}let o=y(i.$headCell,e,t);return!!o&&R(n,r,new E(i.$anchorCell,o))}}function Y(e,t){let n=e.selection;if(!(n instanceof E))return!1;if(t){let r=e.tr,i=f(e.schema).cell.createAndFill().content;n.forEachCell(((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new a.p2(i,0,0))})),r.docChanged&&t(r)}return!0}function j(e,t){let n=m(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new E(n))),!0)}function I(e,t,n){if(!g(e.state))return!1;let r=w(n),i=e.state.selection;if(i instanceof E){r||(r={width:1,height:1,rows:[a.HY.from(x(f(e.state.schema).cell,n))]});let t=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=d.get(t).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=function({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;er&&(i=i.type.create(v(i.attrs,i.attrs.colspan,n+i.attrs.colspan-r),i.content)),s.push(i),n+=i.attrs.colspan;for(let n=1;ni&&(t=t.type.create(T(t.attrs,"rowspan",Math.max(1,i-t.attrs.rowspan)),t.content)),s.push(t)}e.push(a.HY.from(s))}n=e,t=i}return{width:e,height:t,rows:n}}(r,s.right-s.left,s.bottom-s.top),N(e.state,e.dispatch,o,s,r),!0}if(r){let t=_(e.state),n=t.start(-1);return N(e.state,e.dispatch,n,d.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function P(e,t){if(t.ctrlKey||t.metaKey)return;let n,r=H(e,t.target);if(t.shiftKey&&e.state.selection instanceof E)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=m(e.state.selection.$anchor))&&z(e,t).pos!=n.pos)a(n,t),t.preventDefault();else if(!r)return;function a(t,n){let r=z(e,n),a=null==p.getState(e.state);if(!r||!b(t,r)){if(!a)return;r=t}let i=new E(t,r);if(a||!e.state.selection.eq(i)){let n=e.state.tr.setSelection(i);a&&n.setMeta(p,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",o),null!=p.getState(e.state)&&e.dispatch(e.state.tr.setMeta(p,-1))}function o(n){let o,s=p.getState(e.state);if(null!=s)o=e.state.doc.resolve(s);else if(H(e,n.target)!=r&&(o=z(e,t),!o))return i();o&&a(o,n)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",o)}function Z(e,t,n){if(!(e.state.selection instanceof r.Bs))return null;let{$head:a}=e.state.selection;for(let r=a.depth-1;r>=0;r--){let i=a.node(r);if((n<0?a.index(r):a.indexAfter(r))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=a.before(r),o="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(o)?i:null}}return null}function H(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function z(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?m(e.state.doc.resolve(n.pos)):null}const U=new r.H$("fix-tables");function $(e,t,n,r){let a=e.childCount,i=t.childCount;e:for(let o=0,s=0;o{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){let a=d.get(t);if(!a.problems)return r;r||(r=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 r=f(t.type.schema).header_cell;for(let a=0;a0&&a0&&t.map[s-1]==l||a0?-1:0;(function(e,t,n){let r=f(t.type.schema).header_cell;for(let a=0;a0&&a0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,T(t,"rowspan",t.rowspan-1)),i+=t.colspan-1}else if(a0&&n[i]==n[i-1]||r.right0&&n[a]==n[a-e]||r.bottomn[e.type.spec.tableRole],(e,t)=>{let n,a,i=e.selection;if(i instanceof E){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;n=i.$anchorCell.nodeAfter,a=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;a=m(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=T(o,"rowspan",1)),o.colspan>1&&(o=T(o,"colspan",1));let u,c=q(e),d=e.tr;for(let e=0;e{n.attrs[e]!==t&&i.setNodeMarkup(r,null,T(n.attrs,e,t))})):i.setNodeMarkup(a.pos,null,T(a.nodeAfter.attrs,e,t)),r(i)}return!0}}function le(e,t,n){const r=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;ea.table.nodeAt(e)));for(let e=0;e{const t=e+a.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)})),n(i)}return!0}}ue("row",{useDeprecatedLogic:!0}),ue("column",{useDeprecatedLogic:!0});let ce=ue("cell",{useDeprecatedLogic:!0});function de(e){return function(t,n){if(!g(t))return!1;let a=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 r=e.node(-1).child(t);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(e.index()0;r--){if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).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")),pe(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,pe(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}}function pe(e,t,n,r,a,i){let o=0,s=!0,l=t.firstChild,u=e.firstChild;for(let e=0,n=0;enew n(e,t,r),new _e(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>me.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,a){let i=me.getState(e.state);if(!i.dragging){let r=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(r){let{left:a,right:i}=r.getBoundingClientRect();t.clientX-a<=n?o=Ae(e,t,"left"):i-t.clientX<=n&&(o=Ae(e,t,"right"))}if(o!=i.activeHandle){if(!a&&-1!==o){let t=e.state.doc.resolve(o),n=t.node(-1),r=d.get(n),a=t.start(-1);if(r.colCount(t.pos-a)+t.nodeAfter.attrs.colspan-1==r.width-1)return}be(e,o)}}}(t,n,e,0,a)},mouseleave(e){!function(e){let t=me.getState(e.state);t.activeHandle>-1&&!t.dragging&&be(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=me.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let a=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,{colspan:n,colwidth:r}){let a=r&&r[r.length-1];if(a)return a;let i=e.domAtPos(t),o=i.node.childNodes[i.offset].offsetWidth,s=n;if(r)for(let e=0;e-1)return function(e,t){let n=[],r=e.doc.resolve(t),a=r.node(-1),i=d.get(a),s=r.start(-1),l=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);A(e.doc.resolve(n))||(n=null),t=new _e(n,t.dragging)}return t}}function Ae(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:a}=r,i=m(e.state.doc.resolve(a));if(!i)return-1;if("right"==n)return i.pos;let o=d.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 Fe(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function be(e,t){e.dispatch(e.state.tr.setMeta(me,{setHandle:t}))}function ye(e){let t=[];for(let n=0;nnull,apply(e,t){let n=e.getMeta(p);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:a}=e.mapping.mapResult(t);return r?null:a}},props:{decorations:k,handleDOMEvents:{mousedown:P},createSelectionBetween(e){if(null!=p.getState(e.state))return e.state.selection},handleTripleClick:j,handleKeyDown:O,handlePaste:I},appendTransaction:(t,n,a)=>function(e,t,n){let a,i,o=(t||e).selection,s=(t||e).doc;if(o instanceof r.qv&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)a=E.create(s,o.from);else if("row"==i){let e=s.resolve(o.from+1);a=E.rowSelection(e,e)}else if(!n){let e=d.get(o.node),t=o.from+1,n=t+e.map[e.width*e.height-1];a=E.create(s,t+1,n)}}else o instanceof r.Bs&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(a+1)=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(a).type.spec.tableRole)}(o)?a=r.Bs.create(s,o.from):o instanceof r.Bs&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;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){r=n;break}}return n!==r&&0===t.parentOffset}(o)&&(a=r.Bs.create(s,o.$from.start(),o.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}(a,G(a,n),e)})}},11066:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var a=r(n(75872)),i=/^ *\[([\sx])] /i;function o(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return e[r]}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 r=new a.default("taskListItemCheckbox","",0);t||r.attrSet("disabled","true");e.map&&r.attrSet("line",e.map[0].toString());r.attrSet("id",n);var o=i.exec(e.content);"x"===(null==o?void 0:o[1].toLowerCase())&&r.attrSet("checked","true");return r}(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 a.default("taskListItemLabel_open","",1);return t.attrSet("id",e),t}(n)),e.children.push(new a.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,r=2;r")},e.renderer.rules.taskListItemLabel_close=function(){return""},e.renderer.rules.taskListItemLabel_open=function(e){var t=e[0].attrGet("id");return'