Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress/kendo-editor-common

Package Overview
Dependencies
Maintainers
1
Versions
375
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress/kendo-editor-common - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0-dev.201908051032

dist/es/config/keymap.js

2

dist/cdn/js/kendo-editor-common.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("tslib"),require("prosemirror-schema-list"),require("prosemirror-commands"),require("prosemirror-history")):"function"==typeof define&&define.amd?define(["prosemirror-model","prosemirror-state","prosemirror-transform","tslib","prosemirror-schema-list","prosemirror-commands","prosemirror-history"],t):"object"==typeof exports?exports.KendoEditorCommon=t(require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("tslib"),require("prosemirror-schema-list"),require("prosemirror-commands"),require("prosemirror-history")):e.KendoEditorCommon=t(e["prosemirror-model"],e["prosemirror-state"],e["prosemirror-transform"],e.tslib,e["prosemirror-schema-list"],e["prosemirror-commands"],e["prosemirror-history"])}(this,function(e,t,r,n,o,s,i){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.getHtml=n.getHtml,t.setHtml=n.setHtml;var o=r(4);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var s=r(8);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var i=r(9);t.insertText=i.insertText;var a=r(10);t.insertImage=a.insertImage;var l=r(11);t.alignBlocks=l.alignBlocks;var c=r(12);t.formatBlockElements=c.formatBlockElements;var u=r(14);t.indent=u.indent,t.outdent=u.outdent;var d=r(18);t.toggleOrderedList=d.toggleOrderedList,t.toggleUnorderedList=d.toggleUnorderedList;var f=r(20);t.redo=f.redo,t.undo=f.undo},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(3);t.createContentNode=function(e,t,r){var o=document.createElement("div");return o.innerHTML=e,n.DOMParser.fromSchema(t).parse(o,r)},t.getHtml=function(e){var t=n.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),r=document.createElement("div");return r.appendChild(t),r.innerHTML},t.setHtml=function(e,r,n){return void 0===r&&(r="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(s,i){return i(s.tr.setSelection(new o.AllSelection(s.doc)).replaceSelectionWith(t.createContentNode(e,s.schema,n)).setMeta("commandName",r))}}},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(6),s=r(7);t.changeStyleFromMark=function(e,t){var r=e.find(function(e){return"style"===e.type.name}),n=r&&r.attrs.style;return o.changeStyles(n,t)},t.changeStyleMark=function(e,r,o,s,i){var a=i.create({style:s.style}),l=[],c=[],u=null,d=null;return e.doc.nodesBetween(r,o,function(e,f,p){if(e.isInline){var m=e.marks;if(!a.isInSet(m)&&p.type.allowsMarkType(a.type)){var v=Math.max(f,r),h=Math.min(f+e.nodeSize,o),y=t.changeStyleFromMark(m,s);if(y.changed||s.newValue){for(var g=y.changed?{style:y.style}:{style:[s.style]+": "+s.newValue+";"},k=i.create(g),M=k.addToSet(m),S=0;S<m.length;S++)m[S].isInSet(M)||(u&&u.to===v&&u.mark.eq(m[S])?u.to=h:(u=new n.RemoveMarkStep(v,h,m[S]),l.push(u)));var I=d&&d.to===v,b=I&&k.attrs.style===d.mark.attrs.style;I&&b?d.to=h:k.attrs.style&&(d=new n.AddMarkStep(v,h,k),c.push(d))}}}}),l.forEach(function(t){return e.step(t)}),c.forEach(function(t){return e.step(t)}),l.length+c.length>0},t.hasStyle=function(e,r){var n=e.selection,o=n.from,s=n.$from,i=n.to,a=n.empty,l=!1,c={style:r.name,value:r.value};return a?l=t.changeStyleFromMark(e.storedMarks||s.marks(),c).changed:e.doc.nodesBetween(o,i,function(e,r,n){!l&&e.isInline&&(l=t.changeStyleFromMark(e.marks,c).changed)}),l},t.getInlineStyles=function(e,r){var n,o=e.selection,s=o.from,i=o.$from,a=o.to,l=o.empty,c=[],u={style:r.name,value:r.value};return l?(n=t.changeStyleFromMark(e.storedMarks||i.marks(),u),n.changed&&(c=n.styleMatches)):e.doc.nodesBetween(s,a,function(e,r,o){e.isInline&&(n=t.changeStyleFromMark(e.marks,u),n.changed?c.push.apply(c,n.styleMatches):c.push(null))}),c.filter(function(e){return null!==e})},t.changeStyle=function(e,r){return function(n,o,i){var a=n.selection,l=a.empty,c=a.$cursor,u=a.ranges;if(l&&!c||!s.markApplies(n.doc,u,e))return!1;var d=!1;if(o)if(i=i||n.tr,c){var f=n.storedMarks||c.marks();if(e.isInSet(f)){var p=t.changeStyleFromMark(f,r);o(i.removeStoredMark(e)),o(i.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<u.length;m++){var v=u[m],h=v.$from,y=v.$to;d=t.changeStyleMark(i,h.pos,y.pos,r,e)}d&&(i.scrollIntoView(),o(i))}return d}},t.toggleInlineFormat=function(e,r,n){return function(o,i){var a=o.schema.marks,l=e.altStyle,c=e.altMarks,u=void 0===c?[]:c,d=e.mark;r=r||o.tr;var f=!1,p=!1,m=function(){return p=!0};if(l&&a.style){var v=a.style,h=t.changeStyle(v,{style:l.name,value:l.value});f=h(o,m,r)}var y=[d].concat(u).filter(function(e){return a[e]}),g=y.map(function(e){return s.hasMark(o,{mark:e})&&a[e]}).filter(function(e){return e});return g.length?s.removeMarks(g,o,m,r):f||s.toggleMark(a[d],n,r)(o,m),p&&i(r),p}},t.applyInlineStyle=function(e,r){return function(n,o){var s=n.schema.marks,i=t.changeStyle(s.style,{style:e.style,value:/^.+$/,newValue:e.value}),a=n.tr;return r&&(a.setMeta("commandName",r),a.setMeta("args",e)),i(n,o,a)}}},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(7),s=r(4);t.changeStyles=function(e,t){var r=t.style,n=t.value,o=t.newValue,s=[];if(e){var i=e.split(/\s*;\s*/).filter(function(e){return e}),a=i.filter(function(e){if(!e.toLowerCase().trim().startsWith(r))return!0;var t=e.split(":")[1].trim();return!n.test(t)||(s.push(t),!1)});return o&&a.push(r+": "+o),{style:a.join("; ")+(a.length?";":""),changed:!!o||a.length!==i.length,styleMatches:s}}return{changed:!1,styleMatches:s,style:null}},t.changeStyle=function(e,t){return function(r,n,i){var a=r.selection,l=a.empty,c=a.$cursor,u=a.ranges;if(l&&!c||!o.markApplies(r.doc,u,e))return!1;var d=!1;if(n)if(i=i||r.tr,c){var f=r.storedMarks||c.marks();if(e.isInSet(f)){var p=s.changeStyleFromMark(f,t);n(i.removeStoredMark(e)),n(i.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<u.length;m++){var v=u[m],h=v.$from,y=v.$to;d=s.changeStyleMark(i,h.pos,y.pos,t,e)}d&&(i.scrollIntoView(),n(i))}return d}},t.canInsert=function(e,t){for(var r=e.selection.$from,n=r.depth;n>=0;n--){var o=r.index(n);if(r.node(n).canReplaceWith(o,o,t))return!0}return!1},t.getTypeName=function(e){return e instanceof n.Node?e.type.name:e.name},t.findParentNode=function(e){return function(t){for(var r=t.$from,n=r.depth;n>0;n--){var o=r.node(n);if(e(o))return{depth:n,node:o}}}},t.findNthParentNode=function(e,t){return void 0===t&&(t=1),function(r){for(var n=r.$from,o=n.depth;o>0;o--){var s=n.node(o);if(e(s)&&(t-=1,0===t))return{depth:o,node:s}}}},t.findNthParentNodeOfType=function(e,r){return void 0===r&&(r=1),function(n){return t.findNthParentNode(function(r){return t.getTypeName(r)===t.getTypeName(e)},r)(n)}},t.insertNode=function(e,t){return function(r,n){var o=r.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),n(o)}},t.createTable=function(e,t,r){for(var n=e.table,o=e.table_row,s=e.table_cell,i=[],a=[],l=0;l<t+1;l++){a.length=0;for(var c=0;c<r+1;c++)a.push(s.createAndFill());i.push(o.createAndFill(void 0,a))}return n.createAndFill(void 0,i)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(2),s=r(4);t.markApplies=function(e,t,r){for(var n=function(n){var o=t[n],s=o.$from,i=o.$to,a=0===s.depth&&e.type.allowsMarkType(r);if(e.nodesBetween(s.pos,i.pos,function(e){return!a&&void(a=e.inlineContent&&e.type.allowsMarkType(r))}),a)return{v:!0}},o=0;o<t.length;o++){var s=n(o);if(s)return s.v}return!1},t.toggleMark=function(e,r,n){return function(o,s){var i=o.selection,a=i.empty,l=i.$cursor,c=i.ranges;if(a&&!l||!t.markApplies(o.doc,c,e))return!1;if(s)if(l)s(e.isInSet(o.storedMarks||l.marks())?n.removeStoredMark(e):n.addStoredMark(e.create(r)));else{for(var u=!1,d=0;!u&&d<c.length;d++){var f=c[d],p=f.$from,m=f.$to;u=o.doc.rangeHasMark(p.pos,m.pos,e)}for(var d=0;d<c.length;d++){var v=c[d],p=v.$from,m=v.$to;u?n.removeMark(p.pos,m.pos,e):n.addMark(p.pos,m.pos,e.create(r))}s(n.scrollIntoView())}return!0}},t.removeMark=function(e,t,r,s){void 0===s&&(s=null);var i=[],a=0;return e.doc.nodesBetween(t,r,function(e,n){if(e.isInline){a++;var l=null;if(s instanceof o.MarkType){var c=s.isInSet(e.marks);c&&(l=[c])}else s?s.isInSet(e.marks)&&(l=[s]):l=e.marks;if(l&&l.length)for(var u=Math.min(n+e.nodeSize,r),d=0;d<l.length;d++){for(var f=l[d],p=void 0,m=0;m<i.length;m++){var v=i[m];v.step===a-1&&f.eq(v.style)&&(p=v)}p?(p.to=u,p.step=a):i.push({style:f,from:Math.max(n,t),to:u,step:a})}}}),i.forEach(function(t){return e.step(new n.RemoveMarkStep(t.from,t.to,t.style))}),e},t.removeMarks=function(e,r,n,o){var s=r.selection,i=s.$cursor,a=s.ranges;if(o=o||r.tr,i)e.forEach(function(e){e.isInSet(r.storedMarks||i.marks())&&n(o.removeStoredMark(e))});else{for(var l=function(r){var n=a[r],s=n.$from,i=n.$to;e.forEach(function(e){t.removeMark(o,s.pos,i.pos,e)})},c=0;c<a.length;c++)l(c);n(o.scrollIntoView())}return!0};var i=function(e){return e instanceof Array?e:[e]};t.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,r=void 0===t?[]:t;return function(e,t){var n=e.schema,o=e.selection,s=o.$cursor,a=o.from,l=o.to,c=e.tr,u=i(r).map(function(e){return e.name});s||(Object.keys(n.marks).map(function(e){return n.marks[e]}).filter(function(e){return u.indexOf(e.name)===-1}).forEach(function(e){return c.removeMark(a,l,e)}),t(c))}},t.getParentMark=function(e,t){var r=e.selection,n=r.from,o=r.$from,s=r.to,i=r.empty,a=e.doc;if(i)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return a.nodesBetween(n,s,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},t.hasMark=function(e,t){var r,n=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return n[e]}),i=t.altStyle,a=e.selection,l=a.from,c=a.$from,u=a.to,d=a.empty,f=n[t.mark],p=e.doc,m=!1;return d?(r=e.storedMarks||c.marks(),m=f&&f.isInSet(r)||o.some(function(e){return n[e].isInSet(r)})):m=f&&p.rangeHasMark(l,u,f)||o.some(function(e){return p.rangeHasMark(l,u,n[e])}),!m&&i?s.hasStyle(e,i):!!m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(7),s=r(3),i=function(e,t){return function(r,n){var o=r.selection,s=o.$cursor,i=o.from,a=o.to,l=r.schema.marks[e.mark];if(s){var c=s.parent,u=s.index(),d=c.child(u).marks.find(function(e){return e.type===l}),f=c.childCount,p=s.pos-s.textOffset,m=c.child(u).nodeSize,v=void 0,h=void 0;for(v=u-1;v>=0&&d.isInSet(c.child(v).marks);)h=c.child(v).nodeSize,m+=h,p-=h,v-=1;for(v=u+1;v<f&&d.isInSet(c.child(v).marks);)m+=c.child(v).nodeSize,v+=1;t.removeMark(p,p+m,l),t.addMark(p,p+m,l.create(e.attrs)),n(t)}else t.doc.nodesBetween(i,a,function(r,o){r.isInline&&l.isInSet(r.marks)&&(t.removeMark(o,o+r.nodeSize,l),t.addMark(o,o+r.nodeSize,l.create(e.attrs)),n(t))})}};t.removeLink=function(e,t){return function(r,s){var i=r.selection.$cursor;if(i){var a=i.parent,l=i.index(),c=r.schema.marks[e.mark],u=a.child(l).marks.find(function(e){return e.type===c}),d=a.childCount,f=i.pos-i.textOffset,p=a.child(l).nodeSize,m=void 0,v=void 0;for(m=l-1;m>=0&&u.isInSet(a.child(m).marks);)v=a.child(m).nodeSize,p+=v,f-=v,m-=1;for(m=l+1;m<d&&u.isInSet(a.child(m).marks);)p+=a.child(m).nodeSize,m+=1;s(o.removeMark(t||r.tr,f,f+p,u))}else n.toggleInlineFormat(e,t)(r,s)}},t.applyLink=function(e,r){var a=e.mark,l=e.attrs;return function(e,c){var u=e.schema.marks,d=e.tr;r&&(d.setMeta("commandName",r),d.setMeta("args",l));var f=!1,p=function(){return f=!0};if(o.getParentMark(e,u[a]))i({mark:a,attrs:l},d)(e,p);else{var m=e;o.hasMark(e,{mark:a})&&(t.removeLink({mark:a,attrs:l},d)(e,p),m=s.EditorState.create({doc:d.doc,selection:d.selection})),f?o.toggleMark(u[a],l,d)(m,p):n.toggleInlineFormat({mark:a},d,l)(m,p)}return f&&c(d),f}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,r){r(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);t.insertImage=function(e){return function(t,r){var o=t.schema.nodes.image,s="insertImage",i=o.createAndFill(e);n.insertNode({state:t,dispatch:function(t){return r(t.setMeta("commandName",s).setMeta("args",e))}},i)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12);t.alignBlocks=function(e){return function(t,r){var o=n.blockNodes(t),s=t.tr,i=!1;return o.forEach(function(o){if(o.type.isTextblock){var a={},l=e.find(function(e){return e.node===o.type.name});l&&(a=n.addStyles(o,l.style)),i=n.changeBlockNode(t,r,s,o,o.type,a)||i}}),i&&r(s.scrollIntoView()),i}},t.isAligned=function(e,t){var r=n.blockNodes(e),o=!1;return r.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find(function(t){return t.node===e.type.name});r&&(o=r.style.every(function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)}))}}),o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=r(6),s=r(5),i=r(2),a=r(3),l=function(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)};t.changeBlockNode=function(e,t,r,n,o,a){var c=e.selection,u=c.from,d=c.to,f=!1;if(e.doc.nodesBetween(u,d,function(t,r){if(f)return!1;if(t.isTextblock&&!t.hasMarkup(o,a))if(t.type===o)f=!0;else{var n=e.doc.resolve(r),s=n.index();f=n.parent.canReplaceWith(s,s+1,o)}}),!f)return!1;if(t){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var p=r.steps.length;r.doc.nodesBetween(u,d,function(e,t){if(e.eq(n)&&e.isTextblock&&!e.hasMarkup(o,a)&&l(r.doc,r.mapping.slice(p).map(t),o)){r.clearIncompatible(r.mapping.slice(p).map(t,1),o);var c=r.mapping.slice(p),u=c.map(t,1),d=c.map(t+e.nodeSize,1),f=new i.Slice(i.Fragment.from(o.create(a,null,e.marks)),0,0);return r.step(new s.ReplaceAroundStep(u,d,u+1,d-1,f,1,!0)),!1}})}return!0},t.blockNodes=function(e){var t=e.selection,r=t.from,n=t.to,o=t.$from,s=[];return t.node?t.node.isBlock?s.push(t.node):o.parent&&o.parent.isBlock&&s.push(o.parent):e.doc.nodesBetween(r,n,function(e){e.isBlock&&s.push(e)}),s},t.formatBlockElements=function(e,r){return function(o,s){var i=t.blockNodes(o),a=o.schema.nodes,l=!1,c=o.tr;return c.setMeta("commandName",r),c.setMeta("args",{value:e}),i.forEach(function(r){if(r.type.isTextblock)if("p"===e){var i=r.attrs,u=i.level,d=n.__rest(i,["level"]);l=t.changeBlockNode(o,s,c,r,a.paragraph,d)||l}else if(/^h[1-6]$/i.test(e)){var u=parseInt(e.substr(1),10);l=t.changeBlockNode(o,s,c,r,a.heading,n.__assign({},r.attrs,{level:u}))||l}}),l&&s(c.scrollIntoView()),l}},t.getBlockFormats=function(e){var r=t.blockNodes(e),n=e.schema.nodes,o=[];return r.forEach(function(e){if(e.type===n.paragraph)o.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){o.push("h"+t);break}}),o},t.addStyles=function(e,t){var r=e.attrs.style,n=null,s=null;r&&t.forEach(function(e){s={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStyles(r,s),r=n.changed?n.style:r});var i=function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""};return r=r||t.reduce(i,""),Object.assign({},e.attrs,{style:r||null})},t.hasNode=function(e,t){var r=e.selection,n=r.from,o=r.to,s=!1;return e.doc.nodesBetween(n,o,function(e){return s=s||e.type===t,!s}),s};var c=function(e,t){return Object.keys(e).filter(function(e){return t(e)}).reduce(function(t,r){return Object.assign(t,(n={},n[r]=e[r],n));var n},{})},u=function(e){var t=function(t){return null!==e[t]&&void 0!==e[t]&&""!==e[t]};return c(e,t)};t.getNodeTagName=function(e,t){var r,n=e.type.spec.parseDOM||[],o=e.attrs;return r=1===n.length?n[0]:n.find(function(r){var n=i.DOMSerializer.fromSchema(t).serializeNode(e);return JSON.stringify(r.getAttrs(n))===JSON.stringify(u(o))}),r?r.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},t.activeNode=function(e){var r,n=e.schema.nodes.doc;if(e.selection instanceof a.AllSelection)r=e.doc;else if(e.selection instanceof a.TextSelection){var s=e.selection.$anchor,i=s.node(s.blockRange().depth),l=o.getTypeName(i)===o.getTypeName(n);r=l?s.node():i}else e.selection instanceof a.NodeSelection&&(r=e.selection.node);return{name:o.getTypeName(r),tag:t.getNodeTagName(r,e.schema)}}},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15),o=r(16),s=r(12),i=r(6);t.indentBlocks=function(e,t,r){return function(n,o){var i=s.blockNodes(n),a=n.tr,l=!1;return a.setMeta("commandName",t),i.forEach(function(t){if(t.type.isTextblock){var i=void 0,c=e.find(function(e){return e.node===t.type.name});if(c){var u="rtl"===r?c.rtlStyle:c.style,d={name:u,value:c.step>0?""+c.step+c.unit:""};if(t.attrs.style){var f=new RegExp(u+":\\s?(\\d+)"+c.unit,"i"),p=t.attrs.style.match(f);if(p){var m=parseFloat(p[1])+c.step;m=m<=0?"":m,d.value=""+m+(m?c.unit:"")}}i=s.addStyles(t,[d])}i&&(l=s.changeBlockNode(n,o,a,t,t.type,i)||l)}}),l&&o(a.scrollIntoView()),l}},t.isIndented=function(e,t,r){var n=s.blockNodes(e),o=!1;return n.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find(function(t){return t.node===e.type.name});if(n){var s="rtl"===r?n.rtlStyle:n.style,i=new RegExp(s+":\\s?\\d+"+n.unit,"i");o=i.test(e.attrs.style)}}}),o},t.canIndentAsListItem=function(e,t){return n.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var r=t.listsTypes.listItem,o=!!i.findNthParentNodeOfType(t.listsTypes.orderedList,2)(e.selection),s=!!i.findNthParentNodeOfType(t.listsTypes.bulletList,2)(e.selection);return(o||s)&&n.liftListItem(r)(e)},t.canBeIndented=function(e,r){var n=e.schema.nodes;return(t.isIndented(e,r.nodes)||o.indentRules.nodes.some(function(t){return n[t.node]&&s.hasNode(e,n[t.node])}))&&!s.hasNode(e,o.indentRules.listsTypes.listItem)},t.indent=function(e,r){var s=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,o.indentRules.listsTypes.listItem)?n.sinkListItem(o.indentRules.listsTypes.listItem)(e,r):s&&t.indentBlocks(o.indentRules.nodes)(e,r)},t.outdent=function(e,r){var s=t.canBeIndented(e,o.outdentRules);t.canOutdentAsListItem(e,o.outdentRules)?n.liftListItem(o.outdentRules.listsTypes.listItem)(e,r):s&&t.indentBlocks(o.outdentRules.nodes)(e,r)}},function(e,t){e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=r(17);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:n.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:n.__assign({},t.listsTypes)}},function(e,t,r){"use strict";function n(e,r,n){var o=e.selection,s=o.from,i=o.to,a=e.schema.nodes,l=a.paragraph,c=a.heading,u=[];r.doc.nodesBetween(s,i,function(e,t){e.type!==l&&e.type!==c||u.push({node:e,pos:t})});for(var d=u.length-1;d>=0;d--){var f=u[d],p=r.doc.resolve(r.mapping.map(f.pos));if(p.depth>0){var m=void 0;m=f.node.textContent&&f.node.textContent.length>0?r.doc.resolve(r.mapping.map(f.pos+f.node.textContent.length)):r.doc.resolve(r.mapping.map(f.pos+1));var v=p.blockRange(m);v&&r.lift(v,t.getListLiftTarget(e.schema,p,n))}}return r}function o(e){return function(t,r,n){if(!n)return!1;t=n.state;var o=t.schema.nodes[e.listType],s=t.selection,i=s.$from,l=s.$to,c=i.node(-2),f=i.node(-3),p=a(t.doc,i,l,o);return(c&&c.type===o||f&&f.type===o)&&p?u(e)(t,r):(p||(u(e)(t,r),t=n.state),d(o)(t,r))}}function s(e,t,r,n){n||(n=e.schema.nodes.listItem);var o=t.$from,s=t.$to,i=o.blockRange(s,function(e){return e.childCount&&e.firstChild.type===n});if(!i||i.depth<2||o.node(i.depth-1).type!==n)return r;var a=i.end,l=s.end(i.depth);return a<l&&(r.step(new h.ReplaceAroundStep(a-1,l,a,l,new m.Slice(m.Fragment.from(n.create(void 0,i.parent.copy())),1,0),1,!0)),i=new m.NodeRange(r.doc.resolve(o.pos),r.doc.resolve(l),i.depth)),r.lift(i,h.liftTarget(i)).scrollIntoView()}function i(e,t,r,n,o,i){i||(i=e.schema.nodes.listItem);var a=!1;return o.doc.nodesBetween(t,r,function(r,l){if(!a&&r.type===i&&l>t){a=!0;for(var c=n+3;c>n+2;){var u=o.doc.resolve(o.mapping.map(l));c=u.depth;var d=o.doc.resolve(o.mapping.map(l+r.textContent.length)),f=new v.TextSelection(u,d);o=s(e,f,o,i)}}}),o}function a(e,t,r,n){return 0===l(e,t,r).filter(function(e){return e.type!==n}).length}function l(e,t,r){for(var n=Array(),o=c(e,t).depth,s=e.resolve(t.start(o));s.pos<=r.start(r.depth);){var i=Math.min(s.depth,o),a=s.node(i);if(a&&n.push(a),0===i)break;var l=e.resolve(s.after(i));if(l.start(i)>=e.nodeSize-2)break;l.depth!==s.depth&&(l=e.resolve(l.pos+2)),s=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return n}function c(e,t){var r=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var n=t.node(t.depth),o=t;t.depth>=1;)t=e.resolve(t.before(t.depth)),n=t.node(t.depth),n&&r.indexOf(n.type.name)!==-1&&(o=t);return o}function u(e){return function(t,r){var n=t.tr,o=t.selection,s=o.$from,i=o.$to;return n.doc.nodesBetween(s.pos,i.pos,function(r,o){if(r.isTextblock||"blockquote"===r.type.name||"div"===r.type.name){var s=new v.NodeSelection(n.doc.resolve(n.mapping.map(o))),i=s.$from.blockRange(s.$to);if(!i||s.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var a=i&&h.liftTarget(i);if(void 0===a||null===a)return!1;n.lift(i,a)}}),r&&r(n),!0}}function d(e){return y.autoJoin(g.wrapInList(e),function(t,r){return t.type===r.type&&t.type===e})}function f(e,r,n){return t.toggleList(e,r,n,{listType:"bulletList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})}function p(e,r,n){return t.toggleList(e,r,n,{listType:"orderedList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})}Object.defineProperty(t,"__esModule",{value:!0});var m=r(2),v=r(3),h=r(5),y=r(19),g=r(15),k=r(15);t.rootListDepth=function(e,t){for(var r,n=t.bulletList,o=t.orderedList,s=t.listItem,i=e.depth-1;i>0;i--){var a=e.node(i);if(a.type!==n&&a.type!==o||(r=i),a.type!==n&&a.type!==o&&a.type!==s)break}return r},t.getListLiftTarget=function(e,t,r){for(var n=t.depth,o=e.nodes[r.bulletList],s=e.nodes[r.orderedList],i=e.nodes[r.listItem],a=t.depth;a>0;a--){var l=t.node(a);if(l.type!==o&&l.type!==s||(n=a),l.type!==o&&l.type!==s&&l.type!==i)break}return n-1},t.liftSelectionList=n,t.toggleList=function(e,r,s,a,l){var c=a.listType,u=e.selection,d=u.$from.node(u.$from.depth-2),f=u.$to.node(u.$to.depth-2);if(d&&d.type.name===c&&f&&f.type.name===c){var p=s.state.schema.nodes,m={bulletList:p[a.bulletList],orderedList:p[a.orderedList],listItem:p[a.listItem]},v=t.rootListDepth(u.$to,m),h=i(e,u.$to.pos,u.$to.end(v),v,s.state.tr,m.listItem);return h=n(e,h,a),h.setMeta("commandName",l),r(h),!0}return o(a)(e,r,s)},t.toggleListCommand=o,t.liftFollowingList=i,t.isRangeOfType=a,t.getAncestorNodesBetween=l,t.findAncestorPosition=c,t.liftListItems=u,t.wrapInList=d,t.toggleUnorderedList=f,t.toggleOrderedList=p,t.splitListItemKeepMarks=function(e){return function(t,r){return k.splitListItem(e)(t,function(e){var n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();n&&e.ensureMarks(n),r(e)})}}},function(e,t){e.exports=s},function(e,t){e.exports=i}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prosemirror-state"),require("prosemirror-model"),require("tslib"),require("prosemirror-transform"),require("prosemirror-schema-list"),require("prosemirror-tables"),require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules")):"function"==typeof define&&define.amd?define(["prosemirror-state","prosemirror-model","tslib","prosemirror-transform","prosemirror-schema-list","prosemirror-tables","prosemirror-commands","prosemirror-history","prosemirror-inputrules"],t):"object"==typeof exports?exports.KendoEditorCommon=t(require("prosemirror-state"),require("prosemirror-model"),require("tslib"),require("prosemirror-transform"),require("prosemirror-schema-list"),require("prosemirror-tables"),require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules")):e.KendoEditorCommon=t(e["prosemirror-state"],e["prosemirror-model"],e.tslib,e["prosemirror-transform"],e["prosemirror-schema-list"],e["prosemirror-tables"],e["prosemirror-commands"],e["prosemirror-history"],e["prosemirror-inputrules"])}(window,function(e,t,r,n,o,s,a,i,l){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=16)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(0),s=r(6),a=r(9),i=r(4);t.changeStyles=function(e,t){var r=t.style,n=t.value,o=t.newValue,s=[];if(e){var a=e.split(/\s*;\s*/).filter(function(e){return e}),i=a.filter(function(e){if(!e.toLowerCase().trim().startsWith(r))return!0;var t=e.split(":")[1].trim();return!n.test(t)||(s.push(t),!1)});return o&&i.push(r+": "+o),{style:i.join("; ")+(i.length?";":""),changed:!!o||i.length!==a.length,styleMatches:s}}return{changed:!1,styleMatches:s,style:null}},t.changeStyle=function(e,t){return function(r,n,o){var a=r.selection,l=a.empty,u=a.$cursor,c=a.ranges;if(l&&!u||!s.markApplies(r.doc,c,e))return!1;var d=!1;if(n)if(o=o||r.tr,u){var f=r.storedMarks||u.marks();if(e.isInSet(f)){var p=i.changeStyleFromMark(f,t);n(o.removeStoredMark(e)),n(o.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<c.length;m++){var g=c[m],v=g.$from,h=g.$to;d=i.changeStyleMark(o,v.pos,h.pos,t,e)}d&&(o.scrollIntoView(),n(o))}return d}},t.canInsert=function(e,t){for(var r=e.selection.$from,n=r.depth;n>=0;n--){var o=r.index(n);if(r.node(n).canReplaceWith(o,o,t))return!0}return!1},t.getTypeName=function(e){return e instanceof n.Node?e.type.name:e.name},t.findParentNode=function(e){return function(t){for(var r=t.$from,n=r.depth;n>0;n--){var o=r.node(n);if(e(o))return{depth:n,node:o}}}},t.findNthParentNode=function(e,t){return void 0===t&&(t=1),function(r){for(var n=r.$from,o=n.depth;o>0;o--){var s=n.node(o);if(e(s)&&0===(t-=1))return{depth:o,node:s}}}},t.findNthParentNodeOfType=function(e,r){return void 0===r&&(r=1),function(n){return t.findNthParentNode(function(r){return t.getTypeName(r)===t.getTypeName(e)},r)(n)}},t.insertNode=function(e,t){return function(r,n){var o=r.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),n(o)}},t.isNullOrUndefined=function(e){return null==e},t.safeString=function(e){return t.isNullOrUndefined(e)?"":e.toString()},t.createContentNode=function(e){var r=document.createElement("div");return r.innerHTML=t.safeString(e).trim(),n.DOMParser.fromSchema(new n.Schema({nodes:a.nodes,marks:a.marks})).parse(r)},t.hasSameMarkup=function(e,r){var o=n.Fragment.from(t.createContentNode(e)),s=n.Fragment.from(t.createContentNode(r));return o.eq(s)},t.first=function(e){return e[0]},t.last=function(e){return e[e.length-1]},t.split=function(e){return function(t){return t.split(e)}},t.trim=function(e){return e.trim()},t.filter=function(e){return function(t){return t.filter(e)}},t.getUniqueStyleValues=function(e,r){if(e.hasNodesWithoutMarks)return"";var n=e.marks.filter(function(e){return"style"===e.type.name}).map(function(e){return e.attrs.style}).map(t.split(";")).map(t.filter(function(e){return e.includes(r)})).map(function(e){return 0!==e.length?e:[r+": INVALID"]}).map(t.first).map(t.split(":")).map(t.last).map(t.trim).reduce(function(e,t){return e.indexOf(t)>-1?e:e.concat([t])},[]);return n.indexOf("INVALID")>-1||1!==n.length?"":n[0]},t.getSelectionText=function(e){var t=e.selection;if(t instanceof o.TextSelection||t instanceof o.AllSelection){var r=t.content().content;return r.textBetween(0,r.size)}return""},t.getNodeFromSelection=function(e){if(e.selection instanceof o.NodeSelection)return e.selection.node}},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(2),s=r(6);t.changeStyleFromMark=function(e,t){var r=e.find(function(e){return"style"===e.type.name}),n=r&&r.attrs.style;return o.changeStyles(n,t)},t.changeStyleMark=function(e,r,o,s,a){var i=a.create({style:s.style}),l=[],u=[],c=null,d=null;return e.doc.nodesBetween(r,o,function(e,f,p){if(e.isInline){var m=e.marks;if(!i.isInSet(m)&&p.type.allowsMarkType(i.type)){var g=Math.max(f,r),v=Math.min(f+e.nodeSize,o),h=t.changeStyleFromMark(m,s);if(h.changed||s.newValue){for(var y=h.changed?{style:h.style}:{style:[s.style]+": "+s.newValue+";"},k=a.create(y),M=k.addToSet(m),b=0;b<m.length;b++)m[b].isInSet(M)||(c&&c.to===g&&c.mark.eq(m[b])?c.to=v:(c=new n.RemoveMarkStep(g,v,m[b]),l.push(c)));var S=d&&d.to===g,_=S&&k.attrs.style===d.mark.attrs.style;S&&_?d.to=v:k.attrs.style&&(d=new n.AddMarkStep(g,v,k),u.push(d))}}}}),l.forEach(function(t){return e.step(t)}),u.forEach(function(t){return e.step(t)}),l.length+u.length>0},t.hasStyle=function(e,r){var n=e.selection,o=n.from,s=n.$from,a=n.to,i=n.empty,l=!1,u={style:r.name,value:r.value};return i?l=t.changeStyleFromMark(e.storedMarks||s.marks(),u).changed:e.doc.nodesBetween(o,a,function(e,r,n){!l&&e.isInline&&(l=t.changeStyleFromMark(e.marks,u).changed)}),l},t.getInlineStyles=function(e,r){var n,o=e.selection,s=o.from,a=o.$from,i=o.to,l=o.empty,u=[],c={style:r.name,value:r.value};return l?(n=t.changeStyleFromMark(e.storedMarks||a.marks(),c)).changed&&(u=n.styleMatches):e.doc.nodesBetween(s,i,function(e,r,o){e.isInline&&((n=t.changeStyleFromMark(e.marks,c)).changed?u.push.apply(u,n.styleMatches):u.push(null))}),u.filter(function(e){return null!==e})},t.changeStyle=function(e,r){return function(n,o,a){var i=n.selection,l=i.empty,u=i.$cursor,c=i.ranges;if(l&&!u||!s.markApplies(n.doc,c,e))return!1;var d=!1;if(o)if(a=a||n.tr,u){var f=n.storedMarks||u.marks();if(e.isInSet(f)){var p=t.changeStyleFromMark(f,r);o(a.removeStoredMark(e)),o(a.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<c.length;m++){var g=c[m],v=g.$from,h=g.$to;d=t.changeStyleMark(a,v.pos,h.pos,r,e)}d&&(a.scrollIntoView(),o(a))}return d}},t.toggleInlineFormat=function(e,r,n){return function(o,a){var i=o.schema.marks,l=e.altStyle,u=e.altMarks,c=void 0===u?[]:u,d=e.mark;r=r||o.tr;var f=!1,p=!1,m=function(){return p=!0};if(l&&i.style){var g=i.style;f=t.changeStyle(g,{style:l.name,value:l.value})(o,m,r)}var v=[d].concat(c).filter(function(e){return i[e]}).map(function(e){return s.hasMark(o,{mark:e})&&i[e]}).filter(function(e){return e});return v.length?s.removeMarks(v,o,m,r):f||s.toggleMark(i[d],n,r)(o,m),p&&a(r),p}},t.applyInlineStyle=function(e,r){return function(n,o){var s=n.schema.marks,a=t.changeStyle(s.style,{style:e.style,value:/^.+$/,newValue:e.value}),i=n.tr;return r&&(i.setMeta("commandName",r),i.setMeta("args",e)),a(n,o,i)}}},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(1),s=r(0),a=r(4);t.markApplies=function(e,t,r){for(var n=function(n){var o=t[n],s=o.$from,a=o.$to,i=0===s.depth&&e.type.allowsMarkType(r);if(e.nodesBetween(s.pos,a.pos,function(e){if(i)return!1;i=e.inlineContent&&e.type.allowsMarkType(r)}),i)return{v:!0}},o=0;o<t.length;o++){var s=n(o);if(s)return s.v}return!1},t.toggleMark=function(e,r,n){return function(o,s){var a=o.selection,i=a.empty,l=a.$cursor,u=a.ranges;if(i&&!l||!t.markApplies(o.doc,u,e))return!1;if(s)if(l)e.isInSet(o.storedMarks||l.marks())?s(n.removeStoredMark(e)):s(n.addStoredMark(e.create(r)));else{for(var c=!1,d=0;!c&&d<u.length;d++){var f=u[d],p=f.$from,m=f.$to;c=o.doc.rangeHasMark(p.pos,m.pos,e)}for(d=0;d<u.length;d++){var g=u[d];p=g.$from,m=g.$to;c?n.removeMark(p.pos,m.pos,e):n.addMark(p.pos,m.pos,e.create(r))}s(n.scrollIntoView())}return!0}},t.removeMark=function(e,t,r,s){void 0===s&&(s=null);var a=[],i=0;return e.doc.nodesBetween(t,r,function(e,n){if(e.isInline){i++;var l=null;if(s instanceof o.MarkType){var u=s.isInSet(e.marks);u&&(l=[u])}else s?s.isInSet(e.marks)&&(l=[s]):l=e.marks;if(l&&l.length)for(var c=Math.min(n+e.nodeSize,r),d=0;d<l.length;d++){for(var f=l[d],p=void 0,m=0;m<a.length;m++){var g=a[m];g.step===i-1&&f.eq(g.style)&&(p=g)}p?(p.to=c,p.step=i):a.push({style:f,from:Math.max(n,t),to:c,step:i})}}}),a.forEach(function(t){return e.step(new n.RemoveMarkStep(t.from,t.to,t.style))}),e},t.removeMarks=function(e,r,n,o){var s=r.selection,a=s.$cursor,i=s.ranges;if(o=o||r.tr,a)e.forEach(function(e){e.isInSet(r.storedMarks||a.marks())&&n(o.removeStoredMark(e))});else{for(var l=function(r){var n=i[r],s=n.$from,a=n.$to;e.forEach(function(e){t.removeMark(o,s.pos,a.pos,e)})},u=0;u<i.length;u++)l(u);n(o.scrollIntoView())}return!0};t.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,r=void 0===t?[]:t;return function(e,t){var n,o=e.schema,s=e.selection,a=s.$cursor,i=s.from,l=s.to,u=e.tr,c=(n=r,n instanceof Array?n:[n]).map(function(e){return e.name});a||(Object.keys(o.marks).map(function(e){return o.marks[e]}).filter(function(e){return-1===c.indexOf(e.name)}).forEach(function(e){return u.removeMark(i,l,e)}),t(u))}},t.getParentMark=function(e,t){var r=e.selection,n=r.from,o=r.$from,s=r.to,a=r.empty,i=e.doc;if(a)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return i.nodesBetween(n,s,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},t.hasMark=function(e,t){var r,n=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return n[e]}),s=t.altStyle,i=e.selection,l=i.from,u=i.$from,c=i.to,d=i.empty,f=n[t.mark],p=e.doc,m=!1;return d?(r=e.storedMarks||u.marks(),m=f&&f.isInSet(r)||o.some(function(e){return n[e].isInSet(r)})):m=f&&p.rangeHasMark(l,c,f)||o.some(function(e){return p.rangeHasMark(l,c,n[e])}),!m&&s?a.hasStyle(e,s):!!m},t.getMark=function(e,t){var r,n=e.selection,o=n.from,s=n.$from,a=n.to,i=n.empty,l=e.doc;return i?r=t.isInSet(e.storedMarks||s.marks()):l.nodesBetween(o,a,function(e){e.isInline&&!r&&(r=t.isInSet(e.marks))}),r};t.getActiveMarks=function(e,t){var r=e.selection,n=!1;if(r instanceof s.TextSelection&&r.$cursor)return{hasNodesWithoutMarks:n,marks:r.$cursor.marks().filter(function(e){return!t||e.type.name===t.name})};var o=[];return r.content().content.descendants(function(e){if("text"===e.type.name){var r=t?function(e,t){return t.marks.filter(function(t){return t.type.name===e.name})}(t,e):e.marks;e.marks.length>0&&r.length>0?o.push.apply(o,r):n=!0}}),{hasNodesWithoutMarks:n,marks:o}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(2),s=r(5),a=r(1),i=r(0);t.changeBlockNode=function(e,t,r,n,o,i){var l=e.selection,u=l.from,c=l.to,d=!1;if(e.doc.nodesBetween(u,c,function(t,r){if(d)return!1;if(t.isTextblock&&!t.hasMarkup(o,i))if(t.type===o)d=!0;else{var n=e.doc.resolve(r),s=n.index();d=n.parent.canReplaceWith(s,s+1,o)}}),!d)return!1;if(t){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var f=r.steps.length;r.doc.nodesBetween(u,c,function(e,t){if(e.eq(n)&&e.isTextblock&&!e.hasMarkup(o,i)&&function(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}(r.doc,r.mapping.slice(f).map(t),o)){r.clearIncompatible(r.mapping.slice(f).map(t,1),o);var l=r.mapping.slice(f),u=l.map(t,1),c=l.map(t+e.nodeSize,1),d=new a.Slice(a.Fragment.from(o.create(i,null,e.marks)),0,0);return r.step(new s.ReplaceAroundStep(u,c,u+1,c-1,d,1,!0)),!1}})}return!0},t.blockNodes=function(e){var t=e.selection,r=t.from,n=t.to,o=t.$from,s=[];return t.node?t.node.isBlock?s.push(t.node):o.parent&&o.parent.isBlock&&s.push(o.parent):e.doc.nodesBetween(r,n,function(e){e.isBlock&&s.push(e)}),s},t.formatBlockElements=function(e,r){return function(o,s){var a=t.blockNodes(o),i=o.schema.nodes,l=!1,u=o.tr;return u.setMeta("commandName",r),u.setMeta("args",{value:e}),a.forEach(function(r){if(r.type.isTextblock)if("p"===e){var a=r.attrs,c=a.level,d=n.__rest(a,["level"]);l=t.changeBlockNode(o,s,u,r,i.paragraph,d)||l}else if(/^h[1-6]$/i.test(e)){c=parseInt(e.substr(1),10);l=t.changeBlockNode(o,s,u,r,i.heading,n.__assign({},r.attrs,{level:c}))||l}else if("blockquote"===e){var f=r.attrs;c=f.level,d=n.__rest(f,["level"]);l=t.changeBlockNode(o,s,u,r,i.blockquote,d)||l}}),l&&s(u.scrollIntoView()),l}},t.getBlockFormats=function(e){var r=t.blockNodes(e),n=e.schema.nodes,o=[];return r.forEach(function(e){if(e.type===n.paragraph)o.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){o.push("h"+t);break}}),o},t.addStyles=function(e,t){var r=e.attrs.style,n=null,s=null;r&&t.forEach(function(e){s={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStyles(r,s),r=n.changed?n.style:r});return r=r||t.reduce(function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""},""),Object.assign({},e.attrs,{style:r||null})},t.hasNode=function(e,t){var r=e.selection,n=r.from,o=r.to,s=!1;return e.doc.nodesBetween(n,o,function(e){return!(s=s||e.type===t)}),s};var l=function(e){return function(e,t){return Object.keys(e).filter(function(e){return t(e)}).reduce(function(t,r){var n;return Object.assign(t,((n={})[r]=e[r],n))},{})}(e,function(t){return null!==e[t]&&void 0!==e[t]&&""!==e[t]})};t.getNodeTagName=function(e,t){var r,n=e.type.spec.parseDOM||[],o=e.attrs;return(r=1===n.length?n[0]:n.find(function(r){var n=a.DOMSerializer.fromSchema(t).serializeNode(e);return JSON.stringify(r.getAttrs(n))===JSON.stringify(l(o))}))?r.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},t.activeNode=function(e){var r,n=e.schema.nodes.doc;if(e.selection instanceof i.AllSelection)r=e.doc;else if(e.selection instanceof i.TextSelection){var s=e.selection.$anchor,a=s.node(s.blockRange().depth);r=o.getTypeName(a)===o.getTypeName(n)?s.node():a}else e.selection instanceof i.NodeSelection&&(r=e.selection.node);return{name:o.getTypeName(r),tag:t.getNodeTagName(r,e.schema)}}},function(e,t){e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(10),s=["blockquote",0],a=["hr"],i=["pre",["code",0]],l=["ol",0],u=["ul",0],c=["li",0],d=function(e){for(var t,r={},n=e.attributes,o=0;o<n.length;o++)r[(t=n[o]).name]=t.value;return r},f=function(e,t){for(var r in e)if(r&&null!==e[r]&&r!==t)return!0;return!1},p=function(e,t){var r={};for(var n in e)n&&null!==e[n]&&n!==t&&(r[n]=e[n]);return r},m=function(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t},g=n.__assign({link:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:d}],toDOM:function(e){return["a",p(e.attrs),0]}}},m("strong"),m("b"),m("em"),m("i"),m("u"),m("del"),m("sub"),m("sup"),m("code"),{style:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"span",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["span",p(e.attrs),0]:["span",0]}}});t.marks=g;var v=n.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"p",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["p",p(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"div",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["div",p(e.attrs),0]:["div",0]}},blockquote:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return s}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return a}},heading:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return n.__assign({},d(e),{level:1})}},{tag:"h2",getAttrs:function(e){return n.__assign({},d(e),{level:2})}},{tag:"h3",getAttrs:function(e){return n.__assign({},d(e),{level:3})}},{tag:"h4",getAttrs:function(e){return n.__assign({},d(e),{level:4})}},{tag:"h5",getAttrs:function(e){return n.__assign({},d(e),{level:5})}},{tag:"h6",getAttrs:function(e){return n.__assign({},d(e),{level:6})}}],toDOM:function(e){return f(e.attrs,"level")?["h"+e.attrs.level,p(e.attrs,"level"),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return i}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:n.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["img",p(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["br",p(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return n.__assign({},d(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?f(e.attrs,"order")?["ol",p(e.attrs,"order"),0]:l:["ol",n.__assign({},p(e.attrs,"order"),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"ul",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["ul",p(e.attrs),0]:u}},list_item:{content:"block*",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"li",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["li",p(e.attrs),0]:c},defining:!0}},o.tableNodes({tableGroup:"block",cellContent:"block+",cellAttributes:{}}));t.nodes=v},function(e,t){e.exports=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(12);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:n.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:n.__assign({},t.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(1),s=r(0),a=r(5),i=r(14),l=r(8),u=r(8),c=r(12);function d(e,r,n){var o=e.selection,s=o.from,a=o.to,i=e.schema.nodes,l=i.paragraph,u=i.heading,c=[];r.doc.nodesBetween(s,a,function(e,t){e.type!==l&&e.type!==u||c.push({node:e,pos:t})});for(var d=c.length-1;d>=0;d--){var f=c[d],p=r.doc.resolve(r.mapping.map(f.pos));if(p.depth>0){var m=void 0;m=f.node.textContent&&f.node.textContent.length>0?r.doc.resolve(r.mapping.map(f.pos+f.node.textContent.length)):r.doc.resolve(r.mapping.map(f.pos+1));var g=p.blockRange(m);g&&r.lift(g,t.getListLiftTarget(e.schema,p,n))}}return r}function f(e){return function(t,r,n){if(!n)return!1;var o=(t=n.state).schema.nodes[e.listType],s=t.selection,a=s.$from,i=s.$to,l=a.node(-2),u=a.node(-3),c=g(t.doc,a,i,o);return(l&&l.type===o||u&&u.type===o)&&c?y(e)(t,r):(c||(y(e)(t,r),t=n.state),k(o)(t,r))}}function p(e,t,r,n){n||(n=e.schema.nodes.listItem);var s=t.$from,i=t.$to,l=s.blockRange(i,function(e){return e.childCount&&e.firstChild.type===n});if(!l||l.depth<2||s.node(l.depth-1).type!==n)return r;var u=l.end,c=i.end(l.depth);return u<c&&(r.step(new a.ReplaceAroundStep(u-1,c,u,c,new o.Slice(o.Fragment.from(n.create(void 0,l.parent.copy())),1,0),1,!0)),l=new o.NodeRange(r.doc.resolve(s.pos),r.doc.resolve(c),l.depth)),r.lift(l,a.liftTarget(l)).scrollIntoView()}function m(e,t,r,n,o,a){a||(a=e.schema.nodes.listItem);var i=!1;return o.doc.nodesBetween(t,r,function(r,l){if(!i&&r.type===a&&l>t){i=!0;for(var u=n+3;u>n+2;){var c=o.doc.resolve(o.mapping.map(l));u=c.depth;var d=o.doc.resolve(o.mapping.map(l+r.textContent.length)),f=new s.TextSelection(c,d);o=p(e,f,o,a)}}}),o}function g(e,t,r,n){return 0===v(e,t,r).filter(function(e){return e.type!==n}).length}function v(e,t,r){for(var n=Array(),o=h(e,t).depth,s=e.resolve(t.start(o));s.pos<=r.start(r.depth);){var a=Math.min(s.depth,o),i=s.node(a);if(i&&n.push(i),0===a)break;var l=e.resolve(s.after(a));if(l.start(a)>=e.nodeSize-2)break;l.depth!==s.depth&&(l=e.resolve(l.pos+2)),s=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return n}function h(e,t){var r=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var n=t.node(t.depth),o=t;t.depth>=1;)(n=(t=e.resolve(t.before(t.depth))).node(t.depth))&&-1!==r.indexOf(n.type.name)&&(o=t);return o}function y(e){return function(t,r){var n=t.tr,o=t.selection,i=o.$from,l=o.$to;return n.doc.nodesBetween(i.pos,l.pos,function(r,o){if(r.isTextblock||"blockquote"===r.type.name||"div"===r.type.name){var i=new s.NodeSelection(n.doc.resolve(n.mapping.map(o))),l=i.$from.blockRange(i.$to);if(!l||i.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var u=l&&a.liftTarget(l);if(null==u)return!1;n.lift(l,u)}}),r&&r(n),!0}}function k(e){return i.autoJoin(l.wrapInList(e),function(t,r){return t.type===r.type&&t.type===e})}t.rootListDepth=function(e,t){for(var r,n=t.bulletList,o=t.orderedList,s=t.listItem,a=e.depth-1;a>0;a--){var i=e.node(a);if(i.type!==n&&i.type!==o||(r=a),i.type!==n&&i.type!==o&&i.type!==s)break}return r},t.getListLiftTarget=function(e,t,r){for(var n=t.depth,o=e.nodes[r.bulletList],s=e.nodes[r.orderedList],a=e.nodes[r.listItem],i=t.depth;i>0;i--){var l=t.node(i);if(l.type!==o&&l.type!==s||(n=i),l.type!==o&&l.type!==s&&l.type!==a)break}return n-1},t.liftSelectionList=d,t.toggleList=function(e,r,n,o,s){var a=o.listType,i=e.selection,l=i.$from.node(i.$from.depth-2),u=i.$to.node(i.$to.depth-2);if(l&&l.type.name===a&&u&&u.type.name===a){var c=n.state.schema.nodes,p={bulletList:c[o.bulletList],orderedList:c[o.orderedList],listItem:c[o.listItem]},g=t.rootListDepth(i.$to,p),v=m(e,i.$to.pos,i.$to.end(g),g,n.state.tr,p.listItem);return(v=d(e,v,o)).setMeta("commandName",s),r(v),!0}return f(o)(e,r,n)},t.toggleListCommand=f,t.liftFollowingList=m,t.isRangeOfType=g,t.getAncestorNodesBetween=v,t.findAncestorPosition=h,t.liftListItems=y,t.wrapInList=k,t.toggleUnorderedList=function(e,r,o){return t.toggleList(e,r,o,n.__assign({listType:c.bulletList.listType},c.bulletList.types))},t.toggleOrderedList=function(e,r,o){return t.toggleList(e,r,o,n.__assign({listType:c.orderedList.listType},c.orderedList.types))},t.splitListItemKeepMarks=function(e){return function(t,r){return u.splitListItem(e)(t,function(e){var n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();n&&e.ensureMarks(n),r(e)})}}},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(17);t.getHtml=n.getHtml,t.setHtml=n.setHtml;var o=r(4);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var s=r(18);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var a=r(19);t.insertText=a.insertText;var i=r(20);t.insertImage=i.insertImage;var l=r(21);t.alignBlocks=l.alignBlocks,t.isAligned=l.isAligned;var u=r(7);t.hasNode=u.hasNode,t.activeNode=u.activeNode,t.formatBlockElements=u.formatBlockElements;var c=r(6);t.hasMark=c.hasMark,t.getMark=c.getMark,t.getActiveMarks=c.getActiveMarks,t.removeAllMarks=c.removeAllMarks;var d=r(22);t.indent=d.indent,t.canIndentAsListItem=d.canIndentAsListItem,t.outdent=d.outdent,t.canOutdentAsListItem=d.canOutdentAsListItem,t.isIndented=d.isIndented,t.canBeIndented=d.canBeIndented;var f=r(13);t.toggleOrderedList=f.toggleOrderedList,t.toggleUnorderedList=f.toggleUnorderedList;var p=r(2);t.createContentNode=p.createContentNode,t.hasSameMarkup=p.hasSameMarkup,t.getUniqueStyleValues=p.getUniqueStyleValues,t.getSelectionText=p.getSelectionText,t.getNodeFromSelection=p.getNodeFromSelection,t.canInsert=p.canInsert,t.insertNode=p.insertNode;var m=r(15);t.redo=m.redo,t.undo=m.undo;var g=r(23);t.alignLeftRules=g.alignLeftRules,t.alignCenterRules=g.alignCenterRules,t.alignRightRules=g.alignRightRules,t.alignRemoveRules=g.alignRemoveRules;var v=r(11);t.indentRules=v.indentRules,t.outdentRules=v.outdentRules;var h=r(9);t.nodes=h.nodes,t.marks=h.marks;var y=r(24);t.buildKeymap=y.buildKeymap,t.buildListKeymap=y.buildListKeymap;var k=r(26);t.bold=k.bold,t.italic=k.italic,t.underline=k.underline,t.strikethrough=k.strikethrough,t.subscript=k.subscript,t.superscript=k.superscript,t.link=k.link;var M=r(27);t.createTable=M.createTable;var b=r(10);t.addRowBefore=b.addRowBefore,t.addRowAfter=b.addRowAfter,t.addColumnBefore=b.addColumnBefore,t.addColumnAfter=b.addColumnAfter,t.deleteRow=b.deleteRow,t.deleteColumn=b.deleteColumn,t.deleteTable=b.deleteTable,t.mergeCells=b.mergeCells,t.splitCell=b.splitCell,t.selectionCell=b.selectionCell},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(0);t.createContentNode=function(e,t,r){var o=document.createElement("div");return o.innerHTML=e,n.DOMParser.fromSchema(t).parse(o,r)},t.getHtml=function(e){var t=n.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),r=document.createElement("div");return r.appendChild(t),r.innerHTML},t.setHtml=function(e,r,n){return void 0===r&&(r="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(s,a){return a(s.tr.setSelection(new o.AllSelection(s.doc)).replaceSelectionWith(t.createContentNode(e,s.schema,n)).setMeta("commandName",r))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(6),s=r(0);t.removeLink=function(e,t){return function(r,s){var a=r.selection.$cursor;if(a){var i=a.parent,l=a.index(),u=r.schema.marks[e.mark],c=i.child(l).marks.find(function(e){return e.type===u}),d=i.childCount,f=a.pos-a.textOffset,p=i.child(l).nodeSize,m=void 0,g=void 0;for(m=l-1;m>=0&&c.isInSet(i.child(m).marks);)p+=g=i.child(m).nodeSize,f-=g,m-=1;for(m=l+1;m<d&&c.isInSet(i.child(m).marks);)p+=i.child(m).nodeSize,m+=1;s(o.removeMark(t||r.tr,f,f+p,c))}else n.toggleInlineFormat(e,t)(r,s)}},t.applyLink=function(e,r){var a=e.mark,i=e.attrs;return function(e,l){var u=e.schema.marks,c=e.tr;r&&(c.setMeta("commandName",r),c.setMeta("args",i));var d=!1,f=function(){return d=!0};if(o.getParentMark(e,u[a]))!function(e,t){return function(r,n){var o=r.selection,s=o.$cursor,a=o.from,i=o.to,l=r.schema.marks[e.mark];if(s){var u=s.parent,c=s.index(),d=u.child(c).marks.find(function(e){return e.type===l}),f=u.childCount,p=s.pos-s.textOffset,m=u.child(c).nodeSize,g=void 0,v=void 0;for(g=c-1;g>=0&&d.isInSet(u.child(g).marks);)m+=v=u.child(g).nodeSize,p-=v,g-=1;for(g=c+1;g<f&&d.isInSet(u.child(g).marks);)m+=u.child(g).nodeSize,g+=1;t.removeMark(p,p+m,l),t.addMark(p,p+m,l.create(e.attrs)),n(t)}else t.doc.nodesBetween(a,i,function(r,o){r.isInline&&l.isInSet(r.marks)&&(t.removeMark(o,o+r.nodeSize,l),t.addMark(o,o+r.nodeSize,l.create(e.attrs)),n(t))})}}({mark:a,attrs:i},c)(e,f);else{var p=e;o.hasMark(e,{mark:a})&&(t.removeLink({mark:a,attrs:i},c)(e,f),p=s.EditorState.create({doc:c.doc,selection:c.selection})),d?o.toggleMark(u[a],i,c)(p,f):n.toggleInlineFormat({mark:a},c,i)(p,f)}return d&&l(c),d}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,r){r(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.insertImage=function(e){return function(t,r){var o=t.schema.nodes.image,s=o.createAndFill(e);n.insertNode(s)(t,function(t){return r(t.setMeta("commandName","insertImage").setMeta("args",e))})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);t.alignBlocks=function(e){return function(t,r){var o=n.blockNodes(t),s=t.tr,a=!1;return o.forEach(function(o){if(o.type.isTextblock){var i={},l=e.find(function(e){return e.node===o.type.name});l&&(i=n.addStyles(o,l.style)),a=n.changeBlockNode(t,r,s,o,o.type,i)||a}}),a&&r(s.scrollIntoView()),a}},t.isAligned=function(e,t){var r=n.blockNodes(e),o=!1;return r.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find(function(t){return t.node===e.type.name});r&&(o=r.style.every(function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)}))}}),o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),o=r(11),s=r(7),a=r(2);t.indentBlocks=function(e,t,r){return function(n,o){var a=s.blockNodes(n),i=n.tr,l=!1;return i.setMeta("commandName",t),a.forEach(function(t){if(t.type.isTextblock){var a=void 0,u=e.find(function(e){return e.node===t.type.name});if(u){var c="rtl"===r?u.rtlStyle:u.style,d={name:c,value:u.step>0?""+u.step+u.unit:""};if(t.attrs.style){var f=new RegExp(c+":\\s?(\\d+)"+u.unit,"i"),p=t.attrs.style.match(f);if(p){var m=parseFloat(p[1])+u.step;m=m<=0?"":m,d.value=""+m+(m?u.unit:"")}}a=s.addStyles(t,[d])}a&&(l=s.changeBlockNode(n,o,i,t,t.type,a)||l)}}),l&&o(i.scrollIntoView()),l}},t.isIndented=function(e,t,r){var n=s.blockNodes(e),o=!1;return n.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find(function(t){return t.node===e.type.name});if(n){var s="rtl"===r?n.rtlStyle:n.style,a=new RegExp(s+":\\s?\\d+"+n.unit,"i");o=a.test(e.attrs.style)}}}),o},t.canIndentAsListItem=function(e,t){return n.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var r=e.schema.nodes[t.listsTypes.listItem],o=e.schema.nodes[t.listsTypes.orderedList],s=e.schema.nodes[t.listsTypes.bulletList],i=!!a.findNthParentNodeOfType(o,2)(e.selection),l=!!a.findNthParentNodeOfType(s,2)(e.selection);return(i||l)&&n.liftListItem(r)(e)},t.canBeIndented=function(e,r){var n=e.schema.nodes,a=n[o.indentRules.listsTypes.listItem];return(t.isIndented(e,r.nodes)||o.indentRules.nodes.some(function(t){return n[t.node]&&s.hasNode(e,n[t.node])}))&&!s.hasNode(e,a)},t.indent=function(e,r){var s=e.schema.nodes[o.indentRules.listsTypes.listItem],a=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,s)?n.sinkListItem(s)(e,r):a&&t.indentBlocks(o.indentRules.nodes)(e,r)},t.outdent=function(e,r){var s=e.schema.nodes[o.outdentRules.listsTypes.listItem],a=t.canBeIndented(e,o.outdentRules);t.canOutdentAsListItem(e,o.outdentRules)?n.liftListItem(s)(e,r):a&&t.indentBlocks(o.outdentRules.nodes)(e,r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return{name:e,value:t}};t.alignLeftRules=[{node:"paragraph",style:[n("text-align","left")]},{node:"heading",style:[n("text-align","left")]},{node:"listItem",style:[n("text-align","left"),n("list-style-position","inside")]}],t.alignRightRules=[{node:"paragraph",style:[n("text-align","right")]},{node:"heading",style:[n("text-align","right")]},{node:"listItem",style:[n("text-align","right"),n("list-style-position","inside")]}],t.alignCenterRules=[{node:"paragraph",style:[n("text-align","center")]},{node:"heading",style:[n("text-align","center")]},{node:"listItem",style:[n("text-align","center"),n("list-style-position","inside")]}],t.alignRemoveRules=[{node:"paragraph",style:[n("text-align","")]},{node:"heading",style:[n("text-align","")]},{node:"listItem",style:[n("text-align",""),n("list-style-position","")]}]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),o=r(15),s=r(25),a=r(13),i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);t.buildKeymap=function(e){var t={};if(t["Mod-z"]=o.undo,t["Shift-Mod-z"]=o.redo,t.Backspace=n.chainCommands(s.undoInputRule,n.deleteSelection,n.joinBackward,n.selectNodeBackward),t.Enter=n.chainCommands(n.newlineInCode,n.createParagraphNear,n.liftEmptyBlock,n.splitBlockKeepMarks),i||(t["Mod-y"]=o.redo),e.marks.strong&&(t["Mod-b"]=n.toggleMark(e.marks.strong)),e.marks.em&&(t["Mod-i"]=n.toggleMark(e.marks.em)),e.marks.underline&&(t["Mod-u"]=n.toggleMark(e.marks.underline)),e.nodes.hardBreak){var r=e.nodes.hardBreak,a=n.chainCommands(n.exitCode,function(e,t){return t(e.tr.replaceSelectionWith(r.create()).scrollIntoView()),!0});t["Mod-Enter"]=a,t["Shift-Enter"]=a,i&&(t["Ctrl-Enter"]=a)}return t},t.buildListKeymap=function(e){var t={};return e.nodes.listItem&&(t.Enter=a.splitListItemKeepMarks(e.nodes.listItem)),t}},function(e,t){e.exports=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bold={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},t.italic={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},t.underline={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},t.strikethrough={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},t.subscript={mark:"sub"},t.superscript={mark:"sup"},t.link={mark:"link"},t.unlink={mark:"link"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=function(e,t,r){for(var n=e.table,o=e.table_row,s=e.table_cell,a=[],i=[],l=0;l<t+1;l++){i.length=0;for(var u=0;u<r+1;u++)i.push(s.createAndFill());a.push(o.createAndFill(void 0,i))}return n.createAndFill(void 0,a)}}])});

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("tslib"),require("prosemirror-schema-list"),require("prosemirror-commands"),require("prosemirror-history")):"function"==typeof define&&define.amd?define(["prosemirror-model","prosemirror-state","prosemirror-transform","tslib","prosemirror-schema-list","prosemirror-commands","prosemirror-history"],t):"object"==typeof exports?exports.KendoEditorCommon=t(require("prosemirror-model"),require("prosemirror-state"),require("prosemirror-transform"),require("tslib"),require("prosemirror-schema-list"),require("prosemirror-commands"),require("prosemirror-history")):e.KendoEditorCommon=t(e["prosemirror-model"],e["prosemirror-state"],e["prosemirror-transform"],e.tslib,e["prosemirror-schema-list"],e["prosemirror-commands"],e["prosemirror-history"])}(this,function(e,t,r,n,o,s,i){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1);t.getHtml=n.getHtml,t.setHtml=n.setHtml;var o=r(4);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var s=r(8);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var i=r(9);t.insertText=i.insertText;var a=r(10);t.insertImage=a.insertImage;var l=r(11);t.alignBlocks=l.alignBlocks;var c=r(12);t.formatBlockElements=c.formatBlockElements;var u=r(14);t.indent=u.indent,t.outdent=u.outdent;var d=r(18);t.toggleOrderedList=d.toggleOrderedList,t.toggleUnorderedList=d.toggleUnorderedList;var f=r(20);t.redo=f.redo,t.undo=f.undo},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(3);t.createContentNode=function(e,t,r){var o=document.createElement("div");return o.innerHTML=e,n.DOMParser.fromSchema(t).parse(o,r)},t.getHtml=function(e){var t=n.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),r=document.createElement("div");return r.appendChild(t),r.innerHTML},t.setHtml=function(e,r,n){return void 0===r&&(r="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(s,i){return i(s.tr.setSelection(new o.AllSelection(s.doc)).replaceSelectionWith(t.createContentNode(e,s.schema,n)).setMeta("commandName",r))}}},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(6),s=r(7);t.changeStyleFromMark=function(e,t){var r=e.find(function(e){return"style"===e.type.name}),n=r&&r.attrs.style;return o.changeStyles(n,t)},t.changeStyleMark=function(e,r,o,s,i){var a=i.create({style:s.style}),l=[],c=[],u=null,d=null;return e.doc.nodesBetween(r,o,function(e,f,p){if(e.isInline){var m=e.marks;if(!a.isInSet(m)&&p.type.allowsMarkType(a.type)){var v=Math.max(f,r),h=Math.min(f+e.nodeSize,o),y=t.changeStyleFromMark(m,s);if(y.changed||s.newValue){for(var g=y.changed?{style:y.style}:{style:[s.style]+": "+s.newValue+";"},k=i.create(g),M=k.addToSet(m),S=0;S<m.length;S++)m[S].isInSet(M)||(u&&u.to===v&&u.mark.eq(m[S])?u.to=h:(u=new n.RemoveMarkStep(v,h,m[S]),l.push(u)));var I=d&&d.to===v,b=I&&k.attrs.style===d.mark.attrs.style;I&&b?d.to=h:k.attrs.style&&(d=new n.AddMarkStep(v,h,k),c.push(d))}}}}),l.forEach(function(t){return e.step(t)}),c.forEach(function(t){return e.step(t)}),l.length+c.length>0},t.hasStyle=function(e,r){var n=e.selection,o=n.from,s=n.$from,i=n.to,a=n.empty,l=!1,c={style:r.name,value:r.value};return a?l=t.changeStyleFromMark(e.storedMarks||s.marks(),c).changed:e.doc.nodesBetween(o,i,function(e,r,n){!l&&e.isInline&&(l=t.changeStyleFromMark(e.marks,c).changed)}),l},t.getInlineStyles=function(e,r){var n,o=e.selection,s=o.from,i=o.$from,a=o.to,l=o.empty,c=[],u={style:r.name,value:r.value};return l?(n=t.changeStyleFromMark(e.storedMarks||i.marks(),u),n.changed&&(c=n.styleMatches)):e.doc.nodesBetween(s,a,function(e,r,o){e.isInline&&(n=t.changeStyleFromMark(e.marks,u),n.changed?c.push.apply(c,n.styleMatches):c.push(null))}),c.filter(function(e){return null!==e})},t.changeStyle=function(e,r){return function(n,o,i){var a=n.selection,l=a.empty,c=a.$cursor,u=a.ranges;if(l&&!c||!s.markApplies(n.doc,u,e))return!1;var d=!1;if(o)if(i=i||n.tr,c){var f=n.storedMarks||c.marks();if(e.isInSet(f)){var p=t.changeStyleFromMark(f,r);o(i.removeStoredMark(e)),o(i.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<u.length;m++){var v=u[m],h=v.$from,y=v.$to;d=t.changeStyleMark(i,h.pos,y.pos,r,e)}d&&(i.scrollIntoView(),o(i))}return d}},t.toggleInlineFormat=function(e,r,n){return function(o,i){var a=o.schema.marks,l=e.altStyle,c=e.altMarks,u=void 0===c?[]:c,d=e.mark;r=r||o.tr;var f=!1,p=!1,m=function(){return p=!0};if(l&&a.style){var v=a.style,h=t.changeStyle(v,{style:l.name,value:l.value});f=h(o,m,r)}var y=[d].concat(u).filter(function(e){return a[e]}),g=y.map(function(e){return s.hasMark(o,{mark:e})&&a[e]}).filter(function(e){return e});return g.length?s.removeMarks(g,o,m,r):f||s.toggleMark(a[d],n,r)(o,m),p&&i(r),p}},t.applyInlineStyle=function(e,r){return function(n,o){var s=n.schema.marks,i=t.changeStyle(s.style,{style:e.style,value:/^.+$/,newValue:e.value}),a=n.tr;return r&&(a.setMeta("commandName",r),a.setMeta("args",e)),i(n,o,a)}}},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2),o=r(7),s=r(4);t.changeStyles=function(e,t){var r=t.style,n=t.value,o=t.newValue,s=[];if(e){var i=e.split(/\s*;\s*/).filter(function(e){return e}),a=i.filter(function(e){if(!e.toLowerCase().trim().startsWith(r))return!0;var t=e.split(":")[1].trim();return!n.test(t)||(s.push(t),!1)});return o&&a.push(r+": "+o),{style:a.join("; ")+(a.length?";":""),changed:!!o||a.length!==i.length,styleMatches:s}}return{changed:!1,styleMatches:s,style:null}},t.changeStyle=function(e,t){return function(r,n,i){var a=r.selection,l=a.empty,c=a.$cursor,u=a.ranges;if(l&&!c||!o.markApplies(r.doc,u,e))return!1;var d=!1;if(n)if(i=i||r.tr,c){var f=r.storedMarks||c.marks();if(e.isInSet(f)){var p=s.changeStyleFromMark(f,t);n(i.removeStoredMark(e)),n(i.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<u.length;m++){var v=u[m],h=v.$from,y=v.$to;d=s.changeStyleMark(i,h.pos,y.pos,t,e)}d&&(i.scrollIntoView(),n(i))}return d}},t.canInsert=function(e,t){for(var r=e.selection.$from,n=r.depth;n>=0;n--){var o=r.index(n);if(r.node(n).canReplaceWith(o,o,t))return!0}return!1},t.getTypeName=function(e){return e instanceof n.Node?e.type.name:e.name},t.findParentNode=function(e){return function(t){for(var r=t.$from,n=r.depth;n>0;n--){var o=r.node(n);if(e(o))return{depth:n,node:o}}}},t.findNthParentNode=function(e,t){return void 0===t&&(t=1),function(r){for(var n=r.$from,o=n.depth;o>0;o--){var s=n.node(o);if(e(s)&&(t-=1,0===t))return{depth:o,node:s}}}},t.findNthParentNodeOfType=function(e,r){return void 0===r&&(r=1),function(n){return t.findNthParentNode(function(r){return t.getTypeName(r)===t.getTypeName(e)},r)(n)}},t.insertNode=function(e,t){return function(r,n){var o=r.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),n(o)}},t.createTable=function(e,t,r){for(var n=e.table,o=e.table_row,s=e.table_cell,i=[],a=[],l=0;l<t+1;l++){a.length=0;for(var c=0;c<r+1;c++)a.push(s.createAndFill());i.push(o.createAndFill(void 0,a))}return n.createAndFill(void 0,i)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(2),s=r(4);t.markApplies=function(e,t,r){for(var n=function(n){var o=t[n],s=o.$from,i=o.$to,a=0===s.depth&&e.type.allowsMarkType(r);if(e.nodesBetween(s.pos,i.pos,function(e){return!a&&void(a=e.inlineContent&&e.type.allowsMarkType(r))}),a)return{v:!0}},o=0;o<t.length;o++){var s=n(o);if(s)return s.v}return!1},t.toggleMark=function(e,r,n){return function(o,s){var i=o.selection,a=i.empty,l=i.$cursor,c=i.ranges;if(a&&!l||!t.markApplies(o.doc,c,e))return!1;if(s)if(l)s(e.isInSet(o.storedMarks||l.marks())?n.removeStoredMark(e):n.addStoredMark(e.create(r)));else{for(var u=!1,d=0;!u&&d<c.length;d++){var f=c[d],p=f.$from,m=f.$to;u=o.doc.rangeHasMark(p.pos,m.pos,e)}for(var d=0;d<c.length;d++){var v=c[d],p=v.$from,m=v.$to;u?n.removeMark(p.pos,m.pos,e):n.addMark(p.pos,m.pos,e.create(r))}s(n.scrollIntoView())}return!0}},t.removeMark=function(e,t,r,s){void 0===s&&(s=null);var i=[],a=0;return e.doc.nodesBetween(t,r,function(e,n){if(e.isInline){a++;var l=null;if(s instanceof o.MarkType){var c=s.isInSet(e.marks);c&&(l=[c])}else s?s.isInSet(e.marks)&&(l=[s]):l=e.marks;if(l&&l.length)for(var u=Math.min(n+e.nodeSize,r),d=0;d<l.length;d++){for(var f=l[d],p=void 0,m=0;m<i.length;m++){var v=i[m];v.step===a-1&&f.eq(v.style)&&(p=v)}p?(p.to=u,p.step=a):i.push({style:f,from:Math.max(n,t),to:u,step:a})}}}),i.forEach(function(t){return e.step(new n.RemoveMarkStep(t.from,t.to,t.style))}),e},t.removeMarks=function(e,r,n,o){var s=r.selection,i=s.$cursor,a=s.ranges;if(o=o||r.tr,i)e.forEach(function(e){e.isInSet(r.storedMarks||i.marks())&&n(o.removeStoredMark(e))});else{for(var l=function(r){var n=a[r],s=n.$from,i=n.$to;e.forEach(function(e){t.removeMark(o,s.pos,i.pos,e)})},c=0;c<a.length;c++)l(c);n(o.scrollIntoView())}return!0};var i=function(e){return e instanceof Array?e:[e]};t.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,r=void 0===t?[]:t;return function(e,t){var n=e.schema,o=e.selection,s=o.$cursor,a=o.from,l=o.to,c=e.tr,u=i(r).map(function(e){return e.name});s||(Object.keys(n.marks).map(function(e){return n.marks[e]}).filter(function(e){return u.indexOf(e.name)===-1}).forEach(function(e){return c.removeMark(a,l,e)}),t(c))}},t.getParentMark=function(e,t){var r=e.selection,n=r.from,o=r.$from,s=r.to,i=r.empty,a=e.doc;if(i)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return a.nodesBetween(n,s,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},t.hasMark=function(e,t){var r,n=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return n[e]}),i=t.altStyle,a=e.selection,l=a.from,c=a.$from,u=a.to,d=a.empty,f=n[t.mark],p=e.doc,m=!1;return d?(r=e.storedMarks||c.marks(),m=f&&f.isInSet(r)||o.some(function(e){return n[e].isInSet(r)})):m=f&&p.rangeHasMark(l,u,f)||o.some(function(e){return p.rangeHasMark(l,u,n[e])}),!m&&i?s.hasStyle(e,i):!!m}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(7),s=r(3),i=function(e,t){return function(r,n){var o=r.selection,s=o.$cursor,i=o.from,a=o.to,l=r.schema.marks[e.mark];if(s){var c=s.parent,u=s.index(),d=c.child(u).marks.find(function(e){return e.type===l}),f=c.childCount,p=s.pos-s.textOffset,m=c.child(u).nodeSize,v=void 0,h=void 0;for(v=u-1;v>=0&&d.isInSet(c.child(v).marks);)h=c.child(v).nodeSize,m+=h,p-=h,v-=1;for(v=u+1;v<f&&d.isInSet(c.child(v).marks);)m+=c.child(v).nodeSize,v+=1;t.removeMark(p,p+m,l),t.addMark(p,p+m,l.create(e.attrs)),n(t)}else t.doc.nodesBetween(i,a,function(r,o){r.isInline&&l.isInSet(r.marks)&&(t.removeMark(o,o+r.nodeSize,l),t.addMark(o,o+r.nodeSize,l.create(e.attrs)),n(t))})}};t.removeLink=function(e,t){return function(r,s){var i=r.selection.$cursor;if(i){var a=i.parent,l=i.index(),c=r.schema.marks[e.mark],u=a.child(l).marks.find(function(e){return e.type===c}),d=a.childCount,f=i.pos-i.textOffset,p=a.child(l).nodeSize,m=void 0,v=void 0;for(m=l-1;m>=0&&u.isInSet(a.child(m).marks);)v=a.child(m).nodeSize,p+=v,f-=v,m-=1;for(m=l+1;m<d&&u.isInSet(a.child(m).marks);)p+=a.child(m).nodeSize,m+=1;s(o.removeMark(t||r.tr,f,f+p,u))}else n.toggleInlineFormat(e,t)(r,s)}},t.applyLink=function(e,r){var a=e.mark,l=e.attrs;return function(e,c){var u=e.schema.marks,d=e.tr;r&&(d.setMeta("commandName",r),d.setMeta("args",l));var f=!1,p=function(){return f=!0};if(o.getParentMark(e,u[a]))i({mark:a,attrs:l},d)(e,p);else{var m=e;o.hasMark(e,{mark:a})&&(t.removeLink({mark:a,attrs:l},d)(e,p),m=s.EditorState.create({doc:d.doc,selection:d.selection})),f?o.toggleMark(u[a],l,d)(m,p):n.toggleInlineFormat({mark:a},d,l)(m,p)}return f&&c(d),f}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,r){r(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(6);t.insertImage=function(e){return function(t,r){var o=t.schema.nodes.image,s="insertImage",i=o.createAndFill(e);n.insertNode({state:t,dispatch:function(t){return r(t.setMeta("commandName",s).setMeta("args",e))}},i)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(12);t.alignBlocks=function(e){return function(t,r){var o=n.blockNodes(t),s=t.tr,i=!1;return o.forEach(function(o){if(o.type.isTextblock){var a={},l=e.find(function(e){return e.node===o.type.name});l&&(a=n.addStyles(o,l.style)),i=n.changeBlockNode(t,r,s,o,o.type,a)||i}}),i&&r(s.scrollIntoView()),i}},t.isAligned=function(e,t){var r=n.blockNodes(e),o=!1;return r.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find(function(t){return t.node===e.type.name});r&&(o=r.style.every(function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)}))}}),o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=r(6),s=r(5),i=r(2),a=r(3),l=function(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)};t.changeBlockNode=function(e,t,r,n,o,a){var c=e.selection,u=c.from,d=c.to,f=!1;if(e.doc.nodesBetween(u,d,function(t,r){if(f)return!1;if(t.isTextblock&&!t.hasMarkup(o,a))if(t.type===o)f=!0;else{var n=e.doc.resolve(r),s=n.index();f=n.parent.canReplaceWith(s,s+1,o)}}),!f)return!1;if(t){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var p=r.steps.length;r.doc.nodesBetween(u,d,function(e,t){if(e.eq(n)&&e.isTextblock&&!e.hasMarkup(o,a)&&l(r.doc,r.mapping.slice(p).map(t),o)){r.clearIncompatible(r.mapping.slice(p).map(t,1),o);var c=r.mapping.slice(p),u=c.map(t,1),d=c.map(t+e.nodeSize,1),f=new i.Slice(i.Fragment.from(o.create(a,null,e.marks)),0,0);return r.step(new s.ReplaceAroundStep(u,d,u+1,d-1,f,1,!0)),!1}})}return!0},t.blockNodes=function(e){var t=e.selection,r=t.from,n=t.to,o=t.$from,s=[];return t.node?t.node.isBlock?s.push(t.node):o.parent&&o.parent.isBlock&&s.push(o.parent):e.doc.nodesBetween(r,n,function(e){e.isBlock&&s.push(e)}),s},t.formatBlockElements=function(e,r){return function(o,s){var i=t.blockNodes(o),a=o.schema.nodes,l=!1,c=o.tr;return c.setMeta("commandName",r),c.setMeta("args",{value:e}),i.forEach(function(r){if(r.type.isTextblock)if("p"===e){var i=r.attrs,u=i.level,d=n.__rest(i,["level"]);l=t.changeBlockNode(o,s,c,r,a.paragraph,d)||l}else if(/^h[1-6]$/i.test(e)){var u=parseInt(e.substr(1),10);l=t.changeBlockNode(o,s,c,r,a.heading,n.__assign({},r.attrs,{level:u}))||l}}),l&&s(c.scrollIntoView()),l}},t.getBlockFormats=function(e){var r=t.blockNodes(e),n=e.schema.nodes,o=[];return r.forEach(function(e){if(e.type===n.paragraph)o.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){o.push("h"+t);break}}),o},t.addStyles=function(e,t){var r=e.attrs.style,n=null,s=null;r&&t.forEach(function(e){s={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStyles(r,s),r=n.changed?n.style:r});var i=function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""};return r=r||t.reduce(i,""),Object.assign({},e.attrs,{style:r||null})},t.hasNode=function(e,t){var r=e.selection,n=r.from,o=r.to,s=!1;return e.doc.nodesBetween(n,o,function(e){return s=s||e.type===t,!s}),s};var c=function(e,t){return Object.keys(e).filter(function(e){return t(e)}).reduce(function(t,r){return Object.assign(t,(n={},n[r]=e[r],n));var n},{})},u=function(e){var t=function(t){return null!==e[t]&&void 0!==e[t]&&""!==e[t]};return c(e,t)};t.getNodeTagName=function(e,t){var r,n=e.type.spec.parseDOM||[],o=e.attrs;return r=1===n.length?n[0]:n.find(function(r){var n=i.DOMSerializer.fromSchema(t).serializeNode(e);return JSON.stringify(r.getAttrs(n))===JSON.stringify(u(o))}),r?r.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},t.activeNode=function(e){var r,n=e.schema.nodes.doc;if(e.selection instanceof a.AllSelection)r=e.doc;else if(e.selection instanceof a.TextSelection){var s=e.selection.$anchor,i=s.node(s.blockRange().depth),l=o.getTypeName(i)===o.getTypeName(n);r=l?s.node():i}else e.selection instanceof a.NodeSelection&&(r=e.selection.node);return{name:o.getTypeName(r),tag:t.getNodeTagName(r,e.schema)}}},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15),o=r(16),s=r(12),i=r(6);t.indentBlocks=function(e,t,r){return function(n,o){var i=s.blockNodes(n),a=n.tr,l=!1;return a.setMeta("commandName",t),i.forEach(function(t){if(t.type.isTextblock){var i=void 0,c=e.find(function(e){return e.node===t.type.name});if(c){var u="rtl"===r?c.rtlStyle:c.style,d={name:u,value:c.step>0?""+c.step+c.unit:""};if(t.attrs.style){var f=new RegExp(u+":\\s?(\\d+)"+c.unit,"i"),p=t.attrs.style.match(f);if(p){var m=parseFloat(p[1])+c.step;m=m<=0?"":m,d.value=""+m+(m?c.unit:"")}}i=s.addStyles(t,[d])}i&&(l=s.changeBlockNode(n,o,a,t,t.type,i)||l)}}),l&&o(a.scrollIntoView()),l}},t.isIndented=function(e,t,r){var n=s.blockNodes(e),o=!1;return n.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find(function(t){return t.node===e.type.name});if(n){var s="rtl"===r?n.rtlStyle:n.style,i=new RegExp(s+":\\s?\\d+"+n.unit,"i");o=i.test(e.attrs.style)}}}),o},t.canIndentAsListItem=function(e,t){return n.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var r=t.listsTypes.listItem,o=!!i.findNthParentNodeOfType(t.listsTypes.orderedList,2)(e.selection),s=!!i.findNthParentNodeOfType(t.listsTypes.bulletList,2)(e.selection);return(o||s)&&n.liftListItem(r)(e)},t.canBeIndented=function(e,r){var n=e.schema.nodes;return(t.isIndented(e,r.nodes)||o.indentRules.nodes.some(function(t){return n[t.node]&&s.hasNode(e,n[t.node])}))&&!s.hasNode(e,o.indentRules.listsTypes.listItem)},t.indent=function(e,r){var s=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,o.indentRules.listsTypes.listItem)?n.sinkListItem(o.indentRules.listsTypes.listItem)(e,r):s&&t.indentBlocks(o.indentRules.nodes)(e,r)},t.outdent=function(e,r){var s=t.canBeIndented(e,o.outdentRules);t.canOutdentAsListItem(e,o.outdentRules)?n.liftListItem(o.outdentRules.listsTypes.listItem)(e,r):s&&t.indentBlocks(o.outdentRules.nodes)(e,r)}},function(e,t){e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13),o=r(17);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(13);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:n.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:n.__assign({},t.listsTypes)}},function(e,t,r){"use strict";function n(e,r,n){var o=e.selection,s=o.from,i=o.to,a=e.schema.nodes,l=a.paragraph,c=a.heading,u=[];r.doc.nodesBetween(s,i,function(e,t){e.type!==l&&e.type!==c||u.push({node:e,pos:t})});for(var d=u.length-1;d>=0;d--){var f=u[d],p=r.doc.resolve(r.mapping.map(f.pos));if(p.depth>0){var m=void 0;m=f.node.textContent&&f.node.textContent.length>0?r.doc.resolve(r.mapping.map(f.pos+f.node.textContent.length)):r.doc.resolve(r.mapping.map(f.pos+1));var v=p.blockRange(m);v&&r.lift(v,t.getListLiftTarget(e.schema,p,n))}}return r}function o(e){return function(t,r,n){if(!n)return!1;t=n.state;var o=t.schema.nodes[e.listType],s=t.selection,i=s.$from,l=s.$to,c=i.node(-2),f=i.node(-3),p=a(t.doc,i,l,o);return(c&&c.type===o||f&&f.type===o)&&p?u(e)(t,r):(p||(u(e)(t,r),t=n.state),d(o)(t,r))}}function s(e,t,r,n){n||(n=e.schema.nodes.listItem);var o=t.$from,s=t.$to,i=o.blockRange(s,function(e){return e.childCount&&e.firstChild.type===n});if(!i||i.depth<2||o.node(i.depth-1).type!==n)return r;var a=i.end,l=s.end(i.depth);return a<l&&(r.step(new h.ReplaceAroundStep(a-1,l,a,l,new m.Slice(m.Fragment.from(n.create(void 0,i.parent.copy())),1,0),1,!0)),i=new m.NodeRange(r.doc.resolve(o.pos),r.doc.resolve(l),i.depth)),r.lift(i,h.liftTarget(i)).scrollIntoView()}function i(e,t,r,n,o,i){i||(i=e.schema.nodes.listItem);var a=!1;return o.doc.nodesBetween(t,r,function(r,l){if(!a&&r.type===i&&l>t){a=!0;for(var c=n+3;c>n+2;){var u=o.doc.resolve(o.mapping.map(l));c=u.depth;var d=o.doc.resolve(o.mapping.map(l+r.textContent.length)),f=new v.TextSelection(u,d);o=s(e,f,o,i)}}}),o}function a(e,t,r,n){return 0===l(e,t,r).filter(function(e){return e.type!==n}).length}function l(e,t,r){for(var n=Array(),o=c(e,t).depth,s=e.resolve(t.start(o));s.pos<=r.start(r.depth);){var i=Math.min(s.depth,o),a=s.node(i);if(a&&n.push(a),0===i)break;var l=e.resolve(s.after(i));if(l.start(i)>=e.nodeSize-2)break;l.depth!==s.depth&&(l=e.resolve(l.pos+2)),s=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return n}function c(e,t){var r=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var n=t.node(t.depth),o=t;t.depth>=1;)t=e.resolve(t.before(t.depth)),n=t.node(t.depth),n&&r.indexOf(n.type.name)!==-1&&(o=t);return o}function u(e){return function(t,r){var n=t.tr,o=t.selection,s=o.$from,i=o.$to;return n.doc.nodesBetween(s.pos,i.pos,function(r,o){if(r.isTextblock||"blockquote"===r.type.name||"div"===r.type.name){var s=new v.NodeSelection(n.doc.resolve(n.mapping.map(o))),i=s.$from.blockRange(s.$to);if(!i||s.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var a=i&&h.liftTarget(i);if(void 0===a||null===a)return!1;n.lift(i,a)}}),r&&r(n),!0}}function d(e){return y.autoJoin(g.wrapInList(e),function(t,r){return t.type===r.type&&t.type===e})}function f(e,r,n){return t.toggleList(e,r,n,{listType:"bulletList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})}function p(e,r,n){return t.toggleList(e,r,n,{listType:"orderedList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})}Object.defineProperty(t,"__esModule",{value:!0});var m=r(2),v=r(3),h=r(5),y=r(19),g=r(15),k=r(15);t.rootListDepth=function(e,t){for(var r,n=t.bulletList,o=t.orderedList,s=t.listItem,i=e.depth-1;i>0;i--){var a=e.node(i);if(a.type!==n&&a.type!==o||(r=i),a.type!==n&&a.type!==o&&a.type!==s)break}return r},t.getListLiftTarget=function(e,t,r){for(var n=t.depth,o=e.nodes[r.bulletList],s=e.nodes[r.orderedList],i=e.nodes[r.listItem],a=t.depth;a>0;a--){var l=t.node(a);if(l.type!==o&&l.type!==s||(n=a),l.type!==o&&l.type!==s&&l.type!==i)break}return n-1},t.liftSelectionList=n,t.toggleList=function(e,r,s,a,l){var c=a.listType,u=e.selection,d=u.$from.node(u.$from.depth-2),f=u.$to.node(u.$to.depth-2);if(d&&d.type.name===c&&f&&f.type.name===c){var p=s.state.schema.nodes,m={bulletList:p[a.bulletList],orderedList:p[a.orderedList],listItem:p[a.listItem]},v=t.rootListDepth(u.$to,m),h=i(e,u.$to.pos,u.$to.end(v),v,s.state.tr,m.listItem);return h=n(e,h,a),h.setMeta("commandName",l),r(h),!0}return o(a)(e,r,s)},t.toggleListCommand=o,t.liftFollowingList=i,t.isRangeOfType=a,t.getAncestorNodesBetween=l,t.findAncestorPosition=c,t.liftListItems=u,t.wrapInList=d,t.toggleUnorderedList=f,t.toggleOrderedList=p,t.splitListItemKeepMarks=function(e){return function(t,r){return k.splitListItem(e)(t,function(e){var n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();n&&e.ensureMarks(n),r(e)})}}},function(e,t){e.exports=s},function(e,t){e.exports=i}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prosemirror-state"),require("prosemirror-model"),require("tslib"),require("prosemirror-transform"),require("prosemirror-schema-list"),require("prosemirror-tables"),require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules")):"function"==typeof define&&define.amd?define(["prosemirror-state","prosemirror-model","tslib","prosemirror-transform","prosemirror-schema-list","prosemirror-tables","prosemirror-commands","prosemirror-history","prosemirror-inputrules"],t):"object"==typeof exports?exports.KendoEditorCommon=t(require("prosemirror-state"),require("prosemirror-model"),require("tslib"),require("prosemirror-transform"),require("prosemirror-schema-list"),require("prosemirror-tables"),require("prosemirror-commands"),require("prosemirror-history"),require("prosemirror-inputrules")):e.KendoEditorCommon=t(e["prosemirror-state"],e["prosemirror-model"],e.tslib,e["prosemirror-transform"],e["prosemirror-schema-list"],e["prosemirror-tables"],e["prosemirror-commands"],e["prosemirror-history"],e["prosemirror-inputrules"])}(window,function(e,t,r,n,o,s,a,i,l){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=16)}([function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(0),s=r(6),a=r(9),i=r(4);t.changeStyles=function(e,t){var r=t.style,n=t.value,o=t.newValue,s=[];if(e){var a=e.split(/\s*;\s*/).filter(function(e){return e}),i=a.filter(function(e){if(!e.toLowerCase().trim().startsWith(r))return!0;var t=e.split(":")[1].trim();return!n.test(t)||(s.push(t),!1)});return o&&i.push(r+": "+o),{style:i.join("; ")+(i.length?";":""),changed:!!o||i.length!==a.length,styleMatches:s}}return{changed:!1,styleMatches:s,style:null}},t.changeStyle=function(e,t){return function(r,n,o){var a=r.selection,l=a.empty,u=a.$cursor,c=a.ranges;if(l&&!u||!s.markApplies(r.doc,c,e))return!1;var d=!1;if(n)if(o=o||r.tr,u){var f=r.storedMarks||u.marks();if(e.isInSet(f)){var p=i.changeStyleFromMark(f,t);n(o.removeStoredMark(e)),n(o.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<c.length;m++){var g=c[m],v=g.$from,h=g.$to;d=i.changeStyleMark(o,v.pos,h.pos,t,e)}d&&(o.scrollIntoView(),n(o))}return d}},t.canInsert=function(e,t){for(var r=e.selection.$from,n=r.depth;n>=0;n--){var o=r.index(n);if(r.node(n).canReplaceWith(o,o,t))return!0}return!1},t.getTypeName=function(e){return e instanceof n.Node?e.type.name:e.name},t.findParentNode=function(e){return function(t){for(var r=t.$from,n=r.depth;n>0;n--){var o=r.node(n);if(e(o))return{depth:n,node:o}}}},t.findNthParentNode=function(e,t){return void 0===t&&(t=1),function(r){for(var n=r.$from,o=n.depth;o>0;o--){var s=n.node(o);if(e(s)&&0===(t-=1))return{depth:o,node:s}}}},t.findNthParentNodeOfType=function(e,r){return void 0===r&&(r=1),function(n){return t.findNthParentNode(function(r){return t.getTypeName(r)===t.getTypeName(e)},r)(n)}},t.insertNode=function(e,t){return function(r,n){var o=r.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),n(o)}},t.isNullOrUndefined=function(e){return null==e},t.safeString=function(e){return t.isNullOrUndefined(e)?"":e.toString()},t.createContentNode=function(e){var r=document.createElement("div");return r.innerHTML=t.safeString(e).trim(),n.DOMParser.fromSchema(new n.Schema({nodes:a.nodes,marks:a.marks})).parse(r)},t.hasSameMarkup=function(e,r){var o=n.Fragment.from(t.createContentNode(e)),s=n.Fragment.from(t.createContentNode(r));return o.eq(s)},t.first=function(e){return e[0]},t.last=function(e){return e[e.length-1]},t.split=function(e){return function(t){return t.split(e)}},t.trim=function(e){return e.trim()},t.filter=function(e){return function(t){return t.filter(e)}},t.getUniqueStyleValues=function(e,r){if(e.hasNodesWithoutMarks)return"";var n=e.marks.filter(function(e){return"style"===e.type.name}).map(function(e){return e.attrs.style}).map(t.split(";")).map(t.filter(function(e){return e.includes(r)})).map(function(e){return 0!==e.length?e:[r+": INVALID"]}).map(t.first).map(t.split(":")).map(t.last).map(t.trim).reduce(function(e,t){return e.indexOf(t)>-1?e:e.concat([t])},[]);return n.indexOf("INVALID")>-1||1!==n.length?"":n[0]},t.getSelectionText=function(e){var t=e.selection;if(t instanceof o.TextSelection||t instanceof o.AllSelection){var r=t.content().content;return r.textBetween(0,r.size)}return""},t.getNodeFromSelection=function(e){if(e.selection instanceof o.NodeSelection)return e.selection.node}},function(e,t){e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(2),s=r(6);t.changeStyleFromMark=function(e,t){var r=e.find(function(e){return"style"===e.type.name}),n=r&&r.attrs.style;return o.changeStyles(n,t)},t.changeStyleMark=function(e,r,o,s,a){var i=a.create({style:s.style}),l=[],u=[],c=null,d=null;return e.doc.nodesBetween(r,o,function(e,f,p){if(e.isInline){var m=e.marks;if(!i.isInSet(m)&&p.type.allowsMarkType(i.type)){var g=Math.max(f,r),v=Math.min(f+e.nodeSize,o),h=t.changeStyleFromMark(m,s);if(h.changed||s.newValue){for(var y=h.changed?{style:h.style}:{style:[s.style]+": "+s.newValue+";"},k=a.create(y),M=k.addToSet(m),b=0;b<m.length;b++)m[b].isInSet(M)||(c&&c.to===g&&c.mark.eq(m[b])?c.to=v:(c=new n.RemoveMarkStep(g,v,m[b]),l.push(c)));var S=d&&d.to===g,_=S&&k.attrs.style===d.mark.attrs.style;S&&_?d.to=v:k.attrs.style&&(d=new n.AddMarkStep(g,v,k),u.push(d))}}}}),l.forEach(function(t){return e.step(t)}),u.forEach(function(t){return e.step(t)}),l.length+u.length>0},t.hasStyle=function(e,r){var n=e.selection,o=n.from,s=n.$from,a=n.to,i=n.empty,l=!1,u={style:r.name,value:r.value};return i?l=t.changeStyleFromMark(e.storedMarks||s.marks(),u).changed:e.doc.nodesBetween(o,a,function(e,r,n){!l&&e.isInline&&(l=t.changeStyleFromMark(e.marks,u).changed)}),l},t.getInlineStyles=function(e,r){var n,o=e.selection,s=o.from,a=o.$from,i=o.to,l=o.empty,u=[],c={style:r.name,value:r.value};return l?(n=t.changeStyleFromMark(e.storedMarks||a.marks(),c)).changed&&(u=n.styleMatches):e.doc.nodesBetween(s,i,function(e,r,o){e.isInline&&((n=t.changeStyleFromMark(e.marks,c)).changed?u.push.apply(u,n.styleMatches):u.push(null))}),u.filter(function(e){return null!==e})},t.changeStyle=function(e,r){return function(n,o,a){var i=n.selection,l=i.empty,u=i.$cursor,c=i.ranges;if(l&&!u||!s.markApplies(n.doc,c,e))return!1;var d=!1;if(o)if(a=a||n.tr,u){var f=n.storedMarks||u.marks();if(e.isInSet(f)){var p=t.changeStyleFromMark(f,r);o(a.removeStoredMark(e)),o(a.addStoredMark(e.create({style:p.style}))),d=!0}}else{for(var m=0;m<c.length;m++){var g=c[m],v=g.$from,h=g.$to;d=t.changeStyleMark(a,v.pos,h.pos,r,e)}d&&(a.scrollIntoView(),o(a))}return d}},t.toggleInlineFormat=function(e,r,n){return function(o,a){var i=o.schema.marks,l=e.altStyle,u=e.altMarks,c=void 0===u?[]:u,d=e.mark;r=r||o.tr;var f=!1,p=!1,m=function(){return p=!0};if(l&&i.style){var g=i.style;f=t.changeStyle(g,{style:l.name,value:l.value})(o,m,r)}var v=[d].concat(c).filter(function(e){return i[e]}).map(function(e){return s.hasMark(o,{mark:e})&&i[e]}).filter(function(e){return e});return v.length?s.removeMarks(v,o,m,r):f||s.toggleMark(i[d],n,r)(o,m),p&&a(r),p}},t.applyInlineStyle=function(e,r){return function(n,o){var s=n.schema.marks,a=t.changeStyle(s.style,{style:e.style,value:/^.+$/,newValue:e.value}),i=n.tr;return r&&(i.setMeta("commandName",r),i.setMeta("args",e)),a(n,o,i)}}},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5),o=r(1),s=r(0),a=r(4);t.markApplies=function(e,t,r){for(var n=function(n){var o=t[n],s=o.$from,a=o.$to,i=0===s.depth&&e.type.allowsMarkType(r);if(e.nodesBetween(s.pos,a.pos,function(e){if(i)return!1;i=e.inlineContent&&e.type.allowsMarkType(r)}),i)return{v:!0}},o=0;o<t.length;o++){var s=n(o);if(s)return s.v}return!1},t.toggleMark=function(e,r,n){return function(o,s){var a=o.selection,i=a.empty,l=a.$cursor,u=a.ranges;if(i&&!l||!t.markApplies(o.doc,u,e))return!1;if(s)if(l)e.isInSet(o.storedMarks||l.marks())?s(n.removeStoredMark(e)):s(n.addStoredMark(e.create(r)));else{for(var c=!1,d=0;!c&&d<u.length;d++){var f=u[d],p=f.$from,m=f.$to;c=o.doc.rangeHasMark(p.pos,m.pos,e)}for(d=0;d<u.length;d++){var g=u[d];p=g.$from,m=g.$to;c?n.removeMark(p.pos,m.pos,e):n.addMark(p.pos,m.pos,e.create(r))}s(n.scrollIntoView())}return!0}},t.removeMark=function(e,t,r,s){void 0===s&&(s=null);var a=[],i=0;return e.doc.nodesBetween(t,r,function(e,n){if(e.isInline){i++;var l=null;if(s instanceof o.MarkType){var u=s.isInSet(e.marks);u&&(l=[u])}else s?s.isInSet(e.marks)&&(l=[s]):l=e.marks;if(l&&l.length)for(var c=Math.min(n+e.nodeSize,r),d=0;d<l.length;d++){for(var f=l[d],p=void 0,m=0;m<a.length;m++){var g=a[m];g.step===i-1&&f.eq(g.style)&&(p=g)}p?(p.to=c,p.step=i):a.push({style:f,from:Math.max(n,t),to:c,step:i})}}}),a.forEach(function(t){return e.step(new n.RemoveMarkStep(t.from,t.to,t.style))}),e},t.removeMarks=function(e,r,n,o){var s=r.selection,a=s.$cursor,i=s.ranges;if(o=o||r.tr,a)e.forEach(function(e){e.isInSet(r.storedMarks||a.marks())&&n(o.removeStoredMark(e))});else{for(var l=function(r){var n=i[r],s=n.$from,a=n.$to;e.forEach(function(e){t.removeMark(o,s.pos,a.pos,e)})},u=0;u<i.length;u++)l(u);n(o.scrollIntoView())}return!0};t.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,r=void 0===t?[]:t;return function(e,t){var n,o=e.schema,s=e.selection,a=s.$cursor,i=s.from,l=s.to,u=e.tr,c=(n=r,n instanceof Array?n:[n]).map(function(e){return e.name});a||(Object.keys(o.marks).map(function(e){return o.marks[e]}).filter(function(e){return-1===c.indexOf(e.name)}).forEach(function(e){return u.removeMark(i,l,e)}),t(u))}},t.getParentMark=function(e,t){var r=e.selection,n=r.from,o=r.$from,s=r.to,a=r.empty,i=e.doc;if(a)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return i.nodesBetween(n,s,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},t.hasMark=function(e,t){var r,n=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return n[e]}),s=t.altStyle,i=e.selection,l=i.from,u=i.$from,c=i.to,d=i.empty,f=n[t.mark],p=e.doc,m=!1;return d?(r=e.storedMarks||u.marks(),m=f&&f.isInSet(r)||o.some(function(e){return n[e].isInSet(r)})):m=f&&p.rangeHasMark(l,c,f)||o.some(function(e){return p.rangeHasMark(l,c,n[e])}),!m&&s?a.hasStyle(e,s):!!m},t.getMark=function(e,t){var r,n=e.selection,o=n.from,s=n.$from,a=n.to,i=n.empty,l=e.doc;return i?r=t.isInSet(e.storedMarks||s.marks()):l.nodesBetween(o,a,function(e){e.isInline&&!r&&(r=t.isInSet(e.marks))}),r};t.getActiveMarks=function(e,t){var r=e.selection,n=!1;if(r instanceof s.TextSelection&&r.$cursor)return{hasNodesWithoutMarks:n,marks:r.$cursor.marks().filter(function(e){return!t||e.type.name===t.name})};var o=[];return r.content().content.descendants(function(e){if("text"===e.type.name){var r=t?function(e,t){return t.marks.filter(function(t){return t.type.name===e.name})}(t,e):e.marks;e.marks.length>0&&r.length>0?o.push.apply(o,r):n=!0}}),{hasNodesWithoutMarks:n,marks:o}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(2),s=r(5),a=r(1),i=r(0);t.changeBlockNode=function(e,t,r,n,o,i){var l=e.selection,u=l.from,c=l.to,d=!1;if(e.doc.nodesBetween(u,c,function(t,r){if(d)return!1;if(t.isTextblock&&!t.hasMarkup(o,i))if(t.type===o)d=!0;else{var n=e.doc.resolve(r),s=n.index();d=n.parent.canReplaceWith(s,s+1,o)}}),!d)return!1;if(t){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var f=r.steps.length;r.doc.nodesBetween(u,c,function(e,t){if(e.eq(n)&&e.isTextblock&&!e.hasMarkup(o,i)&&function(e,t,r){var n=e.resolve(t),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}(r.doc,r.mapping.slice(f).map(t),o)){r.clearIncompatible(r.mapping.slice(f).map(t,1),o);var l=r.mapping.slice(f),u=l.map(t,1),c=l.map(t+e.nodeSize,1),d=new a.Slice(a.Fragment.from(o.create(i,null,e.marks)),0,0);return r.step(new s.ReplaceAroundStep(u,c,u+1,c-1,d,1,!0)),!1}})}return!0},t.blockNodes=function(e){var t=e.selection,r=t.from,n=t.to,o=t.$from,s=[];return t.node?t.node.isBlock?s.push(t.node):o.parent&&o.parent.isBlock&&s.push(o.parent):e.doc.nodesBetween(r,n,function(e){e.isBlock&&s.push(e)}),s},t.formatBlockElements=function(e,r){return function(o,s){var a=t.blockNodes(o),i=o.schema.nodes,l=!1,u=o.tr;return u.setMeta("commandName",r),u.setMeta("args",{value:e}),a.forEach(function(r){if(r.type.isTextblock)if("p"===e){var a=r.attrs,c=a.level,d=n.__rest(a,["level"]);l=t.changeBlockNode(o,s,u,r,i.paragraph,d)||l}else if(/^h[1-6]$/i.test(e)){c=parseInt(e.substr(1),10);l=t.changeBlockNode(o,s,u,r,i.heading,n.__assign({},r.attrs,{level:c}))||l}else if("blockquote"===e){var f=r.attrs;c=f.level,d=n.__rest(f,["level"]);l=t.changeBlockNode(o,s,u,r,i.blockquote,d)||l}}),l&&s(u.scrollIntoView()),l}},t.getBlockFormats=function(e){var r=t.blockNodes(e),n=e.schema.nodes,o=[];return r.forEach(function(e){if(e.type===n.paragraph)o.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){o.push("h"+t);break}}),o},t.addStyles=function(e,t){var r=e.attrs.style,n=null,s=null;r&&t.forEach(function(e){s={style:e.name,value:/^.+$/,newValue:e.value},n=o.changeStyles(r,s),r=n.changed?n.style:r});return r=r||t.reduce(function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""},""),Object.assign({},e.attrs,{style:r||null})},t.hasNode=function(e,t){var r=e.selection,n=r.from,o=r.to,s=!1;return e.doc.nodesBetween(n,o,function(e){return!(s=s||e.type===t)}),s};var l=function(e){return function(e,t){return Object.keys(e).filter(function(e){return t(e)}).reduce(function(t,r){var n;return Object.assign(t,((n={})[r]=e[r],n))},{})}(e,function(t){return null!==e[t]&&void 0!==e[t]&&""!==e[t]})};t.getNodeTagName=function(e,t){var r,n=e.type.spec.parseDOM||[],o=e.attrs;return(r=1===n.length?n[0]:n.find(function(r){var n=a.DOMSerializer.fromSchema(t).serializeNode(e);return JSON.stringify(r.getAttrs(n))===JSON.stringify(l(o))}))?r.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},t.activeNode=function(e){var r,n=e.schema.nodes.doc;if(e.selection instanceof i.AllSelection)r=e.doc;else if(e.selection instanceof i.TextSelection){var s=e.selection.$anchor,a=s.node(s.blockRange().depth);r=o.getTypeName(a)===o.getTypeName(n)?s.node():a}else e.selection instanceof i.NodeSelection&&(r=e.selection.node);return{name:o.getTypeName(r),tag:t.getNodeTagName(r,e.schema)}}},function(e,t){e.exports=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(10),s=["blockquote",0],a=["hr"],i=["pre",["code",0]],l=["ol",0],u=["ul",0],c=["li",0],d=function(e){for(var t,r={},n=e.attributes,o=0;o<n.length;o++)r[(t=n[o]).name]=t.value;return r},f=function(e,t){for(var r in e)if(r&&null!==e[r]&&r!==t)return!0;return!1},p=function(e,t){var r={};for(var n in e)n&&null!==e[n]&&n!==t&&(r[n]=e[n]);return r},m=function(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t},g=n.__assign({link:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:d}],toDOM:function(e){return["a",p(e.attrs),0]}}},m("strong"),m("b"),m("em"),m("i"),m("u"),m("del"),m("sub"),m("sup"),m("code"),{style:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"span",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["span",p(e.attrs),0]:["span",0]}}});t.marks=g;var v=n.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"p",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["p",p(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"div",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["div",p(e.attrs),0]:["div",0]}},blockquote:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return s}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return a}},heading:{attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return n.__assign({},d(e),{level:1})}},{tag:"h2",getAttrs:function(e){return n.__assign({},d(e),{level:2})}},{tag:"h3",getAttrs:function(e){return n.__assign({},d(e),{level:3})}},{tag:"h4",getAttrs:function(e){return n.__assign({},d(e),{level:4})}},{tag:"h5",getAttrs:function(e){return n.__assign({},d(e),{level:5})}},{tag:"h6",getAttrs:function(e){return n.__assign({},d(e),{level:6})}}],toDOM:function(e){return f(e.attrs,"level")?["h"+e.attrs.level,p(e.attrs,"level"),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return i}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:n.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["img",p(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["br",p(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return n.__assign({},d(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?f(e.attrs,"order")?["ol",p(e.attrs,"order"),0]:l:["ol",n.__assign({},p(e.attrs,"order"),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"ul",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["ul",p(e.attrs),0]:u}},list_item:{content:"block*",attrs:n.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"li",getAttrs:d}],toDOM:function(e){return f(e.attrs)?["li",p(e.attrs),0]:c},defining:!0}},o.tableNodes({tableGroup:"block",cellContent:"block+",cellAttributes:{}}));t.nodes=v},function(e,t){e.exports=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(12);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:n.__assign({},o.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:n.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:n.__assign({},t.listsTypes)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(3),o=r(1),s=r(0),a=r(5),i=r(14),l=r(8),u=r(8),c=r(12);function d(e,r,n){var o=e.selection,s=o.from,a=o.to,i=e.schema.nodes,l=i.paragraph,u=i.heading,c=[];r.doc.nodesBetween(s,a,function(e,t){e.type!==l&&e.type!==u||c.push({node:e,pos:t})});for(var d=c.length-1;d>=0;d--){var f=c[d],p=r.doc.resolve(r.mapping.map(f.pos));if(p.depth>0){var m=void 0;m=f.node.textContent&&f.node.textContent.length>0?r.doc.resolve(r.mapping.map(f.pos+f.node.textContent.length)):r.doc.resolve(r.mapping.map(f.pos+1));var g=p.blockRange(m);g&&r.lift(g,t.getListLiftTarget(e.schema,p,n))}}return r}function f(e){return function(t,r,n){if(!n)return!1;var o=(t=n.state).schema.nodes[e.listType],s=t.selection,a=s.$from,i=s.$to,l=a.node(-2),u=a.node(-3),c=g(t.doc,a,i,o);return(l&&l.type===o||u&&u.type===o)&&c?y(e)(t,r):(c||(y(e)(t,r),t=n.state),k(o)(t,r))}}function p(e,t,r,n){n||(n=e.schema.nodes.listItem);var s=t.$from,i=t.$to,l=s.blockRange(i,function(e){return e.childCount&&e.firstChild.type===n});if(!l||l.depth<2||s.node(l.depth-1).type!==n)return r;var u=l.end,c=i.end(l.depth);return u<c&&(r.step(new a.ReplaceAroundStep(u-1,c,u,c,new o.Slice(o.Fragment.from(n.create(void 0,l.parent.copy())),1,0),1,!0)),l=new o.NodeRange(r.doc.resolve(s.pos),r.doc.resolve(c),l.depth)),r.lift(l,a.liftTarget(l)).scrollIntoView()}function m(e,t,r,n,o,a){a||(a=e.schema.nodes.listItem);var i=!1;return o.doc.nodesBetween(t,r,function(r,l){if(!i&&r.type===a&&l>t){i=!0;for(var u=n+3;u>n+2;){var c=o.doc.resolve(o.mapping.map(l));u=c.depth;var d=o.doc.resolve(o.mapping.map(l+r.textContent.length)),f=new s.TextSelection(c,d);o=p(e,f,o,a)}}}),o}function g(e,t,r,n){return 0===v(e,t,r).filter(function(e){return e.type!==n}).length}function v(e,t,r){for(var n=Array(),o=h(e,t).depth,s=e.resolve(t.start(o));s.pos<=r.start(r.depth);){var a=Math.min(s.depth,o),i=s.node(a);if(i&&n.push(i),0===a)break;var l=e.resolve(s.after(a));if(l.start(a)>=e.nodeSize-2)break;l.depth!==s.depth&&(l=e.resolve(l.pos+2)),s=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return n}function h(e,t){var r=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var n=t.node(t.depth),o=t;t.depth>=1;)(n=(t=e.resolve(t.before(t.depth))).node(t.depth))&&-1!==r.indexOf(n.type.name)&&(o=t);return o}function y(e){return function(t,r){var n=t.tr,o=t.selection,i=o.$from,l=o.$to;return n.doc.nodesBetween(i.pos,l.pos,function(r,o){if(r.isTextblock||"blockquote"===r.type.name||"div"===r.type.name){var i=new s.NodeSelection(n.doc.resolve(n.mapping.map(o))),l=i.$from.blockRange(i.$to);if(!l||i.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var u=l&&a.liftTarget(l);if(null==u)return!1;n.lift(l,u)}}),r&&r(n),!0}}function k(e){return i.autoJoin(l.wrapInList(e),function(t,r){return t.type===r.type&&t.type===e})}t.rootListDepth=function(e,t){for(var r,n=t.bulletList,o=t.orderedList,s=t.listItem,a=e.depth-1;a>0;a--){var i=e.node(a);if(i.type!==n&&i.type!==o||(r=a),i.type!==n&&i.type!==o&&i.type!==s)break}return r},t.getListLiftTarget=function(e,t,r){for(var n=t.depth,o=e.nodes[r.bulletList],s=e.nodes[r.orderedList],a=e.nodes[r.listItem],i=t.depth;i>0;i--){var l=t.node(i);if(l.type!==o&&l.type!==s||(n=i),l.type!==o&&l.type!==s&&l.type!==a)break}return n-1},t.liftSelectionList=d,t.toggleList=function(e,r,n,o,s){var a=o.listType,i=e.selection,l=i.$from.node(i.$from.depth-2),u=i.$to.node(i.$to.depth-2);if(l&&l.type.name===a&&u&&u.type.name===a){var c=n.state.schema.nodes,p={bulletList:c[o.bulletList],orderedList:c[o.orderedList],listItem:c[o.listItem]},g=t.rootListDepth(i.$to,p),v=m(e,i.$to.pos,i.$to.end(g),g,n.state.tr,p.listItem);return(v=d(e,v,o)).setMeta("commandName",s),r(v),!0}return f(o)(e,r,n)},t.toggleListCommand=f,t.liftFollowingList=m,t.isRangeOfType=g,t.getAncestorNodesBetween=v,t.findAncestorPosition=h,t.liftListItems=y,t.wrapInList=k,t.toggleUnorderedList=function(e,r,o){return t.toggleList(e,r,o,n.__assign({listType:c.bulletList.listType},c.bulletList.types))},t.toggleOrderedList=function(e,r,o){return t.toggleList(e,r,o,n.__assign({listType:c.orderedList.listType},c.orderedList.types))},t.splitListItemKeepMarks=function(e){return function(t,r){return u.splitListItem(e)(t,function(e){var n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();n&&e.ensureMarks(n),r(e)})}}},function(e,t){e.exports=a},function(e,t){e.exports=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(17);t.getHtml=n.getHtml,t.setHtml=n.setHtml;var o=r(4);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var s=r(18);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var a=r(19);t.insertText=a.insertText;var i=r(20);t.insertImage=i.insertImage;var l=r(21);t.alignBlocks=l.alignBlocks,t.isAligned=l.isAligned;var u=r(7);t.hasNode=u.hasNode,t.activeNode=u.activeNode,t.formatBlockElements=u.formatBlockElements;var c=r(6);t.hasMark=c.hasMark,t.getMark=c.getMark,t.getActiveMarks=c.getActiveMarks,t.removeAllMarks=c.removeAllMarks;var d=r(22);t.indent=d.indent,t.canIndentAsListItem=d.canIndentAsListItem,t.outdent=d.outdent,t.canOutdentAsListItem=d.canOutdentAsListItem,t.isIndented=d.isIndented,t.canBeIndented=d.canBeIndented;var f=r(13);t.toggleOrderedList=f.toggleOrderedList,t.toggleUnorderedList=f.toggleUnorderedList;var p=r(2);t.createContentNode=p.createContentNode,t.hasSameMarkup=p.hasSameMarkup,t.getUniqueStyleValues=p.getUniqueStyleValues,t.getSelectionText=p.getSelectionText,t.getNodeFromSelection=p.getNodeFromSelection,t.canInsert=p.canInsert,t.insertNode=p.insertNode;var m=r(15);t.redo=m.redo,t.undo=m.undo;var g=r(23);t.alignLeftRules=g.alignLeftRules,t.alignCenterRules=g.alignCenterRules,t.alignRightRules=g.alignRightRules,t.alignRemoveRules=g.alignRemoveRules;var v=r(11);t.indentRules=v.indentRules,t.outdentRules=v.outdentRules;var h=r(9);t.nodes=h.nodes,t.marks=h.marks;var y=r(24);t.buildKeymap=y.buildKeymap,t.buildListKeymap=y.buildListKeymap;var k=r(26);t.bold=k.bold,t.italic=k.italic,t.underline=k.underline,t.strikethrough=k.strikethrough,t.subscript=k.subscript,t.superscript=k.superscript,t.link=k.link;var M=r(27);t.createTable=M.createTable;var b=r(10);t.addRowBefore=b.addRowBefore,t.addRowAfter=b.addRowAfter,t.addColumnBefore=b.addColumnBefore,t.addColumnAfter=b.addColumnAfter,t.deleteRow=b.deleteRow,t.deleteColumn=b.deleteColumn,t.deleteTable=b.deleteTable,t.mergeCells=b.mergeCells,t.splitCell=b.splitCell,t.selectionCell=b.selectionCell},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1),o=r(0);t.createContentNode=function(e,t,r){var o=document.createElement("div");return o.innerHTML=e,n.DOMParser.fromSchema(t).parse(o,r)},t.getHtml=function(e){var t=n.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),r=document.createElement("div");return r.appendChild(t),r.innerHTML},t.setHtml=function(e,r,n){return void 0===r&&(r="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(s,a){return a(s.tr.setSelection(new o.AllSelection(s.doc)).replaceSelectionWith(t.createContentNode(e,s.schema,n)).setMeta("commandName",r))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),o=r(6),s=r(0);t.removeLink=function(e,t){return function(r,s){var a=r.selection.$cursor;if(a){var i=a.parent,l=a.index(),u=r.schema.marks[e.mark],c=i.child(l).marks.find(function(e){return e.type===u}),d=i.childCount,f=a.pos-a.textOffset,p=i.child(l).nodeSize,m=void 0,g=void 0;for(m=l-1;m>=0&&c.isInSet(i.child(m).marks);)p+=g=i.child(m).nodeSize,f-=g,m-=1;for(m=l+1;m<d&&c.isInSet(i.child(m).marks);)p+=i.child(m).nodeSize,m+=1;s(o.removeMark(t||r.tr,f,f+p,c))}else n.toggleInlineFormat(e,t)(r,s)}},t.applyLink=function(e,r){var a=e.mark,i=e.attrs;return function(e,l){var u=e.schema.marks,c=e.tr;r&&(c.setMeta("commandName",r),c.setMeta("args",i));var d=!1,f=function(){return d=!0};if(o.getParentMark(e,u[a]))!function(e,t){return function(r,n){var o=r.selection,s=o.$cursor,a=o.from,i=o.to,l=r.schema.marks[e.mark];if(s){var u=s.parent,c=s.index(),d=u.child(c).marks.find(function(e){return e.type===l}),f=u.childCount,p=s.pos-s.textOffset,m=u.child(c).nodeSize,g=void 0,v=void 0;for(g=c-1;g>=0&&d.isInSet(u.child(g).marks);)m+=v=u.child(g).nodeSize,p-=v,g-=1;for(g=c+1;g<f&&d.isInSet(u.child(g).marks);)m+=u.child(g).nodeSize,g+=1;t.removeMark(p,p+m,l),t.addMark(p,p+m,l.create(e.attrs)),n(t)}else t.doc.nodesBetween(a,i,function(r,o){r.isInline&&l.isInSet(r.marks)&&(t.removeMark(o,o+r.nodeSize,l),t.addMark(o,o+r.nodeSize,l.create(e.attrs)),n(t))})}}({mark:a,attrs:i},c)(e,f);else{var p=e;o.hasMark(e,{mark:a})&&(t.removeLink({mark:a,attrs:i},c)(e,f),p=s.EditorState.create({doc:c.doc,selection:c.selection})),d?o.toggleMark(u[a],i,c)(p,f):n.toggleInlineFormat({mark:a},c,i)(p,f)}return d&&l(c),d}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(e){return function(t,r){r(t.tr.insertText(e.text,e.from,e.to))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);t.insertImage=function(e){return function(t,r){var o=t.schema.nodes.image,s=o.createAndFill(e);n.insertNode(s)(t,function(t){return r(t.setMeta("commandName","insertImage").setMeta("args",e))})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);t.alignBlocks=function(e){return function(t,r){var o=n.blockNodes(t),s=t.tr,a=!1;return o.forEach(function(o){if(o.type.isTextblock){var i={},l=e.find(function(e){return e.node===o.type.name});l&&(i=n.addStyles(o,l.style)),a=n.changeBlockNode(t,r,s,o,o.type,i)||a}}),a&&r(s.scrollIntoView()),a}},t.isAligned=function(e,t){var r=n.blockNodes(e),o=!1;return r.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var r=t.find(function(t){return t.node===e.type.name});r&&(o=r.style.every(function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)}))}}),o}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(8),o=r(11),s=r(7),a=r(2);t.indentBlocks=function(e,t,r){return function(n,o){var a=s.blockNodes(n),i=n.tr,l=!1;return i.setMeta("commandName",t),a.forEach(function(t){if(t.type.isTextblock){var a=void 0,u=e.find(function(e){return e.node===t.type.name});if(u){var c="rtl"===r?u.rtlStyle:u.style,d={name:c,value:u.step>0?""+u.step+u.unit:""};if(t.attrs.style){var f=new RegExp(c+":\\s?(\\d+)"+u.unit,"i"),p=t.attrs.style.match(f);if(p){var m=parseFloat(p[1])+u.step;m=m<=0?"":m,d.value=""+m+(m?u.unit:"")}}a=s.addStyles(t,[d])}a&&(l=s.changeBlockNode(n,o,i,t,t.type,a)||l)}}),l&&o(i.scrollIntoView()),l}},t.isIndented=function(e,t,r){var n=s.blockNodes(e),o=!1;return n.forEach(function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var n=t.find(function(t){return t.node===e.type.name});if(n){var s="rtl"===r?n.rtlStyle:n.style,a=new RegExp(s+":\\s?\\d+"+n.unit,"i");o=a.test(e.attrs.style)}}}),o},t.canIndentAsListItem=function(e,t){return n.sinkListItem(t)(e)},t.canOutdentAsListItem=function(e,t){var r=e.schema.nodes[t.listsTypes.listItem],o=e.schema.nodes[t.listsTypes.orderedList],s=e.schema.nodes[t.listsTypes.bulletList],i=!!a.findNthParentNodeOfType(o,2)(e.selection),l=!!a.findNthParentNodeOfType(s,2)(e.selection);return(i||l)&&n.liftListItem(r)(e)},t.canBeIndented=function(e,r){var n=e.schema.nodes,a=n[o.indentRules.listsTypes.listItem];return(t.isIndented(e,r.nodes)||o.indentRules.nodes.some(function(t){return n[t.node]&&s.hasNode(e,n[t.node])}))&&!s.hasNode(e,a)},t.indent=function(e,r){var s=e.schema.nodes[o.indentRules.listsTypes.listItem],a=t.canBeIndented(e,o.indentRules);t.canIndentAsListItem(e,s)?n.sinkListItem(s)(e,r):a&&t.indentBlocks(o.indentRules.nodes)(e,r)},t.outdent=function(e,r){var s=e.schema.nodes[o.outdentRules.listsTypes.listItem],a=t.canBeIndented(e,o.outdentRules);t.canOutdentAsListItem(e,o.outdentRules)?n.liftListItem(s)(e,r):a&&t.indentBlocks(o.outdentRules.nodes)(e,r)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){return{name:e,value:t}};t.alignLeftRules=[{node:"paragraph",style:[n("text-align","left")]},{node:"heading",style:[n("text-align","left")]},{node:"listItem",style:[n("text-align","left"),n("list-style-position","inside")]}],t.alignRightRules=[{node:"paragraph",style:[n("text-align","right")]},{node:"heading",style:[n("text-align","right")]},{node:"listItem",style:[n("text-align","right"),n("list-style-position","inside")]}],t.alignCenterRules=[{node:"paragraph",style:[n("text-align","center")]},{node:"heading",style:[n("text-align","center")]},{node:"listItem",style:[n("text-align","center"),n("list-style-position","inside")]}],t.alignRemoveRules=[{node:"paragraph",style:[n("text-align","")]},{node:"heading",style:[n("text-align","")]},{node:"listItem",style:[n("text-align",""),n("list-style-position","")]}]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),o=r(15),s=r(25),a=r(13),i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);t.buildKeymap=function(e){var t={};if(t["Mod-z"]=o.undo,t["Shift-Mod-z"]=o.redo,t.Backspace=n.chainCommands(s.undoInputRule,n.deleteSelection,n.joinBackward,n.selectNodeBackward),t.Enter=n.chainCommands(n.newlineInCode,n.createParagraphNear,n.liftEmptyBlock,n.splitBlockKeepMarks),i||(t["Mod-y"]=o.redo),e.marks.strong&&(t["Mod-b"]=n.toggleMark(e.marks.strong)),e.marks.em&&(t["Mod-i"]=n.toggleMark(e.marks.em)),e.marks.underline&&(t["Mod-u"]=n.toggleMark(e.marks.underline)),e.nodes.hardBreak){var r=e.nodes.hardBreak,a=n.chainCommands(n.exitCode,function(e,t){return t(e.tr.replaceSelectionWith(r.create()).scrollIntoView()),!0});t["Mod-Enter"]=a,t["Shift-Enter"]=a,i&&(t["Ctrl-Enter"]=a)}return t},t.buildListKeymap=function(e){var t={};return e.nodes.listItem&&(t.Enter=a.splitListItemKeepMarks(e.nodes.listItem)),t}},function(e,t){e.exports=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bold={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},t.italic={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},t.underline={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},t.strikethrough={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},t.subscript={mark:"sub"},t.superscript={mark:"sup"},t.link={mark:"link"},t.unlink={mark:"link"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=function(e,t,r){for(var n=e.table,o=e.table_row,s=e.table_cell,a=[],i=[],l=0;l<t+1;l++){i.length=0;for(var u=0;u<r+1;u++)i.push(s.createAndFill());a.push(o.createAndFill(void 0,i))}return n.createAndFill(void 0,a)}}])});

@@ -105,2 +105,6 @@ import * as tslib_1 from "tslib";

}
else if (value === 'blockquote') {
var _b = node.attrs, level = _b.level, attrs = tslib_1.__rest(_b, ["level"]);
result = changeBlockNode(state, dispatch, tr, node, nodes.blockquote, attrs) || result;
}
}

@@ -171,4 +175,4 @@ });

.reduce(function (acc, curr) {
var _a;
return Object.assign(acc, (_a = {}, _a[curr] = obj[curr], _a));
var _a;
}, {});

@@ -175,0 +179,0 @@ };

@@ -9,9 +9,3 @@ import { insertNode } from './utils';

var newImage = image.createAndFill(attrs);
insertNode({
state: state,
dispatch: function (tr) {
return dispatch(tr.setMeta('commandName', commandName)
.setMeta('args', attrs));
}
}, newImage);
insertNode(newImage)(state, function (tr) { return dispatch(tr.setMeta('commandName', commandName).setMeta('args', attrs)); });
}; };

@@ -74,5 +74,7 @@ import { sinkListItem, liftListItem } from 'prosemirror-schema-list';

export var canOutdentAsListItem = function (state, rules) {
var listItem = rules.listsTypes.listItem;
var isNestedInOL = !!findNthParentNodeOfType(rules.listsTypes.orderedList, 2)(state.selection);
var isNestedInUL = !!findNthParentNodeOfType(rules.listsTypes.bulletList, 2)(state.selection);
var listItem = state.schema.nodes[rules.listsTypes.listItem];
var orderedList = state.schema.nodes[rules.listsTypes.orderedList];
var bulletList = state.schema.nodes[rules.listsTypes.bulletList];
var isNestedInOL = !!findNthParentNodeOfType(orderedList, 2)(state.selection);
var isNestedInUL = !!findNthParentNodeOfType(bulletList, 2)(state.selection);
return (isNestedInOL || isNestedInUL) && liftListItem(listItem)(state);

@@ -85,4 +87,5 @@ };

var nodes = state.schema.nodes;
var listItem = nodes[indentRules.listsTypes.listItem];
return ((isIndented(state, rules.nodes) || indentRules.nodes.some(function (rule) { return nodes[rule.node] && hasNode(state, nodes[rule.node]); })) &&
!hasNode(state, indentRules.listsTypes.listItem));
!hasNode(state, listItem));
};

@@ -93,5 +96,6 @@ /**

export var indent = function (state, dispatch) {
var listItem = state.schema.nodes[indentRules.listsTypes.listItem];
var isIndentableBlock = canBeIndented(state, indentRules);
if (canIndentAsListItem(state, indentRules.listsTypes.listItem)) {
sinkListItem(indentRules.listsTypes.listItem)(state, dispatch);
if (canIndentAsListItem(state, listItem)) {
sinkListItem(listItem)(state, dispatch);
}

@@ -106,5 +110,6 @@ else if (isIndentableBlock) {

export var outdent = function (state, dispatch) {
var listItem = state.schema.nodes[outdentRules.listsTypes.listItem];
var isIndentableBlock = canBeIndented(state, outdentRules);
if (canOutdentAsListItem(state, outdentRules)) {
liftListItem(outdentRules.listsTypes.listItem)(state, dispatch);
liftListItem(listItem)(state, dispatch);
}

@@ -111,0 +116,0 @@ else if (isIndentableBlock) {

@@ -0,1 +1,2 @@

import * as tslib_1 from "tslib";
import { Fragment, Slice, NodeRange } from 'prosemirror-model';

@@ -7,2 +8,3 @@ import { TextSelection, NodeSelection } from 'prosemirror-state';

import { splitListItem } from 'prosemirror-schema-list';
import { bulletList as bulletListSettings, orderedList as orderedListSettings } from './types/list-settings';
//exactly the same

@@ -280,3 +282,3 @@ /**

export function toggleUnorderedList(state, dispatch, view) {
return toggleList(state, dispatch, view, { listType: 'bulletList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return toggleList(state, dispatch, view, tslib_1.__assign({ listType: bulletListSettings.listType }, bulletListSettings.types));
}

@@ -287,3 +289,3 @@ /**

export function toggleOrderedList(state, dispatch, view) {
return toggleList(state, dispatch, view, { listType: 'orderedList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return toggleList(state, dispatch, view, tslib_1.__assign({ listType: orderedListSettings.listType }, orderedListSettings.types));
}

@@ -290,0 +292,0 @@ /**

@@ -6,6 +6,15 @@ export { getHtml, setHtml } from './source';

export { insertImage } from './image';
export { alignBlocks } from './align';
export { formatBlockElements } from './blockNode';
export { indent, outdent } from './indent';
export { alignBlocks, isAligned } from './align';
export { hasNode, activeNode, formatBlockElements } from './blockNode';
export { hasMark, getMark, getActiveMarks, removeAllMarks } from './mark';
export { indent, canIndentAsListItem, outdent, canOutdentAsListItem, isIndented, canBeIndented } from './indent';
export { toggleOrderedList, toggleUnorderedList } from './lists';
export { createContentNode, hasSameMarkup, getUniqueStyleValues, getSelectionText, getNodeFromSelection, canInsert, insertNode } from './utils';
export { redo, undo } from 'prosemirror-history';
export { alignLeftRules, alignCenterRules, alignRightRules, alignRemoveRules } from './types/align-rules';
export { indentRules, outdentRules } from './types/indent-rules';
export { nodes, marks } from './config/schema';
export { buildKeymap, buildListKeymap } from './config/keymap';
export { bold, italic, underline, strikethrough, subscript, superscript, link } from './types/commands';
export { createTable } from './table';
export { addRowBefore, addRowAfter, addColumnBefore, addColumnAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell, selectionCell } from 'prosemirror-tables';
import { RemoveMarkStep } from 'prosemirror-transform';
import { MarkType } from 'prosemirror-model';
import { TextSelection } from 'prosemirror-state';
import { hasStyle } from './inline-style';

@@ -225,1 +226,50 @@ /**

};
/**
* @hidden
*/
export var getMark = function (state, markType) {
var _a = state.selection, from = _a.from, $from = _a.$from, to = _a.to, empty = _a.empty;
var stateDoc = state.doc;
var mark;
if (empty) {
mark = markType.isInSet(state.storedMarks || $from.marks());
}
else {
stateDoc.nodesBetween(from, to, function (node) {
if (node.isInline && !mark) {
mark = markType.isInSet(node.marks);
}
});
}
return mark;
};
var getNodeMarksOfType = function (markType, node) { return node.marks.filter(function (m) { return m.type.name === markType.name; }); };
/**
* @hidden
*/
export var getActiveMarks = function (_a, markType) {
var selection = _a.selection;
var hasNodesWithoutMarks = false;
if (selection instanceof TextSelection && selection.$cursor) {
return {
hasNodesWithoutMarks: hasNodesWithoutMarks,
marks: selection.$cursor.marks().filter(function (m) { return (markType ? m.type.name === markType.name : true); })
};
}
var filtered = [];
selection.content().content.descendants(function (node) {
if (node.type.name === 'text') {
var nodeMarksOfType = markType ? getNodeMarksOfType(markType, node) : node.marks;
if (node.marks.length > 0 && nodeMarksOfType.length > 0) {
filtered.push.apply(filtered, nodeMarksOfType);
}
else {
hasNodesWithoutMarks = true;
}
}
});
return {
hasNodesWithoutMarks: hasNodesWithoutMarks,
marks: filtered
};
};

@@ -131,46 +131,1 @@ /**

// const style = (name: string, value: string) => ({ name, value });
// /**
// * The object of the AlignLeft tool settings.
// */
// export const alignLeft: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'left')] },
// { node: 'heading', style: [style('text-align', 'left')] }
// ]
// };
// /**
// * The object of the AlignRight tool settings.
// */
// export const alignRight: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'right')] },
// { node: 'heading', style: [style('text-align', 'right')] }
// ]
// };
// /**
// * The object of the AlignCenter tool settings.
// */
// export const alignCenter: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'center')] },
// { node: 'heading', style: [style('text-align', 'center')] }
// ]
// };
// /**
// * The object of the AlignJustify tool settings.
// */
// export const alignJustify: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'justify')] },
// { node: 'heading', style: [style('text-align', 'justify')] }
// ]
// };
// /**
// * The object of the AlignRemove tool settings.
// */
// export const alignRemove: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', '')] },
// { node: 'heading', style: [style('text-align', '')] }
// ]
// };

@@ -1,3 +0,5 @@

import { Node } from 'prosemirror-model';
import { Node, DOMParser, Schema, Fragment } from 'prosemirror-model';
import { TextSelection, AllSelection, NodeSelection } from 'prosemirror-state';
import { markApplies } from './mark';
import { nodes, marks } from './config/schema';
import { changeStyleFromMark, changeStyleMark } from './inline-style';

@@ -152,19 +154,89 @@ //exactly the same

}; };
//from react
/**
* Creates table.
* @returns Node
* @hidden
*/
export var createTable = function (nodes, rows, columns) {
var table = nodes.table, table_row = nodes.table_row, table_cell = nodes.table_cell;
var tableRows = [];
var cells = [];
for (var r = 0; r < rows + 1; r++) {
cells.length = 0;
for (var c = 0; c < columns + 1; c++) {
cells.push(table_cell.createAndFill());
}
tableRows.push(table_row.createAndFill(undefined, cells));
export var isNullOrUndefined = function (value) { return value === undefined || value === null; };
/**
* @hidden
*/
export var safeString = function (value) { return isNullOrUndefined(value) ? '' : value.toString(); };
/**
* @hidden
*/
export var createContentNode = function (value) {
var element = document.createElement('div');
// when using ngModel with name attr, content is null and errors, default params dont help
element.innerHTML = safeString(value).trim();
return DOMParser.fromSchema(new Schema({ nodes: nodes, marks: marks })).parse(element);
};
/**
* @hidden
*/
export var hasSameMarkup = function (dom1, dom2) {
var fragment1 = Fragment.from(createContentNode(dom1));
var fragment2 = Fragment.from(createContentNode(dom2));
return fragment1.eq(fragment2);
};
/**
* @hidden
*/
export var first = function (arr) { return arr[0]; };
/**
* @hidden
*/
export var last = function (arr) { return arr[arr.length - 1]; };
/**
* @hidden
*/
export var split = function (splitter) { return function (value) { return value.split(splitter); }; };
/**
* @hidden
*/
export var trim = function (value) { return value.trim(); };
/**
* @hidden
*/
export var filter = function (predicate) { return function (arr) { return arr.filter(predicate); }; };
/**
* @hidden
*/
export var getUniqueStyleValues = function (style, cssStyle) {
if (style.hasNodesWithoutMarks) {
return '';
}
return table.createAndFill(undefined, tableRows);
var uniqueMarkValues = style.marks
.filter(function (m) { return m.type.name === 'style'; })
.map(function (m) { return m.attrs.style; })
.map(split(';'))
.map(filter(function (m) { return m.includes(cssStyle); }))
// guards against empty array
.map(function (cssStyleValues) { return (cssStyleValues.length !== 0 ? cssStyleValues : [cssStyle + ": INVALID"]); })
.map(first)
.map(split(':'))
.map(last)
.map(trim)
.reduce(function (acc, curr) { return (acc.indexOf(curr) > -1 ? acc : acc.concat([curr])); }, []);
if (uniqueMarkValues.indexOf('INVALID') > -1 || uniqueMarkValues.length !== 1) {
return '';
}
return uniqueMarkValues[0];
};
/**
* @hidden
*/
export var getSelectionText = function (state) {
var sel = state.selection;
if (sel instanceof TextSelection || sel instanceof AllSelection) {
var fragment = sel.content().content;
return fragment.textBetween(0, fragment.size);
}
return '';
};
/**
* @hidden
*/
export var getNodeFromSelection = function (state) {
if (state.selection instanceof NodeSelection) {
return state.selection.node;
}
};

@@ -104,2 +104,6 @@ import * as tslib_1 from "tslib";

}
else if (value === 'blockquote') {
const _b = node.attrs, { level } = _b, attrs = tslib_1.__rest(_b, ["level"]);
result = changeBlockNode(state, dispatch, tr, node, nodes.blockquote, attrs) || result;
}
}

@@ -106,0 +110,0 @@ });

@@ -9,7 +9,3 @@ import { insertNode } from './utils';

const newImage = image.createAndFill(attrs);
insertNode({
state: state,
dispatch: tr => dispatch(tr.setMeta('commandName', commandName)
.setMeta('args', attrs))
}, newImage);
insertNode(newImage)(state, tr => dispatch(tr.setMeta('commandName', commandName).setMeta('args', attrs)));
};

@@ -74,5 +74,7 @@ import { sinkListItem, liftListItem } from 'prosemirror-schema-list';

export const canOutdentAsListItem = (state, rules) => {
const listItem = rules.listsTypes.listItem;
const isNestedInOL = !!findNthParentNodeOfType(rules.listsTypes.orderedList, 2)(state.selection);
const isNestedInUL = !!findNthParentNodeOfType(rules.listsTypes.bulletList, 2)(state.selection);
const listItem = state.schema.nodes[rules.listsTypes.listItem];
const orderedList = state.schema.nodes[rules.listsTypes.orderedList];
const bulletList = state.schema.nodes[rules.listsTypes.bulletList];
const isNestedInOL = !!findNthParentNodeOfType(orderedList, 2)(state.selection);
const isNestedInUL = !!findNthParentNodeOfType(bulletList, 2)(state.selection);
return (isNestedInOL || isNestedInUL) && liftListItem(listItem)(state);

@@ -85,4 +87,5 @@ };

const nodes = state.schema.nodes;
const listItem = nodes[indentRules.listsTypes.listItem];
return ((isIndented(state, rules.nodes) || indentRules.nodes.some(rule => nodes[rule.node] && hasNode(state, nodes[rule.node]))) &&
!hasNode(state, indentRules.listsTypes.listItem));
!hasNode(state, listItem));
};

@@ -93,5 +96,6 @@ /**

export const indent = (state, dispatch) => {
const listItem = state.schema.nodes[indentRules.listsTypes.listItem];
const isIndentableBlock = canBeIndented(state, indentRules);
if (canIndentAsListItem(state, indentRules.listsTypes.listItem)) {
sinkListItem(indentRules.listsTypes.listItem)(state, dispatch);
if (canIndentAsListItem(state, listItem)) {
sinkListItem(listItem)(state, dispatch);
}

@@ -106,5 +110,6 @@ else if (isIndentableBlock) {

export const outdent = (state, dispatch) => {
const listItem = state.schema.nodes[outdentRules.listsTypes.listItem];
const isIndentableBlock = canBeIndented(state, outdentRules);
if (canOutdentAsListItem(state, outdentRules)) {
liftListItem(outdentRules.listsTypes.listItem)(state, dispatch);
liftListItem(listItem)(state, dispatch);
}

@@ -111,0 +116,0 @@ else if (isIndentableBlock) {

@@ -7,2 +7,3 @@ import { Fragment, Slice, NodeRange } from 'prosemirror-model';

import { splitListItem } from 'prosemirror-schema-list';
import { bulletList as bulletListSettings, orderedList as orderedListSettings } from './types/list-settings';
//exactly the same

@@ -280,3 +281,3 @@ /**

export function toggleUnorderedList(state, dispatch, view) {
return toggleList(state, dispatch, view, { listType: 'bulletList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return toggleList(state, dispatch, view, Object.assign({ listType: bulletListSettings.listType }, bulletListSettings.types));
}

@@ -287,3 +288,3 @@ /**

export function toggleOrderedList(state, dispatch, view) {
return toggleList(state, dispatch, view, { listType: 'orderedList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return toggleList(state, dispatch, view, Object.assign({ listType: orderedListSettings.listType }, orderedListSettings.types));
}

@@ -290,0 +291,0 @@ /**

@@ -6,6 +6,15 @@ export { getHtml, setHtml } from './source';

export { insertImage } from './image';
export { alignBlocks } from './align';
export { formatBlockElements } from './blockNode';
export { indent, outdent } from './indent';
export { alignBlocks, isAligned } from './align';
export { hasNode, activeNode, formatBlockElements } from './blockNode';
export { hasMark, getMark, getActiveMarks, removeAllMarks } from './mark';
export { indent, canIndentAsListItem, outdent, canOutdentAsListItem, isIndented, canBeIndented } from './indent';
export { toggleOrderedList, toggleUnorderedList } from './lists';
export { createContentNode, hasSameMarkup, getUniqueStyleValues, getSelectionText, getNodeFromSelection, canInsert, insertNode } from './utils';
export { redo, undo } from 'prosemirror-history';
export { alignLeftRules, alignCenterRules, alignRightRules, alignRemoveRules } from './types/align-rules';
export { indentRules, outdentRules } from './types/indent-rules';
export { nodes, marks } from './config/schema';
export { buildKeymap, buildListKeymap } from './config/keymap';
export { bold, italic, underline, strikethrough, subscript, superscript, link } from './types/commands';
export { createTable } from './table';
export { addRowBefore, addRowAfter, addColumnBefore, addColumnAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell, selectionCell } from 'prosemirror-tables';
import { RemoveMarkStep } from 'prosemirror-transform';
import { MarkType } from 'prosemirror-model';
import { TextSelection } from 'prosemirror-state';
import { hasStyle } from './inline-style';

@@ -219,1 +220,49 @@ /**

};
/**
* @hidden
*/
export const getMark = (state, markType) => {
let { from, $from, to, empty } = state.selection;
const stateDoc = state.doc;
let mark;
if (empty) {
mark = markType.isInSet(state.storedMarks || $from.marks());
}
else {
stateDoc.nodesBetween(from, to, node => {
if (node.isInline && !mark) {
mark = markType.isInSet(node.marks);
}
});
}
return mark;
};
const getNodeMarksOfType = (markType, node) => node.marks.filter(m => m.type.name === markType.name);
/**
* @hidden
*/
export const getActiveMarks = ({ selection }, markType) => {
let hasNodesWithoutMarks = false;
if (selection instanceof TextSelection && selection.$cursor) {
return {
hasNodesWithoutMarks,
marks: selection.$cursor.marks().filter(m => (markType ? m.type.name === markType.name : true))
};
}
const filtered = [];
selection.content().content.descendants((node) => {
if (node.type.name === 'text') {
const nodeMarksOfType = markType ? getNodeMarksOfType(markType, node) : node.marks;
if (node.marks.length > 0 && nodeMarksOfType.length > 0) {
filtered.push(...nodeMarksOfType);
}
else {
hasNodesWithoutMarks = true;
}
}
});
return {
hasNodesWithoutMarks,
marks: filtered
};
};

@@ -131,46 +131,1 @@ /**

// const style = (name: string, value: string) => ({ name, value });
// /**
// * The object of the AlignLeft tool settings.
// */
// export const alignLeft: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'left')] },
// { node: 'heading', style: [style('text-align', 'left')] }
// ]
// };
// /**
// * The object of the AlignRight tool settings.
// */
// export const alignRight: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'right')] },
// { node: 'heading', style: [style('text-align', 'right')] }
// ]
// };
// /**
// * The object of the AlignCenter tool settings.
// */
// export const alignCenter: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'center')] },
// { node: 'heading', style: [style('text-align', 'center')] }
// ]
// };
// /**
// * The object of the AlignJustify tool settings.
// */
// export const alignJustify: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'justify')] },
// { node: 'heading', style: [style('text-align', 'justify')] }
// ]
// };
// /**
// * The object of the AlignRemove tool settings.
// */
// export const alignRemove: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', '')] },
// { node: 'heading', style: [style('text-align', '')] }
// ]
// };

@@ -1,3 +0,5 @@

import { Node } from 'prosemirror-model';
import { Node, DOMParser, Schema, Fragment } from 'prosemirror-model';
import { TextSelection, AllSelection, NodeSelection } from 'prosemirror-state';
import { markApplies } from './mark';
import { nodes, marks } from './config/schema';
import { changeStyleFromMark, changeStyleMark } from './inline-style';

@@ -150,19 +152,89 @@ //exactly the same

};
//from react
/**
* Creates table.
* @returns Node
* @hidden
*/
export const createTable = (nodes, rows, columns) => {
const { table, table_row, table_cell } = nodes;
const tableRows = [];
const cells = [];
for (let r = 0; r < rows + 1; r++) {
cells.length = 0;
for (let c = 0; c < columns + 1; c++) {
cells.push(table_cell.createAndFill());
}
tableRows.push(table_row.createAndFill(undefined, cells));
export const isNullOrUndefined = (value) => value === undefined || value === null;
/**
* @hidden
*/
export const safeString = (value) => isNullOrUndefined(value) ? '' : value.toString();
/**
* @hidden
*/
export const createContentNode = (value) => {
const element = document.createElement('div');
// when using ngModel with name attr, content is null and errors, default params dont help
element.innerHTML = safeString(value).trim();
return DOMParser.fromSchema(new Schema({ nodes, marks })).parse(element);
};
/**
* @hidden
*/
export const hasSameMarkup = (dom1, dom2) => {
const fragment1 = Fragment.from(createContentNode(dom1));
const fragment2 = Fragment.from(createContentNode(dom2));
return fragment1.eq(fragment2);
};
/**
* @hidden
*/
export const first = (arr) => arr[0];
/**
* @hidden
*/
export const last = (arr) => arr[arr.length - 1];
/**
* @hidden
*/
export const split = (splitter) => (value) => value.split(splitter);
/**
* @hidden
*/
export const trim = (value) => value.trim();
/**
* @hidden
*/
export const filter = (predicate) => (arr) => arr.filter(predicate);
/**
* @hidden
*/
export const getUniqueStyleValues = (style, cssStyle) => {
if (style.hasNodesWithoutMarks) {
return '';
}
return table.createAndFill(undefined, tableRows);
const uniqueMarkValues = style.marks
.filter(m => m.type.name === 'style')
.map((m) => m.attrs.style)
.map(split(';'))
.map(filter((m) => m.includes(cssStyle)))
// guards against empty array
.map((cssStyleValues) => (cssStyleValues.length !== 0 ? cssStyleValues : [`${cssStyle}: INVALID`]))
.map(first)
.map(split(':'))
.map(last)
.map(trim)
.reduce((acc, curr) => (acc.indexOf(curr) > -1 ? acc : [...acc, curr]), []);
if (uniqueMarkValues.indexOf('INVALID') > -1 || uniqueMarkValues.length !== 1) {
return '';
}
return uniqueMarkValues[0];
};
/**
* @hidden
*/
export const getSelectionText = (state) => {
const sel = state.selection;
if (sel instanceof TextSelection || sel instanceof AllSelection) {
const fragment = sel.content().content;
return fragment.textBetween(0, fragment.size);
}
return '';
};
/**
* @hidden
*/
export const getNodeFromSelection = (state) => {
if (state.selection instanceof NodeSelection) {
return state.selection.node;
}
};

@@ -14,3 +14,3 @@ import { Command } from './types/command';

*/
export declare const formatBlockElements: (value: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p", commandName?: Command) => (state: any, dispatch: any) => boolean;
export declare const formatBlockElements: (value: "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p", commandName?: Command) => (state: any, dispatch: any) => boolean;
/**

@@ -17,0 +17,0 @@ * @hidden

@@ -107,2 +107,6 @@ "use strict";

}
else if (value === 'blockquote') {
var _b = node.attrs, level = _b.level, attrs = tslib_1.__rest(_b, ["level"]);
result = exports.changeBlockNode(state, dispatch, tr, node, nodes.blockquote, attrs) || result;
}
}

@@ -173,4 +177,4 @@ });

.reduce(function (acc, curr) {
var _a;
return Object.assign(acc, (_a = {}, _a[curr] = obj[curr], _a));
var _a;
}, {});

@@ -177,0 +181,0 @@ };

@@ -11,9 +11,3 @@ "use strict";

var newImage = image.createAndFill(attrs);
utils_1.insertNode({
state: state,
dispatch: function (tr) {
return dispatch(tr.setMeta('commandName', commandName)
.setMeta('args', attrs));
}
}, newImage);
utils_1.insertNode(newImage)(state, function (tr) { return dispatch(tr.setMeta('commandName', commandName).setMeta('args', attrs)); });
}; };

@@ -76,5 +76,7 @@ "use strict";

exports.canOutdentAsListItem = function (state, rules) {
var listItem = rules.listsTypes.listItem;
var isNestedInOL = !!utils_1.findNthParentNodeOfType(rules.listsTypes.orderedList, 2)(state.selection);
var isNestedInUL = !!utils_1.findNthParentNodeOfType(rules.listsTypes.bulletList, 2)(state.selection);
var listItem = state.schema.nodes[rules.listsTypes.listItem];
var orderedList = state.schema.nodes[rules.listsTypes.orderedList];
var bulletList = state.schema.nodes[rules.listsTypes.bulletList];
var isNestedInOL = !!utils_1.findNthParentNodeOfType(orderedList, 2)(state.selection);
var isNestedInUL = !!utils_1.findNthParentNodeOfType(bulletList, 2)(state.selection);
return (isNestedInOL || isNestedInUL) && prosemirror_schema_list_1.liftListItem(listItem)(state);

@@ -87,4 +89,5 @@ };

var nodes = state.schema.nodes;
var listItem = nodes[indent_rules_1.indentRules.listsTypes.listItem];
return ((exports.isIndented(state, rules.nodes) || indent_rules_1.indentRules.nodes.some(function (rule) { return nodes[rule.node] && blockNode_1.hasNode(state, nodes[rule.node]); })) &&
!blockNode_1.hasNode(state, indent_rules_1.indentRules.listsTypes.listItem));
!blockNode_1.hasNode(state, listItem));
};

@@ -95,5 +98,6 @@ /**

exports.indent = function (state, dispatch) {
var listItem = state.schema.nodes[indent_rules_1.indentRules.listsTypes.listItem];
var isIndentableBlock = exports.canBeIndented(state, indent_rules_1.indentRules);
if (exports.canIndentAsListItem(state, indent_rules_1.indentRules.listsTypes.listItem)) {
prosemirror_schema_list_1.sinkListItem(indent_rules_1.indentRules.listsTypes.listItem)(state, dispatch);
if (exports.canIndentAsListItem(state, listItem)) {
prosemirror_schema_list_1.sinkListItem(listItem)(state, dispatch);
}

@@ -108,5 +112,6 @@ else if (isIndentableBlock) {

exports.outdent = function (state, dispatch) {
var listItem = state.schema.nodes[indent_rules_1.outdentRules.listsTypes.listItem];
var isIndentableBlock = exports.canBeIndented(state, indent_rules_1.outdentRules);
if (exports.canOutdentAsListItem(state, indent_rules_1.outdentRules)) {
prosemirror_schema_list_1.liftListItem(indent_rules_1.outdentRules.listsTypes.listItem)(state, dispatch);
prosemirror_schema_list_1.liftListItem(listItem)(state, dispatch);
}

@@ -113,0 +118,0 @@ else if (isIndentableBlock) {

@@ -9,5 +9,5 @@ import { Command } from './types/command';

*/
export declare const applyLink: ({mark, attrs}: {
export declare const applyLink: ({ mark, attrs }: {
mark: any;
attrs: any;
}, command?: Command) => (state: any, dispatch: any) => boolean;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var prosemirror_model_1 = require("prosemirror-model");

@@ -9,2 +10,3 @@ var prosemirror_state_1 = require("prosemirror-state");

var prosemirror_schema_list_1 = require("prosemirror-schema-list");
var list_settings_1 = require("./types/list-settings");
//exactly the same

@@ -290,3 +292,3 @@ /**

function toggleUnorderedList(state, dispatch, view) {
return exports.toggleList(state, dispatch, view, { listType: 'bulletList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return exports.toggleList(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.bulletList.listType }, list_settings_1.bulletList.types));
}

@@ -298,3 +300,3 @@ exports.toggleUnorderedList = toggleUnorderedList;

function toggleOrderedList(state, dispatch, view) {
return exports.toggleList(state, dispatch, view, { listType: 'orderedList', bulletList: 'bulletList', orderedList: 'orderedList', listItem: 'listItem' });
return exports.toggleList(state, dispatch, view, tslib_1.__assign({ listType: list_settings_1.orderedList.listType }, list_settings_1.orderedList.types));
}

@@ -301,0 +303,0 @@ exports.toggleOrderedList = toggleOrderedList;

@@ -6,6 +6,16 @@ export { getHtml, setHtml } from './source';

export { insertImage } from './image';
export { alignBlocks } from './align';
export { formatBlockElements } from './blockNode';
export { indent, outdent } from './indent';
export { alignBlocks, isAligned } from './align';
export { hasNode, activeNode, formatBlockElements } from './blockNode';
export { hasMark, getMark, getActiveMarks, removeAllMarks } from './mark';
export { indent, canIndentAsListItem, outdent, canOutdentAsListItem, isIndented, canBeIndented } from './indent';
export { toggleOrderedList, toggleUnorderedList } from './lists';
export { createContentNode, hasSameMarkup, getUniqueStyleValues, getSelectionText, getNodeFromSelection, canInsert, insertNode } from './utils';
export { redo, undo } from 'prosemirror-history';
export { Command } from './types/command';
export { alignLeftRules, alignCenterRules, alignRightRules, alignRemoveRules } from './types/align-rules';
export { indentRules, outdentRules } from './types/indent-rules';
export { nodes, marks } from './config/schema';
export { buildKeymap, buildListKeymap } from './config/keymap';
export { bold, italic, underline, strikethrough, subscript, superscript, link } from './types/commands';
export { createTable } from './table';
export { addRowBefore, addRowAfter, addColumnBefore, addColumnAfter, deleteRow, deleteColumn, deleteTable, mergeCells, splitCell, selectionCell } from 'prosemirror-tables';

@@ -18,12 +18,67 @@ "use strict";

exports.alignBlocks = align_1.alignBlocks;
exports.isAligned = align_1.isAligned;
var blockNode_1 = require("./blockNode");
exports.hasNode = blockNode_1.hasNode;
exports.activeNode = blockNode_1.activeNode;
exports.formatBlockElements = blockNode_1.formatBlockElements;
var mark_1 = require("./mark");
exports.hasMark = mark_1.hasMark;
exports.getMark = mark_1.getMark;
exports.getActiveMarks = mark_1.getActiveMarks;
exports.removeAllMarks = mark_1.removeAllMarks;
var indent_1 = require("./indent");
exports.indent = indent_1.indent;
exports.canIndentAsListItem = indent_1.canIndentAsListItem;
exports.outdent = indent_1.outdent;
exports.canOutdentAsListItem = indent_1.canOutdentAsListItem;
exports.isIndented = indent_1.isIndented;
exports.canBeIndented = indent_1.canBeIndented;
var lists_1 = require("./lists");
exports.toggleOrderedList = lists_1.toggleOrderedList;
exports.toggleUnorderedList = lists_1.toggleUnorderedList;
var utils_1 = require("./utils");
exports.createContentNode = utils_1.createContentNode;
exports.hasSameMarkup = utils_1.hasSameMarkup;
exports.getUniqueStyleValues = utils_1.getUniqueStyleValues;
exports.getSelectionText = utils_1.getSelectionText;
exports.getNodeFromSelection = utils_1.getNodeFromSelection;
exports.canInsert = utils_1.canInsert;
exports.insertNode = utils_1.insertNode;
var prosemirror_history_1 = require("prosemirror-history");
exports.redo = prosemirror_history_1.redo;
exports.undo = prosemirror_history_1.undo;
var align_rules_1 = require("./types/align-rules");
exports.alignLeftRules = align_rules_1.alignLeftRules;
exports.alignCenterRules = align_rules_1.alignCenterRules;
exports.alignRightRules = align_rules_1.alignRightRules;
exports.alignRemoveRules = align_rules_1.alignRemoveRules;
var indent_rules_1 = require("./types/indent-rules");
exports.indentRules = indent_rules_1.indentRules;
exports.outdentRules = indent_rules_1.outdentRules;
var schema_1 = require("./config/schema");
exports.nodes = schema_1.nodes;
exports.marks = schema_1.marks;
var keymap_1 = require("./config/keymap");
exports.buildKeymap = keymap_1.buildKeymap;
exports.buildListKeymap = keymap_1.buildListKeymap;
var commands_1 = require("./types/commands");
exports.bold = commands_1.bold;
exports.italic = commands_1.italic;
exports.underline = commands_1.underline;
exports.strikethrough = commands_1.strikethrough;
exports.subscript = commands_1.subscript;
exports.superscript = commands_1.superscript;
exports.link = commands_1.link;
var table_1 = require("./table");
exports.createTable = table_1.createTable;
var prosemirror_tables_1 = require("prosemirror-tables");
exports.addRowBefore = prosemirror_tables_1.addRowBefore;
exports.addRowAfter = prosemirror_tables_1.addRowAfter;
exports.addColumnBefore = prosemirror_tables_1.addColumnBefore;
exports.addColumnAfter = prosemirror_tables_1.addColumnAfter;
exports.deleteRow = prosemirror_tables_1.deleteRow;
exports.deleteColumn = prosemirror_tables_1.deleteColumn;
exports.deleteTable = prosemirror_tables_1.deleteTable;
exports.mergeCells = prosemirror_tables_1.mergeCells;
exports.splitCell = prosemirror_tables_1.splitCell;
exports.selectionCell = prosemirror_tables_1.selectionCell;
import { InlineFormatOptions } from './types/commands';
import { Command } from './types/command';
import { ActiveMarks } from './types/active-marks';
/**

@@ -22,3 +23,3 @@ * @hidden

*/
export declare const removeAllMarks: ({except}?: {
export declare const removeAllMarks: ({ except }?: {
except?: any;

@@ -37,1 +38,9 @@ }) => Command;

export declare const hasMark: (state: any, options: InlineFormatOptions) => boolean;
/**
* @hidden
*/
export declare const getMark: (state: any, markType: any) => any;
/**
* @hidden
*/
export declare const getActiveMarks: ({ selection }: any, markType?: any) => ActiveMarks;

@@ -5,2 +5,3 @@ "use strict";

var prosemirror_model_1 = require("prosemirror-model");
var prosemirror_state_1 = require("prosemirror-state");
var inline_style_1 = require("./inline-style");

@@ -228,1 +229,50 @@ /**

};
/**
* @hidden
*/
exports.getMark = function (state, markType) {
var _a = state.selection, from = _a.from, $from = _a.$from, to = _a.to, empty = _a.empty;
var stateDoc = state.doc;
var mark;
if (empty) {
mark = markType.isInSet(state.storedMarks || $from.marks());
}
else {
stateDoc.nodesBetween(from, to, function (node) {
if (node.isInline && !mark) {
mark = markType.isInSet(node.marks);
}
});
}
return mark;
};
var getNodeMarksOfType = function (markType, node) { return node.marks.filter(function (m) { return m.type.name === markType.name; }); };
/**
* @hidden
*/
exports.getActiveMarks = function (_a, markType) {
var selection = _a.selection;
var hasNodesWithoutMarks = false;
if (selection instanceof prosemirror_state_1.TextSelection && selection.$cursor) {
return {
hasNodesWithoutMarks: hasNodesWithoutMarks,
marks: selection.$cursor.marks().filter(function (m) { return (markType ? m.type.name === markType.name : true); })
};
}
var filtered = [];
selection.content().content.descendants(function (node) {
if (node.type.name === 'text') {
var nodeMarksOfType = markType ? getNodeMarksOfType(markType, node) : node.marks;
if (node.marks.length > 0 && nodeMarksOfType.length > 0) {
filtered.push.apply(filtered, nodeMarksOfType);
}
else {
hasNodesWithoutMarks = true;
}
}
});
return {
hasNodesWithoutMarks: hasNodesWithoutMarks,
marks: filtered
};
};

@@ -133,46 +133,1 @@ "use strict";

// const style = (name: string, value: string) => ({ name, value });
// /**
// * The object of the AlignLeft tool settings.
// */
// export const alignLeft: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'left')] },
// { node: 'heading', style: [style('text-align', 'left')] }
// ]
// };
// /**
// * The object of the AlignRight tool settings.
// */
// export const alignRight: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'right')] },
// { node: 'heading', style: [style('text-align', 'right')] }
// ]
// };
// /**
// * The object of the AlignCenter tool settings.
// */
// export const alignCenter: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'center')] },
// { node: 'heading', style: [style('text-align', 'center')] }
// ]
// };
// /**
// * The object of the AlignJustify tool settings.
// */
// export const alignJustify: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', 'justify')] },
// { node: 'heading', style: [style('text-align', 'justify')] }
// ]
// };
// /**
// * The object of the AlignRemove tool settings.
// */
// export const alignRemove: AlignSettings = {
// actions: [
// { node: 'paragraph', style: [style('text-align', '')] },
// { node: 'heading', style: [style('text-align', '')] }
// ]
// };
import { Command } from './types/command';
import { DispatchFn } from './types/dispatchFn';
import { Predicate } from './types/predicate';
import { ActiveMarks } from './types/active-marks';
/**

@@ -53,9 +54,48 @@ * @hidden

/**
* Creates table.
* @returns Node
* @hidden
*/
export declare const createTable: (nodes: {
table: any;
table_row: any;
table_cell: any;
}, rows: number, columns: number) => any;
export declare const isNullOrUndefined: (value: any) => boolean;
/**
* @hidden
*/
export declare const safeString: (value: any) => string;
/**
* @hidden
*/
export declare const createContentNode: (value: string) => any;
/**
* @hidden
*/
export declare const hasSameMarkup: (dom1: string, dom2: string) => boolean;
/**
* @hidden
*/
export declare const first: (arr: any[]) => any;
/**
* @hidden
*/
export declare const last: (arr: any[]) => any;
/**
* @hidden
*/
export declare const split: (splitter: string) => (value: string) => string[];
/**
* @hidden
*/
export declare const trim: (value: string) => string;
/**
* @hidden
*/
export declare const filter: (predicate: (value: any) => boolean) => (arr: any[]) => any[];
/**
* @hidden
*/
export declare const getUniqueStyleValues: (style: ActiveMarks, cssStyle: string) => string;
/**
* @hidden
*/
export declare const getSelectionText: (state: any) => String;
/**
* @hidden
*/
export declare const getNodeFromSelection: (state: any) => any;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var prosemirror_model_1 = require("prosemirror-model");
var prosemirror_state_1 = require("prosemirror-state");
var mark_1 = require("./mark");
var schema_1 = require("./config/schema");
var inline_style_1 = require("./inline-style");

@@ -154,19 +156,89 @@ //exactly the same

}; };
//from react
/**
* Creates table.
* @returns Node
* @hidden
*/
exports.createTable = function (nodes, rows, columns) {
var table = nodes.table, table_row = nodes.table_row, table_cell = nodes.table_cell;
var tableRows = [];
var cells = [];
for (var r = 0; r < rows + 1; r++) {
cells.length = 0;
for (var c = 0; c < columns + 1; c++) {
cells.push(table_cell.createAndFill());
}
tableRows.push(table_row.createAndFill(undefined, cells));
exports.isNullOrUndefined = function (value) { return value === undefined || value === null; };
/**
* @hidden
*/
exports.safeString = function (value) { return exports.isNullOrUndefined(value) ? '' : value.toString(); };
/**
* @hidden
*/
exports.createContentNode = function (value) {
var element = document.createElement('div');
// when using ngModel with name attr, content is null and errors, default params dont help
element.innerHTML = exports.safeString(value).trim();
return prosemirror_model_1.DOMParser.fromSchema(new prosemirror_model_1.Schema({ nodes: schema_1.nodes, marks: schema_1.marks })).parse(element);
};
/**
* @hidden
*/
exports.hasSameMarkup = function (dom1, dom2) {
var fragment1 = prosemirror_model_1.Fragment.from(exports.createContentNode(dom1));
var fragment2 = prosemirror_model_1.Fragment.from(exports.createContentNode(dom2));
return fragment1.eq(fragment2);
};
/**
* @hidden
*/
exports.first = function (arr) { return arr[0]; };
/**
* @hidden
*/
exports.last = function (arr) { return arr[arr.length - 1]; };
/**
* @hidden
*/
exports.split = function (splitter) { return function (value) { return value.split(splitter); }; };
/**
* @hidden
*/
exports.trim = function (value) { return value.trim(); };
/**
* @hidden
*/
exports.filter = function (predicate) { return function (arr) { return arr.filter(predicate); }; };
/**
* @hidden
*/
exports.getUniqueStyleValues = function (style, cssStyle) {
if (style.hasNodesWithoutMarks) {
return '';
}
return table.createAndFill(undefined, tableRows);
var uniqueMarkValues = style.marks
.filter(function (m) { return m.type.name === 'style'; })
.map(function (m) { return m.attrs.style; })
.map(exports.split(';'))
.map(exports.filter(function (m) { return m.includes(cssStyle); }))
// guards against empty array
.map(function (cssStyleValues) { return (cssStyleValues.length !== 0 ? cssStyleValues : [cssStyle + ": INVALID"]); })
.map(exports.first)
.map(exports.split(':'))
.map(exports.last)
.map(exports.trim)
.reduce(function (acc, curr) { return (acc.indexOf(curr) > -1 ? acc : acc.concat([curr])); }, []);
if (uniqueMarkValues.indexOf('INVALID') > -1 || uniqueMarkValues.length !== 1) {
return '';
}
return uniqueMarkValues[0];
};
/**
* @hidden
*/
exports.getSelectionText = function (state) {
var sel = state.selection;
if (sel instanceof prosemirror_state_1.TextSelection || sel instanceof prosemirror_state_1.AllSelection) {
var fragment = sel.content().content;
return fragment.textBetween(0, fragment.size);
}
return '';
};
/**
* @hidden
*/
exports.getNodeFromSelection = function (state) {
if (state.selection instanceof prosemirror_state_1.NodeSelection) {
return state.selection.node;
}
};

@@ -1,1 +0,1 @@

System.register("@progress/kendo-editor-common",["prosemirror-history","prosemirror-transform","prosemirror-model","prosemirror-state","prosemirror-schema-list","tslib","prosemirror-commands"],function(p){var s,i,a,l,c,u,d;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){s=t(e)},function(e){i=t(e)},function(e){a=t(e)},function(e){l=t(e)},function(e){c=t(e)},function(e){u=t(e)},function(e){d=t(e)}],execute:function(){function n(e){if(o[e])return o[e].exports;var t=o[e]={exports:{},id:e,loaded:!1};return r[e].call(t.exports,t,t.exports,n),t.loaded=!0,t.exports}var r,o;o={},n.m=r=[function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.getHtml=r.getHtml,t.setHtml=r.setHtml;var o=n(4);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var s=n(8);t.applyLink=s.applyLink,t.removeLink=s.removeLink;var i=n(9);t.insertText=i.insertText;var a=n(10);t.insertImage=a.insertImage;var l=n(11);t.alignBlocks=l.alignBlocks;var c=n(12);t.formatBlockElements=c.formatBlockElements;var u=n(14);t.indent=u.indent,t.outdent=u.outdent;var d=n(18);t.toggleOrderedList=d.toggleOrderedList,t.toggleUnorderedList=d.toggleUnorderedList;var f=n(20);t.redo=f.redo,t.undo=f.undo,function(e){for(var t in e)p(t,e[t])}(t)},function(e,s,t){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var o=t(2),i=t(3);s.createContentNode=function(e,t,n){var r=document.createElement("div");return r.innerHTML=e,o.DOMParser.fromSchema(t).parse(r,n)},s.getHtml=function(e){var t=o.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),n=document.createElement("div");return n.appendChild(t),n.innerHTML},s.setHtml=function(n,r,o){return void 0===r&&(r="setHTML"),void 0===o&&(o={preserveWhitespace:"full"}),function(e,t){return t(e.tr.setSelection(new i.AllSelection(e.doc)).replaceSelectionWith(s.createContentNode(n,e.schema,o)).setMeta("commandName",r))}}},function(e,t){e.exports=a},function(e,t){e.exports=l},function(e,I,t){"use strict";Object.defineProperty(I,"__esModule",{value:!0});var L=t(5),o=t(6),h=t(7);I.changeStyleFromMark=function(e,t){var n=e.find(function(e){return"style"===e.type.name}),r=n&&n.attrs.style;return o.changeStyles(r,t)},I.changeStyleMark=function(t,p,m,v,h){var y=h.create({style:v.style}),g=[],k=[],M=null,S=null;return t.doc.nodesBetween(p,m,function(e,t,n){if(e.isInline){var r=e.marks;if(!y.isInSet(r)&&n.type.allowsMarkType(y.type)){var o=Math.max(t,p),s=Math.min(t+e.nodeSize,m),i=I.changeStyleFromMark(r,v);if(i.changed||v.newValue){for(var a=i.changed?{style:i.style}:{style:[v.style]+": "+v.newValue+";"},l=h.create(a),c=l.addToSet(r),u=0;u<r.length;u++)r[u].isInSet(c)||(M&&M.to===o&&M.mark.eq(r[u])?M.to=s:(M=new L.RemoveMarkStep(o,s,r[u]),g.push(M)));var d=S&&S.to===o,f=d&&l.attrs.style===S.mark.attrs.style;d&&f?S.to=s:l.attrs.style&&(S=new L.AddMarkStep(o,s,l),k.push(S))}}}}),g.forEach(function(e){return t.step(e)}),k.forEach(function(e){return t.step(e)}),0<g.length+k.length},I.hasStyle=function(e,t){var n=e.selection,r=n.from,o=n.$from,s=n.to,i=n.empty,a=!1,l={style:t.name,value:t.value};return i?a=I.changeStyleFromMark(e.storedMarks||o.marks(),l).changed:e.doc.nodesBetween(r,s,function(e,t,n){!a&&e.isInline&&(a=I.changeStyleFromMark(e.marks,l).changed)}),a},I.getInlineStyles=function(e,t){var r,n=e.selection,o=n.from,s=n.$from,i=n.to,a=n.empty,l=[],c={style:t.name,value:t.value};return a?(r=I.changeStyleFromMark(e.storedMarks||s.marks(),c)).changed&&(l=r.styleMatches):e.doc.nodesBetween(o,i,function(e,t,n){e.isInline&&((r=I.changeStyleFromMark(e.marks,c)).changed?l.push.apply(l,r.styleMatches):l.push(null))}),l.filter(function(e){return null!==e})},I.changeStyle=function(m,v){return function(e,t,n){var r=e.selection,o=r.empty,s=r.$cursor,i=r.ranges;if(o&&!s||!h.markApplies(e.doc,i,m))return!1;var a=!1;if(t)if(n=n||e.tr,s){var l=e.storedMarks||s.marks();if(m.isInSet(l)){var c=I.changeStyleFromMark(l,v);t(n.removeStoredMark(m)),t(n.addStoredMark(m.create({style:c.style}))),a=!0}}else{for(var u=0;u<i.length;u++){var d=i[u],f=d.$from,p=d.$to;a=I.changeStyleMark(n,f.pos,p.pos,v,m)}a&&(n.scrollIntoView(),t(n))}return a}},I.toggleInlineFormat=function(f,p,m){return function(t,e){var n=t.schema.marks,r=f.altStyle,o=f.altMarks,s=void 0===o?[]:o,i=f.mark;p=p||t.tr;function a(){return c=!0}var l=!1,c=!1;if(r&&n.style){var u=n.style;l=I.changeStyle(u,{style:r.name,value:r.value})(t,a,p)}var d=[i].concat(s).filter(function(e){return n[e]}).map(function(e){return h.hasMark(t,{mark:e})&&n[e]}).filter(function(e){return e});return d.length?h.removeMarks(d,t,a,p):l||h.toggleMark(n[i],m,p)(t,a),c&&e(p),c}},I.applyInlineStyle=function(s,i){return function(e,t){var n=e.schema.marks,r=I.changeStyle(n.style,{style:s.style,value:/^.+$/,newValue:s.value}),o=e.tr;return i&&(o.setMeta("commandName",i),o.setMeta("args",s)),r(e,t,o)}}},function(e,t){e.exports=i},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t(2),h=t(7),y=t(4);r.changeStyles=function(e,t){var n=t.style,r=t.value,o=t.newValue,s=[];if(e){var i=e.split(/\s*;\s*/).filter(function(e){return e}),a=i.filter(function(e){if(!e.toLowerCase().trim().startsWith(n))return!0;var t=e.split(":")[1].trim();return!r.test(t)||(s.push(t),!1)});return o&&a.push(n+": "+o),{style:a.join("; ")+(a.length?";":""),changed:!!o||a.length!==i.length,styleMatches:s}}return{changed:!1,styleMatches:s,style:null}},r.changeStyle=function(m,v){return function(e,t,n){var r=e.selection,o=r.empty,s=r.$cursor,i=r.ranges;if(o&&!s||!h.markApplies(e.doc,i,m))return!1;var a=!1;if(t)if(n=n||e.tr,s){var l=e.storedMarks||s.marks();if(m.isInSet(l)){var c=y.changeStyleFromMark(l,v);t(n.removeStoredMark(m)),t(n.addStoredMark(m.create({style:c.style}))),a=!0}}else{for(var u=0;u<i.length;u++){var d=i[u],f=d.$from,p=d.$to;a=y.changeStyleMark(n,f.pos,p.pos,v,m)}a&&(n.scrollIntoView(),t(n))}return a}},r.canInsert=function(e,t){for(var n=e.selection.$from,r=n.depth;0<=r;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1},r.getTypeName=function(e){return e instanceof n.Node?e.type.name:e.name},r.findParentNode=function(o){return function(e){for(var t=e.$from,n=t.depth;0<n;n--){var r=t.node(n);if(o(r))return{depth:n,node:r}}}},r.findNthParentNode=function(o,s){return void 0===s&&(s=1),function(e){for(var t=e.$from,n=t.depth;0<n;n--){var r=t.node(n);if(o(r)&&0===(s-=1))return{depth:n,node:r}}}},r.findNthParentNodeOfType=function(t,n){return void 0===n&&(n=1),function(e){return r.findNthParentNode(function(e){return r.getTypeName(e)===r.getTypeName(t)},n)(e)}},r.insertNode=function(r,o){return function(e,t){var n=e.tr.replaceSelectionWith(r);o&&n.scrollIntoView(),t(n)}},r.createTable=function(e,t,n){for(var r=e.table,o=e.table_row,s=e.table_cell,i=[],a=[],l=0;l<t+1;l++){for(var c=a.length=0;c<n+1;c++)a.push(s.createAndFill());i.push(o.createAndFill(void 0,a))}return r.createAndFill(void 0,i)}},function(e,v,t){"use strict";Object.defineProperty(v,"__esModule",{value:!0});var n=t(5),h=t(2),m=t(4);v.markApplies=function(s,i,a){for(var e=function(e){var t=i[e],n=t.$from,r=t.$to,o=0===n.depth&&s.type.allowsMarkType(a);if(s.nodesBetween(n.pos,r.pos,function(e){if(o)return!1;o=e.inlineContent&&e.type.allowsMarkType(a)}),o)return{v:!0}},t=0;t<i.length;t++){var n=e(t);if(n)return n.v}return!1},v.toggleMark=function(f,p,m){return function(e,t){var n=e.selection,r=n.empty,o=n.$cursor,s=n.ranges;if(r&&!o||!v.markApplies(e.doc,s,f))return!1;if(t)if(o)f.isInSet(e.storedMarks||o.marks())?t(m.removeStoredMark(f)):t(m.addStoredMark(f.create(p)));else{for(var i=!1,a=0;!i&&a<s.length;a++){var l=s[a],c=l.$from,u=l.$to;i=e.doc.rangeHasMark(c.pos,u.pos,f)}for(a=0;a<s.length;a++){var d=s[a];c=d.$from,u=d.$to;i?m.removeMark(c.pos,u.pos,f):m.addMark(c.pos,u.pos,f.create(p))}t(m.scrollIntoView())}return!0}},v.removeMark=function(t,u,d,f){void 0===f&&(f=null);var p=[],m=0;return t.doc.nodesBetween(u,d,function(e,t){if(e.isInline){m++;var n=null;if(f instanceof h.MarkType){var r=f.isInSet(e.marks);r&&(n=[r])}else f?f.isInSet(e.marks)&&(n=[f]):n=e.marks;if(n&&n.length)for(var o=Math.min(t+e.nodeSize,d),s=0;s<n.length;s++){for(var i=n[s],a=void 0,l=0;l<p.length;l++){var c=p[l];c.step===m-1&&i.eq(c.style)&&(a=c)}a?(a.to=o,a.step=m):p.push({style:i,from:Math.max(t,u),to:o,step:m})}}}),p.forEach(function(e){return t.step(new n.RemoveMarkStep(e.from,e.to,e.style))}),t},v.removeMarks=function(o,t,n,s){var e=t.selection,r=e.$cursor,i=e.ranges;if(s=s||t.tr,r)o.forEach(function(e){e.isInSet(t.storedMarks||r.marks())&&n(s.removeStoredMark(e))});else{for(var a=function(e){var t=i[e],n=t.$from,r=t.$to;o.forEach(function(e){v.removeMark(s,n.pos,r.pos,e)})},l=0;l<i.length;l++)a(l);n(s.scrollIntoView())}return!0};v.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,c=void 0===t?[]:t;return function(e,t){var n=e.schema,r=e.selection,o=r.$cursor,s=r.from,i=r.to,a=e.tr,l=function(e){return e instanceof Array?e:[e]}(c).map(function(e){return e.name});o||(Object.keys(n.marks).map(function(e){return n.marks[e]}).filter(function(e){return-1===l.indexOf(e.name)}).forEach(function(e){return a.removeMark(s,i,e)}),t(a))}},v.getParentMark=function(e,t){var n=e.selection,r=n.from,o=n.$from,s=n.to,i=n.empty,a=e.doc;if(i)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return a.nodesBetween(r,s,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},v.hasMark=function(e,t){var n,r=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return r[e]}),s=t.altStyle,i=e.selection,a=i.from,l=i.$from,c=i.to,u=i.empty,d=r[t.mark],f=e.doc,p=!1;return!(p=u?(n=e.storedMarks||l.marks(),d&&d.isInSet(n)||o.some(function(e){return r[e].isInSet(n)})):d&&f.rangeHasMark(a,c,d)||o.some(function(e){return f.rangeHasMark(a,c,r[e])}))&&s?m.hasStyle(e,s):!!p}},function(e,u,t){"use strict";Object.defineProperty(u,"__esModule",{value:!0});var m=t(4),v=t(7),d=t(3);u.removeLink=function(f,p){return function(e,t){var n=e.selection.$cursor;if(n){var r=n.parent,o=n.index(),s=e.schema.marks[f.mark],i=r.child(o).marks.find(function(e){return e.type===s}),a=r.childCount,l=n.pos-n.textOffset,c=r.child(o).nodeSize,u=void 0,d=void 0;for(u=o-1;0<=u&&i.isInSet(r.child(u).marks);)c+=d=r.child(u).nodeSize,l-=d,u-=1;for(u=o+1;u<a&&i.isInSet(r.child(u).marks);)c+=r.child(u).nodeSize,u+=1;t(v.removeMark(p||e.tr,l,l+c,i))}else m.toggleInlineFormat(f,p)(e,t)}},u.applyLink=function(e,a){var l=e.mark,c=e.attrs;return function(e,t){var n=e.schema.marks,r=e.tr;a&&(r.setMeta("commandName",a),r.setMeta("args",c));function o(){return s=!0}var s=!1;if(v.getParentMark(e,n[l]))!function(v,h){return function(e,n){var t=e.selection,r=t.$cursor,o=t.from,s=t.to,i=e.schema.marks[v.mark];if(r){var a=r.parent,l=r.index(),c=a.child(l).marks.find(function(e){return e.type===i}),u=a.childCount,d=r.pos-r.textOffset,f=a.child(l).nodeSize,p=void 0,m=void 0;for(p=l-1;0<=p&&c.isInSet(a.child(p).marks);)f+=m=a.child(p).nodeSize,d-=m,p-=1;for(p=l+1;p<u&&c.isInSet(a.child(p).marks);)f+=a.child(p).nodeSize,p+=1;h.removeMark(d,d+f,i),h.addMark(d,d+f,i.create(v.attrs)),n(h)}else h.doc.nodesBetween(o,s,function(e,t){e.isInline&&i.isInSet(e.marks)&&(h.removeMark(t,t+e.nodeSize,i),h.addMark(t,t+e.nodeSize,i.create(v.attrs)),n(h))})}}({mark:l,attrs:c},r)(e,o);else{var i=e;v.hasMark(e,{mark:l})&&(u.removeLink({mark:l,attrs:c},r)(e,o),i=d.EditorState.create({doc:r.doc,selection:r.selection})),s?v.toggleMark(n[l],c,r)(i,o):m.toggleInlineFormat({mark:l},r,c)(i,o)}return s&&t(r),s}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(n){return function(e,t){t(e.tr.insertText(n.text,n.from,n.to))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=n(6);t.insertImage=function(o){return function(e,t){var n=e.schema.nodes.image,r=n.createAndFill(o);s.insertNode({state:e,dispatch:function(e){return t(e.setMeta("commandName","insertImage").setMeta("args",o))}},r)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(12);t.alignBlocks=function(a){return function(r,o){var e=l.blockNodes(r),s=r.tr,i=!1;return e.forEach(function(t){if(t.type.isTextblock){var e={},n=a.find(function(e){return e.node===t.type.name});n&&(e=l.addStyles(t,n.style)),i=l.changeBlockNode(r,o,s,t,t.type,e)||i}}),i&&o(s.scrollIntoView()),i}},t.isAligned=function(e,n){var t=l.blockNodes(e),r=!1;return t.forEach(function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var e=n.find(function(e){return e.node===t.type.name});e&&(r=e.style.every(function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)}))}}),r}},function(e,u,t){"use strict";Object.defineProperty(u,"__esModule",{value:!0});var d=t(13),s=t(6),f=t(5),p=t(2),i=t(3);u.changeBlockNode=function(o,e,i,a,l,c){var t=o.selection,n=t.from,r=t.to,s=!1;if(o.doc.nodesBetween(n,r,function(e,t){if(s)return!1;if(e.isTextblock&&!e.hasMarkup(l,c))if(e.type===l)s=!0;else{var n=o.doc.resolve(t),r=n.index();s=n.parent.canReplaceWith(r,r+1,l)}}),!s)return!1;if(e){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var u=i.steps.length;i.doc.nodesBetween(n,r,function(e,t){if(e.eq(a)&&e.isTextblock&&!e.hasMarkup(l,c)&&function(e,t,n){var r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(i.doc,i.mapping.slice(u).map(t),l)){i.clearIncompatible(i.mapping.slice(u).map(t,1),l);var n=i.mapping.slice(u),r=n.map(t,1),o=n.map(t+e.nodeSize,1),s=new p.Slice(p.Fragment.from(l.create(c,null,e.marks)),0,0);return i.step(new f.ReplaceAroundStep(r,o,r+1,o-1,s,1,!0)),!1}})}return!0},u.blockNodes=function(e){var t=e.selection,n=t.from,r=t.to,o=t.$from,s=[];return t.node?t.node.isBlock?s.push(t.node):o.parent&&o.parent.isBlock&&s.push(o.parent):e.doc.nodesBetween(n,r,function(e){e.isBlock&&s.push(e)}),s},u.formatBlockElements=function(c,t){return function(o,s){var e=u.blockNodes(o),i=o.schema.nodes,a=!1,l=o.tr;return l.setMeta("commandName",t),l.setMeta("args",{value:c}),e.forEach(function(e){if(e.type.isTextblock)if("p"===c){var t=e.attrs,n=t.level,r=d.__rest(t,["level"]);a=u.changeBlockNode(o,s,l,e,i.paragraph,r)||a}else if(/^h[1-6]$/i.test(c)){n=parseInt(c.substr(1),10);a=u.changeBlockNode(o,s,l,e,i.heading,d.__assign({},e.attrs,{level:n}))||a}}),a&&s(l.scrollIntoView()),a}},u.getBlockFormats=function(e){var t=u.blockNodes(e),n=e.schema.nodes,r=[];return t.forEach(function(e){if(e.type===n.paragraph)r.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){r.push("h"+t);break}}),r},u.addStyles=function(e,t){var n=e.attrs.style,r=null,o=null;n&&t.forEach(function(e){o={style:e.name,value:/^.+$/,newValue:e.value},r=s.changeStyles(n,o),n=r.changed?r.style:n});return n=n||t.reduce(function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""},""),Object.assign({},e.attrs,{style:n||null})},u.hasNode=function(e,t){var n=e.selection,r=n.from,o=n.to,s=!1;return e.doc.nodesBetween(r,o,function(e){return!(s=s||e.type===t)}),s};function a(t){return function(r,t){return Object.keys(r).filter(function(e){return t(e)}).reduce(function(e,t){return Object.assign(e,((n={})[t]=r[t],n));var n},{})}(t,function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]})}u.getNodeTagName=function(n,r){var e,t=n.type.spec.parseDOM||[],o=n.attrs;return(e=1===t.length?t[0]:t.find(function(e){var t=p.DOMSerializer.fromSchema(r).serializeNode(n);return JSON.stringify(e.getAttrs(t))===JSON.stringify(a(o))}))?e.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},u.activeNode=function(e){var t,n=e.schema.nodes.doc;if(e.selection instanceof i.AllSelection)t=e.doc;else if(e.selection instanceof i.TextSelection){var r=e.selection.$anchor,o=r.node(r.blockRange().depth);t=s.getTypeName(o)===s.getTypeName(n)?r.node():o}else e.selection instanceof i.NodeSelection&&(t=e.selection.node);return{name:s.getTypeName(t),tag:u.getNodeTagName(t,e.schema)}}},function(e,t){e.exports=u},function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s=t(15),o=t(16),m=t(12),i=t(6);r.indentBlocks=function(f,t,p){return function(l,c){var e=m.blockNodes(l),u=l.tr,d=!1;return u.setMeta("commandName",t),e.forEach(function(t){if(t.type.isTextblock){var e=void 0,n=f.find(function(e){return e.node===t.type.name});if(n){var r="rtl"===p?n.rtlStyle:n.style,o={name:r,value:0<n.step?""+n.step+n.unit:""};if(t.attrs.style){var s=new RegExp(r+":\\s?(\\d+)"+n.unit,"i"),i=t.attrs.style.match(s);if(i){var a=parseFloat(i[1])+n.step;a=a<=0?"":a,o.value=""+a+(a?n.unit:"")}}e=m.addStyles(t,[o])}e&&(d=m.changeBlockNode(l,c,u,t,t.type,e)||d)}}),d&&c(u.scrollIntoView()),d}},r.isIndented=function(e,o,s){var t=m.blockNodes(e),i=!1;return t.forEach(function(t){if(!i&&t.type.isTextblock&&t.attrs.style){var e=o.find(function(e){return e.node===t.type.name});if(e){var n="rtl"===s?e.rtlStyle:e.style,r=new RegExp(n+":\\s?\\d+"+e.unit,"i");i=r.test(t.attrs.style)}}}),i},r.canIndentAsListItem=function(e,t){return s.sinkListItem(t)(e)},r.canOutdentAsListItem=function(e,t){var n=t.listsTypes.listItem,r=!!i.findNthParentNodeOfType(t.listsTypes.orderedList,2)(e.selection),o=!!i.findNthParentNodeOfType(t.listsTypes.bulletList,2)(e.selection);return(r||o)&&s.liftListItem(n)(e)},r.canBeIndented=function(t,e){var n=t.schema.nodes;return(r.isIndented(t,e.nodes)||o.indentRules.nodes.some(function(e){return n[e.node]&&m.hasNode(t,n[e.node])}))&&!m.hasNode(t,o.indentRules.listsTypes.listItem)},r.indent=function(e,t){var n=r.canBeIndented(e,o.indentRules);r.canIndentAsListItem(e,o.indentRules.listsTypes.listItem)?s.sinkListItem(o.indentRules.listsTypes.listItem)(e,t):n&&r.indentBlocks(o.indentRules.nodes)(e,t)},r.outdent=function(e,t){var n=r.canBeIndented(e,o.outdentRules);r.canOutdentAsListItem(e,o.outdentRules)?s.liftListItem(o.outdentRules.listsTypes.listItem)(e,t):n&&r.indentBlocks(o.outdentRules.nodes)(e,t)}},function(e,t){e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=n(17);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:r.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:r.__assign({},t.listsTypes)}},function(e,v,t){"use strict";Object.defineProperty(v,"__esModule",{value:!0});var c=t(2),f=t(3),u=t(5),r=t(19),o=t(15),s=t(15);function p(e,t,n){var r=e.selection,o=r.from,s=r.to,i=e.schema.nodes,a=i.paragraph,l=i.heading,c=[];t.doc.nodesBetween(o,s,function(e,t){e.type!==a&&e.type!==l||c.push({node:e,pos:t})});for(var u=c.length-1;0<=u;u--){var d=c[u],f=t.doc.resolve(t.mapping.map(d.pos));if(0<f.depth){var p=void 0;p=d.node.textContent&&0<d.node.textContent.length?t.doc.resolve(t.mapping.map(d.pos+d.node.textContent.length)):t.doc.resolve(t.mapping.map(d.pos+1));var m=f.blockRange(p);m&&t.lift(m,v.getListLiftTarget(e.schema,f,n))}}return t}function m(u){return function(e,t,n){if(!n)return!1;var r=(e=n.state).schema.nodes[u.listType],o=e.selection,s=o.$from,i=o.$to,a=s.node(-2),l=s.node(-3),c=d(e.doc,s,i,r);return(a&&a.type===r||l&&l.type===r)&&c?k(u)(e,t):(c||(k(u)(e,t),e=n.state),M(r)(e,t))}}function h(e,t,n,r){r=r||e.schema.nodes.listItem;var o=t.$from,s=t.$to,i=o.blockRange(s,function(e){return e.childCount&&e.firstChild.type===r});if(!i||i.depth<2||o.node(i.depth-1).type!==r)return n;var a=i.end,l=s.end(i.depth);return a<l&&(n.step(new u.ReplaceAroundStep(a-1,l,a,l,new c.Slice(c.Fragment.from(r.create(void 0,i.parent.copy())),1,0),1,!0)),i=new c.NodeRange(n.doc.resolve(o.pos),n.doc.resolve(l),i.depth)),n.lift(i,u.liftTarget(i)).scrollIntoView()}function y(i,a,e,l,c,u){u=u||i.schema.nodes.listItem;var d=!1;return c.doc.nodesBetween(a,e,function(e,t){if(!d&&e.type===u&&a<t){d=!0;for(var n=l+3;l+2<n;){var r=c.doc.resolve(c.mapping.map(t));n=r.depth;var o=c.doc.resolve(c.mapping.map(t+e.textContent.length)),s=new f.TextSelection(r,o);c=h(i,s,c,u)}}}),c}function d(e,t,n,r){return 0===i(e,t,n).filter(function(e){return e.type!==r}).length}function i(e,t,n){for(var r=Array(),o=g(e,t).depth,s=e.resolve(t.start(o));s.pos<=n.start(n.depth);){var i=Math.min(s.depth,o),a=s.node(i);if(a&&r.push(a),0===i)break;var l=e.resolve(s.after(i));if(l.start(i)>=e.nodeSize-2)break;l.depth!==s.depth&&(l=e.resolve(l.pos+2)),s=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return r}function g(e,t){var n=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var r=t.node(t.depth),o=t;1<=t.depth;)(r=(t=e.resolve(t.before(t.depth))).node(t.depth))&&-1!==n.indexOf(r.type.name)&&(o=t);return o}function k(a){return function(s,e){var i=s.tr,t=s.selection,n=t.$from,r=t.$to;return i.doc.nodesBetween(n.pos,r.pos,function(e,t){if(e.isTextblock||"blockquote"===e.type.name||"div"===e.type.name){var n=new f.NodeSelection(i.doc.resolve(i.mapping.map(t))),r=n.$from.blockRange(n.$to);if(!r||n.$from.parent.type!==s.schema.nodes[a.listItem])return!1;var o=r&&u.liftTarget(r);if(null==o)return!1;i.lift(r,o)}}),e&&e(i),!0}}function M(n){return r.autoJoin(o.wrapInList(n),function(e,t){return e.type===t.type&&e.type===n})}v.rootListDepth=function(e,t){for(var n,r=t.bulletList,o=t.orderedList,s=t.listItem,i=e.depth-1;0<i;i--){var a=e.node(i);if(a.type!==r&&a.type!==o||(n=i),a.type!==r&&a.type!==o&&a.type!==s)break}return n},v.getListLiftTarget=function(e,t,n){for(var r=t.depth,o=e.nodes[n.bulletList],s=e.nodes[n.orderedList],i=e.nodes[n.listItem],a=t.depth;0<a;a--){var l=t.node(a);if(l.type!==o&&l.type!==s||(r=a),l.type!==o&&l.type!==s&&l.type!==i)break}return r-1},v.liftSelectionList=p,v.toggleList=function(e,t,n,r,o){var s=r.listType,i=e.selection,a=i.$from.node(i.$from.depth-2),l=i.$to.node(i.$to.depth-2);if(a&&a.type.name===s&&l&&l.type.name===s){var c=n.state.schema.nodes,u={bulletList:c[r.bulletList],orderedList:c[r.orderedList],listItem:c[r.listItem]},d=v.rootListDepth(i.$to,u),f=y(e,i.$to.pos,i.$to.end(d),d,n.state.tr,u.listItem);return(f=p(e,f,r)).setMeta("commandName",o),t(f),!0}return m(r)(e,t,n)},v.toggleListCommand=m,v.liftFollowingList=y,v.isRangeOfType=d,v.getAncestorNodesBetween=i,v.findAncestorPosition=g,v.liftListItems=k,v.wrapInList=M,v.toggleUnorderedList=function(e,t,n){return v.toggleList(e,t,n,{listType:"bulletList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})},v.toggleOrderedList=function(e,t,n){return v.toggleList(e,t,n,{listType:"orderedList",bulletList:"bulletList",orderedList:"orderedList",listItem:"listItem"})},v.splitListItemKeepMarks=function(e){return function(n,r){return s.splitListItem(e)(n,function(e){var t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();t&&e.ensureMarks(t),r(e)})}}},function(e,t){e.exports=d},function(e,t){e.exports=s}],n.c=o,n.p="",n(0)}}});
System.register("@progress/kendo-editor-common",["prosemirror-history","prosemirror-tables","prosemirror-transform","prosemirror-state","prosemirror-model","prosemirror-schema-list","tslib","prosemirror-commands","prosemirror-inputrules"],function(S){var a,s,i,l,u,c,d,f,p;function t(e){return e.__useDefault?e.default:e}return{setters:[function(e){a=t(e)},function(e){s=t(e)},function(e){i=t(e)},function(e){l=t(e)},function(e){u=t(e)},function(e){c=t(e)},function(e){d=t(e)},function(e){f=t(e)},function(e){p=t(e)}],execute:function(){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var n,o;o={},r.m=n=[function(e,t){e.exports=l},function(e,t){e.exports=d},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=t(3),r=t(0),v=t(4),n=t(15),h=t(6);o.changeStyles=function(e,t){var n=t.style,r=t.value,o=t.newValue,a=[];if(e){var s=e.split(/\s*;\s*/).filter(function(e){return e}),i=s.filter(function(e){if(!e.toLowerCase().trim().startsWith(n))return!0;var t=e.split(":")[1].trim();return!r.test(t)||(a.push(t),!1)});return o&&i.push(n+": "+o),{style:i.join("; ")+(i.length?";":""),changed:!!o||i.length!==s.length,styleMatches:a}}return{changed:!1,styleMatches:a,style:null}},o.changeStyle=function(m,g){return function(e,t,n){var r=e.selection,o=r.empty,a=r.$cursor,s=r.ranges;if(o&&!a||!v.markApplies(e.doc,s,m))return!1;var i=!1;if(t)if(n=n||e.tr,a){var l=e.storedMarks||a.marks();if(m.isInSet(l)){var u=h.changeStyleFromMark(l,g);t(n.removeStoredMark(m)),t(n.addStoredMark(m.create({style:u.style}))),i=!0}}else{for(var c=0;c<s.length;c++){var d=s[c],f=d.$from,p=d.$to;i=h.changeStyleMark(n,f.pos,p.pos,g,m)}i&&(n.scrollIntoView(),t(n))}return i}},o.canInsert=function(e,t){for(var n=e.selection.$from,r=n.depth;0<=r;r--){var o=n.index(r);if(n.node(r).canReplaceWith(o,o,t))return!0}return!1},o.getTypeName=function(e){return e instanceof a.Node?e.type.name:e.name},o.findParentNode=function(o){return function(e){for(var t=e.$from,n=t.depth;0<n;n--){var r=t.node(n);if(o(r))return{depth:n,node:r}}}},o.findNthParentNode=function(o,a){return void 0===a&&(a=1),function(e){for(var t=e.$from,n=t.depth;0<n;n--){var r=t.node(n);if(o(r)&&0==(a-=1))return{depth:n,node:r}}}},o.findNthParentNodeOfType=function(t,n){return void 0===n&&(n=1),function(e){return o.findNthParentNode(function(e){return o.getTypeName(e)===o.getTypeName(t)},n)(e)}},o.insertNode=function(r,o){return function(e,t){var n=e.tr.replaceSelectionWith(r);o&&n.scrollIntoView(),t(n)}},o.isNullOrUndefined=function(e){return null==e},o.safeString=function(e){return o.isNullOrUndefined(e)?"":e.toString()},o.createContentNode=function(e){var t=document.createElement("div");return t.innerHTML=o.safeString(e).trim(),a.DOMParser.fromSchema(new a.Schema({nodes:n.nodes,marks:n.marks})).parse(t)},o.hasSameMarkup=function(e,t){var n=a.Fragment.from(o.createContentNode(e)),r=a.Fragment.from(o.createContentNode(t));return n.eq(r)},o.first=function(e){return e[0]},o.last=function(e){return e[e.length-1]},o.split=function(t){return function(e){return e.split(t)}},o.trim=function(e){return e.trim()},o.filter=function(t){return function(e){return e.filter(t)}},o.getUniqueStyleValues=function(e,t){if(e.hasNodesWithoutMarks)return"";var n=e.marks.filter(function(e){return"style"===e.type.name}).map(function(e){return e.attrs.style}).map(o.split(";")).map(o.filter(function(e){return e.includes(t)})).map(function(e){return 0!==e.length?e:[t+": INVALID"]}).map(o.first).map(o.split(":")).map(o.last).map(o.trim).reduce(function(e,t){return-1<e.indexOf(t)?e:e.concat([t])},[]);return-1<n.indexOf("INVALID")||1!==n.length?"":n[0]},o.getSelectionText=function(e){var t=e.selection;if(t instanceof r.TextSelection||t instanceof r.AllSelection){var n=t.content().content;return n.textBetween(0,n.size)}return""},o.getNodeFromSelection=function(e){if(e.selection instanceof r.NodeSelection)return e.selection.node}},function(e,t){e.exports=u},function(e,g,t){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var n=t(5),v=t(3),s=t(0),m=t(6);g.markApplies=function(a,s,i){for(var e=function(e){var t=s[e],n=t.$from,r=t.$to,o=0===n.depth&&a.type.allowsMarkType(i);if(a.nodesBetween(n.pos,r.pos,function(e){if(o)return!1;o=e.inlineContent&&e.type.allowsMarkType(i)}),o)return{v:!0}},t=0;t<s.length;t++){var n=e(t);if(n)return n.v}return!1},g.toggleMark=function(f,p,m){return function(e,t){var n=e.selection,r=n.empty,o=n.$cursor,a=n.ranges;if(r&&!o||!g.markApplies(e.doc,a,f))return!1;if(t)if(o)f.isInSet(e.storedMarks||o.marks())?t(m.removeStoredMark(f)):t(m.addStoredMark(f.create(p)));else{for(var s=!1,i=0;!s&&i<a.length;i++){var l=a[i],u=l.$from,c=l.$to;s=e.doc.rangeHasMark(u.pos,c.pos,f)}for(i=0;i<a.length;i++){var d=a[i];u=d.$from,c=d.$to,s?m.removeMark(u.pos,c.pos,f):m.addMark(u.pos,c.pos,f.create(p))}t(m.scrollIntoView())}return!0}},g.removeMark=function(t,c,d,f){void 0===f&&(f=null);var p=[],m=0;return t.doc.nodesBetween(c,d,function(e,t){if(e.isInline){m++;var n=null;if(f instanceof v.MarkType){var r=f.isInSet(e.marks);r&&(n=[r])}else f?f.isInSet(e.marks)&&(n=[f]):n=e.marks;if(n&&n.length)for(var o=Math.min(t+e.nodeSize,d),a=0;a<n.length;a++){for(var s=n[a],i=void 0,l=0;l<p.length;l++){var u=p[l];u.step===m-1&&s.eq(u.style)&&(i=u)}i?(i.to=o,i.step=m):p.push({style:s,from:Math.max(t,c),to:o,step:m})}}}),p.forEach(function(e){return t.step(new n.RemoveMarkStep(e.from,e.to,e.style))}),t},g.removeMarks=function(o,t,n,a){var e=t.selection,r=e.$cursor,s=e.ranges;if(a=a||t.tr,r)o.forEach(function(e){e.isInSet(t.storedMarks||r.marks())&&n(a.removeStoredMark(e))});else{for(var i=function(e){var t=s[e],n=t.$from,r=t.$to;o.forEach(function(e){g.removeMark(a,n.pos,r.pos,e)})},l=0;l<s.length;l++)i(l);n(a.scrollIntoView())}return!0},g.removeAllMarks=function(e){var t=(void 0===e?{}:e).except,u=void 0===t?[]:t;return function(e,t){var n=e.schema,r=e.selection,o=r.$cursor,a=r.from,s=r.to,i=e.tr,l=(u instanceof Array?u:[u]).map(function(e){return e.name});o||(Object.keys(n.marks).map(function(e){return n.marks[e]}).filter(function(e){return-1===l.indexOf(e.name)}).forEach(function(e){return i.removeMark(a,s,e)}),t(i))}},g.getParentMark=function(e,t){var n=e.selection,r=n.from,o=n.$from,a=n.to,s=n.empty,i=e.doc;if(s)return t.isInSet(e.storedMarks||o.marks())||null;var l=[];return i.nodesBetween(r,a,function(e){e.isInline&&l.push(t.isInSet(e.marks))}),1===l.length&&l[0]?l[0]:null},g.hasMark=function(e,t){var n,r=e.schema.marks,o=(t.altMarks||[]).filter(function(e){return r[e]}),a=t.altStyle,s=e.selection,i=s.from,l=s.$from,u=s.to,c=s.empty,d=r[t.mark],f=e.doc,p=!1;return!(p=c?(n=e.storedMarks||l.marks(),d&&d.isInSet(n)||o.some(function(e){return r[e].isInSet(n)})):d&&f.rangeHasMark(i,u,d)||o.some(function(e){return f.rangeHasMark(i,u,r[e])}))&&a?m.hasStyle(e,a):!!p},g.getMark=function(e,t){var n,r=e.selection,o=r.from,a=r.$from,s=r.to,i=r.empty,l=e.doc;return i?n=t.isInSet(e.storedMarks||a.marks()):l.nodesBetween(o,s,function(e){e.isInline&&!n&&(n=t.isInSet(e.marks))}),n},g.getActiveMarks=function(e,r){var t=e.selection,o=!1;if(t instanceof s.TextSelection&&t.$cursor)return{hasNodesWithoutMarks:o,marks:t.$cursor.marks().filter(function(e){return!r||e.type.name===r.name})};var a=[];return t.content().content.descendants(function(e){if("text"===e.type.name){var t=r?(n=r,e.marks.filter(function(e){return e.type.name===n.name})):e.marks;0<e.marks.length&&0<t.length?a.push.apply(a,t):o=!0}var n}),{hasNodesWithoutMarks:o,marks:a}}},function(e,t){e.exports=i},function(e,S,t){"use strict";Object.defineProperty(S,"__esModule",{value:!0});var _=t(5),o=t(2),v=t(4);S.changeStyleFromMark=function(e,t){var n=e.find(function(e){return"style"===e.type.name}),r=n&&n.attrs.style;return o.changeStyles(r,t)},S.changeStyleMark=function(t,p,m,g,v){var h=v.create({style:g.style}),y=[],k=[],M=null,b=null;return t.doc.nodesBetween(p,m,function(e,t,n){if(e.isInline){var r=e.marks;if(!h.isInSet(r)&&n.type.allowsMarkType(h.type)){var o=Math.max(t,p),a=Math.min(t+e.nodeSize,m),s=S.changeStyleFromMark(r,g);if(s.changed||g.newValue){for(var i=s.changed?{style:s.style}:{style:[g.style]+": "+g.newValue+";"},l=v.create(i),u=l.addToSet(r),c=0;c<r.length;c++)r[c].isInSet(u)||(M&&M.to===o&&M.mark.eq(r[c])?M.to=a:(M=new _.RemoveMarkStep(o,a,r[c]),y.push(M)));var d=b&&b.to===o,f=d&&l.attrs.style===b.mark.attrs.style;d&&f?b.to=a:l.attrs.style&&(b=new _.AddMarkStep(o,a,l),k.push(b))}}}}),y.forEach(function(e){return t.step(e)}),k.forEach(function(e){return t.step(e)}),0<y.length+k.length},S.hasStyle=function(e,t){var n=e.selection,r=n.from,o=n.$from,a=n.to,s=n.empty,i=!1,l={style:t.name,value:t.value};return s?i=S.changeStyleFromMark(e.storedMarks||o.marks(),l).changed:e.doc.nodesBetween(r,a,function(e,t,n){!i&&e.isInline&&(i=S.changeStyleFromMark(e.marks,l).changed)}),i},S.getInlineStyles=function(e,t){var r,n=e.selection,o=n.from,a=n.$from,s=n.to,i=n.empty,l=[],u={style:t.name,value:t.value};return i?(r=S.changeStyleFromMark(e.storedMarks||a.marks(),u)).changed&&(l=r.styleMatches):e.doc.nodesBetween(o,s,function(e,t,n){e.isInline&&((r=S.changeStyleFromMark(e.marks,u)).changed?l.push.apply(l,r.styleMatches):l.push(null))}),l.filter(function(e){return null!==e})},S.changeStyle=function(m,g){return function(e,t,n){var r=e.selection,o=r.empty,a=r.$cursor,s=r.ranges;if(o&&!a||!v.markApplies(e.doc,s,m))return!1;var i=!1;if(t)if(n=n||e.tr,a){var l=e.storedMarks||a.marks();if(m.isInSet(l)){var u=S.changeStyleFromMark(l,g);t(n.removeStoredMark(m)),t(n.addStoredMark(m.create({style:u.style}))),i=!0}}else{for(var c=0;c<s.length;c++){var d=s[c],f=d.$from,p=d.$to;i=S.changeStyleMark(n,f.pos,p.pos,g,m)}i&&(n.scrollIntoView(),t(n))}return i}},S.toggleInlineFormat=function(f,p,m){return function(t,e){var n=t.schema.marks,r=f.altStyle,o=f.altMarks,a=void 0===o?[]:o,s=f.mark;p=p||t.tr;function i(){return u=!0}var l=!1,u=!1;if(r&&n.style){var c=n.style;l=S.changeStyle(c,{style:r.name,value:r.value})(t,i,p)}var d=[s].concat(a).filter(function(e){return n[e]}).map(function(e){return v.hasMark(t,{mark:e})&&n[e]}).filter(function(e){return e});return d.length?v.removeMarks(d,t,i,p):l||v.toggleMark(n[s],m,p)(t,i),u&&e(p),u}},S.applyInlineStyle=function(a,s){return function(e,t){var n=e.schema.marks,r=S.changeStyle(n.style,{style:a.style,value:/^.+$/,newValue:a.value}),o=e.tr;return s&&(o.setMeta("commandName",s),o.setMeta("args",a)),r(e,t,o)}}},function(e,t){e.exports=c},function(e,d,t){"use strict";Object.defineProperty(d,"__esModule",{value:!0});var f=t(1),a=t(2),v=t(5),h=t(3),s=t(0);d.changeBlockNode=function(o,e,d,f,p,m){var t=o.selection,n=t.from,r=t.to,a=!1;if(o.doc.nodesBetween(n,r,function(e,t){if(a)return!1;if(e.isTextblock&&!e.hasMarkup(p,m))if(e.type===p)a=!0;else{var n=o.doc.resolve(t),r=n.index();a=n.parent.canReplaceWith(r,r+1,p)}}),!a)return!1;if(e){if(!p.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var g=d.steps.length;d.doc.nodesBetween(n,r,function(e,t){if(e.eq(f)&&e.isTextblock&&!e.hasMarkup(p,m)&&(s=d.doc,i=d.mapping.slice(g).map(t),l=p,u=s.resolve(i),c=u.index(),u.parent.canReplaceWith(c,c+1,l))){d.clearIncompatible(d.mapping.slice(g).map(t,1),p);var n=d.mapping.slice(g),r=n.map(t,1),o=n.map(t+e.nodeSize,1),a=new h.Slice(h.Fragment.from(p.create(m,null,e.marks)),0,0);return d.step(new v.ReplaceAroundStep(r,o,r+1,o-1,a,1,!0)),!1}var s,i,l,u,c})}return!0},d.blockNodes=function(e){var t=e.selection,n=t.from,r=t.to,o=t.$from,a=[];return t.node?t.node.isBlock?a.push(t.node):o.parent&&o.parent.isBlock&&a.push(o.parent):e.doc.nodesBetween(n,r,function(e){e.isBlock&&a.push(e)}),a},d.formatBlockElements=function(c,t){return function(a,s){var e=d.blockNodes(a),i=a.schema.nodes,l=!1,u=a.tr;return u.setMeta("commandName",t),u.setMeta("args",{value:c}),e.forEach(function(e){if(e.type.isTextblock)if("p"===c){var t=e.attrs,n=t.level,r=f.__rest(t,["level"]);l=d.changeBlockNode(a,s,u,e,i.paragraph,r)||l}else if(/^h[1-6]$/i.test(c))n=parseInt(c.substr(1),10),l=d.changeBlockNode(a,s,u,e,i.heading,f.__assign({},e.attrs,{level:n}))||l;else if("blockquote"===c){var o=e.attrs;n=o.level,r=f.__rest(o,["level"]),l=d.changeBlockNode(a,s,u,e,i.blockquote,r)||l}}),l&&s(u.scrollIntoView()),l}},d.getBlockFormats=function(e){var t=d.blockNodes(e),n=e.schema.nodes,r=[];return t.forEach(function(e){if(e.type===n.paragraph)r.push("p");else if(e.type===n.heading)for(var t=1;t<=6;t++)if(e.attrs.level===t){r.push("h"+t);break}}),r},d.addStyles=function(e,t){var n=e.attrs.style,r=null,o=null;return n&&t.forEach(function(e){o={style:e.name,value:/^.+$/,newValue:e.value},r=a.changeStyles(n,o),n=r.changed?r.style:n}),n=n||t.reduce(function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""},""),Object.assign({},e.attrs,{style:n||null})},d.hasNode=function(e,t){var n=e.selection,r=n.from,o=n.to,a=!1;return e.doc.nodesBetween(r,o,function(e){return!(a=a||e.type===t)}),a};function i(t){return r=t,Object.keys(r).filter(function(e){return function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]}(e)}).reduce(function(e,t){var n;return Object.assign(e,((n={})[t]=r[t],n))},{});var r}d.getNodeTagName=function(n,r){var e,t=n.type.spec.parseDOM||[],o=n.attrs;return(e=1===t.length?t[0]:t.find(function(e){var t=h.DOMSerializer.fromSchema(r).serializeNode(n);return JSON.stringify(e.getAttrs(t))===JSON.stringify(i(o))}))?e.tag.toLowerCase().replace(/ *\[[^\]]*]/,""):""},d.activeNode=function(e){var t,n=e.schema.nodes.doc;if(e.selection instanceof s.AllSelection)t=e.doc;else if(e.selection instanceof s.TextSelection){var r=e.selection.$anchor,o=r.node(r.blockRange().depth);t=a.getTypeName(o)===a.getTypeName(n)?r.node():o}else e.selection instanceof s.NodeSelection&&(t=e.selection.node);return{name:a.getTypeName(t),tag:d.getNodeTagName(t,e.schema)}}},function(e,t){e.exports=a},function(e,t){e.exports=f},function(e,g,t){"use strict";Object.defineProperty(g,"__esModule",{value:!0});var r=t(1),u=t(3),f=t(0),c=t(5),o=t(10),a=t(7),s=t(7),i=t(12);function p(e,t,n){var r=e.selection,o=r.from,a=r.to,s=e.schema.nodes,i=s.paragraph,l=s.heading,u=[];t.doc.nodesBetween(o,a,function(e,t){e.type!==i&&e.type!==l||u.push({node:e,pos:t})});for(var c=u.length-1;0<=c;c--){var d=u[c],f=t.doc.resolve(t.mapping.map(d.pos));if(0<f.depth){var p;p=d.node.textContent&&0<d.node.textContent.length?t.doc.resolve(t.mapping.map(d.pos+d.node.textContent.length)):t.doc.resolve(t.mapping.map(d.pos+1));var m=f.blockRange(p);m&&t.lift(m,g.getListLiftTarget(e.schema,f,n))}}return t}function m(c){return function(e,t,n){if(!n)return!1;var r=(e=n.state).schema.nodes[c.listType],o=e.selection,a=o.$from,s=o.$to,i=a.node(-2),l=a.node(-3),u=d(e.doc,a,s,r);return(i&&i.type===r||l&&l.type===r)&&u?k(c)(e,t):(u||(k(c)(e,t),e=n.state),M(r)(e,t))}}function v(e,t,n,r){r=r||e.schema.nodes.listItem;var o=t.$from,a=t.$to,s=o.blockRange(a,function(e){return e.childCount&&e.firstChild.type===r});if(!s||s.depth<2||o.node(s.depth-1).type!==r)return n;var i=s.end,l=a.end(s.depth);return i<l&&(n.step(new c.ReplaceAroundStep(i-1,l,i,l,new u.Slice(u.Fragment.from(r.create(void 0,s.parent.copy())),1,0),1,!0)),s=new u.NodeRange(n.doc.resolve(o.pos),n.doc.resolve(l),s.depth)),n.lift(s,c.liftTarget(s)).scrollIntoView()}function h(s,i,e,l,u,c){c=c||s.schema.nodes.listItem;var d=!1;return u.doc.nodesBetween(i,e,function(e,t){if(!d&&e.type===c&&i<t){d=!0;for(var n=l+3;l+2<n;){var r=u.doc.resolve(u.mapping.map(t));n=r.depth;var o=u.doc.resolve(u.mapping.map(t+e.textContent.length)),a=new f.TextSelection(r,o);u=v(s,a,u,c)}}}),u}function d(e,t,n,r){return 0===l(e,t,n).filter(function(e){return e.type!==r}).length}function l(e,t,n){for(var r=Array(),o=y(e,t).depth,a=e.resolve(t.start(o));a.pos<=n.start(n.depth);){var s=Math.min(a.depth,o),i=a.node(s);if(i&&r.push(i),0===s)break;var l=e.resolve(a.after(s));if(l.start(s)>=e.nodeSize-2)break;l.depth!==a.depth&&(l=e.resolve(l.pos+2)),a=l.depth?e.resolve(l.start(l.depth)):e.resolve(l.end(l.depth))}return r}function y(e,t){var n=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;for(var r=t.node(t.depth),o=t;1<=t.depth;)(r=(t=e.resolve(t.before(t.depth))).node(t.depth))&&-1!==n.indexOf(r.type.name)&&(o=t);return o}function k(i){return function(a,e){var s=a.tr,t=a.selection,n=t.$from,r=t.$to;return s.doc.nodesBetween(n.pos,r.pos,function(e,t){if(e.isTextblock||"blockquote"===e.type.name||"div"===e.type.name){var n=new f.NodeSelection(s.doc.resolve(s.mapping.map(t))),r=n.$from.blockRange(n.$to);if(!r||n.$from.parent.type!==a.schema.nodes[i.listItem])return!1;var o=r&&c.liftTarget(r);if(null==o)return!1;s.lift(r,o)}}),e&&e(s),!0}}function M(n){return o.autoJoin(a.wrapInList(n),function(e,t){return e.type===t.type&&e.type===n})}g.rootListDepth=function(e,t){for(var n,r=t.bulletList,o=t.orderedList,a=t.listItem,s=e.depth-1;0<s;s--){var i=e.node(s);if(i.type!==r&&i.type!==o||(n=s),i.type!==r&&i.type!==o&&i.type!==a)break}return n},g.getListLiftTarget=function(e,t,n){for(var r=t.depth,o=e.nodes[n.bulletList],a=e.nodes[n.orderedList],s=e.nodes[n.listItem],i=t.depth;0<i;i--){var l=t.node(i);if(l.type!==o&&l.type!==a||(r=i),l.type!==o&&l.type!==a&&l.type!==s)break}return r-1},g.liftSelectionList=p,g.toggleList=function(e,t,n,r,o){var a=r.listType,s=e.selection,i=s.$from.node(s.$from.depth-2),l=s.$to.node(s.$to.depth-2);if(i&&i.type.name===a&&l&&l.type.name===a){var u=n.state.schema.nodes,c={bulletList:u[r.bulletList],orderedList:u[r.orderedList],listItem:u[r.listItem]},d=g.rootListDepth(s.$to,c),f=h(e,s.$to.pos,s.$to.end(d),d,n.state.tr,c.listItem);return(f=p(e,f,r)).setMeta("commandName",o),t(f),!0}return m(r)(e,t,n)},g.toggleListCommand=m,g.liftFollowingList=h,g.isRangeOfType=d,g.getAncestorNodesBetween=l,g.findAncestorPosition=y,g.liftListItems=k,g.wrapInList=M,g.toggleUnorderedList=function(e,t,n){return g.toggleList(e,t,n,r.__assign({listType:i.bulletList.listType},i.bulletList.types))},g.toggleOrderedList=function(e,t,n){return g.toggleList(e,t,n,r.__assign({listType:i.orderedList.listType},i.orderedList.types))},g.splitListItemKeepMarks=function(e){return function(n,r){return s.splitListItem(e)(n,function(e){var t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();t&&e.ensureMarks(t),r(e)})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1);t.listsTypes={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},t.orderedList={listType:t.listsTypes.orderedList,types:r.__assign({},t.listsTypes)},t.bulletList={listType:t.listsTypes.bulletList,types:r.__assign({},t.listsTypes)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(12);t.indentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)},t.outdentRules={nodes:[{node:"paragraph",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"},{node:"heading",style:"margin-left",rtlStyle:"margin-right",step:-30,unit:"px"}],listsTypes:r.__assign({},o.listsTypes)}},function(e,t){e.exports=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(e){for(var t,n={},r=e.attributes,o=0;o<r.length;o++)n[(t=r[o]).name]=t.value;return n}function o(e,t){for(var n in e)if(n&&null!==e[n]&&n!==t)return!0;return!1}function a(e,t){var n={};for(var r in e)r&&null!==e[r]&&r!==t&&(n[r]=e[r]);return n}function s(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t}var i=n(1),l=n(14),u=["blockquote",0],c=["hr"],d=["pre",["code",0]],f=["ol",0],p=["ul",0],m=["li",0],g=i.__assign({link:{attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:r}],toDOM:function(e){return["a",a(e.attrs),0]}}},s("strong"),s("b"),s("em"),s("i"),s("u"),s("del"),s("sub"),s("sup"),s("code"),{style:{attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"span",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["span",a(e.attrs),0]:["span",0]}}});t.marks=g;var v=i.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"p",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["p",a(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"div",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["div",a(e.attrs),0]:["div",0]}},blockquote:{attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:function(){return u}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return c}},heading:{attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return i.__assign({},r(e),{level:1})}},{tag:"h2",getAttrs:function(e){return i.__assign({},r(e),{level:2})}},{tag:"h3",getAttrs:function(e){return i.__assign({},r(e),{level:3})}},{tag:"h4",getAttrs:function(e){return i.__assign({},r(e),{level:4})}},{tag:"h5",getAttrs:function(e){return i.__assign({},r(e),{level:5})}},{tag:"h6",getAttrs:function(e){return i.__assign({},r(e),{level:6})}}],toDOM:function(e){return o(e.attrs,"level")?["h"+e.attrs.level,a(e.attrs,"level"),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return d}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:i.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["img",a(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["br",a(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}},{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return i.__assign({},r(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?o(e.attrs,"order")?["ol",a(e.attrs,"order"),0]:f:["ol",i.__assign({},a(e.attrs,"order"),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"ul",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["ul",a(e.attrs),0]:p}},list_item:{content:"block*",attrs:i.__assign({},{style:{default:null},class:{default:null},id:{default:null}}),parseDOM:[{tag:"li",getAttrs:r}],toDOM:function(e){return o(e.attrs)?["li",a(e.attrs),0]:m},defining:!0}},l.tableNodes({tableGroup:"block",cellContent:"block+",cellAttributes:{}}));t.nodes=v},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTable=function(e,t,n){for(var r=e.table,o=e.table_row,a=e.table_cell,s=[],i=[],l=0;l<t+1;l++){for(var u=i.length=0;u<n+1;u++)i.push(a.createAndFill());s.push(o.createAndFill(void 0,i))}return r.createAndFill(void 0,s)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bold={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},t.italic={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},t.underline={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},t.strikethrough={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},t.subscript={mark:"sub"},t.superscript={mark:"sup"},t.link={mark:"link"},t.unlink={mark:"link"}},function(e,t){e.exports=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(10),a=n(9),s=n(18),r=n(11),i="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);t.buildKeymap=function(e){var t={};if(t["Mod-z"]=a.undo,t["Shift-Mod-z"]=a.redo,t.Backspace=o.chainCommands(s.undoInputRule,o.deleteSelection,o.joinBackward,o.selectNodeBackward),t.Enter=o.chainCommands(o.newlineInCode,o.createParagraphNear,o.liftEmptyBlock,o.splitBlockKeepMarks),i||(t["Mod-y"]=a.redo),e.marks.strong&&(t["Mod-b"]=o.toggleMark(e.marks.strong)),e.marks.em&&(t["Mod-i"]=o.toggleMark(e.marks.em)),e.marks.underline&&(t["Mod-u"]=o.toggleMark(e.marks.underline)),e.nodes.hardBreak){var n=e.nodes.hardBreak,r=o.chainCommands(o.exitCode,function(e,t){return t(e.tr.replaceSelectionWith(n.create()).scrollIntoView()),!0});t["Mod-Enter"]=r,t["Shift-Enter"]=r,i&&(t["Ctrl-Enter"]=r)}return t},t.buildListKeymap=function(e){var t={};return e.nodes.listItem&&(t.Enter=r.splitListItemKeepMarks(e.nodes.listItem)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(e,t){return{name:e,value:t}}t.alignLeftRules=[{node:"paragraph",style:[r("text-align","left")]},{node:"heading",style:[r("text-align","left")]},{node:"listItem",style:[r("text-align","left"),r("list-style-position","inside")]}],t.alignRightRules=[{node:"paragraph",style:[r("text-align","right")]},{node:"heading",style:[r("text-align","right")]},{node:"listItem",style:[r("text-align","right"),r("list-style-position","inside")]}],t.alignCenterRules=[{node:"paragraph",style:[r("text-align","center")]},{node:"heading",style:[r("text-align","center")]},{node:"listItem",style:[r("text-align","center"),r("list-style-position","inside")]}],t.alignRemoveRules=[{node:"paragraph",style:[r("text-align","")]},{node:"heading",style:[r("text-align","")]},{node:"listItem",style:[r("text-align",""),r("list-style-position","")]}]},function(e,o,t){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var i=t(7),a=t(13),m=t(8),l=t(2);o.indentBlocks=function(f,t,p){return function(l,u){var e=m.blockNodes(l),c=l.tr,d=!1;return c.setMeta("commandName",t),e.forEach(function(t){if(t.type.isTextblock){var e=void 0,n=f.find(function(e){return e.node===t.type.name});if(n){var r="rtl"===p?n.rtlStyle:n.style,o={name:r,value:0<n.step?""+n.step+n.unit:""};if(t.attrs.style){var a=new RegExp(r+":\\s?(\\d+)"+n.unit,"i"),s=t.attrs.style.match(a);if(s){var i=parseFloat(s[1])+n.step;i=i<=0?"":i,o.value=""+i+(i?n.unit:"")}}e=m.addStyles(t,[o])}e&&(d=m.changeBlockNode(l,u,c,t,t.type,e)||d)}}),d&&u(c.scrollIntoView()),d}},o.isIndented=function(e,o,a){var s=!1;return m.blockNodes(e).forEach(function(t){if(!s&&t.type.isTextblock&&t.attrs.style){var e=o.find(function(e){return e.node===t.type.name});if(e){var n="rtl"===a?e.rtlStyle:e.style,r=new RegExp(n+":\\s?\\d+"+e.unit,"i");s=r.test(t.attrs.style)}}}),s},o.canIndentAsListItem=function(e,t){return i.sinkListItem(t)(e)},o.canOutdentAsListItem=function(e,t){var n=e.schema.nodes[t.listsTypes.listItem],r=e.schema.nodes[t.listsTypes.orderedList],o=e.schema.nodes[t.listsTypes.bulletList],a=!!l.findNthParentNodeOfType(r,2)(e.selection),s=!!l.findNthParentNodeOfType(o,2)(e.selection);return(a||s)&&i.liftListItem(n)(e)},o.canBeIndented=function(t,e){var n=t.schema.nodes,r=n[a.indentRules.listsTypes.listItem];return(o.isIndented(t,e.nodes)||a.indentRules.nodes.some(function(e){return n[e.node]&&m.hasNode(t,n[e.node])}))&&!m.hasNode(t,r)},o.indent=function(e,t){var n=e.schema.nodes[a.indentRules.listsTypes.listItem],r=o.canBeIndented(e,a.indentRules);o.canIndentAsListItem(e,n)?i.sinkListItem(n)(e,t):r&&o.indentBlocks(a.indentRules.nodes)(e,t)},o.outdent=function(e,t){var n=e.schema.nodes[a.outdentRules.listsTypes.listItem],r=o.canBeIndented(e,a.outdentRules);o.canOutdentAsListItem(e,a.outdentRules)?i.liftListItem(n)(e,t):r&&o.indentBlocks(a.outdentRules.nodes)(e,t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=n(8);t.alignBlocks=function(i){return function(r,o){var e=l.blockNodes(r),a=r.tr,s=!1;return e.forEach(function(t){if(t.type.isTextblock){var e={},n=i.find(function(e){return e.node===t.type.name});n&&(e=l.addStyles(t,n.style)),s=l.changeBlockNode(r,o,a,t,t.type,e)||s}}),s&&o(a.scrollIntoView()),s}},t.isAligned=function(e,n){var r=!1;return l.blockNodes(e).forEach(function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var e=n.find(function(e){return e.node===t.type.name});e&&(r=e.style.every(function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)}))}}),r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2);t.insertImage=function(r){return function(e,t){var n=e.schema.nodes.image.createAndFill(r);o.insertNode(n)(e,function(e){return t(e.setMeta("commandName","insertImage").setMeta("args",r))})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=function(n){return function(e,t){t(e.tr.insertText(n.text,n.from,n.to))}}},function(e,c,t){"use strict";Object.defineProperty(c,"__esModule",{value:!0});var m=t(6),h=t(4),d=t(0);c.removeLink=function(f,p){return function(e,t){var n=e.selection.$cursor;if(n){var r=n.parent,o=n.index(),a=e.schema.marks[f.mark],s=r.child(o).marks.find(function(e){return e.type===a}),i=r.childCount,l=n.pos-n.textOffset,u=r.child(o).nodeSize,c=void 0,d=void 0;for(c=o-1;0<=c&&s.isInSet(r.child(c).marks);)u+=d=r.child(c).nodeSize,l-=d,c-=1;for(c=o+1;c<i&&s.isInSet(r.child(c).marks);)u+=r.child(c).nodeSize,c+=1;t(h.removeMark(p||e.tr,l,l+u,s))}else m.toggleInlineFormat(f,p)(e,t)}},c.applyLink=function(e,i){var l=e.mark,u=e.attrs;return function(e,t){var n=e.schema.marks,r=e.tr;i&&(r.setMeta("commandName",i),r.setMeta("args",u));function o(){return a=!0}var g,v,a=!1;if(h.getParentMark(e,n[l]))g={mark:l,attrs:u},v=r,function(e,n){var t=e.selection,r=t.$cursor,o=t.from,a=t.to,s=e.schema.marks[g.mark];if(r){var i=r.parent,l=r.index(),u=i.child(l).marks.find(function(e){return e.type===s}),c=i.childCount,d=r.pos-r.textOffset,f=i.child(l).nodeSize,p=void 0,m=void 0;for(p=l-1;0<=p&&u.isInSet(i.child(p).marks);)f+=m=i.child(p).nodeSize,d-=m,p-=1;for(p=l+1;p<c&&u.isInSet(i.child(p).marks);)f+=i.child(p).nodeSize,p+=1;v.removeMark(d,d+f,s),v.addMark(d,d+f,s.create(g.attrs)),n(v)}else v.doc.nodesBetween(o,a,function(e,t){e.isInline&&s.isInSet(e.marks)&&(v.removeMark(t,t+e.nodeSize,s),v.addMark(t,t+e.nodeSize,s.create(g.attrs)),n(v))})}(e,o);else{var s=e;h.hasMark(e,{mark:l})&&(c.removeLink({mark:l,attrs:u},r)(e,o),s=d.EditorState.create({doc:r.doc,selection:r.selection})),a?h.toggleMark(n[l],u,r)(s,o):m.toggleInlineFormat({mark:l},r,u)(s,o)}return a&&t(r),a}}},function(e,a,t){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var o=t(3),s=t(0);a.createContentNode=function(e,t,n){var r=document.createElement("div");return r.innerHTML=e,o.DOMParser.fromSchema(t).parse(r,n)},a.getHtml=function(e){var t=o.DOMSerializer.fromSchema(e.schema).serializeFragment(e.doc.content),n=document.createElement("div");return n.appendChild(t),n.innerHTML},a.setHtml=function(n,r,o){return void 0===r&&(r="setHTML"),void 0===o&&(o={preserveWhitespace:"full"}),function(e,t){return t(e.tr.setSelection(new s.AllSelection(e.doc)).replaceSelectionWith(a.createContentNode(n,e.schema,o)).setMeta("commandName",r))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(26);t.getHtml=r.getHtml,t.setHtml=r.setHtml;var o=n(6);t.applyInlineStyle=o.applyInlineStyle,t.toggleInlineFormat=o.toggleInlineFormat;var a=n(25);t.applyLink=a.applyLink,t.removeLink=a.removeLink;var s=n(24);t.insertText=s.insertText;var i=n(23);t.insertImage=i.insertImage;var l=n(22);t.alignBlocks=l.alignBlocks,t.isAligned=l.isAligned;var u=n(8);t.hasNode=u.hasNode,t.activeNode=u.activeNode,t.formatBlockElements=u.formatBlockElements;var c=n(4);t.hasMark=c.hasMark,t.getMark=c.getMark,t.getActiveMarks=c.getActiveMarks,t.removeAllMarks=c.removeAllMarks;var d=n(21);t.indent=d.indent,t.canIndentAsListItem=d.canIndentAsListItem,t.outdent=d.outdent,t.canOutdentAsListItem=d.canOutdentAsListItem,t.isIndented=d.isIndented,t.canBeIndented=d.canBeIndented;var f=n(11);t.toggleOrderedList=f.toggleOrderedList,t.toggleUnorderedList=f.toggleUnorderedList;var p=n(2);t.createContentNode=p.createContentNode,t.hasSameMarkup=p.hasSameMarkup,t.getUniqueStyleValues=p.getUniqueStyleValues,t.getSelectionText=p.getSelectionText,t.getNodeFromSelection=p.getNodeFromSelection,t.canInsert=p.canInsert,t.insertNode=p.insertNode;var m=n(9);t.redo=m.redo,t.undo=m.undo;var g=n(20);t.alignLeftRules=g.alignLeftRules,t.alignCenterRules=g.alignCenterRules,t.alignRightRules=g.alignRightRules,t.alignRemoveRules=g.alignRemoveRules;var v=n(13);t.indentRules=v.indentRules,t.outdentRules=v.outdentRules;var h=n(15);t.nodes=h.nodes,t.marks=h.marks;var y=n(19);t.buildKeymap=y.buildKeymap,t.buildListKeymap=y.buildListKeymap;var k=n(17);t.bold=k.bold,t.italic=k.italic,t.underline=k.underline,t.strikethrough=k.strikethrough,t.subscript=k.subscript,t.superscript=k.superscript,t.link=k.link;var M=n(16);t.createTable=M.createTable;var b=n(14);t.addRowBefore=b.addRowBefore,t.addRowAfter=b.addRowAfter,t.addColumnBefore=b.addColumnBefore,t.addColumnAfter=b.addColumnAfter,t.deleteRow=b.deleteRow,t.deleteColumn=b.deleteColumn,t.deleteTable=b.deleteTable,t.mergeCells=b.mergeCells,t.splitCell=b.splitCell,t.selectionCell=b.selectionCell,function(e){for(var t in e)S(t,e[t])}(t)}],r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}}});
{
"name": "@progress/kendo-editor-common",
"description": "Kendo UI TypeScript package exporting functions for Editor component",
"version": "0.1.0",
"version": "0.2.0-dev.201908051032",
"keywords": [

@@ -43,3 +43,3 @@ "Kendo UI"

"@krux/condition-jenkins": "1.0.1",
"@progress/kendo-typescript-tasks": "^4.4.0",
"@progress/kendo-typescript-tasks": "^7.0.0",
"@telerik/semantic-prerelease": "^1.0.0",

@@ -60,3 +60,3 @@ "@types/jasmine": "~2.2.0",

"ts-jest": "^23.1.4",
"typescript": "~2.5.0",
"typescript": "~2.9.0",
"validate-commit-msg": "^1.1.1"

@@ -63,0 +63,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc