@progress/kendo-angular-editor 3.1.3-dev.202203090959 → 3.1.3-dev.202203091612

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@progress/kendo-angular-toolbar"),require("@progress/kendo-angular-dialog"),require("@progress/kendo-angular-common"),require("@progress/kendo-angular-l10n"),require("@angular/forms"),require("@progress/kendo-angular-dropdowns"),require("rxjs"),require("rxjs/operators"),require("@progress/kendo-angular-inputs"),require("@progress/kendo-licensing"),require("@angular/common"),require("@progress/kendo-angular-buttons"),require("@progress/kendo-angular-popup")):"function"==typeof define&&define.amd?define([,,,,,,,,,,,,,],e):"object"==typeof exports?exports.KendoAngularEditor=e(require("@angular/core"),require("@progress/kendo-angular-toolbar"),require("@progress/kendo-angular-dialog"),require("@progress/kendo-angular-common"),require("@progress/kendo-angular-l10n"),require("@angular/forms"),require("@progress/kendo-angular-dropdowns"),require("rxjs"),require("rxjs/operators"),require("@progress/kendo-angular-inputs"),require("@progress/kendo-licensing"),require("@angular/common"),require("@progress/kendo-angular-buttons"),require("@progress/kendo-angular-popup")):t.KendoAngularEditor=e(t.ng.core,t.KendoAngularToolbar,t.KendoAngularDialog,t.KendoAngularCommon,t.KendoAngularL10N,t.ng.forms,t.KendoAngularDropdowns,t.rxjs,t.rxjs.operators,t.KendoAngularInputs,t.KendoLicensing,t.ng.common,t.KendoAngularButtons,t.KendoAngularPopup)}(window,(function(t,e,n,o,r,i,a,s,l,d,c,u,p,f){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=36)}([function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return r})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return l})),n.d(e,"__metadata",(function(){return d})),n.d(e,"__awaiter",(function(){return c})),n.d(e,"__generator",(function(){return u})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return h})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return w})),n.d(e,"__asyncValues",(function(){return k})),n.d(e,"__makeTemplateObject",(function(){return _})),n.d(e,"__importStar",(function(){return C})),n.d(e,"__importDefault",(function(){return x})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return E}));
5
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@progress/kendo-angular-toolbar"),require("@progress/kendo-angular-dialog"),require("@progress/kendo-angular-common"),require("@progress/kendo-angular-l10n"),require("@angular/forms"),require("@progress/kendo-angular-dropdowns"),require("rxjs"),require("rxjs/operators"),require("@progress/kendo-angular-inputs"),require("@progress/kendo-licensing"),require("@angular/common"),require("@progress/kendo-angular-buttons"),require("@progress/kendo-angular-popup")):"function"==typeof define&&define.amd?define([,,,,,,,,,,,,,],e):"object"==typeof exports?exports.KendoAngularEditor=e(require("@angular/core"),require("@progress/kendo-angular-toolbar"),require("@progress/kendo-angular-dialog"),require("@progress/kendo-angular-common"),require("@progress/kendo-angular-l10n"),require("@angular/forms"),require("@progress/kendo-angular-dropdowns"),require("rxjs"),require("rxjs/operators"),require("@progress/kendo-angular-inputs"),require("@progress/kendo-licensing"),require("@angular/common"),require("@progress/kendo-angular-buttons"),require("@progress/kendo-angular-popup")):t.KendoAngularEditor=e(t.ng.core,t.KendoAngularToolbar,t.KendoAngularDialog,t.KendoAngularCommon,t.KendoAngularL10N,t.ng.forms,t.KendoAngularDropdowns,t.rxjs,t.rxjs.operators,t.KendoAngularInputs,t.KendoLicensing,t.ng.common,t.KendoAngularButtons,t.KendoAngularPopup)}(window,(function(t,e,n,o,r,i,a,s,l,c,d,u,p,f){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=36)}([function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",(function(){return r})),n.d(e,"__assign",(function(){return i})),n.d(e,"__rest",(function(){return a})),n.d(e,"__decorate",(function(){return s})),n.d(e,"__param",(function(){return l})),n.d(e,"__metadata",(function(){return c})),n.d(e,"__awaiter",(function(){return d})),n.d(e,"__generator",(function(){return u})),n.d(e,"__createBinding",(function(){return p})),n.d(e,"__exportStar",(function(){return f})),n.d(e,"__values",(function(){return h})),n.d(e,"__read",(function(){return m})),n.d(e,"__spread",(function(){return v})),n.d(e,"__spreadArrays",(function(){return g})),n.d(e,"__await",(function(){return y})),n.d(e,"__asyncGenerator",(function(){return b})),n.d(e,"__asyncDelegator",(function(){return w})),n.d(e,"__asyncValues",(function(){return k})),n.d(e,"__makeTemplateObject",(function(){return _})),n.d(e,"__importStar",(function(){return C})),n.d(e,"__importDefault",(function(){return x})),n.d(e,"__classPrivateFieldGet",(function(){return S})),n.d(e,"__classPrivateFieldSet",(function(){return E}));
6
6
  /*! *****************************************************************************
7
7
  Copyright (c) Microsoft Corporation.
8
8
 
@@ -17,4 +17,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
17
17
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
18
18
  PERFORMANCE OF THIS SOFTWARE.
19
19
  ***************************************************************************** */
20
- var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}function s(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,o){e(n,o,t)}}function d(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function c(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function u(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function p(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}function f(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(t,e||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(t){r[t]&&(o[t]=function(e){return new Promise((function(n,o){i.push([t,e,n,o])>1||s(t,e)}))})}function s(t,e){try{(n=r[t](e)).value instanceof y?Promise.resolve(n.value.v).then(l,d):c(i[0][2],n)}catch(t){c(i[0][3],t)}var n}function l(t){s("next",t)}function d(t){s("throw",t)}function c(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}function w(t){var e,n;return e={},o("next"),o("throw",(function(t){throw t})),o("return"),e[Symbol.iterator]=function(){return this},e;function o(o,r){e[o]=t[o]?function(e){return(n=!n)?{value:y(t[o](e)),done:"return"===o}:r?r(e):e}:r}}function k(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){(function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)})(o,r,(e=t[n](e)).done,e.value)}))}}}function _(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function C(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function x(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function E(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=function(t){function e(e,n,o){return t.call(this,e,n,o)||this}return o.__extends(e,t),e=o.__decorate([o.__param(0,r.Inject(i.L10N_PREFIX)),o.__param(1,r.Optional()),o.__param(2,r.Optional()),o.__param(2,r.Inject(i.RTL)),o.__metadata("design:paramtypes",[String,i.MessageService,Boolean])],e)}(i.LocalizationService);e.EditorLocalizationService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(15),s=n(16),l=n(4),d=n(7),c=n(10),u=n(8),p=n(37),f=n(38),h=n(23),m=n(41),v=n(43),g=n(9),y=n(24),b=n(25),w=n(26),k=n(11),_=n(2),C=n(44),x=n(27),S=n(5),E=n(28),T={convertMsLists:!1,removeAttributes:[],removeHtmlComments:!1,removeInvalidHTML:!0,removeMsClasses:!1,removeMsStyles:!1,stripTags:[]},M=g.conditionallyExecute(u.removeComments),D=g.conditionallyExecute(u.sanitize),O=function(t){if("all"===t.removeAttributes)return{"*":u.removeAttribute};var e=g.removeEmptyEntries({style:t.removeMsStyles?u.sanitizeStyleAttr:void 0,class:t.removeMsClasses?u.sanitizeClassAttr:void 0});return t.removeAttributes.reduce((function(t,e){var n;return o.__assign({},t,((n={})[e]=u.removeAttribute,n))}),e)},A=function(){function t(t,e,n,i,s,l){var d=this;this.dialogService=t,this.localization=e,this.cdr=n,this.ngZone=i,this.element=s,this.toolsService=l,this.iframe=!0,this.applyToWord=!1,this.preserveWhitespace=!1,this.resizable=!1,this.valueChange=new r.EventEmitter,this.onFocus=new r.EventEmitter,this.paste=new r.EventEmitter,this.onBlur=new r.EventEmitter,this.hostClass=!0,this.stateChange=new a.BehaviorSubject(v.initialToolBarState),this.valueModified=new a.Subject,this._readonly=!1,this._placeholder="",this.inForm=!1,this.afterViewInit=new a.Subject,this.contentAreaLoaded=new a.Subject,this.dispatchTransaction=function(t){var e=t.docChanged;if(!(d.disabled||d.readonly&&e)){if(e){var n=t.doc,o=u.getHtml({doc:n});d.trOnChange=t,d.htmlOnChange=o,d.ngZone.run((function(){d.valueModified.next(o)}))}e&&!d.inForm||d.view.updateState(d.view.state.apply(t))}},this.transformPastedHTML=function(t){var e=o.__assign({},T,d.pasteCleanupSettings),n=g.pipe(D(e.removeInvalidHTML),M(e.removeHtmlComments))(t),r=u.pasteCleanup(n,{convertMsLists:e.convertMsLists,stripTags:e.stripTags.join("|"),attributes:O(e)});if(c.hasObservers(d.paste)){var i=new E.EditorPasteEvent(r,t,d._pasteEvent);return d.ngZone.run((function(){return d.paste.emit(i)})),i.isDefaultPrevented()?"":i.cleanedHtml}return r},this.changeValue=function(t){var e=d._value;if(d._value=t,d._view){if(d.htmlOnChange===t&&d.trOnChange)d.view.updateState(d.view.state.apply(d.trOnChange));else if((e||"")!==(t||"")){if(d.iframe&&!d.container.element.nativeElement.contentWindow)return;var n=d.view.state,o=u.parseContent(t||"",n.schema,{preserveWhitespace:d.preserveWhitespace}),r=n.tr.setSelection(new u.AllSelection(n.doc)).replaceSelectionWith(o);d.view.updateState(n.apply(r))}d.trOnChange=null,d.htmlOnChange=null}},this.onChangeCallback=function(t){d.changeValue(t)},this.onTouchedCallback=function(t){},this.onPaste=function(t,e){return d._pasteEvent=e,!1},p.validatePackage(f.packageMetadata),this.direction=e.rtl?"rtl":"ltr",this.subs=a.zip(this.afterViewInit.asObservable(),this.contentAreaLoaded.asObservable()).subscribe((function(){return d.initialize()}))}var e;return e=t,Object.defineProperty(t.prototype,"value",{get:function(){if(this.trOnChange)return this.htmlOnChange;var t=this._view?this.getSource():this._value;return"<p></p>"===t?this._value?"":this._value:t},set:function(t){this.changeValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t||!1,this._view&&this._view.updateState(this._view.state),this._disabled&&(this.readonly=!1),this._disabled||this._readonly?this.stateChange.next(v.disabledToolBarState):this.stateChange.next(v.initialToolBarState)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return this._readonly},set:function(t){if(this._readonly=t||!1,this._view){var e=void 0,n=(e=this.iframe?this.container.element.nativeElement.contentWindow:window).getSelection().focusNode;this._view.dom.contains(n)&&e.getSelection().removeAllRanges();var o=this._view.state.doc,r=this._view.state.tr.setSelection(u.TextSelection.create(o,1));this._view.dispatch(r)}this._readonly?(this.toolbar&&(this.toolbar.tabindex=-1),this.stateChange.next(v.disabledToolBarState)):(this.toolbar&&(this.toolbar.tabindex=0),this.stateChange.next(v.initialToolBarState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this._schema},set:function(t){if(r.isDevMode){if(!(t instanceof u.Schema))throw new Error(x.EditorErrorMessages.schemaType);if(this._view)throw new Error(x.EditorErrorMessages.setSchemaOnce)}this._schema=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return this._plugins},set:function(t){if(r.isDevMode){if("function"!=typeof t)throw new Error(x.EditorErrorMessages.pluginsCallbackType(t));if(this._view)throw new Error(x.EditorErrorMessages.setPluginsOnce)}this._plugins=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){if(r.isDevMode&&this._view)throw new Error(x.EditorErrorMessages.setPlaceHolderOnce);this._placeholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizableClass",{get:function(){return!!this.resizable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIE",{get:function(){return this.iframe&&g.detectIE()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){var t=this.resizable;return t.minWidth?t.minWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){var t=this.resizable;return t.maxWidth?t.maxWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){var t=this.resizable;return t.minHeight?t.minHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){var t=this.resizable;return t.maxHeight?t.maxHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toolbar",{get:function(){return this.defaultToolbarComponent||this.userToolBarComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){return this._view&&this._view.state?u.getSelectionText(this._view.state):""},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.subs.add(this.localization.changes.subscribe((function(e){var n=e.rtl;t.direction=n?"rtl":"ltr"}))),this.subs.add(this.toolsService.needsCheck.subscribe((function(){return t.cdr.markForCheck()})))},t.prototype.ngAfterViewInit=function(){this.afterViewInit.next(),this.iframe||this.contentAreaLoaded.next(),this.resizable&&this.normalizeSize()},t.prototype.ngOnChanges=function(t){var e=this;t.value&&this.view&&this.changeValue(t.value.currentValue),t.iframe&&!t.iframe.isFirstChange()&&this.ngZone.onStable.pipe(s.take(1)).subscribe((function(){return e.initialize()})),t.resizable&&!t.resizable.isFirstChange()&&this.normalizeSize()},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.iframeOnLoad=function(){this.contentAreaLoaded.next()},t.prototype.exec=function(t,e){"setHTML"===t&&"string"==typeof e?e={content:e,parseOptions:{preserveWhitespace:this.preserveWhitespace}}:["fontFamily","fontSize","foreColor","backColor","createLink"].some((function(e){return e===t}))&&(e={value:e,applyToWord:this.applyToWord}),m.editorCommands[t](e)(this._view.state,this._view.dispatch,this._view)},t.prototype.openDialog=function(t){var e={createLink:{content:w.FileLinkDialogComponent},insertFile:{content:w.FileLinkDialogComponent},insertImage:{content:b.ImageDialogComponent},viewSource:{content:y.SourceDialogComponent,height:400,width:500}},n=Object.assign({appendTo:this.dialogContainer},e[t]);this.toolbar.toggle(!1);var o=this.dialogService.open(n).content.instance;"createLink"!==t&&"insertFile"!==t||(o.command=t),o.editor=this,o.setData(this._view.state,{applyToWord:this.applyToWord})},t.prototype.focus=function(){this.focusChangedProgrammatically=!0,this._view.focus(),this.focusChangedProgrammatically=!1},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,this._view.dom.blur(),this.focusChangedProgrammatically=!1},t.prototype.getSource=function(){return u.getHtml(this._view.state)},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe(),this._styleObserver&&this._styleObserver.disconnect()},t.prototype.writeValue=function(t){this.inForm=!0,this.value=null===t?void 0:t},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.isEmpty=function(){return!1},t.prototype.initialize=function(){var t=this;if(c.isDocumentAvailable()){var e=this.schema||h.schema,n=this.container.element.nativeElement,o=u.parseContent((this.value||"").trim(),e,{preserveWhitespace:this.preserveWhitespace});if(this.iframe){var r=n.contentDocument,i=r.createElement("meta");i.setAttribute("charset","utf-8"),r.head.appendChild(i),[C.defaultStyle,C.tablesStyles,"rtl"===this.dir?C.rtlStyles:void 0].forEach((function(t){if(t){var e=r.createElement("style");e.appendChild(r.createTextNode(t)),r.head.appendChild(e)}})),(l=r.createElement("div")).classList.add("k-content"),r.body.appendChild(l)}else{var l=document.createElement("div");n.appendChild(l)}var d=[new u.Plugin({key:new u.PluginKey("editor-tabindex"),props:{attributes:function(){return{tabIndex:t.readonly?"0":""}}}}),new u.Plugin({key:new u.PluginKey("toolbar-tools-update"),view:function(){return{update:function(e){t.disabled||t.stateChange.next(t.readonly?v.disabledToolBarState:v.getToolbarState(e.state,{applyToWord:t.applyToWord}))}}}}),u.history(),u.keymap(u.buildListKeymap(e)),u.keymap(u.buildKeymap(e,{applyToWord:this.applyToWord})),u.keymap(u.baseKeymap),u.gapCursor(),u.imageResizing(),u.tableEditing(),u.caretColor()];this.placeholder&&d.push(u.placeholder(this.placeholder));var p=u.EditorState.create({schema:e,doc:o,plugins:g.isPresent(this.plugins)?this.plugins(d):d});if(this.iframe?this.viewMountElement=n.contentDocument.querySelector("div"):this.viewMountElement=n.querySelector("div"),this.ngZone.runOutsideAngular((function(){t._view=new u.EditorView({mount:t.viewMountElement},{state:p,editable:function(){return!t.readonly},dispatchTransaction:t.dispatchTransaction,transformPastedHTML:t.transformPastedHTML,handleDOMEvents:{paste:t.onPaste}})})),this._view){var f=void 0,m=this.element.nativeElement.querySelector(".k-editor-content").classList;f=this.iframe?this.container.element.nativeElement.contentDocument:this.container.element.nativeElement,this.subs.add(a.fromEvent(f,"focusin").subscribe((function(e){if(t.readonly&&m.add("k-focus"),!t.focusChangedProgrammatically||t.shouldEmitFocus){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")&&!t.shouldEmitFocus||t.ngZone.run((function(){return t.onFocus.emit()})),t.shouldEmitFocus=!1}}))),this.subs.add(a.fromEvent(f,"focusout").subscribe((function(e){if(t.readonly&&m.remove("k-focus"),!t.focusChangedProgrammatically){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")||t.ngZone.run((function(){return t.onBlur.emit()}))}})))}this.subs.add(this.stateChange.subscribe((function(){t.userToolBarComponent?t.userToolBarComponent.cdr.detectChanges():t.cdr.detectChanges()}))),this.subs.add(this.valueModified.subscribe((function(e){t.onChangeCallback(e),t.valueChange.emit(e),t.cdr.markForCheck()}))),this.subs.add(a.fromEvent(this.viewMountElement,"keyup").pipe(s.map((function(t){return t.keyCode})),s.filter((function(t){return 121===t})),s.map((function(){return t.userToolBarElement||t.defaultToolbar}))).subscribe((function(t){return t.nativeElement.focus()}))),this.subs.add(a.fromEvent(this.viewMountElement,"blur").pipe(s.filter((function(e){return!t.viewMountElement.contains(e.relatedTarget)}))).subscribe((function(){return t.onTouchedCallback()})))}},t.prototype.normalizeSize=function(){var t=this;if("object"==typeof this.resizable&&!this._styleObserver){var e=this.element.nativeElement;this._styleObserver=new MutationObserver((function(){t.ngZone.runOutsideAngular((function(){return t.normalizeProperties(e)}))})),this._styleObserver.observe(e,{attributeFilter:["style"]})}},t.prototype.normalizeProperties=function(t){var e=Object.keys(this.resizable),n=parseInt(t.style.width,10),o=parseInt(t.style.height,10),r=this.resizable;e.forEach((function(e){var i=e.startsWith("min"),a=!i,s=e.endsWith("Width"),l=!s;i&&s?n<r.minWidth&&(t.style.width=r.minWidth+"px"):i&&l?o<r.minHeight&&(t.style.height=r.minHeight+"px"):a&&s?n>r.maxWidth&&(t.style.width=r.maxWidth+"px"):o>r.maxHeight&&(t.style.height=r.maxHeight+"px")}))},o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],t.prototype,"value",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[Boolean])],t.prototype,"disabled",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[Boolean])],t.prototype,"readonly",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"iframe",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"applyToWord",void 0),o.__decorate([r.Input(),o.__metadata("design:type",u.Schema),o.__metadata("design:paramtypes",[u.Schema])],t.prototype,"schema",null),o.__decorate([r.Input(),o.__metadata("design:type",Function),o.__metadata("design:paramtypes",[Function])],t.prototype,"plugins",null),o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],t.prototype,"placeholder",null),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"preserveWhitespace",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"pasteCleanupSettings",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"resizable",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.Output("focus"),o.__metadata("design:type",r.EventEmitter)],t.prototype,"onFocus",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"paste",void 0),o.__decorate([r.Output("blur"),o.__metadata("design:type",r.EventEmitter)],t.prototype,"onBlur",void 0),o.__decorate([r.HostBinding("class.k-editor"),o.__metadata("design:type",Boolean)],t.prototype,"hostClass",void 0),o.__decorate([r.HostBinding("class.k-editor-resizable"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"resizableClass",null),o.__decorate([r.HostBinding("class.k-disabled"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isDisabled",null),o.__decorate([r.HostBinding("class.k-readonly"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isReadonly",null),o.__decorate([r.HostBinding("class.k-ie"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isIE",null),o.__decorate([r.HostBinding("attr.dir"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"dir",null),o.__decorate([r.HostBinding("attr.ariaDisabled"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"ariaDisabled",null),o.__decorate([r.HostBinding("style.minWidth"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"minWidth",null),o.__decorate([r.HostBinding("style.maxWidth"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"maxWidth",null),o.__decorate([r.HostBinding("style.minHeight"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"minHeight",null),o.__decorate([r.HostBinding("style.maxHeight"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"maxHeight",null),o.__decorate([r.ContentChild(l.ToolBarComponent,{static:!1}),o.__metadata("design:type",l.ToolBarComponent)],t.prototype,"userToolBarComponent",void 0),o.__decorate([r.ContentChild(l.ToolBarComponent,{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],t.prototype,"userToolBarElement",void 0),o.__decorate([r.ViewChild("dialogsContainer",{read:r.ViewContainerRef,static:!0}),o.__metadata("design:type",r.ViewContainerRef)],t.prototype,"dialogContainer",void 0),o.__decorate([r.ViewChild("content",{read:r.ViewContainerRef,static:!1}),o.__metadata("design:type",r.ViewContainerRef)],t.prototype,"container",void 0),o.__decorate([r.ViewChild("defaultToolbar",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],t.prototype,"defaultToolbar",void 0),o.__decorate([r.ViewChild("defaultToolbar",{read:l.ToolBarComponent,static:!1}),o.__metadata("design:type",l.ToolBarComponent)],t.prototype,"defaultToolbarComponent",void 0),t=e=o.__decorate([r.Component({selector:"kendo-editor",providers:[_.EditorLocalizationService,S.EditorToolsService,{provide:k.LocalizationService,useExisting:_.EditorLocalizationService},{provide:k.L10N_PREFIX,useValue:"kendo.editor"},{provide:i.NG_VALUE_ACCESSOR,useExisting:r.forwardRef((function(){return e})),multi:!0},{provide:c.KendoInput,useExisting:r.forwardRef((function(){return e}))}],template:'\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter="kendo.editor.alignCenter|The title of the tool that aligns text in the center."\n alignCenter="Center text"\n i18n-alignJustify="kendo.editor.alignJustify|The title of the tool that justifies text both left and right."\n alignJustify="Justify"\n i18n-alignLeft="kendo.editor.alignLeft|The title of the tool that aligns text on the left."\n alignLeft="Align text left"\n i18n-alignRight="kendo.editor.alignRight|The title of the tool that aligns text on the right."\n alignRight="Align text right"\n i18n-backColor="kendo.editor.backColor|The title of the tool that changes the text background color."\n backColor="Background color"\n i18n-blockquote="kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote"\n blockquote="Quotation"\n i18n-bold="kendo.editor.bold|The title of the tool that makes text bold."\n bold="Bold"\n i18n-cleanFormatting="kendo.editor.cleanFormatting|The title of the Clean Formatting tool."\n cleanFormatting="Clean formatting"\n i18n-createLink="kendo.editor.createLink|The title of the tool that creates hyperlinks."\n createLink="Insert link"\n i18n-dialogApply="kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs."\n dialogApply="Apply"\n i18n-dialogCancel="kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs."\n dialogCancel="Cancel"\n i18n-dialogInsert="kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs."\n dialogInsert="Insert"\n i18n-dialogUpdate="kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs."\n dialogUpdate="Update"\n i18n-fileText="kendo.editor.fileText|The caption for the file text in the insertFile dialog."\n fileText="Text"\n i18n-fileTitle="kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog."\n fileTitle="Title"\n i18n-fileWebAddress="kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog."\n fileWebAddress="Web address"\n i18n-fontFamily="kendo.editor.fontFamily|The title of the tool that changes the text font."\n fontFamily="Select font family"\n i18n-fontSize="kendo.editor.fontSize|The title of the tool that changes the text size."\n fontSize="Select font size"\n i18n-foreColor="kendo.editor.foreColor|The title of the tool that changes the text color."\n foreColor="Color"\n i18n-format="kendo.editor.format|The title of the tool that lets users choose block formats."\n format="Format"\n i18n-imageAltText="kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog."\n imageAltText="Alternate text"\n i18n-imageHeight="kendo.editor.imageHeight|The caption for the image height in the insertImage dialog."\n imageHeight="Height (px)"\n i18n-imageWebAddress="kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog."\n imageWebAddress="Web address"\n i18n-imageWidth="kendo.editor.imageWidth|The caption for the image width in the insertImage dialog."\n imageWidth="Width (px)"\n i18n-indent="kendo.editor.indent|The title of the tool that indents the content."\n indent="Indent"\n i18n-insertFile="kendo.editor.insertFile|The title of the tool that inserts links to files."\n insertFile="Insert file"\n i18n-insertImage="kendo.editor.insertImage|The title of the tool that inserts images."\n insertImage="Insert image"\n i18n-insertOrderedList="kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list."\n insertOrderedList="Insert ordered list"\n i18n-insertUnorderedList="kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list."\n insertUnorderedList="Insert unordered list"\n i18n-italic="kendo.editor.italic|The title of the tool that makes text italicized."\n italic="Italic"\n i18n-linkOpenInNewWindow="kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog."\n linkOpenInNewWindow="Open link in new window"\n i18n-linkText="kendo.editor.linkText|The caption for the link text in the createLink dialog."\n linkText="Text"\n i18n-linkTitle="kendo.editor.linkTitle|The caption for the link title in the createLink dialog."\n linkTitle="Title"\n i18n-linkWebAddress="kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog."\n linkWebAddress="Web address"\n i18n-outdent="kendo.editor.outdent|The title of the tool that outdents the content."\n outdent="Outdent"\n i18n-print="kendo.editor.print|The title of the print tool."\n print="Print"\n i18n-redo="kendo.editor.redo|The title of the tool that undos the last action."\n redo="Redo"\n i18n-selectAll="kendo.editor.selectAll|The title of the tool that selects all content."\n selectAll="Select All"\n i18n-strikethrough="kendo.editor.strikethrough|The title of the tool that strikes through text."\n strikethrough="Strikethrough"\n i18n-subscript="kendo.editor.subscript|The title of the tool that makes text subscript."\n subscript="Subscript"\n i18n-superscript="kendo.editor.superscript|The title of the tool that makes text superscript."\n superscript="Superscript"\n i18n-underline="kendo.editor.underline|The title of the tool that underlines text."\n underline="Underline"\n i18n-unlink="kendo.editor.unlink|The title of the tool that removes hyperlinks."\n unlink="Remove Link"\n i18n-undo="kendo.editor.undo|The title of the tool that undos the last action."\n undo="Undo"\n i18n-viewSource="kendo.editor.viewSource|The title of the tool that shows the editor value as HTML."\n viewSource="View source"\n i18n-insertTable="kendo.editor.insertTable|The title of the tool that inserts table."\n insertTable="Insert Table"\n i18n-addColumnBefore="kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column."\n addColumnBefore="Add column before"\n i18n-addColumnAfter="kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column."\n addColumnAfter="Add column after"\n i18n-addRowBefore="kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row."\n addRowBefore="Add row before"\n i18n-addRowAfter="kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row."\n addRowAfter="Add row after"\n i18n-deleteColumn="kendo.editor.deleteColumn|The title of the tool that deletes a table column."\n deleteColumn="Delete column"\n i18n-deleteRow="kendo.editor.deleteRow|The title of the tool that deletes a table row."\n deleteRow="Delete row"\n i18n-deleteTable="kendo.editor.deleteTable|The title of the tool that deletes a table."\n deleteTable="Delete table"\n >\n </ng-container>\n\n <ng-content select="kendo-toolbar"></ng-content>\n <kendo-toolbar [overflow]="true" [tabindex]="readonly ? -1 : 0" *ngIf="!userToolBarElement" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf="!iframe" #content [attr.dir]="direction" class="k-editor-content"></div>\n\n <div class="k-editor-content" *ngIf="iframe">\n <iframe #content srcdoc="<!DOCTYPE html>" frameborder="0" class="k-iframe" (load)="iframeOnLoad()"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ',styles:["\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "]}),o.__metadata("design:paramtypes",[d.DialogService,k.LocalizationService,r.ChangeDetectorRef,r.NgZone,r.ElementRef,S.EditorToolsService])],t)}();e.EditorComponent=A},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(15),a=function(){function t(){this.needsCheck=new i.Subject}return t=o.__decorate([r.Injectable()],t)}();e.EditorToolsService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o,r,i){var a=t.call(this,e,n,o,r,i)||this;return a.command=e,a.button=n,a.editor=o,a.localization=r,a.toolsService=i,a}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.exec(this.command,this.editor.applyToWord),this.editor.focus()},e.prototype.pointerdownHandler=function(t){t.preventDefault()},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandButton=r},function(t,e){t.exports=n},function(t,e,n){"use strict";function o(t){this.content=t}n.r(e),n.d(e,"getHtml",(function(){return Ie})),n.d(e,"setHtml",(function(){return Be})),n.d(e,"parseContent",(function(){return Ae})),n.d(e,"trimWhitespace",(function(){return Te})),n.d(e,"htmlToFragment",(function(){return Me})),n.d(e,"domToPmDoc",(function(){return Oe})),n.d(e,"pmDocToFragment",(function(){return De})),n.d(e,"applyInlineStyle",(function(){return cn})),n.d(e,"getInlineStyles",(function(){return sn})),n.d(e,"toggleInlineFormat",(function(){return dn})),n.d(e,"applyLink",(function(){return pn})),n.d(e,"removeLink",(function(){return un})),n.d(e,"insertText",(function(){return fn})),n.d(e,"insertImage",(function(){return hn})),n.d(e,"alignBlocks",(function(){return xn})),n.d(e,"isAligned",(function(){return Sn})),n.d(e,"cleanFormatting",(function(){return En})),n.d(e,"hasNode",(function(){return kn})),n.d(e,"activeNode",(function(){return Cn})),n.d(e,"formatBlockElements",(function(){return gn})),n.d(e,"getBlockFormats",(function(){return bn})),n.d(e,"parentBlockFormat",(function(){return _n})),n.d(e,"changeTextBlock",(function(){return mn})),n.d(e,"blockNodes",(function(){return vn})),n.d(e,"cleanTextBlockFormatting",(function(){return yn})),n.d(e,"hasMark",(function(){return Qe})),n.d(e,"getMark",(function(){return nn})),n.d(e,"getActiveMarks",(function(){return on})),n.d(e,"removeAllMarks",(function(){return Ye})),n.d(e,"cleanMarks",(function(){return Ze})),n.d(e,"selectionMarks",(function(){return en})),n.d(e,"indent",(function(){return Bo})),n.d(e,"canIndentAsListItem",(function(){return Oo})),n.d(e,"outdent",(function(){return No})),n.d(e,"canOutdentAsListItem",(function(){return Ao})),n.d(e,"isIndented",(function(){return Do})),n.d(e,"canBeIndented",(function(){return Io})),n.d(e,"indentBlocks",(function(){return Mo})),n.d(e,"toggleOrderedList",(function(){return Wo})),n.d(e,"toggleUnorderedList",(function(){return jo})),n.d(e,"toggleList",(function(){return Vo})),n.d(e,"listStyle",(function(){return $o})),n.d(e,"blockquote",(function(){return Eo})),n.d(e,"liftBlockquote",(function(){return To})),n.d(e,"hasSameMarkup",(function(){return $e})),n.d(e,"getSelectionText",(function(){return Ve})),n.d(e,"getNodeFromSelection",(function(){return je})),n.d(e,"selectedLineTextOnly",(function(){return We})),n.d(e,"expandSelection",(function(){return Je})),n.d(e,"expandToWordWrap",(function(){return Ke})),n.d(e,"canInsert",(function(){return Re})),n.d(e,"insertNode",(function(){return Fe})),n.d(e,"indentHtml",(function(){return He})),n.d(e,"alignLeftRules",(function(){return qo})),n.d(e,"alignCenterRules",(function(){return Ko})),n.d(e,"alignRightRules",(function(){return Jo})),n.d(e,"alignJustifyRules",(function(){return Uo})),n.d(e,"alignRemoveRules",(function(){return Go})),n.d(e,"indentRules",(function(){return jn})),n.d(e,"outdentRules",(function(){return Wn})),n.d(e,"nodes",(function(){return Ul})),n.d(e,"marks",(function(){return jl})),n.d(e,"buildKeymap",(function(){return Ld})),n.d(e,"buildListKeymap",(function(){return Fd})),n.d(e,"bold",(function(){return Od})),n.d(e,"italic",(function(){return Ad})),n.d(e,"underline",(function(){return Id})),n.d(e,"strikethrough",(function(){return Bd})),n.d(e,"subscript",(function(){return Nd})),n.d(e,"superscript",(function(){return zd})),n.d(e,"link",(function(){return Rd})),n.d(e,"sanitize",(function(){return Gd})),n.d(e,"removeComments",(function(){return Xd})),n.d(e,"removeTag",(function(){return Yd})),n.d(e,"pasteCleanup",(function(){return oc})),n.d(e,"sanitizeClassAttr",(function(){return Qd})),n.d(e,"sanitizeStyleAttr",(function(){return nc})),n.d(e,"removeAttribute",(function(){return Zd})),n.d(e,"replaceImageSourcesFromRtf",(function(){return uc})),n.d(e,"convertMsLists",(function(){return Ud})),n.d(e,"find",(function(){return fc})),n.d(e,"findAt",(function(){return pc})),n.d(e,"findAll",(function(){return hc})),n.d(e,"replace",(function(){return mc})),n.d(e,"replaceAll",(function(){return vc})),n.d(e,"placeholder",(function(){return wc})),n.d(e,"spacesFix",(function(){return Cc})),n.d(e,"textHighlight",(function(){return Sc})),n.d(e,"textHighlightKey",(function(){return xc})),n.d(e,"imageResizing",(function(){return Nc})),n.d(e,"imageResizeKey",(function(){return Ec})),n.d(e,"caretColor",(function(){return Rc})),n.d(e,"caretColorKey",(function(){return zc})),n.d(e,"autoJoin",(function(){return yo})),n.d(e,"baseKeymap",(function(){return So})),n.d(e,"chainCommands",(function(){return bo})),n.d(e,"createParagraphNear",(function(){return ro})),n.d(e,"deleteSelection",(function(){return Hn})),n.d(e,"exitCode",(function(){return oo})),n.d(e,"joinBackward",(function(){return qn})),n.d(e,"joinDown",(function(){return Qn})),n.d(e,"joinForward",(function(){return Gn})),n.d(e,"joinUp",(function(){return Zn})),n.d(e,"lift",(function(){return to})),n.d(e,"liftEmptyBlock",(function(){return io})),n.d(e,"macBaseKeymap",(function(){return Co})),n.d(e,"newlineInCode",(function(){return eo})),n.d(e,"pcBaseKeymap",(function(){return _o})),n.d(e,"selectAll",(function(){return co})),n.d(e,"selectNodeBackward",(function(){return Kn})),n.d(e,"selectNodeForward",(function(){return Xn})),n.d(e,"selectParentNode",(function(){return lo})),n.d(e,"selectTextblockEnd",(function(){return ho})),n.d(e,"selectTextblockStart",(function(){return fo})),n.d(e,"setBlockType",(function(){return vo})),n.d(e,"splitBlock",(function(){return ao})),n.d(e,"splitBlockKeepMarks",(function(){return so})),n.d(e,"toggleMark",(function(){return go})),n.d(e,"wrapIn",(function(){return mo})),n.d(e,"dropCursor",(function(){return Pc})),n.d(e,"GapCursor",(function(){return Fc})),n.d(e,"gapCursor",(function(){return Vc})),n.d(e,"HistoryState",(function(){return ed})),n.d(e,"closeHistory",(function(){return dd})),n.d(e,"history",(function(){return pd})),n.d(e,"redo",(function(){return hd})),n.d(e,"redoDepth",(function(){return vd})),n.d(e,"undo",(function(){return fd})),n.d(e,"undoDepth",(function(){return md})),n.d(e,"InputRule",(function(){return gd})),n.d(e,"closeDoubleQuote",(function(){return xd})),n.d(e,"closeSingleQuote",(function(){return Ed})),n.d(e,"ellipsis",(function(){return _d})),n.d(e,"emDash",(function(){return kd})),n.d(e,"inputRules",(function(){return yd})),n.d(e,"openDoubleQuote",(function(){return Cd})),n.d(e,"openSingleQuote",(function(){return Sd})),n.d(e,"smartQuotes",(function(){return Td})),n.d(e,"textblockTypeInputRule",(function(){return Dd})),n.d(e,"undoInputRule",(function(){return wd})),n.d(e,"wrappingInputRule",(function(){return Md})),n.d(e,"keydownHandler",(function(){return cr})),n.d(e,"keymap",(function(){return dr})),n.d(e,"ContentMatch",(function(){return B})),n.d(e,"DOMParser",(function(){return tt})),n.d(e,"DOMSerializer",(function(){return ut})),n.d(e,"Fragment",(function(){return i})),n.d(e,"Mark",(function(){return c})),n.d(e,"MarkType",(function(){return Y})),n.d(e,"Node",(function(){return D})),n.d(e,"NodeRange",(function(){return E})),n.d(e,"NodeType",(function(){return K})),n.d(e,"ReplaceError",(function(){return u})),n.d(e,"ResolvedPos",(function(){return k})),n.d(e,"Schema",(function(){return Z})),n.d(e,"Slice",(function(){return p})),n.d(e,"addListNodes",(function(){return Nn})),n.d(e,"bulletList",(function(){return An})),n.d(e,"liftListItem",(function(){return Pn})),n.d(e,"listItem",(function(){return In})),n.d(e,"orderedList",(function(){return On})),n.d(e,"sinkListItem",(function(){return Ln})),n.d(e,"splitListItem",(function(){return Rn})),n.d(e,"wrapInList",(function(){return zn})),n.d(e,"AllSelection",(function(){return se})),n.d(e,"EditorState",(function(){return ve})),n.d(e,"NodeSelection",(function(){return ie})),n.d(e,"Plugin",(function(){return be})),n.d(e,"PluginKey",(function(){return _e})),n.d(e,"Selection",(function(){return te})),n.d(e,"SelectionRange",(function(){return ne})),n.d(e,"TextSelection",(function(){return oe})),n.d(e,"Transaction",(function(){return ue})),n.d(e,"CellSelection",(function(){return Ms})),n.d(e,"TableMap",(function(){return ls})),n.d(e,"TableView",(function(){return wl})),n.d(e,"__clipCells",(function(){return Bs})),n.d(e,"__insertCells",(function(){return Rs})),n.d(e,"__pastedCells",(function(){return As})),n.d(e,"addColSpan",(function(){return Es})),n.d(e,"addColumn",(function(){return Ys})),n.d(e,"addColumnAfter",(function(){return Qs})),n.d(e,"addColumnBefore",(function(){return Zs})),n.d(e,"addRow",(function(){return ol})),n.d(e,"cellAround",(function(){return ms})),n.d(e,"colCount",(function(){return _s})),n.d(e,"columnIsHeader",(function(){return Ts})),n.d(e,"columnResizing",(function(){return Cl})),n.d(e,"columnResizingPluginKey",(function(){return _l})),n.d(e,"deleteColumn",(function(){return el})),n.d(e,"deleteRow",(function(){return sl})),n.d(e,"deleteTable",(function(){return bl})),n.d(e,"findCell",(function(){return ks})),n.d(e,"fixTables",(function(){return Gs})),n.d(e,"fixTablesKey",(function(){return Us})),n.d(e,"goToNextCell",(function(){return yl})),n.d(e,"handlePaste",(function(){return Ws})),n.d(e,"inSameTable",(function(){return ws})),n.d(e,"isInTable",(function(){return vs})),n.d(e,"mergeCells",(function(){return dl})),n.d(e,"moveCellForward",(function(){return bs})),n.d(e,"nextCell",(function(){return Cs})),n.d(e,"pointsAtCell",(function(){return ys})),n.d(e,"removeColSpan",(function(){return Ss})),n.d(e,"removeColumn",(function(){return tl})),n.d(e,"removeRow",(function(){return al})),n.d(e,"rowIsHeader",(function(){return nl})),n.d(e,"selectedRect",(function(){return Xs})),n.d(e,"selectionCell",(function(){return gs})),n.d(e,"setAttr",(function(){return xs})),n.d(e,"setCellAttr",(function(){return pl})),n.d(e,"splitCell",(function(){return cl})),n.d(e,"splitCellWithType",(function(){return ul})),n.d(e,"tableEditing",(function(){return Dl})),n.d(e,"tableEditingKey",(function(){return hs})),n.d(e,"tableNodeTypes",(function(){return fs})),n.d(e,"tableNodes",(function(){return ps})),n.d(e,"toggleHeader",(function(){return hl})),n.d(e,"toggleHeaderCell",(function(){return gl})),n.d(e,"toggleHeaderColumn",(function(){return vl})),n.d(e,"toggleHeaderRow",(function(){return ml})),n.d(e,"updateColumnsOnResize",(function(){return kl})),n.d(e,"AddMarkStep",(function(){return $t})),n.d(e,"MapResult",(function(){return vt})),n.d(e,"Mapping",(function(){return yt})),n.d(e,"RemoveMarkStep",(function(){return Vt})),n.d(e,"ReplaceAroundStep",(function(){return Tt})),n.d(e,"ReplaceStep",(function(){return Et})),n.d(e,"Step",(function(){return xt})),n.d(e,"StepMap",(function(){return gt})),n.d(e,"StepResult",(function(){return St})),n.d(e,"Transform",(function(){return wt})),n.d(e,"TransformError",(function(){return bt})),n.d(e,"canJoin",(function(){return Nt})),n.d(e,"canSplit",(function(){return Bt})),n.d(e,"dropPoint",(function(){return Lt})),n.d(e,"findWrapping",(function(){return At})),n.d(e,"insertPoint",(function(){return Pt})),n.d(e,"joinPoint",(function(){return Rt})),n.d(e,"liftTarget",(function(){return Ot})),n.d(e,"replaceStep",(function(){return jt})),n.d(e,"Decoration",(function(){return Ba})),n.d(e,"DecorationSet",(function(){return Pa})),n.d(e,"EditorView",(function(){return Xa})),n.d(e,"__endComposition",(function(){return Ca})),n.d(e,"__parseFromClipboard",(function(){return Ji})),n.d(e,"__serializeForClipboard",(function(){return qi})),n.d(e,"createTable",(function(){return Jc})),n.d(e,"addRowAfter",(function(){return Gc})),n.d(e,"addRowBefore",(function(){return Uc})),n.d(e,"pmAddRowAfter",(function(){return il})),n.d(e,"pmAddRowBefore",(function(){return rl})),o.prototype={constructor:o,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),a=r.content.slice();return-1==i?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new o(a)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new o(n)},addToStart:function(t,e){return new o([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new o(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(-1==a?i.length:a,0,e,n),new o(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=o.from(t)).size?new o(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=o.from(t)).size?new o(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=o.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},o.from=function(t){if(t instanceof o)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new o(e)};var r=o;var i=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},a={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(t,e,n,o,r){void 0===o&&(o=0);for(var i=0,a=0;a<e;i++){var s=this.content[i],l=a+s.nodeSize;if(l>t&&!1!==n(s,o+a,r,i)&&s.content.size){var d=a+1;s.nodesBetween(Math.max(0,t-d),Math.min(s.content.size,e-d),n,o+d)}a=l}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,o){var r="",i=!0;return this.nodesBetween(t,e,(function(a,s){a.isText?(r+=a.text.slice(Math.max(t,s)-s,e-s),i=!n):a.isLeaf&&o?(r+="function"==typeof o?o(a):o,i=!n):!i&&a.isBlock&&(r+=n,i=!0)}),0),r},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,o=this.content.slice(),r=0;for(e.isText&&e.sameMarkup(n)&&(o[o.length-1]=e.withText(e.text+n.text),r=1);r<t.content.length;r++)o.push(t.content[r]);return new i(o,this.size+t.size)},i.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],o=0;if(e>t)for(var r=0,a=0;a<e;r++){var s=this.content[r],l=a+s.nodeSize;l>t&&((a<t||l>e)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,e-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,e-a-1))),n.push(s),o+=s.nodeSize),a=l}return new i(n,o)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var o=this.content.slice(),r=this.size+e.nodeSize-n.nodeSize;return o[t]=e,new i(o,r)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},i.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},i.prototype.maybeChild=function(t){return this.content[t]},i.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var o=this.content[e];t(o,n,e),n+=o.nodeSize}},i.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),function t(e,n,o){for(var r=0;;r++){if(r==e.childCount||r==n.childCount)return e.childCount==n.childCount?null:o;var i=e.child(r),a=n.child(r);if(i!=a){if(!i.sameMarkup(a))return o;if(i.isText&&i.text!=a.text){for(var s=0;i.text[s]==a.text[s];s++)o++;return o}if(i.content.size||a.content.size){var l=t(i.content,a.content,o+1);if(null!=l)return l}o+=i.nodeSize}else o+=i.nodeSize}}(this,t,e)},i.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),function t(e,n,o,r){for(var i=e.childCount,a=n.childCount;;){if(0==i||0==a)return i==a?null:{a:o,b:r};var s=e.child(--i),l=n.child(--a),d=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:o,b:r};if(s.isText&&s.text!=l.text){for(var c=0,u=Math.min(s.text.length,l.text.length);c<u&&s.text[s.text.length-c-1]==l.text[l.text.length-c-1];)c++,o--,r--;return{a:o,b:r}}if(s.content.size||l.content.size){var p=t(s.content,l.content,o-1,r-1);if(p)return p}o-=d,r-=d}else o-=d,r-=d}}(this,t,e,n)},i.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return l(0,t);if(t==this.size)return l(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var r=o+this.child(n).nodeSize;if(r>=t)return r==t||e>0?l(n+1,r):l(n,o);o=r}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,o=0;o<t.length;o++){var r=t[o];n+=r.nodeSize,o&&r.isText&&t[o-1].sameMarkup(r)?(e||(e=t.slice(0,o)),e[e.length-1]=r.withText(e[e.length-1].text+r.text)):e&&e.push(r)}return new i(e||t,n)},i.from=function(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,a);var s={index:0,offset:0};function l(t,e){return s.index=t,s.offset=e,s}function d(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(!d(t[o],e[o]))return!1}else{for(var r in t)if(!(r in e)||!d(t[r],e[r]))return!1;for(var i in e)if(!(i in t))return!1}return!0}i.empty=new i([],0);var c=function(t,e){this.type=t,this.attrs=e};function u(t){var e=Error.call(this,t);return e.__proto__=u.prototype,e}c.prototype.addToSet=function(t){for(var e,n=!1,o=0;o<t.length;o++){var r=t[o];if(this.eq(r))return t;if(this.type.excludes(r.type))e||(e=t.slice(0,o));else{if(r.type.excludes(this.type))return t;!n&&r.type.rank>this.type.rank&&(e||(e=t.slice(0,o)),e.push(this),n=!0),e&&e.push(r)}}return e||(e=t.slice()),n||e.push(this),e},c.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},c.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},c.prototype.eq=function(t){return this==t||this.type==t.type&&d(this.attrs,t.attrs)},c.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},c.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},c.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},c.setFrom=function(t){if(!t||0==t.length)return c.none;if(t instanceof c)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},c.none=[],u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.prototype.name="ReplaceError";var p=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},f={size:{configurable:!0}};function h(t,e,n){if(n.openStart>t.depth)throw new u("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new u("Inconsistent open depths");return function t(e,n,o,r){var a=e.index(r),s=e.node(r);if(a==n.index(r)&&r<e.depth-o.openStart){var l=t(e,n,o,r+1);return s.copy(s.content.replaceChild(a,l))}if(o.content.size){if(o.openStart||o.openEnd||e.depth!=r||n.depth!=r){var d=function(t,e){for(var n=e.depth-t.openStart,o=e.node(n).copy(t.content),r=n-1;r>=0;r--)o=e.node(r).copy(i.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}(o,e),c=d.start,u=d.end;return b(s,function t(e,n,o,r,a){var s=e.depth>a&&v(e,n,a+1),l=r.depth>a&&v(o,r,a+1),d=[];y(null,e,a,d),s&&l&&n.index(a)==o.index(a)?(m(s,l),g(b(s,t(e,n,o,r,a+1)),d)):(s&&g(b(s,w(e,n,a+1)),d),y(n,o,a,d),l&&g(b(l,w(o,r,a+1)),d));return y(r,null,a,d),new i(d)}(e,c,u,n,r))}var p=e.parent,f=p.content;return b(p,f.cut(0,e.parentOffset).append(o.content).append(f.cut(n.parentOffset)))}return b(s,w(e,n,r))}(t,e,n,0)}function m(t,e){if(!e.type.compatibleContent(t.type))throw new u("Cannot join "+e.type.name+" onto "+t.type.name)}function v(t,e,n){var o=t.node(n);return m(o,e.node(n)),o}function g(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function y(t,e,n,o){var r=(e||t).node(n),i=0,a=e?e.index(n):r.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(g(t.nodeAfter,o),i++));for(var s=i;s<a;s++)g(r.child(s),o);e&&e.depth==n&&e.textOffset&&g(e.nodeBefore,o)}function b(t,e){if(!t.type.validContent(e))throw new u("Invalid content for node "+t.type.name);return t.copy(e)}function w(t,e,n){var o=[];(y(null,t,n,o),t.depth>n)&&g(b(v(t,e,n+1),w(t,e,n+1)),o);return y(e,null,n,o),new i(o)}f.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(t,e){var n=function t(e,n,o,r){var i=e.findIndex(n),a=i.index,s=i.offset,l=e.maybeChild(a);if(s==n||l.isText)return r&&!r.canReplace(a,a,o)?null:e.cut(0,n).append(o).append(e.cut(n));var d=t(l.content,n-s-1,o);return d&&e.replaceChild(a,l.copy(d))}(this.content,t+this.openStart,e,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(t,e){return new p(function t(e,n,o){var r=e.findIndex(n),i=r.index,a=r.offset,s=e.maybeChild(i),l=e.findIndex(o),d=l.index,c=l.offset;if(a==n||s.isText){if(c!=o&&!e.child(d).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(o))}if(i!=d)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-a-1,o-a-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},p.fromJSON=function(t,e){if(!e)return p.empty;var n=e.openStart||0,o=e.openEnd||0;if("number"!=typeof n||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(t,e.content),n,o)},p.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,o=0,r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)o++;return new p(t,n,o)},Object.defineProperties(p.prototype,f),p.empty=new p(i.empty,0,0);var k=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},_={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};k.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},_.parent.get=function(){return this.node(this.depth)},_.doc.get=function(){return this.node(0)},k.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},k.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},k.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},k.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},k.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},k.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},k.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},_.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},_.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],o=t.child(e);return n?t.child(e).cut(n):o},_.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},k.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],o=0==e?0:this.path[3*e-1]+1,r=0;r<t;r++)o+=n.child(r).nodeSize;return o},k.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return c.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),o=t.maybeChild(e);if(!n){var r=n;n=o,o=r}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||o&&i[a].isInSet(o.marks)||(i=i[a--].removeFromSet(i));return i},k.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,o=t.parent.maybeChild(t.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||o&&n[r].isInSet(o.marks)||(n=n[r--].removeFromSet(n));return n},k.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},k.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new E(this,t,n)},k.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},k.prototype.max=function(t){return t.pos>this.pos?t:this},k.prototype.min=function(t){return t.pos<this.pos?t:this},k.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},k.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],o=0,r=e,i=t;;){var a=i.content.findIndex(r),s=a.index,l=a.offset,d=r-l;if(n.push(i,s,o+l),!d)break;if((i=i.child(s)).isText)break;r=d-1,o+=l+1}return new k(e,n,r)},k.resolveCached=function(t,e){for(var n=0;n<C.length;n++){var o=C[n];if(o.pos==e&&o.doc==t)return o}var r=C[x]=k.resolve(t,e);return x=(x+1)%S,r},Object.defineProperties(k.prototype,_);var C=[],x=0,S=12,E=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},T={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};T.start.get=function(){return this.$from.before(this.depth+1)},T.end.get=function(){return this.$to.after(this.depth+1)},T.parent.get=function(){return this.$from.node(this.depth)},T.startIndex.get=function(){return this.$from.index(this.depth)},T.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(E.prototype,T);var M=Object.create(null),D=function(t,e,n,o){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=o||c.none},O={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};O.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},O.childCount.get=function(){return this.content.childCount},D.prototype.child=function(t){return this.content.child(t)},D.prototype.maybeChild=function(t){return this.content.maybeChild(t)},D.prototype.forEach=function(t){this.content.forEach(t)},D.prototype.nodesBetween=function(t,e,n,o){void 0===o&&(o=0),this.content.nodesBetween(t,e,n,o,this)},D.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},O.textContent.get=function(){return this.textBetween(0,this.content.size,"")},D.prototype.textBetween=function(t,e,n,o){return this.content.textBetween(t,e,n,o)},O.firstChild.get=function(){return this.content.firstChild},O.lastChild.get=function(){return this.content.lastChild},D.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},D.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},D.prototype.hasMarkup=function(t,e,n){return this.type==t&&d(this.attrs,e||t.defaultAttrs||M)&&c.sameSet(this.marks,n||c.none)},D.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},D.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},D.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},D.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return p.empty;var o=this.resolve(t),r=this.resolve(e),i=n?0:o.sharedDepth(e),a=o.start(i),s=o.node(i).content.cut(o.pos-a,r.pos-a);return new p(s,o.depth-i,r.depth-i)},D.prototype.replace=function(t,e,n){return h(this.resolve(t),this.resolve(e),n)},D.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),o=n.index,r=n.offset;if(!(e=e.maybeChild(o)))return null;if(r==t||e.isText)return e;t-=r+1}},D.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,o=e.offset;return{node:this.content.maybeChild(n),index:n,offset:o}},D.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,o=e.offset;if(o<t)return{node:this.content.child(n),index:n,offset:o};var r=this.content.child(n-1);return{node:r,index:n-1,offset:o-r.nodeSize}},D.prototype.resolve=function(t){return k.resolveCached(this,t)},D.prototype.resolveNoCache=function(t){return k.resolve(this,t)},D.prototype.rangeHasMark=function(t,e,n){var o=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(o=!0),!o})),o},O.isBlock.get=function(){return this.type.isBlock},O.isTextblock.get=function(){return this.type.isTextblock},O.inlineContent.get=function(){return this.type.inlineContent},O.isInline.get=function(){return this.type.isInline},O.isText.get=function(){return this.type.isText},O.isLeaf.get=function(){return this.type.isLeaf},O.isAtom.get=function(){return this.type.isAtom},D.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),I(this.marks,t)},D.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},D.prototype.canReplace=function(t,e,n,o,r){void 0===n&&(n=i.empty),void 0===o&&(o=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(t).matchFragment(n,o,r),s=a&&a.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var l=o;l<r;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0},D.prototype.canReplaceWith=function(t,e,n,o){if(o&&!this.type.allowsMarks(o))return!1;var r=this.contentMatchAt(t).matchType(n),i=r&&r.matchFragment(this.content,e);return!!i&&i.validEnd},D.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},D.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var t=c.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!c.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(t){return t.type.name})));this.content.forEach((function(t){return t.check()}))},D.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},D.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var o=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,o,n)},Object.defineProperties(D.prototype,O);var A=function(t){function e(e,n,o,r){if(t.call(this,e,n,null,r),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):I(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(D);function I(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var B=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},N={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};B.parse=function(t,e){var n=new z(t,e);if(null==n.next)return B.empty;var o=P(n);n.next&&n.err("Unexpected trailing text");var r=function(t){var e=Object.create(null);return function n(o){var r=[];o.forEach((function(e){t[e].forEach((function(e){var n=e.term,o=e.to;if(n){var i=r.indexOf(n),a=i>-1&&r[i+1];W(t,o).forEach((function(t){a||r.push(n,a=[]),-1==a.indexOf(t)&&a.push(t)}))}}))}));for(var i=e[o.join(",")]=new B(o.indexOf(t.length-1)>-1),a=0;a<r.length;a+=2){var s=r[a+1].sort(j);i.next.push(r[a],e[s.join(",")]||n(s))}return i}(W(t,0))}(function(t){var e=[[]];return r(function t(e,i){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(t(n,i))}),[]);if("seq"==e.type)for(var a=0;;a++){var s=t(e.exprs[a],i);if(a==e.exprs.length-1)return s;r(s,i=n())}else{if("star"==e.type){var l=n();return o(i,l),r(t(e.expr,l),l),[o(l)]}if("plus"==e.type){var d=n();return r(t(e.expr,i),d),r(t(e.expr,d),d),[o(d)]}if("opt"==e.type)return[o(i)].concat(t(e.expr,i));if("range"==e.type){for(var c=i,u=0;u<e.min;u++){var p=n();r(t(e.expr,c),p),c=p}if(-1==e.max)r(t(e.expr,c),c);else for(var f=e.min;f<e.max;f++){var h=n();o(c,h),r(t(e.expr,c),h),c=h}return[o(c)]}if("name"==e.type)return[o(i,null,e.value)]}}(t,0),n()),e;function n(){return e.push([])-1}function o(t,n,o){var r={term:o,to:n};return e[t].push(r),r}function r(t,e){t.forEach((function(t){return t.to=e}))}}(o));return function(t,e){for(var n=0,o=[t];n<o.length;n++){for(var r=o[n],i=!r.validEnd,a=[],s=0;s<r.next.length;s+=2){var l=r.next[s],d=r.next[s+1];a.push(l.name),!i||l.isText||l.hasRequiredAttrs()||(i=!1),-1==o.indexOf(d)&&o.push(d)}i&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},B.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},B.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var o=this,r=e;o&&r<n;r++)o=o.matchType(t.child(r).type);return o},N.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},N.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},B.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},B.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var o=[this];return function r(a,s){var l=a.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(s.map((function(t){return t.createAndFill()})));for(var d=0;d<a.next.length;d+=2){var c=a.next[d],u=a.next[d+1];if(!c.isText&&!c.hasRequiredAttrs()&&-1==o.indexOf(u)){o.push(u);var p=r(u,s.concat(c));if(p)return p}}}(this,[])},B.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},B.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var o=n.shift(),r=o.match;if(r.matchType(t)){for(var i=[],a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in e||o.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:o}),e[l.name]=!0)}}},N.edgeCount.get=function(){return this.next.length>>1},B.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},B.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var o=1;o<n.next.length;o+=2)-1==t.indexOf(n.next[o])&&e(n.next[o])}(this),t.map((function(e,n){for(var o=n+(e.validEnd?"*":" ")+" ",r=0;r<e.next.length;r+=2)o+=(r?", ":"")+e.next[r].name+"->"+t.indexOf(e.next[r+1]);return o})).join("\n")},Object.defineProperties(B.prototype,N),B.empty=new B(!0);var z=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},R={next:{configurable:!0}};function P(t){var e=[];do{e.push(L(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function L(t){var e=[];do{e.push(F(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function F(t){for(var e=function(t){if(t.eat("(")){var e=P(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,o=n[e];if(o)return[o];var r=[];for(var i in n){var a=n[i];a.groups.indexOf(e)>-1&&r.push(a)}0==r.length&&t.err("No node type or group '"+e+"' found");return r}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=V(t,e)}return e}function $(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function V(t,e){var n=$(t),o=n;return t.eat(",")&&(o="}"!=t.next?$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function j(t,e){return e-t}function W(t,e){var n=[];return function e(o){var r=t[o];if(1==r.length&&!r[0].term)return e(r[0].to);n.push(o);for(var i=0;i<r.length;i++){var a=r[i],s=a.term,l=a.to;s||-1!=n.indexOf(l)||e(l)}}(e),n.sort(j)}function H(t){var e=Object.create(null);for(var n in t){var o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function q(t,e){var n=Object.create(null);for(var o in t){var r=e&&e[o];if(void 0===r){var i=t[o];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+o);r=i.default}n[o]=r}return n}function J(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new G(t[n]);return e}R.next.get=function(){return this.tokens[this.pos]},z.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},z.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(z.prototype,R);var K=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==B.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},U.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},K.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},K.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},K.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)},K.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(t),i.from(e),c.setFrom(n))},K.prototype.createChecked=function(t,e,n){if(e=i.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new D(this,this.computeAttrs(t),e,c.setFrom(n))},K.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){var o=this.contentMatch.fillBefore(e);if(!o)return null;e=o.append(e)}var r=this.contentMatch.matchFragment(e).fillBefore(i.empty,!0);return r?new D(this,t,e.append(r),c.setFrom(n)):null},K.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},K.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},K.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:c.empty:t},K.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,o){return n[t]=new K(t,e,o)}));var o=e.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var G=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},X={isRequired:{configurable:!0}};X.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,X);var Y=function(t,e,n,o){this.name=t,this.schema=n,this.spec=o,this.attrs=J(o.attrs),this.rank=e,this.excluded=null;var r=H(this.attrs);this.instance=r&&new c(this,r)};Y.prototype.create=function(t){return!t&&this.instance?this.instance:new c(this,q(this.attrs,t))},Y.compile=function(t,e){var n=Object.create(null),o=0;return t.forEach((function(t,r){return n[t]=new Y(t,o++,e,r)})),n},Y.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},Y.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},Y.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var Z=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=r.from(t.nodes),this.spec.marks=r.from(t.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Y.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],a=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[a]||(n[a]=B.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?Q(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var l in this.marks){var d=this.marks[l],c=d.spec.excludes;d.excluded=null==c?[d]:""==c?[]:Q(this,c.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o],i=t.marks[r],a=i;if(i)n.push(i);else for(var s in t.marks){var l=t.marks[s];("_"==r||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}Z.prototype.node=function(t,e,n,o){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,o)},Z.prototype.text=function(t,e){var n=this.nodes.text;return new A(n,n.defaultAttrs,t,c.setFrom(e))},Z.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},Z.prototype.nodeFromJSON=function(t){return D.fromJSON(this,t)},Z.prototype.markFromJSON=function(t){return c.fromJSON(this,t)},Z.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var tt=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};tt.prototype.parse=function(t,e){void 0===e&&(e={});var n=new at(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},tt.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new at(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},tt.prototype.matchTag=function(t,e,n){for(var o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r=this.tags[o];if(lt(t,r.tag)&&(void 0===r.namespace||t.namespaceURI==r.namespace)&&(!r.context||e.matchesContext(r.context))){if(r.getAttrs){var i=r.getAttrs(t);if(!1===i)continue;r.attrs=i}return r}}},tt.prototype.matchStyle=function(t,e,n,o){for(var r=o?this.styles.indexOf(o)+1:0;r<this.styles.length;r++){var i=this.styles[r];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var a=i.getAttrs(e);if(!1===a)continue;i.attrs=a}return i}}},tt.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,o=0;o<e.length;o++){var r=e[o];if((null==r.priority?50:r.priority)<n)break}e.splice(o,0,t)}var o=function(e){var o=t.marks[e].spec.parseDOM;o&&o.forEach((function(t){n(t=dt(t)),t.mark=e}))};for(var r in t.marks)o(r);var i;for(var a in t.nodes)i=void 0,(i=t.nodes[a].spec.parseDOM)&&i.forEach((function(t){n(t=dt(t)),t.node=a}));return e},tt.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new tt(t,tt.schemaRules(t)))};var et={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ot={ol:!0,ul:!0};function rt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var it=function(t,e,n,o,r,i,a){this.type=t,this.attrs=e,this.solid=r,this.match=i||(4&a?null:t.contentMatch),this.options=a,this.content=[],this.marks=n,this.activeMarks=c.none,this.pendingMarks=o,this.stashMarks=[]};it.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(i.from(t));if(!e){var n,o=this.type.contentMatch;return(n=o.findWrapping(t.type))?(this.match=o,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},it.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var o=i.from(this.content);return!t&&this.match&&(o=o.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o},it.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},it.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var o=n[e];(this.type?this.type.allowsMarkType(o.type):ct(o.type,t))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}},it.prototype.inlineContext=function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!et.hasOwnProperty(t.parentNode.nodeName.toLowerCase())};var at=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var o,r=e.topNode,i=rt(null,e.preserveWhitespace,0)|(n?4:0);o=r?new it(r.type,r.attrs,c.none,c.none,!0,e.topMatch||r.type.contentMatch,i):new it(n?null:t.schema.topNodeType,null,c.none,c.none,!0,null,i),this.nodes=[o],this.open=0,this.find=e.findPositions,this.needsBlock=!1},st={top:{configurable:!0},currentPos:{configurable:!0}};function lt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function dt(t){var e={};for(var n in t)e[n]=t[n];return e}function ct(t,e){var n=e.schema.nodes,o=function(o){var r=n[o];if(r.allowsMarkType(t)){var i=[],a=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var o=t.edge(n),r=o.type,s=o.next;if(r==e)return!0;if(i.indexOf(s)<0&&a(s))return!0}};return a(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var i=o(r);if(i)return i.v}}st.top.get=function(){return this.nodes[this.open]},at.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,o=[];for(;e=n.exec(t);)o.push(e[1],e[2].trim());return o}(e)):null,o=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],o)}},at.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var o=n.content[n.content.length-1],r=t.previousSibling;(!o||r&&"BR"==r.nodeName||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},at.prototype.addElement=function(t,e){var n,o=t.nodeName.toLowerCase();ot.hasOwnProperty(o)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var o=1==e.nodeType?e.nodeName.toLowerCase():null;o&&ot.hasOwnProperty(o)&&n?(n.appendChild(e),e=n):"li"==o?n=e:o&&(n=null)}}(t);var r=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(r?r.ignore:nt.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(t=r.skip);var i,a=this.top,s=this.needsBlock;if(et.hasOwnProperty(o))i=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(a),this.needsBlock=s}else this.addElementByRule(t,r,!1===r.consuming?n:null)},at.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},at.prototype.ignoreFallback=function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},at.prototype.readStyles=function(t){var e=c.none;t:for(var n=0;n<t.length;n+=2)for(var o=null;;){var r=this.parser.matchStyle(t[n],t[n+1],this,o);if(!r)continue t;if(r.ignore)return null;if(e=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(e),!1!==r.consuming)break;o=r}return e},at.prototype.addElementByRule=function(t,e,n){var o,r,i,a=this;e.node?(r=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(r.create(e.attrs))||this.leafFallback(t):o=this.enter(r,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var s=this.top;if(r&&r.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return a.insertNode(t)}));else{var l=e.contentElement;"string"==typeof l?l=t.querySelector(l):"function"==typeof l&&(l=l(t)),l||(l=t),this.findAround(t,l,!0),this.addAll(l,o)}o&&(this.sync(s),this.open--),i&&this.removePendingMark(i,s)},at.prototype.addAll=function(t,e,n,o){for(var r=n||0,i=n?t.childNodes[n]:t.firstChild,a=null==o?null:t.childNodes[o];i!=a;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i),e&&et.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,r)},at.prototype.findPlace=function(t){for(var e,n,o=this.open;o>=0;o--){var r=this.nodes[o],i=r.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=r,!i.length))break;if(r.solid)break}if(!e)return!1;this.sync(n);for(var a=0;a<e.length;a++)this.enterInner(e[a],null,!1);return!0},at.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var o=n.activeMarks,r=0;r<t.marks.length;r++)n.type&&!n.type.allowsMarkType(t.marks[r].type)||(o=t.marks[r].addToSet(o));return n.content.push(t.mark(o)),!0}return!1},at.prototype.enter=function(t,e,n){var o=this.findPlace(t.create(e));return o&&this.enterInner(t,e,!0,n),o},at.prototype.enterInner=function(t,e,n,o){this.closeExtra();var r=this.top;r.applyPending(t),r.match=r.match&&r.match.matchType(t,e);var i=rt(t,o,r.options);4&r.options&&0==r.content.length&&(i|=4),this.nodes.push(new it(t,e,r.activeMarks,r.pendingMarks,n,null,i)),this.open++},at.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},at.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},at.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},st.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,o=n.length-1;o>=0;o--)t+=n[o].nodeSize;e&&t++}return t},at.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},at.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},at.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var o=0;o<this.find.length;o++){if(null==this.find[o].pos&&1==t.nodeType&&t.contains(this.find[o].node))e.compareDocumentPosition(this.find[o].node)&(n?2:4)&&(this.find[o].pos=this.currentPos)}},at.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},at.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),o=this.options.context,r=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),i=-(o?o.depth+1:0)+(r?0:1),a=function(t,s){for(;t>=0;t--){var l=n[t];if(""==l){if(t==n.length-1||0==t)continue;for(;s>=i;s--)if(a(t-1,s))return!0;return!1}var d=s>0||0==s&&r?e.nodes[s].type:o&&s>=i?o.node(s-i).type:null;if(!d||d.name!=l&&-1==d.groups.indexOf(l))return!1;s--}return!0};return a(n.length-1,this.open)},at.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var r=this.parser.schema.nodes[o];if(r.isTextblock&&r.defaultAttrs)return r}},at.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},at.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var r=o.popFromStashMark(t);r&&o.type&&o.type.allowsMarkType(r.type)&&(o.activeMarks=r.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(at.prototype,st);var ut=function(t,e){this.nodes=t||{},this.marks=e||{}};function pt(t){var e={};for(var n in t){var o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function ft(t){return t.document||window.document}ut.prototype.serializeFragment=function(t,e,n){var o=this;void 0===e&&(e={}),n||(n=ft(e).createDocumentFragment());var r=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,a=0;n<i.length&&a<t.marks.length;){var s=t.marks[a];if(o.marks[s.type.name]){if(!s.eq(i[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<i.length;)r=i.pop(),i.pop();for(;a<t.marks.length;){var l=t.marks[a++],d=o.serializeMark(l,t.isInline,e);d&&(i.push(l,r),r.appendChild(d.dom),r=d.contentDOM||d.dom)}}r.appendChild(o.serializeNodeInner(t,e))})),n},ut.prototype.serializeNodeInner=function(t,e){void 0===e&&(e={});var n=ut.renderSpec(ft(e),this.nodes[t.type.name](t)),o=n.dom,r=n.contentDOM;if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,r,e):this.serializeFragment(t.content,e,r)}return o},ut.prototype.serializeNode=function(t,e){void 0===e&&(e={});for(var n=this.serializeNodeInner(t,e),o=t.marks.length-1;o>=0;o--){var r=this.serializeMark(t.marks[o],t.isInline,e);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n},ut.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var o=this.marks[t.type.name];return o&&ut.renderSpec(ft(n),o(t,e))},ut.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var o=e[0],r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));var i=null,a=n?t.createElementNS(n,o):t.createElement(o),s=e[1],l=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s))for(var d in l=2,s)if(null!=s[d]){var c=d.indexOf(" ");c>0?a.setAttributeNS(d.slice(0,c),d.slice(c+1),s[d]):a.setAttribute(d,s[d])}for(var u=l;u<e.length;u++){var p=e[u];if(0===p){if(u<e.length-1||u>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var f=ut.renderSpec(t,p,n),h=f.dom,m=f.contentDOM;if(a.appendChild(h),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:a,contentDOM:i}},ut.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ut(this.nodesFromSchema(t),this.marksFromSchema(t)))},ut.nodesFromSchema=function(t){var e=pt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},ut.marksFromSchema=function(t){return pt(t.marks)};var ht=Math.pow(2,16);function mt(t){return 65535&t}var vt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},gt=function t(e,n){if(void 0===n&&(n=!1),!e.length&&t.empty)return t.empty;this.ranges=e,this.inverted=n};gt.prototype.recover=function(t){var e=0,n=mt(t);if(!this.inverted)for(var o=0;o<n;o++)e+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ht}(t)},gt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},gt.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},gt.prototype._map=function(t,e,n){for(var o=0,r=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?o:0);if(s>t)break;var l=this.ranges[a+r],d=this.ranges[a+i],c=s+l;if(t<=c){var u=s+o+((l?t==s?-1:t==c?1:e:e)<0?0:d);if(n)return u;var p=t==(e<0?s:c)?null:a/3+(t-s)*ht;return new vt(u,e<0?t!=s:t!=c,p)}o+=d-l}return n?t+o:new vt(t+o)},gt.prototype.touches=function(t,e){for(var n=0,o=mt(e),r=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>t)break;var l=this.ranges[a+r];if(t<=s+l&&a==3*o)return!0;n+=this.ranges[a+i]-l}return!1},gt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,o=0,r=0;o<this.ranges.length;o+=3){var i=this.ranges[o],a=i-(this.inverted?r:0),s=i+(this.inverted?0:r),l=this.ranges[o+e],d=this.ranges[o+n];t(a,a+l,s,s+d),r+=d-l}},gt.prototype.invert=function(){return new gt(this.ranges,!this.inverted)},gt.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},gt.offset=function(t){return 0==t?gt.empty:new gt(t<0?[0,-t,0]:[0,0,t])},gt.empty=new gt([]);var yt=function(t,e,n,o){this.maps=t||[],this.from=n||0,this.to=null==o?this.maps.length:o,this.mirror=e};function bt(t){var e=Error.call(this,t);return e.__proto__=bt.prototype,e}yt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new yt(this.maps,this.mirror,t,e)},yt.prototype.copy=function(){return new yt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},yt.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},yt.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var o=t.getMirror(e);this.appendMap(t.maps[e],null!=o&&o<e?n+o:null)}},yt.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},yt.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},yt.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=o&&o>e?n-o-1:null)}},yt.prototype.invert=function(){var t=new yt;return t.appendMappingInverted(this),t},yt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},yt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},yt.prototype._map=function(t,e,n){for(var o=!1,r=this.from;r<this.to;r++){var i=this.maps[r].mapResult(t,e);if(null!=i.recover){var a=this.getMirror(r);if(null!=a&&a>r&&a<this.to){r=a,t=this.maps[a].recover(i.recover);continue}}i.deleted&&(o=!0),t=i.pos}return n?t:new vt(t,o)},bt.prototype=Object.create(Error.prototype),bt.prototype.constructor=bt,bt.prototype.name="TransformError";var wt=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new yt},kt={before:{configurable:!0},docChanged:{configurable:!0}};function _t(){throw new Error("Override me")}kt.before.get=function(){return this.docs.length?this.docs[0]:this.doc},wt.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new bt(e.failed);return this},wt.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},kt.docChanged.get=function(){return this.steps.length>0},wt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(wt.prototype,kt);var Ct=Object.create(null),xt=function(){};xt.prototype.apply=function(t){return _t()},xt.prototype.getMap=function(){return gt.empty},xt.prototype.invert=function(t){return _t()},xt.prototype.map=function(t){return _t()},xt.prototype.merge=function(t){return null},xt.prototype.toJSON=function(){return _t()},xt.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ct[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},xt.jsonID=function(t,e){if(t in Ct)throw new RangeError("Duplicate use of step JSON ID "+t);return Ct[t]=e,e.prototype.jsonID=t,e};var St=function(t,e){this.doc=t,this.failed=e};St.ok=function(t){return new St(t,null)},St.fail=function(t){return new St(null,t)},St.fromReplace=function(t,e,n,o){try{return St.ok(t.replace(e,n,o))}catch(t){if(t instanceof u)return St.fail(t.message);throw t}};var Et=function(t){function e(e,n,o,r){t.call(this),this.from=e,this.to=n,this.slice=o,this.structure=!!r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Mt(t,this.from,this.to)?St.fail("Structure replace would overwrite content"):St.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new gt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted?null:new e(n.pos,Math.max(n.pos,o.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?p.empty:new p(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var o=this.slice.size+t.slice.size==0?p.empty:new p(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),o,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,p.fromJSON(t,n.slice),!!n.structure)},e}(xt);xt.jsonID("replace",Et);var Tt=function(t){function e(e,n,o,r,i,a,s){t.call(this),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=r,this.slice=i,this.insert=a,this.structure=!!s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Mt(t,this.from,this.gapFrom)||Mt(t,this.gapTo,this.to)))return St.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return St.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?St.fromReplace(t,this.from,this.to,n):St.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new gt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&o.deleted||r<n.pos||i>o.pos?null:new e(n.pos,o.pos,r,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,p.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(xt);function Mt(t,e,n){for(var o=t.resolve(e),r=n-e,i=o.depth;r>0&&i>0&&o.indexAfter(i)==o.node(i).childCount;)i--,r--;if(r>0)for(var a=o.node(i).maybeChild(o.indexAfter(i));r>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,r--}return!1}function Dt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ot(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var o=t.$from.node(n),r=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(r,i,e))return n;if(0==n||o.type.spec.isolating||!Dt(o,r,i))break}}function At(t,e,n,o){void 0===o&&(o=t);var r=function(t,e){var n=t.parent,o=t.startIndex,r=t.endIndex,i=n.contentMatchAt(o).findWrapping(e);if(!i)return null;var a=i.length?i[0]:e;return n.canReplaceWith(o,r,a)?i:null}(t,e),i=r&&function(t,e){var n=t.parent,o=t.startIndex,r=t.endIndex,i=n.child(o),a=e.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,l=o;s&&l<r;l++)s=s.matchType(n.child(l).type);if(!s||!s.validEnd)return null;return a}(o,e);return i?r.map(It).concat({type:e,attrs:n}).concat(i.map(It)):null}function It(t){return{type:t,attrs:null}}function Bt(t,e,n,o){void 0===n&&(n=1);var r=t.resolve(e),i=r.depth-n,a=o&&o[o.length-1]||r.parent;if(i<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!a.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(var s=r.depth-1,l=n-2;s>i;s--,l--){var d=r.node(s),c=r.index(s);if(d.type.spec.isolating)return!1;var u=d.content.cutByIndex(c,d.childCount),p=o&&o[l]||d;if(p!=d&&(u=u.replaceChild(0,p.type.create(p.attrs))),!d.canReplace(c+1,d.childCount)||!p.type.validContent(u))return!1}var f=r.indexAfter(i),h=o&&o[0];return r.node(i).canReplaceWith(f,f,h?h.type:r.node(i+1).type)}function Nt(t,e){var n=t.resolve(e),o=n.index();return zt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function zt(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function Rt(t,e,n){void 0===n&&(n=-1);for(var o=t.resolve(e),r=o.depth;;r--){var i=void 0,a=void 0,s=o.index(r);if(r==o.depth?(i=o.nodeBefore,a=o.nodeAfter):n>0?(i=o.node(r+1),s++,a=o.node(r).maybeChild(s)):(i=o.node(r).maybeChild(s-1),a=o.node(r+1)),i&&!i.isTextblock&&zt(i,a)&&o.node(r).canReplace(s,s+1))return e;if(0==r)break;e=n<0?o.before(r):o.after(r)}}function Pt(t,e,n){var o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n))return e;if(0==o.parentOffset)for(var r=o.depth-1;r>=0;r--){var i=o.index(r);if(o.node(r).canReplaceWith(i,i,n))return o.before(r+1);if(i>0)return null}if(o.parentOffset==o.parent.content.size)for(var a=o.depth-1;a>=0;a--){var s=o.indexAfter(a);if(o.node(a).canReplaceWith(s,s,n))return o.after(a+1);if(s<o.node(a).childCount)return null}}function Lt(t,e,n){var o=t.resolve(e);if(!n.content.size)return e;for(var r=n.content,i=0;i<n.openStart;i++)r=r.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=o.depth;s>=0;s--){var l=s==o.depth?0:o.pos<=(o.start(s+1)+o.end(s+1))/2?-1:1,d=o.index(s)+(l>0?1:0),c=o.node(s),u=!1;if(1==a)u=c.canReplace(d,d,r);else{var p=c.contentMatchAt(d).findWrapping(r.firstChild.type);u=p&&c.canReplaceWith(d,d,p[0])}if(u)return 0==l?o.pos:l<0?o.before(s+1):o.after(s+1)}return null}function Ft(t,e,n){for(var o=[],r=0;r<t.childCount;r++){var a=t.child(r);a.content.size&&(a=a.copy(Ft(a.content,e,a))),a.isInline&&(a=e(a,n,r)),o.push(a)}return i.fromArray(o)}xt.jsonID("replaceAround",Tt),wt.prototype.lift=function(t,e){for(var n=t.$from,o=t.$to,r=t.depth,a=n.before(r+1),s=o.after(r+1),l=a,d=s,c=i.empty,u=0,f=r,h=!1;f>e;f--)h||n.index(f)>0?(h=!0,c=i.from(n.node(f).copy(c)),u++):l--;for(var m=i.empty,v=0,g=r,y=!1;g>e;g--)y||o.after(g+1)<o.end(g)?(y=!0,m=i.from(o.node(g).copy(m)),v++):d++;return this.step(new Tt(l,d,a,s,new p(c.append(m),u,v),c.size-u,!0))},wt.prototype.wrap=function(t,e){for(var n=i.empty,o=e.length-1;o>=0;o--){if(n.size){var r=e[o].type.contentMatch.matchFragment(n);if(!r||!r.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=i.from(e[o].type.create(e[o].attrs,n))}var a=t.start,s=t.end;return this.step(new Tt(a,s,a,s,new p(n,0,0),e.length,!0))},wt.prototype.setBlockType=function(t,e,n,o){var r=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,o)&&function(t,e,n){var o=t.resolve(e),r=o.index();return o.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(e),n)){r.clearIncompatible(r.mapping.slice(a).map(e,1),n);var s=r.mapping.slice(a),l=s.map(e,1),d=s.map(e+t.nodeSize,1);return r.step(new Tt(l,d,l+1,d-1,new p(i.from(n.create(o,null,t.marks)),0,0),1,!0)),!1}})),this},wt.prototype.setNodeMarkup=function(t,e,n,o){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");e||(e=r.type);var a=e.create(n,null,o||r.marks);if(r.isLeaf)return this.replaceWith(t,t+r.nodeSize,a);if(!e.validContent(r.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Tt(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new p(i.from(a),0,0),1,!0))},wt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var o=this.doc.resolve(t),r=i.empty,a=i.empty,s=o.depth,l=o.depth-e,d=e-1;s>l;s--,d--){r=i.from(o.node(s).copy(r));var c=n&&n[d];a=i.from(c?c.type.create(c.attrs,a):o.node(s).copy(a))}return this.step(new Et(t,t,new p(r.append(a),e,e),!0))},wt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Et(t-e,t+e,p.empty,!0);return this.step(n)};var $t=function(t){function e(e,n,o){t.call(this),this.from=e,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),r=o.node(o.sharedDepth(this.to)),i=new p(Ft(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),r),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Vt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new e(n.pos,o.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);xt.jsonID("addMark",$t);var Vt=function(t){function e(e,n,o){t.call(this),this.from=e,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=new p(Ft(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new $t(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new e(n.pos,o.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);function jt(t,e,n,o){if(void 0===n&&(n=e),void 0===o&&(o=p.empty),e==n&&!o.size)return null;var r=t.resolve(e),i=t.resolve(n);return Wt(r,i,o)?new Et(e,n,o):new Ht(r,i,o).fit()}function Wt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}xt.jsonID("removeMark",Vt),wt.prototype.addMark=function(t,e,n){var o=this,r=[],i=[],a=null,s=null;return this.doc.nodesBetween(t,e,(function(o,l,d){if(o.isInline){var c=o.marks;if(!n.isInSet(c)&&d.type.allowsMarkType(n.type)){for(var u=Math.max(l,t),p=Math.min(l+o.nodeSize,e),f=n.addToSet(c),h=0;h<c.length;h++)c[h].isInSet(f)||(a&&a.to==u&&a.mark.eq(c[h])?a.to=p:r.push(a=new Vt(u,p,c[h])));s&&s.to==u?s.to=p:i.push(s=new $t(u,p,n))}}})),r.forEach((function(t){return o.step(t)})),i.forEach((function(t){return o.step(t)})),this},wt.prototype.removeMark=function(t,e,n){var o=this;void 0===n&&(n=null);var r=[],i=0;return this.doc.nodesBetween(t,e,(function(o,a){if(o.isInline){i++;var s=null;if(n instanceof Y)for(var l,d=o.marks;l=n.isInSet(d);)(s||(s=[])).push(l),d=l.removeFromSet(d);else n?n.isInSet(o.marks)&&(s=[n]):s=o.marks;if(s&&s.length)for(var c=Math.min(a+o.nodeSize,e),u=0;u<s.length;u++){for(var p=s[u],f=void 0,h=0;h<r.length;h++){var m=r[h];m.step==i-1&&p.eq(r[h].style)&&(f=m)}f?(f.to=c,f.step=i):r.push({style:p,from:Math.max(a,t),to:c,step:i})}}})),r.forEach((function(t){return o.step(new Vt(t.from,t.to,t.style))})),this},wt.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var o=this.doc.nodeAt(t),r=[],a=t+1,s=0;s<o.childCount;s++){var l=o.child(s),d=a+l.nodeSize,c=n.matchType(l.type,l.attrs);if(c){n=c;for(var u=0;u<l.marks.length;u++)e.allowsMarkType(l.marks[u].type)||this.step(new Vt(a,d,l.marks[u]))}else r.push(new Et(a,d,p.empty));a=d}if(!n.validEnd){var f=n.fillBefore(i.empty,!0);this.replace(a,a,new p(f,0,0))}for(var h=r.length-1;h>=0;h--)this.step(r[h]);return this},wt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=p.empty);var o=jt(this.doc,t,e,n);return o&&this.step(o),this},wt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new p(i.from(n),0,0))},wt.prototype.delete=function(t,e){return this.replace(t,e,p.empty)},wt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Ht=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var r=t.node(o);this.frontier.push({type:r.type,match:r.contentMatchAt(t.indexAfter(o))})}this.placed=i.empty;for(var a=t.depth;a>0;a--)this.placed=i.from(t.node(a).copy(this.placed))},qt={depth:{configurable:!0}};function Jt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Jt(t.firstChild.content,e-1,n)))}function Kt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Kt(t.lastChild.content,e-1,n)))}function Ut(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function Gt(t,e,n){if(e<=0)return t;var o=t.content;return e>1&&(o=o.replaceChild(0,Gt(o.firstChild,e-1,1==o.childCount?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(i.empty,!0)))),t.copy(o)}function Xt(t,e,n,o,r){var i=t.node(e),a=r?t.indexAfter(e):t.index(e);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=o.fillBefore(i.content,!0,a);return s&&!function(t,e,n){for(var o=n;o<e.childCount;o++)if(!t.allowsMarks(e.child(o).marks))return!0;return!1}(n,i.content,a)?s:null}function Yt(t,e,n,o,r){if(e<n){var a=t.firstChild;t=t.replaceChild(0,a.copy(Yt(a.content,e+1,n,o,a)))}if(e>o){var s=r.contentMatchAt(0),l=s.fillBefore(t).append(t);t=l.append(s.matchFragment(l).fillBefore(i.empty,!0))}return t}function Zt(t,e){for(var n=[],o=Math.min(t.depth,e.depth);o>=0;o--){var r=t.start(o);if(r<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(r==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==r-1)&&n.push(o)}return n}qt.depth.get=function(){return this.frontier.length-1},Ht.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,r=this.close(e<0?this.$to:o.doc.resolve(e));if(!r)return null;for(var i=this.placed,a=o.depth,s=r.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var l=new p(i,a,s);return e>-1?new Tt(o.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new Et(o.pos,r.pos,l):void 0},Ht.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,o=(e?(n=Ut(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],s=a.type,l=a.match,d=void 0,c=void 0;if(1==t&&(o?l.matchType(o.type)||(c=l.fillBefore(i.from(o),!1)):s.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:r,parent:n,inject:c};if(2==t&&o&&(d=l.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:r,parent:n,wrap:d};if(n&&l.matchType(n.type))break}},Ht.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,r=Ut(e,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new p(e,n+1,Math.max(o,r.size+n>=e.size-o?n+1:0)),!0)},Ht.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,r=Ut(e,n);if(r.childCount<=1&&n>0){var i=e.size-n<=n+r.size;this.unplaced=new p(Jt(e,n-1,1),n-1,i?n-1:o)}else this.unplaced=new p(Jt(e,n,1),n,o)},Ht.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,o=t.parent,r=t.inject,a=t.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var s=0;s<a.length;s++)this.openFrontierNode(a[s]);var l=this.unplaced,d=o?o.content:l.content,c=l.openStart-e,u=0,f=[],h=this.frontier[n],m=h.match,v=h.type;if(r){for(var g=0;g<r.childCount;g++)f.push(r.child(g));m=m.matchFragment(r)}for(var y=d.size+e-(l.content.size-l.openEnd);u<d.childCount;){var b=d.child(u),w=m.matchType(b.type);if(!w)break;(++u>1||0==c||b.content.size)&&(m=w,f.push(Gt(b.mark(v.allowedMarks(b.marks)),1==u?c:0,u==d.childCount?y:-1)))}var k=u==d.childCount;k||(y=-1),this.placed=Kt(this.placed,n,i.from(f)),this.frontier[n].match=m,k&&y<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var _=0,C=d;_<y;_++){var x=C.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),C=x.content}this.unplaced=k?0==e?p.empty:new p(Jt(l.content,e-1,1),e-1,y<0?l.openEnd:e-1):new p(Jt(l.content,e,u),l.openStart,l.openEnd)},Ht.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Xt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,o=this.$to.after(n);n>1&&o==this.$to.end(--n);)++o;return o},Ht.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],o=n.match,r=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=Xt(t,e,r,o,i);if(a){for(var s=e-1;s>=0;s--){var l=this.frontier[s],d=l.match,c=Xt(t,s,l.type,d,!0);if(!c||c.childCount)continue t}return{depth:e,fit:a,move:i?t.doc.resolve(t.after(e+1)):t}}}},Ht.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Kt(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var o=t.node(n),r=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,r)}return t},Ht.prototype.openFrontierNode=function(t,e,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Kt(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Ht.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Kt(this.placed,this.frontier.length,t))},Object.defineProperties(Ht.prototype,qt),wt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var o=this.doc.resolve(t),r=this.doc.resolve(e);if(Wt(o,r,n))return this.step(new Et(t,e,n));var i=Zt(o,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var a=-(o.depth+1);i.unshift(a);for(var s=o.depth,l=o.pos-1;s>0;s--,l--){var d=o.node(s).type.spec;if(d.defining||d.isolating)break;i.indexOf(s)>-1?a=s:o.before(s)==l&&i.splice(1,0,-s)}for(var c=i.indexOf(a),u=[],f=n.openStart,h=n.content,m=0;;m++){var v=h.firstChild;if(u.push(v),m==n.openStart)break;h=v.content}f>0&&u[f-1].type.spec.defining&&o.node(c).type!=u[f-1].type?f-=1:f>=2&&u[f-1].isTextblock&&u[f-2].type.spec.defining&&o.node(c).type!=u[f-2].type&&(f-=2);for(var g=n.openStart;g>=0;g--){var y=(g+f+1)%(n.openStart+1),b=u[y];if(b)for(var w=0;w<i.length;w++){var k=i[(w+c)%i.length],_=!0;k<0&&(_=!1,k=-k);var C=o.node(k-1),x=o.index(k-1);if(C.canReplaceWith(x,x,b.type,b.marks))return this.replace(o.before(k),_?r.after(k):e,new p(Yt(n.content,0,n.openStart,y),y,n.openEnd))}}for(var S=this.steps.length,E=i.length-1;E>=0&&(this.replace(t,e,n),!(this.steps.length>S));E--){var T=i[E];T<0||(t=o.before(T),e=r.after(T))}return this},wt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var o=Pt(this.doc,t,n.type);null!=o&&(t=e=o)}return this.replaceRange(t,e,new p(i.from(n),0,0))},wt.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),o=this.doc.resolve(e),r=Zt(n,o),i=0;i<r.length;i++){var a=r[i],s=i==r.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),o.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return this.delete(n.before(a),o.after(a))}for(var l=1;l<=n.depth&&l<=o.depth;l++)if(t-n.start(l)==n.depth-l&&e>n.end(l)&&o.end(l)-e!=o.depth-l)return this.delete(n.before(l),e);return this.delete(t,e)};var Qt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},te.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},te.prototype.replace=function(t,e){void 0===e&&(e=p.empty);for(var n=e.content.lastChild,o=null,r=0;r<e.openEnd;r++)o=n,n=n.lastChild;for(var i=t.steps.length,a=this.ranges,s=0;s<a.length;s++){var l=a[s],d=l.$from,c=l.$to,u=t.mapping.slice(i);t.replaceRange(u.map(d.pos),u.map(c.pos),s?p.empty:e),0==s&&ce(t,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}},te.prototype.replaceWith=function(t,e){for(var n=t.steps.length,o=this.ranges,r=0;r<o.length;r++){var i=o[r],a=i.$from,s=i.$to,l=t.mapping.slice(n),d=l.map(a.pos),c=l.map(s.pos);r?t.deleteRange(d,c):(t.replaceRangeWith(d,c,e),ce(t,n,e.isInline?-1:1))}},te.findFrom=function(t,e,n){var o=t.parent.inlineContent?new oe(t):de(t.node(0),t.parent,t.pos,t.index(),e,n);if(o)return o;for(var r=t.depth-1;r>=0;r--){var i=e<0?de(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):de(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new se(t.node(0))},te.atStart=function(t){return de(t,t,0,0,1)||new se(t)},te.atEnd=function(t){return de(t,t,t.content.size,t.childCount,-1)||new se(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Qt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Qt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Qt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return oe.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},oe=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,o){var r=n.resolve(o.map(this.head));if(!r.parent.inlineContent)return t.near(r);var i=n.resolve(o.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)},e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),t.prototype.replace.call(this,e,n),n==p.empty){var o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new re(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var o=t.resolve(e);return new this(o,n==e?o:t.resolve(n))},e.between=function(n,o,r){var i=n.pos-o.pos;if(r&&!i||(r=i>=0?1:-1),!o.parent.inlineContent){var a=t.findFrom(o,r,!0)||t.findFrom(o,-r,!0);if(!a)return t.near(o,r);o=a.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-r,!0)||t.findFrom(n,r,!0)).$anchor).pos<o.pos!=i<0)&&(n=o),new e(n,o)},Object.defineProperties(e.prototype,n),e}(te);te.jsonID("text",oe);var re=function(t,e){this.anchor=t,this.head=e};re.prototype.map=function(t){return new re(t.map(this.anchor),t.map(this.head))},re.prototype.resolve=function(t){return oe.between(t.resolve(this.anchor),t.resolve(this.head))};var ie=function(t){function e(e){var n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,o),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,o){var r=o.mapResult(this.anchor),i=r.deleted,a=r.pos,s=n.resolve(a);return i?t.near(s):new e(s)},e.prototype.content=function(){return new p(i.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new ae(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(te);ie.prototype.visible=!1,te.jsonID("node",ie);var ae=function(t){this.anchor=t};ae.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,o=e.pos;return n?new re(o,o):new ae(o)},ae.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&ie.isSelectable(n)?new ie(e):te.near(e)};var se=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),n==p.empty){e.delete(0,e.doc.content.size);var o=t.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return le},e}(te);te.jsonID("all",se);var le={map:function(){return this},resolve:function(t){return new se(t)}};function de(t,e,n,o,r,i){if(e.inlineContent)return oe.create(t,n);for(var a=o-(r>0?0:1);r>0?a<e.childCount:a>=0;a+=r){var s=e.child(a);if(s.isAtom){if(!i&&ie.isSelectable(s))return ie.create(t,n-(r<0?s.nodeSize:0))}else{var l=de(t,s,n+r,r<0?s.childCount:0,r,i);if(l)return l}n+=s.nodeSize*r}}function ce(t,e,n){var o=t.steps.length-1;if(!(o<e)){var r,i=t.steps[o];if(i instanceof Et||i instanceof Tt)t.mapping.maps[o].forEach((function(t,e,n,o){null==r&&(r=o)})),t.setSelection(te.near(t.doc.resolve(r),n))}}var ue=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return c.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||c.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var o=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var r=this.storedMarks;if(!r){var i=this.doc.resolve(e);r=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,o.text(t,r)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(wt);function pe(t,e){return e&&t?t.bind(e):t}var fe=function(t,e,n){this.name=t,this.init=pe(e.init,n),this.apply=pe(e.apply,n)},he=[new fe("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new fe("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new fe("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,o){return o.selection.$cursor?t.storedMarks:null}}),new fe("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=he.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new fe(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var o=this.config.plugins[n];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0},ve.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),o=null;;){for(var r=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=o?o[i].n:0,l=o?o[i].state:this,d=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,l,n);if(d&&n.filterTransaction(d,i)){if(d.setMeta("appendedTransaction",t),!o){o=[];for(var c=0;c<this.config.plugins.length;c++)o.push(c<i?{state:n,n:e.length}:{state:this,n:0})}e.push(d),n=n.applyInner(d),r=!0}o&&(o[i]={state:n,n:e.length})}}if(!r)return{state:n,transactions:e}}},ve.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new ve(this.config),n=this.config.fields,o=0;o<n.length;o++){var r=n[o];e[r.name]=r.apply(t,this[r.name],this,e)}for(var i=0;i<ye.length;i++)ye[i](this,t,e);return e},ge.tr.get=function(){return new ue(this)},ve.create=function(t){for(var e=new me(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new ve(e),o=0;o<e.fields.length;o++)n[e.fields[o].name]=e.fields[o].init(t,n);return n},ve.prototype.reconfigure=function(t){for(var e=new me(this.schema,t.plugins),n=e.fields,o=new ve(e),r=0;r<n.length;r++){var i=n[r].name;o[i]=this.hasOwnProperty(i)?this[i]:n[r].init(t,o)}return o},ve.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=t[n],r=o.spec.state;r&&r.toJSON&&(e[n]=r.toJSON.call(o,this[o.key]))}return e},ve.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new me(t.schema,t.plugins),r=new ve(o);return o.fields.forEach((function(o){if("doc"==o.name)r.doc=D.fromJSON(t.schema,e.doc);else if("selection"==o.name)r.selection=te.fromJSON(r.doc,e.selection);else if("storedMarks"==o.name)e.storedMarks&&(r.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var i in n){var a=n[i],s=a.spec.state;if(a.key==o.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(r[o.name]=s.fromJSON.call(a,t,e[i],r))}r[o.name]=o.init(t,r)}})),r},ve.addApplyListener=function(t){ye.push(t)},ve.removeApplyListener=function(t){var e=ye.indexOf(t);e>-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];var be=function(t){this.props={},t.props&&function t(e,n,o){for(var r in e){var i=e[r];i instanceof Function?i=i.bind(n):"handleDOMEvents"==r&&(i=t(i,n,{})),o[r]=i}return o}(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:ke("plugin")};be.prototype.getState=function(t){return t[this.key]};var we=Object.create(null);function ke(t){return t in we?t+"$"+ ++we[t]:(we[t]=0,t+"$")}var _e=function(t){void 0===t&&(t="key"),this.key=ke(t)};_e.prototype.get=function(t){return t.config.pluginsByKey[this.key]},_e.prototype.getState=function(t){return t[this.key]};var Ce="k-parent-node",xe=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],Se=function(t,e){var n=(t.ownerDocument||document).createElement(e);Array.from(t.rows).filter((function(t){return t.getAttribute(Ce)===e})).forEach((function(t){t.removeAttribute(Ce),n.appendChild(t)})),n.children.length&&t.appendChild(n)},Ee=function(t,e){var n=e.toUpperCase();t.filter((function(t){return t.nodeName===n})).forEach((function(t){Array.from(t.children).forEach((function(n){n.setAttribute(Ce,e),t.parentNode&&t.parentNode.insertBefore(n,t)})),t.remove()}))},Te=function(t,e){void 0===e&&(e=xe);var n=e.join("|");return t.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},Me=function(t){var e,n=document.createElement("template");if("content"in n)n.innerHTML=t,e=n.content;else{var o=(new DOMParser).parseFromString(t,"text/html");e=document.createDocumentFragment();for(var r=o.body;r&&r.firstChild;)e.appendChild(r.firstChild)}return e},De=function(t){var e=ut.fromSchema(t.type.schema).serializeFragment(t.content);return function(t){Array.from(t.querySelectorAll("table")).forEach((function(t){Se(t,"thead"),Se(t,"tbody"),Se(t,"tfoot");var e=Array.from(t.children).find((function(t){return 0===t.children.length}));e&&e.remove()}))}(e),e},Oe=function(t,e,n){return tt.fromSchema(e).parse(t,n)},Ae=function(t,e,n){var o,r=Me(t);return o=r,Array.from(o.querySelectorAll("table")).forEach((function(t){var e=Array.from(t.children);e.some((function(t){return"THEAD"===t.nodeName||"TFOOT"===t.nodeName}))&&(Ee(e,"thead"),Ee(e,"tbody"),Ee(e,"tfoot"));var n=e.find((function(t){return"COLGROUP"===t.nodeName}));n&&(t.setAttribute("k-colgroup-data",n.outerHTML),n.remove())})),Oe(r,e,n)},Ie=function(t){var e=De(t.doc),n=document.createElement("div");return n.appendChild(e),n.innerHTML},Be=function(t,e,n){return void 0===e&&(e="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(o,r){return r(o.tr.setSelection(new se(o.doc)).replaceSelectionWith(Ae(t,o.schema,n)).setMeta("commandName",e))}},Ne=n(0),ze=function(t,e){var n=e.style,o=e.value,r=e.newValue;if(!t)return{changed:!1,style:null};var i=t.split(/\s*;\s*/).filter((function(t){return Boolean(t)})),a=i.filter((function(t){var e=t.split(/\s*:\s*/);return!(e[0].toLowerCase()===n&&o.test(e[1]))}));return r&&a.push(n+": "+r),{style:a.join("; ")+(a.length?";":""),changed:Boolean(r)||a.length!==i.length}},Re=function(t,e){for(var n=t.selection.$from,o=n.depth;o>=0;o--){var r=n.index(o);if(n.node(o).canReplaceWith(r,r,e))return!0}return!1},Pe=function(t){return t instanceof D?t.type.name:t.name},Le=function(t,e){return void 0===e&&(e=1),function(n){return function(t,e){return void 0===e&&(e=1),function(n){for(var o=n.$from,r=o.depth;r>0;r--){var i=o.node(r);if(t(i)&&0===(e-=1))return{depth:r,node:i}}}}((function(e){return Pe(e)===Pe(t)}),e)(n)}},Fe=function(t,e){return function(n,o){var r=n.tr.replaceSelectionWith(t);e&&r.scrollIntoView(),o(r)}},$e=function(t,e,n,o){var r=i.from(Ae(t,n,o)),a=i.from(Ae(e,n,o));return r.eq(a)},Ve=function(t){var e=t.selection;if(e instanceof oe||e instanceof se){var n=e.content().content;return n.textBetween(0,n.size)}return""},je=function(t){if(t.selection instanceof ie)return t.selection.node},We=function(t){var e="",n=!1,o=t.selection,r=t.doc,i=o.$from,a=o.$to,s=o.from,l=o.to;return i.sameParent(a)&&(r.nodesBetween(s,l,(function(t){n=n||t.isLeaf&&!t.isText})),n||(e=Ve(t))),e},He=function(t){return t.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},qe={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i},Je=function(t,e,n){if(!n.applyToWord||!t.selection.empty)return{state:t,dispatch:e};var o=!0===n.applyToWord?qe:n.applyToWord,r=null,i=t.tr,a=t.selection,s=a.$head.nodeBefore,l=a.$head.nodeAfter;if(s&&"text"===s.type.name&&s.text&&l&&"text"===l.type.name&&l.text){var d=[];a.$head.parent.descendants((function(t,e){return d.push({node:t,pos:e}),!1}));for(var c=a.$head.parentOffset,u=d.findIndex((function(t){var e=t.node,n=t.pos;return n<=c&&n+e.nodeSize>=c})),p=d[u].node.text,f=!1,h=u-1;h>=0;h--){var m=d[h];!f&&m&&"text"===m.node.type.name?p=m.node.text+p:(f=!0,c-=m.node.nodeSize)}for(h=u+1;h<d.length;h++){if(!(m=d[h])||"text"!==m.node.type.name)break;p+=m.node.text}var v=p.substring(0,c),g=p.substring(c),y=o.before.exec(v),b=o.after.exec(g);if(y&&b){var w=y[0].length,k=b[0].length,_=r=a.from;i.setSelection(oe.create(t.doc,_-w,_+k));return{state:{tr:i,selection:i.selection,doc:i.doc,storedMarks:null,schema:i.doc.type.schema},dispatch:function(t){t.setSelection(oe.create(t.doc,r)),e(t)}}}}return{state:t,dispatch:e}},Ke=function(t,e){return function(n,o,r){var i=Je(n,o,e),a=i.state,s=i.dispatch;return t(e)(a,s)}},Ue=function(t,e,n){for(var o=function(o){var r=e[o],i=r.$from,a=r.$to,s=0===i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},r=0;r<e.length;r++){var i=o(r);if(i)return i.v}return!1},Ge=function(t,e,n){return function(o,r){var i=o.selection,a=i.empty,s=i.$cursor,l=i.ranges;if(a&&!s||!Ue(o.doc,l,t))return!1;if(r)if(s)t.isInSet(o.storedMarks||s.marks())?r(n.removeStoredMark(t)):r(n.addStoredMark(t.create(e)));else{for(var d=!1,c=0;!d&&c<l.length;c++){var u=l[c],p=u.$from,f=u.$to;d=o.doc.rangeHasMark(p.pos,f.pos,t)}for(c=0;c<l.length;c++){var h=l[c];p=h.$from,f=h.$to;d?n.removeMark(p.pos,f.pos,t):n.addMark(p.pos,f.pos,t.create(e))}r(n.scrollIntoView())}return!0}},Xe=function(t,e,n,o){void 0===o&&(o=null);var r=[],i=0;return t.doc.nodesBetween(e,n,(function(t,a){if(t.isInline){i++;var s=null;if(o instanceof Y){var l=o.isInSet(t.marks);l&&(s=[l])}else o?o.isInSet(t.marks)&&(s=[o]):s=t.marks;if(s&&s.length)for(var d=Math.min(a+t.nodeSize,n),c=0;c<s.length;c++){for(var u=s[c],p=void 0,f=0;f<r.length;f++){var h=r[f];h.step===i-1&&u.eq(h.style)&&(p=h)}p?(p.to=d,p.step=i):r.push({style:u,from:Math.max(a,e),to:d,step:i})}}})),r.forEach((function(e){return t.step(new Vt(e.from,e.to,e.style))})),t},Ye=function(t){var e=(void 0===t?{}:t).except,n=void 0===e?[]:e;return function(t,e){var o,r=t.tr;Ze(r,{except:(o=n,o instanceof Array?o:[o])}),r.docChanged&&e(r)}},Ze=function(t,e){var n=e.except,o=t.doc,r=t.selection,i=o.type.schema,a=r.empty,s=r.ranges,l=(n||[]).map((function(t){return t.name}));if(!a){var d=Object.keys(i.marks).map((function(t){return i.marks[t]})).filter((function(t){return-1===l.indexOf(t.name)}));s.forEach((function(e){var n=e.$from,o=e.$to;d.forEach((function(e){return t.removeMark(n.pos,o.pos,e)}))}))}},Qe=function(t,e){var n,o=t.schema.marks,r=(e.altMarks||[]).filter((function(t){return o[t]})),i=e.altStyle,a=t.selection,s=a.from,l=a.$from,d=a.to,c=a.empty,u=o[e.mark],p=t.doc,f=!1;return c?(n=t.storedMarks||l.marks(),f=u&&u.isInSet(n)||r.some((function(t){return o[t].isInSet(n)}))):f=u&&p.rangeHasMark(s,d,u)||r.some((function(t){return p.rangeHasMark(s,d,o[t])})),!f&&i&&o.style?en(t,o.style).some((function(t){return null!==tn(t,i)})):Boolean(f)},tn=function(t,e){for(var n=(t&&t.attrs.style||"").split(/\s*;\s*/).filter((function(t){return Boolean(t)})),o=0;o<n.length;o++){var r=n[o].split(/\s*:\s*/);if(r[0].toLowerCase()===e.name&&e.value.test(r[1]))return r[1]}return null},en=function(t,e){var n=t.selection,o=n.from,r=n.$from,i=n.to,a=n.empty,s=[];return a?s.push(e.isInSet(t.storedMarks||r.marks())):t.doc.nodesBetween(o,i,(function(t){t.isInline&&s.push(e.isInSet(t.marks))})),s},nn=function(t,e){var n=en(t,e),o=n.filter((function(t){return Boolean(t)}));return n.length===o.length?n[0]:void 0},on=function(t,e){var n=en(t,e),o=n.filter((function(t){return Boolean(t)}));return{hasNodesWithoutMarks:n.length!==o.length,marks:o}},rn=function(t,e){var n=t.find((function(t){return"style"===t.type.name})),o=n&&n.attrs.style;return ze(o,e)},an=function(t,e,n,o,r){var i=r.create({style:o.style}),a=[],s=[],l=null,d=null;return t.doc.nodesBetween(e,n,(function(t,c,u){if(t.isInline){var p=t.marks;if(!i.isInSet(p)&&u.type.allowsMarkType(i.type)){var f=Math.max(c,e),h=Math.min(c+t.nodeSize,n),m=rn(p,o);if(m.changed||o.newValue){for(var v=m.changed?{style:m.style||null}:{style:[o.style]+": "+o.newValue+";"},g=r.isInSet(p)?p.find((function(t){return"style"===t.type.name})):null,y=g?Ne.__assign({},g.attrs,v):v,b=r.create(y),w=b.addToSet(p),k=0;k<p.length;k++)p[k].isInSet(w)||(l&&l.to===f&&l.mark.eq(p[k])?l.to=h:(l=new Vt(f,h,p[k]),a.push(l)));var _=d&&d.to===f,C=_&&b.attrs.style===d.mark.attrs.style;_&&C?d.to=h:Object.keys(y).some((function(t){return null!==y[t]}))&&(d=new $t(f,h,b),s.push(d))}}}})),a.forEach((function(e){return t.step(e)})),s.forEach((function(e){return t.step(e)})),a.length+s.length>0},sn=function(t,e){var n=t.schema.marks.style;return(n?en(t,n):[]).map((function(t){return tn(t,e)})).filter((function(t){return null!==t}))},ln=function(t,e){return function(n,o,r){var i=n.selection,a=i.empty,s=i.$cursor,l=i.ranges;if(a&&!s||!Ue(n.doc,l,t))return!1;var d,c,u,p,f=!1;if(o){var h=r||n.tr;if(s){var m=n.storedMarks||s.marks();if(t.isInSet(m)){var v=rn(m,e),g=m.find((function(t){return"style"===t.type.name})),y=Ne.__assign({},g?g.attrs:{},{style:v.style||null});if(d=g.attrs,c=y,u=Object.keys(d),p=Object.keys(c),u.length===p.length&&u.every((function(t){return d[t]===c[t]})))return!1;o(h.removeStoredMark(t)),Object.keys(y).some((function(t){return null!==y[t]}))&&o(h.addStoredMark(t.create(y))),f=!0}}else{for(var b=0;b<l.length;b++){var w=l[b],k=w.$from,_=w.$to;f=an(h,k.pos,_.pos,e,t)}f&&(h.scrollIntoView(),o(h))}}return f}},dn=function(t,e,n){return function(o,r){var i=o.schema.marks,a=t.altStyle,s=t.altMarks,l=void 0===s?[]:s,d=t.mark,c=e||o.tr,u=!1,p=!1,f=function(){return p=!0};a&&i.style&&(u=ln(i.style,{style:a.name,value:a.value})(o,f,c));var h=[d].concat(l).filter((function(t){return i[t]})).map((function(t){return Qe(o,{mark:t})&&i[t]})).filter((function(t){return t}));return h.length?function(t,e,n,o){var r=e.selection,i=r.$cursor,a=r.ranges;if(o=o||e.tr,i)t.forEach((function(t){t.isInSet(e.storedMarks||i.marks())&&n(o.removeStoredMark(t))}));else{for(var s=function(e){var n=a[e],r=n.$from,i=n.$to;t.forEach((function(t){Xe(o,r.pos,i.pos,t)}))},l=0;l<a.length;l++)s(l);n(o.scrollIntoView())}}(h,o,f,c):u||Ge(i[d],n,c)(o,f),p&&r(c),p}},cn=function(t,e){return function(n,o){var r=n.schema.marks.style,i={style:t.style,value:/^.+$/,newValue:t.value},a=n.tr;e&&a.setMeta("commandName",e),a.setMeta("args",t);var s=n.selection,l=s.empty,d=s.$cursor,c=s.ranges;if(l&&!d||!r||!Ue(n.doc,c,r))return!1;if(d){var u=n.storedMarks||d.marks(),p=r.isInSet(u)?u.find((function(t){return"style"===t.type.name})):null,f={style:null};if(p&&p.attrs.style){var h=ze(p.attrs.style,i);h.changed&&h.style&&(f.style=h.style)}else i.newValue&&(f.style=[i.style]+": "+i.newValue+";");var m=p?Ne.__assign({},p.attrs,f):f;return Object.keys(m).some((function(t){return null!==m[t]}))?o(a.addStoredMark(r.create(m))):o(a.removeStoredMark(r)),!0}return ln(r,i)(n,o,a)}},un=function(t,e){return function(n,o){var r=n.selection.$cursor;if(r){var i=r.parent,a=r.index(),s=n.schema.marks[t.mark],l=i.child(a).marks.find((function(t){return t.type===s})),d=i.childCount,c=r.pos-r.textOffset,u=i.child(a).nodeSize,p=void 0,f=void 0;for(p=a-1;p>=0&&l.isInSet(i.child(p).marks);)u+=f=i.child(p).nodeSize,c-=f,p-=1;for(p=a+1;p<d&&l.isInSet(i.child(p).marks);)u+=i.child(p).nodeSize,p+=1;o(Xe(e||n.tr,c,c+u,l))}else dn(t,e)(n,o)}},pn=function(t,e){var n=t.mark,o=t.attrs;return void 0===e&&(e="link"),function(t,r){var i=t.schema.marks,a=t.tr;e&&(a.setMeta("commandName",e),a.setMeta("args",o));var s=!1,l=function(){return s=!0};if(function(t,e){var n=en(t,e);return 1===n.length&&n[0]?n[0]:null}(t,i[n]))!function(t,e){return function(n,o){var r=n.selection,i=r.$cursor,a=r.from,s=r.to,l=n.schema.marks[t.mark];if(i){var d=i.parent,c=i.index(),u=d.child(c).marks.find((function(t){return t.type===l})),p=d.childCount,f=i.pos-i.textOffset,h=d.child(c).nodeSize,m=void 0,v=void 0;for(m=c-1;m>=0&&u.isInSet(d.child(m).marks);)h+=v=d.child(m).nodeSize,f-=v,m-=1;for(m=c+1;m<p&&u.isInSet(d.child(m).marks);)h+=d.child(m).nodeSize,m+=1;e.removeMark(f,f+h,l),e.addMark(f,f+h,l.create(t.attrs)),o(e)}else e.doc.nodesBetween(a,s,(function(n,r){n.isInline&&l.isInSet(n.marks)&&(e.removeMark(r,r+n.nodeSize,l),e.addMark(r,r+n.nodeSize,l.create(t.attrs)),o(e))}))}}({mark:n,attrs:o},a)(t,l);else{var d=t;Qe(t,{mark:n})&&(un({mark:n,attrs:o},a)(t,l),d=ve.create({doc:a.doc,selection:a.selection})),s?Ge(i[n],o,a)(d,l):dn({mark:n},a,o)(d,l)}return s&&r(a),s}},fn=function(t){return function(e,n){n(e.tr.insertText(t.text,t.from,t.to))}},hn=function(t){return function(e,n){var o=e.schema.nodes.image,r=o.createAndFill(t);Fe(r)(e,(function(e){return n(e.setMeta("commandName","insertImage").setMeta("args",t))}))}},mn=function(t,e,n,o){if(!n.isTextblock)return!1;t.selection.ranges.forEach((function(r){var a=t.steps.length,s=r.$from.pos,l=r.$to.pos;t.doc.nodesBetween(s,l,(function(r,s){if(r.eq(e)&&r.isTextblock&&!r.hasMarkup(n,o)&&function(t,e,n){var o=t.resolve(e),r=o.index();return o.parent.canReplaceWith(r,r+1,n)}(t.doc,t.mapping.slice(a).map(s),n)){t.clearIncompatible(t.mapping.slice(a).map(s,1),n);var l=t.mapping.slice(a),d=l.map(s,1),c=l.map(s+r.nodeSize,1),u=new p(i.from(n.create(o,null,r.marks)),0,0);return t.step(new Tt(d,c,d+1,c-1,u,1,!0)),!1}}))}))},vn=function(t,e){void 0===e&&(e={blocksInSelection:!1});var n=t.doc,o=t.selection,r=o.$from,i=o.ranges,a=e.blocksInSelection,s=[],l=o instanceof ie?o.node:void 0;return l?l.isBlock?(s.push(l),l.nodesBetween(0,l.content.size,(function(t){t.isBlock&&s.push(t)}))):!a&&r.parent&&r.parent.isBlock&&s.push(r.parent):i.forEach((function(t){var e=t.$from.pos,o=t.$to.pos;n.nodesBetween(e,o,(function(t,n,r,i){t.isBlock&&(!a||n>=e&&n+t.content.size+2<=o)&&s.push(t)}))})),s},gn=function(t,e){return function(n,o){var r=vn(n),i=n.schema.nodes,a=n.tr;a.setMeta("commandName",e),a.setMeta("args",{value:t}),r.forEach((function(e){if(e.type.isTextblock)if("p"===t){var n=e.attrs,o=n.level,r=Ne.__rest(n,["level"]);mn(a,e,i.paragraph,r)}else if(/^h[1-6]$/i.test(t)){o=parseInt(t.substr(1),10);mn(a,e,i.heading,Ne.__assign({},e.attrs,{level:o}))}else if("blockquote"===t){var s=e.attrs;o=s.level,r=Ne.__rest(s,["level"]);mn(a,e,i.blockquote,r)}}));var s=a.docChanged;return s&&o(a.scrollIntoView()),s}},yn=function(t,e){void 0===e&&(e={blocksInSelection:!0});var n=t.doc,o=t.selection,r=e.blocksInSelection,i=e.blockNodeType;vn({doc:n,selection:o},{blocksInSelection:r}).filter((function(t){return t.isTextblock})).forEach((function(e){var n=e.attrs||{},o=n.style,r=void 0===o?"":o,a=n.class,s=void 0===a?"":a,l=Ne.__rest(n,["style","class"]),d=i||e.type;(r||s||d!==e.type)&&mn(t,e,d,l)}))},bn=function(t){var e=vn(t),n=t.schema.nodes,o=[];return e.forEach((function(t){t.type===n.paragraph?o.push("p"):t.type===n.heading?o.push("h"+t.attrs.level):t.type===n.blockquote&&n.blockquote.isTextblock&&o.push("blockquote")})),o},wn=function(t,e){var n,o,r=t.attrs.style;r&&e.forEach((function(t){o={style:t.name,value:/^.+$/,newValue:t.value},n=ze(r,o),r=n.changed?n.style:r}));return r=r||e.reduce((function(t,e){return(t&&e.value?t+" ":"")+e.value?e.name+": "+e.value+";":""}),""),Object.assign({},t.attrs,{style:r||null})},kn=function(t,e){var n=t.selection,o=n.from,r=n.to,i=!1;return t.doc.nodesBetween(o,r,(function(t){return!(i=i||t.type===e)})),i},_n=function(t){var e=bn(t);return 1===new Set(e).size?e[0]:null},Cn=function(t){return{tag:_n(t)||""}},xn=function(t,e){return function(n,o){var r=vn(n),i=n.tr;i.setMeta("commandName",e),r.forEach((function(e){if(e.type.isTextblock){var n={},o=t.find((function(t){return t.node===e.type.name}));o&&(n=wn(e,o.style)),mn(i,e,e.type,n)}}));var a=i.docChanged;return a&&o(i.scrollIntoView()),a}},Sn=function(t,e){var n=vn(t),o=!1;return n.forEach((function(t){if(!o&&t.type.isTextblock&&t.attrs.style){var n=e.find((function(e){return e.node===t.type.name}));n&&(o=n.style.every((function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)})))}})),o},En=function(t){return void 0===t&&(t={blocksInSelection:!0}),function(e,n){var o=e.tr,r=t.blocksInSelection,i=t.blockNodeType,a=(t.exceptMarks||[e.schema.marks.link]).filter(Boolean);Ze(o,{except:a}),yn(o,{blocksInSelection:r,blockNodeType:i});var s=o.docChanged;return s&&n&&n(o),s}},Tn=["ol",0],Mn=["ul",0],Dn=["li",0],On={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?Tn:["ol",{start:t.attrs.order},0]}},An={parseDOM:[{tag:"ul"}],toDOM:function(){return Mn}},In={parseDOM:[{tag:"li"}],toDOM:function(){return Dn},defining:!0};function Bn(t,e){var n={};for(var o in t)n[o]=t[o];for(var r in e)n[r]=e[r];return n}function Nn(t,e,n){return t.append({ordered_list:Bn(On,{content:"list_item+",group:n}),bullet_list:Bn(An,{content:"list_item+",group:n}),list_item:Bn(In,{content:e})})}function zn(t,e){return function(n,o){var r=n.selection,a=r.$from,s=r.$to,l=a.blockRange(s),d=!1,c=l;if(!l)return!1;if(l.depth>=2&&a.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==a.index(l.depth-1))return!1;var u=n.doc.resolve(l.start-2);c=new E(u,u,l.depth),l.endIndex<l.parent.childCount&&(l=new E(a,n.doc.resolve(s.end(l.depth)),l.depth)),d=!0}var f=At(c,t,e,l);return!!f&&(o&&o(function(t,e,n,o,r){for(var a=i.empty,s=n.length-1;s>=0;s--)a=i.from(n[s].type.create(n[s].attrs,a));t.step(new Tt(e.start-(o?2:0),e.end,e.start,e.end,new p(a,0,0),n.length,!0));for(var l=0,d=0;d<n.length;d++)n[d].type==r&&(l=d+1);for(var c=n.length-l,u=e.start+n.length-(o?2:0),f=e.parent,h=e.startIndex,m=e.endIndex,v=!0;h<m;h++,v=!1)!v&&Bt(t.doc,u,c)&&(t.split(u,c),u+=2*c),u+=f.child(h).nodeSize;return t}(n.tr,l,f,d,t).scrollIntoView()),!0)}}function Rn(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=o.node;if(s&&s.isBlock||r.depth<2||!r.sameParent(a))return!1;var l=r.node(-1);if(l.type!=t)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(2==r.depth||r.node(-3).type!=t||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){for(var d=i.empty,c=r.index(-1)?1:r.index(-2)?2:3,u=r.depth-c;u>=r.depth-3;u--)d=i.from(r.node(u).copy(d));var f=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;d=d.append(i.from(t.createAndFill()));var h=r.before(r.depth-(c-1)),m=e.tr.replace(h,r.after(-f),new p(d,4-c,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(t,e){if(v>-1)return!1;t.isTextblock&&0==t.content.size&&(v=e+1)})),v>-1&&m.setSelection(e.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=a.pos==r.end()?l.contentMatchAt(0).defaultType:null,y=e.tr.delete(r.pos,a.pos),b=g&&[null,{type:g}];return!!Bt(y.doc,r.pos,2,b)&&(n&&n(y.split(r.pos,2,b).scrollIntoView()),!0)}}function Pn(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=r.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));return!!s&&(!n||(r.node(s.depth-1).type==t?function(t,e,n,o){var r=t.tr,a=o.end,s=o.$to.end(o.depth);a<s&&(r.step(new Tt(a-1,s,a,s,new p(i.from(n.create(null,o.parent.copy())),1,0),1,!0)),o=new E(r.doc.resolve(o.$from.pos),r.doc.resolve(s),o.depth));return e(r.lift(o,Ot(o)).scrollIntoView()),!0}(e,n,t,s):function(t,e,n){for(var o=t.tr,r=n.parent,a=n.end,s=n.endIndex-1,l=n.startIndex;s>l;s--)a-=r.child(s).nodeSize,o.delete(a-1,a+1);var d=o.doc.resolve(n.start),c=d.nodeAfter;if(o.mapping.map(n.end)!=n.start+d.nodeAfter.nodeSize)return!1;var u=0==n.startIndex,f=n.endIndex==r.childCount,h=d.node(-1),m=d.index(-1);if(!h.canReplace(m+(u?0:1),m+1,c.content.append(f?i.empty:i.from(r))))return!1;var v=d.pos,g=v+c.nodeSize;return o.step(new Tt(v-(u?1:0),g+(f?1:0),v+1,g-1,new p((u?i.empty:i.from(r.copy(i.empty))).append(f?i.empty:i.from(r.copy(i.empty))),u?0:1,f?0:1),u?0:1)),e(o.scrollIntoView()),!0}(e,n,s)))}}function Ln(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=r.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));if(!s)return!1;var l=s.startIndex;if(0==l)return!1;var d=s.parent,c=d.child(l-1);if(c.type!=t)return!1;if(n){var u=c.lastChild&&c.lastChild.type==d.type,f=i.from(u?t.create():null),h=new p(i.from(t.create(null,i.from(d.type.create(null,f)))),u?3:1,0),m=s.start,v=s.end;n(e.tr.step(new Tt(m-(u?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}var Fn={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},$n={listType:Fn.orderedList,types:Ne.__assign({},Fn)},Vn={listType:Fn.bulletList,types:Ne.__assign({},Fn)},jn={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:Ne.__assign({},Fn)},Wn={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:Ne.__assign({},Fn)};function Hn(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function qn(t,e,n){var o=t.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",t):o.parentOffset>0))return!1;var r=Un(o);if(!r){var i=o.blockRange(),a=i&&Ot(i);return null!=a&&(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}var s=r.nodeBefore;if(!s.type.spec.isolating&&uo(t,r,e))return!0;if(0==o.parent.content.size&&(Jn(s,"end")||ie.isSelectable(s))){var l=jt(t.doc,o.before(),o.after(),p.empty);if(l.slice.size<l.to-l.from){if(e){var d=t.tr.step(l);d.setSelection(Jn(s,"end")?te.findFrom(d.doc.resolve(d.mapping.map(r.pos,-1)),-1):ie.create(d.doc,r.pos-s.nodeSize)),e(d.scrollIntoView())}return!0}}return!(!s.isAtom||r.depth!=o.depth-1)&&(e&&e(t.tr.delete(r.pos-s.nodeSize,r.pos).scrollIntoView()),!0)}function Jn(t,e,n){for(;t;t="start"==e?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(n&&1!=t.childCount)return!1}return!1}function Kn(t,e,n){var o=t.selection,r=o.$head,i=r;if(!o.empty)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Un(r)}var a=i&&i.nodeBefore;return!(!a||!ie.isSelectable(a))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)}function Un(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Gn(t,e,n){var o=t.selection.$cursor;if(!o||(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size))return!1;var r=Yn(o);if(!r)return!1;var i=r.nodeAfter;if(uo(t,r,e))return!0;if(0==o.parent.content.size&&(Jn(i,"start")||ie.isSelectable(i))){var a=jt(t.doc,o.before(),o.after(),p.empty);if(a.slice.size<a.to-a.from){if(e){var s=t.tr.step(a);s.setSelection(Jn(i,"start")?te.findFrom(s.doc.resolve(s.mapping.map(r.pos)),1):ie.create(s.doc,s.mapping.map(r.pos))),e(s.scrollIntoView())}return!0}}return!(!i.isAtom||r.depth!=o.depth-1)&&(e&&e(t.tr.delete(r.pos,r.pos+i.nodeSize).scrollIntoView()),!0)}function Xn(t,e,n){var o=t.selection,r=o.$head,i=r;if(!o.empty)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Yn(r)}var a=i&&i.nodeAfter;return!(!a||!ie.isSelectable(a))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos)).scrollIntoView()),!0)}function Yn(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Zn(t,e){var n,o=t.selection,r=o instanceof ie;if(r){if(o.node.isTextblock||!Nt(t.doc,o.from))return!1;n=o.from}else if(null==(n=Rt(t.doc,o.from,-1)))return!1;if(e){var i=t.tr.join(n);r&&i.setSelection(ie.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0}function Qn(t,e){var n,o=t.selection;if(o instanceof ie){if(o.node.isTextblock||!Nt(t.doc,o.to))return!1;n=o.to}else if(null==(n=Rt(t.doc,o.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}function to(t,e){var n=t.selection,o=n.$from,r=n.$to,i=o.blockRange(r),a=i&&Ot(i);return null!=a&&(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}function eo(t,e){var n=t.selection,o=n.$head,r=n.$anchor;return!(!o.parent.type.spec.code||!o.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function no(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function oo(t,e){var n=t.selection,o=n.$head,r=n.$anchor;if(!o.parent.type.spec.code||!o.sameParent(r))return!1;var i=o.node(-1),a=o.indexAfter(-1),s=no(i.contentMatchAt(a));if(!i.canReplaceWith(a,a,s))return!1;if(e){var l=o.after(),d=t.tr.replaceWith(l,l,s.createAndFill());d.setSelection(te.near(d.doc.resolve(l),1)),e(d.scrollIntoView())}return!0}function ro(t,e){var n=t.selection,o=n.$from,r=n.$to;if(n instanceof se||o.parent.inlineContent||r.parent.inlineContent)return!1;var i=no(r.parent.contentMatchAt(r.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var a=(!o.parentOffset&&r.index()<r.parent.childCount?o:r).pos,s=t.tr.insert(a,i.createAndFill());s.setSelection(oe.create(s.doc,a+1)),e(s.scrollIntoView())}return!0}function io(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Bt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var r=n.blockRange(),i=r&&Ot(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}function ao(t,e){var n=t.selection,o=n.$from,r=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!o.parentOffset||!Bt(t.doc,o.pos))&&(e&&e(t.tr.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;if(e){var i=r.parentOffset==r.parent.content.size,a=t.tr;(t.selection instanceof oe||t.selection instanceof se)&&a.deleteSelection();var s=0==o.depth?null:no(o.node(-1).contentMatchAt(o.indexAfter(-1))),l=i&&s?[{type:s}]:null,d=Bt(a.doc,a.mapping.map(o.pos),1,l);if(l||d||!Bt(a.doc,a.mapping.map(o.pos),1,s&&[{type:s}])||(l=[{type:s}],d=!0),d&&(a.split(a.mapping.map(o.pos),1,l),!i&&!o.parentOffset&&o.parent.type!=s)){var c=a.mapping.map(o.before()),u=a.doc.resolve(c);o.node(-1).canReplaceWith(u.index(),u.index()+1,s)&&a.setNodeMarkup(a.mapping.map(o.before()),s)}e(a.scrollIntoView())}return!0}function so(t,e){return ao(t,e&&function(n){var o=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();o&&n.ensureMarks(o),e(n)})}function lo(t,e){var n,o=t.selection,r=o.$from,i=o.to,a=r.sharedDepth(i);return 0!=a&&(n=r.before(a),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}function co(t,e){return e&&e(t.tr.setSelection(new se(t.doc))),!0}function uo(t,e,n){var o,r,a=e.nodeBefore,s=e.nodeAfter;if(a.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){var o=e.nodeBefore,r=e.nodeAfter,i=e.index();return!!(o&&r&&o.type.compatibleContent(r.type))&&(!o.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(i,i+1)||!r.isTextblock&&!Nt(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,o.type,o.contentMatchAt(o.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(r=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&r.matchType(o[0]||s.type).validEnd){if(n){for(var d=e.pos+s.nodeSize,c=i.empty,u=o.length-1;u>=0;u--)c=i.from(o[u].create(null,c));c=i.from(a.copy(c));var f=t.tr.step(new Tt(e.pos-1,d,e.pos,d,new p(c,1,0),o.length,!0)),h=d+2*o.length;Nt(f.doc,h)&&f.join(h),n(f.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Ot(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(l&&Jn(s,"start",!0)&&Jn(a,"end")){for(var y=a,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;for(var w=s,k=1;!w.isTextblock;w=w.firstChild)k++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){for(var _=i.empty,C=b.length-1;C>=0;C--)_=i.from(b[C].copy(_));n(t.tr.step(new Tt(e.pos-b.length,e.pos+s.nodeSize,e.pos+k,e.pos+s.nodeSize-k,new p(_,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function po(t){return function(e,n){for(var o=e.selection,r=t<0?o.$from:o.$to,i=r.depth;r.node(i).isInline;){if(!i)return!1;i--}return!!r.node(i).isTextblock&&(n&&n(e.tr.setSelection(oe.create(e.doc,t<0?r.start(i):r.end(i)))),!0)}}var fo=po(-1),ho=po(1);function mo(t,e){return function(n,o){var r=n.selection,i=r.$from,a=r.$to,s=i.blockRange(a),l=s&&At(s,t,e);return!!l&&(o&&o(n.tr.wrap(s,l).scrollIntoView()),!0)}}function vo(t,e){return function(n,o){var r=n.selection,i=r.from,a=r.to,s=!1;return n.doc.nodesBetween(i,a,(function(o,r){if(s)return!1;if(o.isTextblock&&!o.hasMarkup(t,e))if(o.type==t)s=!0;else{var i=n.doc.resolve(r),a=i.index();s=i.parent.canReplaceWith(a,a+1,t)}})),!!s&&(o&&o(n.tr.setBlockType(i,a,t,e).scrollIntoView()),!0)}}function go(t,e){return function(n,o){var r=n.selection,i=r.empty,a=r.$cursor,s=r.ranges;if(i&&!a||!function(t,e,n){for(var o=function(o){var r=e[o],i=r.$from,a=r.$to,s=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},r=0;r<e.length;r++){var i=o(r);if(i)return i.v}return!1}(n.doc,s,t))return!1;if(o)if(a)t.isInSet(n.storedMarks||a.marks())?o(n.tr.removeStoredMark(t)):o(n.tr.addStoredMark(t.create(e)));else{for(var l=!1,d=n.tr,c=0;!l&&c<s.length;c++){var u=s[c],p=u.$from,f=u.$to;l=n.doc.rangeHasMark(p.pos,f.pos,t)}for(var h=0;h<s.length;h++){var m=s[h],v=m.$from,g=m.$to;if(l)d.removeMark(v.pos,g.pos,t);else{var y=v.pos,b=g.pos,w=v.nodeAfter,k=g.nodeBefore,_=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,C=k&&k.isText?/\s*$/.exec(k.text)[0].length:0;y+_<b&&(y+=_,b-=C),d.addMark(y,b,t.create(e))}}o(d.scrollIntoView())}return!0}}function yo(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,o,r){return t(n,o&&function(t,e){return function(n){if(!n.isGeneric)return t(n);for(var o=[],r=0;r<n.mapping.maps.length;r++){for(var i=n.mapping.maps[r],a=0;a<o.length;a++)o[a]=i.map(o[a]);i.forEach((function(t,e,n,r){return o.push(n,r)}))}for(var s=[],l=0;l<o.length;l+=2)for(var d=o[l],c=o[l+1],u=n.doc.resolve(d),p=u.sharedDepth(c),f=u.node(p),h=u.indexAfter(p),m=u.after(p+1);m<=c;++h){var v=f.maybeChild(h);if(!v)break;if(h&&-1==s.indexOf(m)){var g=f.child(h-1);g.type==v.type&&e(g,v)&&s.push(m)}m+=v.nodeSize}s.sort((function(t,e){return t-e}));for(var y=s.length-1;y>=0;y--)Nt(n.doc,s[y])&&n.join(s[y]);t(n)}}(o,e),r)}}function bo(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,o){for(var r=0;r<t.length;r++)if(t[r](e,n,o))return!0;return!1}}var wo=bo(Hn,qn,Kn),ko=bo(Hn,Gn,Xn),_o={Enter:bo(eo,ro,io,ao),"Mod-Enter":oo,Backspace:wo,"Mod-Backspace":wo,"Shift-Backspace":wo,Delete:ko,"Mod-Delete":ko,"Mod-a":co},Co={"Ctrl-h":_o.Backspace,"Alt-Backspace":_o["Mod-Backspace"],"Ctrl-d":_o.Delete,"Ctrl-Alt-Backspace":_o["Mod-Delete"],"Alt-Delete":_o["Mod-Delete"],"Alt-d":_o["Mod-Delete"],"Ctrl-a":fo,"Ctrl-e":ho};for(var xo in _o)Co[xo]=_o[xo];_o.Home=fo,_o.End=ho;var So=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?Co:_o,Eo=function(t,e){return mo(t.schema.nodes.blockquote)(t,e)},To=function(t,e){var n=t.selection,o=n.$from,r=n.$to,i=t.schema.nodes.blockquote,a=t.doc,s=-1,l=o.blockRange(r);l&&a.nodesBetween(l.start,l.end,(function(t,e,n,o){t.type===i&&(s=e)}));var d=-1!==s;return e&&d&&e(t.tr.lift(l,a.resolve(s).depth)),d},Mo=function(t,e,n){return function(o,r){var i=vn(o),a=o.tr;a.setMeta("commandName",e),i.forEach((function(e){if(e.type.isTextblock){var o=void 0,r=t.find((function(t){return t.node===e.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s={name:i,value:r.step>0?""+r.step+r.unit:""};if(e.attrs.style){var l=new RegExp(i+":\\s?(\\d+)"+r.unit,"i"),d=e.attrs.style.match(l);if(d){var c=parseFloat(d[1])+r.step;c=c<=0?"":c,s.value=""+c+(c?r.unit:"")}}o=wn(e,[s])}o&&mn(a,e,e.type,o)}}));var s=a.docChanged;return s&&r(a.scrollIntoView()),s}},Do=function(t,e,n){var o=vn(t),r=!1;return o.forEach((function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var o=e.find((function(e){return e.node===t.type.name}));if(o){var i="rtl"===n?o.rtlStyle:o.style,a=new RegExp(i+":\\s?\\d+"+o.unit,"i");r=a.test(t.attrs.style)}}})),r},Oo=function(t,e){return Ln(e)(t)},Ao=function(t,e){var n=t.schema.nodes[e.listsTypes.listItem],o=t.schema.nodes[e.listsTypes.orderedList],r=t.schema.nodes[e.listsTypes.bulletList],i=!!Le(o,2)(t.selection),a=!!Le(r,2)(t.selection);return(i||a)&&Pn(n)(t)},Io=function(t,e){var n=t.schema.nodes,o=n[jn.listsTypes.listItem];return(Do(t,e.nodes)||jn.nodes.some((function(e){return n[e.node]&&kn(t,n[e.node])})))&&!kn(t,o)},Bo=function(t,e){var n=t.schema.nodes[jn.listsTypes.listItem],o=Io(t,jn);Oo(t,n)?Ln(n)(t,e):o&&Mo(jn.nodes)(t,e)},No=function(t,e){var n=t.schema.nodes,o=n[Wn.listsTypes.listItem],r=Io(t,Wn);kn(t,n.blockquote)?To(t,e):Ao(t,Wn)?Pn(o)(t,e):r&&Mo(Wn.nodes)(t,e)},zo=function(t,e,n){for(var o=e.depth,r=t.nodes[n.bulletList],i=t.nodes[n.orderedList],a=t.nodes[n.listItem],s=e.depth;s>0;s--){var l=e.node(s);if(l.type!==r&&l.type!==i||(o=s),l.type!==r&&l.type!==i&&l.type!==a)break}return o-1};function Ro(t){return function(e,n,o){if(!o)return!1;var r=(e=o.state).schema.nodes[t.listType],i=e.selection,a=i.$from,s=i.$to,l=a.node(-2),d=a.node(-3),c=function(t,e,n,o){return 0===function(t,e,n){var o=Array(),r=function(t,e){var n=["blockquote","bulletList","orderedList"];if(1===e.depth)return e;var o=e.node(e.depth),r=e;for(;e.depth>=1;)e=t.resolve(e.before(e.depth)),(o=e.node(e.depth))&&-1!==n.indexOf(o.type.name)&&(r=e);return r}(t,e).depth,i=t.resolve(e.start(r));for(;i.pos<=n.start(n.depth);){var a=Math.min(i.depth,r),s=i.node(a);if(s&&o.push(s),0===a)break;var l=t.resolve(i.after(a));if(l.start(a)>=t.nodeSize-2)break;l.depth!==i.depth&&(l=t.resolve(l.pos+2)),i=l.depth?t.resolve(l.start(l.depth)):t.resolve(l.end(l.depth))}return o}(t,e,n).filter((function(t){return t.type!==o})).length}(e.doc,a,s,r);return(l&&l.type===r||d&&d.type===r)&&c?Lo(t)(e,n):(c||(Lo(t)(e,n),e=o.state),function(t,e){void 0===e&&(e={});return yo(zn(t,e),(function(e,n){return e.type===n.type&&e.type===t}))}(r,t.listAttrs)(e,n))}}function Po(t,e,n,o){var r=o||t.schema.nodes.listItem,a=e.$from,s=e.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type===r}));if(!l||l.depth<2||a.node(l.depth-1).type!==r)return n;var d=l.end,c=s.end(l.depth);return d<c&&(n.step(new Tt(d-1,c,d,c,new p(i.from(r.create(void 0,l.parent.copy())),1,0),1,!0)),l=new E(n.doc.resolve(a.pos),n.doc.resolve(c),l.depth)),n.lift(l,Ot(l)).scrollIntoView()}function Lo(t){return function(e,n){var o=e.tr,r=e.selection,i=r.$from,a=r.$to;return o.doc.nodesBetween(i.pos,a.pos,(function(n,r){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var i=new ie(o.doc.resolve(o.mapping.map(r))),a=i.$from.blockRange(i.$to);if(!a||i.$from.parent.type!==e.schema.nodes[t.listItem])return!1;var s=a&&Ot(a);if(null==s)return!1;o.lift(a,s)}})),n&&n(o),!0}}var Fo=/list\-style\-type:\s?([\w-]+)/,$o=function(t){var e=t.style||"",n=Fo.exec(e);return n&&n[1]||""},Vo=function(t,e,n,o,r){var i=o.listType,a=o.listAttrs,s=void 0===a?{style:null}:a,l=t.selection,d=l.$from.node(l.$from.depth-2),c=l.$to.node(l.$to.depth-2);if(d&&d.type.name===i&&$o(d.attrs)===$o(s)&&c&&c.type.name===i&&$o(c.attrs)===$o(s)){var u=n.state.schema.nodes,p={bulletList:u[o.bulletList],orderedList:u[o.orderedList],listItem:u[o.listItem]},f=function(t,e){for(var n,o=e.bulletList,r=e.orderedList,i=e.listItem,a=t.depth-1;a>0;a--){var s=t.node(a);if(s.type!==o&&s.type!==r||(n=a),s.type!==o&&s.type!==r&&s.type!==i)break}return n}(l.$to,p),h=function(t,e,n,o,r,i){i||(i=t.schema.nodes.listItem);var a=!1;return r.doc.nodesBetween(e,n,(function(n,s){if(!a&&n.type===i&&s>e){a=!0;for(var l=o+3;l>o+2;){var d=r.doc.resolve(r.mapping.map(s));l=d.depth;var c=r.doc.resolve(r.mapping.map(s+n.textContent.length)),u=new oe(d,c);r=Po(t,u,r,i)}}})),r}(t,l.$to.pos,l.$to.end(f),f,n.state.tr,p.listItem);return(h=function(t,e,n){var o=t.selection,r=o.from,i=o.to,a=t.schema.nodes,s=a.paragraph,l=a.heading,d=[];e.doc.nodesBetween(r,i,(function(t,e){t.type!==s&&t.type!==l||d.push({node:t,pos:e})}));for(var c=d.length-1;c>=0;c--){var u=d[c],p=e.doc.resolve(e.mapping.map(u.pos));if(p.depth>0){var f=void 0;f=u.node.textContent&&u.node.textContent.length>0?e.doc.resolve(e.mapping.map(u.pos+u.node.textContent.length)):e.doc.resolve(e.mapping.map(u.pos+1));var h=p.blockRange(f);h&&e.lift(h,zo(t.schema,p,n))}}return e}(t,h,o)).setMeta("commandName",r),e(h),!0}return Ro(o)(t,e,n)};function jo(t,e,n){return Vo(t,e,n,Ne.__assign({listType:Vn.listType},Vn.types))}function Wo(t,e,n){return Vo(t,e,n,Ne.__assign({listType:$n.listType},$n.types))}for(var Ho=function(t,e){return{name:t,value:e}},qo=[{node:"paragraph",style:[Ho("text-align","left")]},{node:"heading",style:[Ho("text-align","left")]}],Jo=[{node:"paragraph",style:[Ho("text-align","right")]},{node:"heading",style:[Ho("text-align","right")]}],Ko=[{node:"paragraph",style:[Ho("text-align","center")]},{node:"heading",style:[Ho("text-align","center")]}],Uo=[{node:"paragraph",style:[Ho("text-align","justify")]},{node:"heading",style:[Ho("text-align","justify")]}],Go=[{node:"paragraph",style:[Ho("text-align","")]},{node:"heading",style:[Ho("text-align","")]}],Xo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Yo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Zo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),tr="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),er="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),nr="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),or=Zo&&(er||+Zo[1]<57)||tr&&er,rr=0;rr<10;rr++)Xo[48+rr]=Xo[96+rr]=String(rr);for(rr=1;rr<=24;rr++)Xo[rr+111]="F"+rr;for(rr=65;rr<=90;rr++)Xo[rr]=String.fromCharCode(rr+32),Yo[rr]=String.fromCharCode(rr);for(var ir in Xo)Yo.hasOwnProperty(ir)||(Yo[ir]=Xo[ir]);var ar="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function sr(t){var e,n,o,r,i=t.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var l=i[s];if(/^(cmd|meta|m)$/i.test(l))r=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))o=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);ar?r=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),r&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function lr(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function dr(t){return new be({props:{handleKeyDown:cr(t)}})}function cr(t){var e=function(t){var e=Object.create(null);for(var n in t)e[sr(n)]=t[n];return e}(t);return function(t,n){var o,r=function(t){var e=!(or&&(t.ctrlKey||t.altKey||t.metaKey)||(Qo||nr)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?Yo:Xo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==r.length&&" "!=r,a=e[lr(r,n,!i)];if(a&&a(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||r.charCodeAt(0)>127)&&(o=Xo[n.keyCode])&&o!=r){var s=e[lr(o,n,!0)];if(s&&s(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var l=e[lr(r,n,!0)];if(l&&l(t.state,t.dispatch,t))return!0}return!1}}var ur={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var pr=/Edge\/(\d+)/.exec(navigator.userAgent),fr=/MSIE \d/.test(navigator.userAgent),hr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mr=ur.ie=!!(fr||hr||pr);ur.ie_version=fr?document.documentMode||6:hr?+hr[1]:pr?+pr[1]:null,ur.gecko=!mr&&/gecko\/(\d+)/i.test(navigator.userAgent),ur.gecko_version=ur.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var vr=!mr&&/Chrome\/(\d+)/.exec(navigator.userAgent);ur.chrome=!!vr,ur.chrome_version=vr&&+vr[1],ur.safari=!mr&&/Apple Computer/.test(navigator.vendor),ur.ios=ur.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),ur.mac=ur.ios||/Mac/.test(navigator.platform),ur.android=/Android \d/.test(navigator.userAgent),ur.webkit="webkitFontSmoothing"in document.documentElement.style,ur.webkit_version=ur.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var gr=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},yr=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},br=null,wr=function(t,e,n){var o=br||(br=document.createRange());return o.setEnd(t,null==n?t.nodeValue.length:n),o.setStart(t,e||0),o},kr=function(t,e,n,o){return n&&(Cr(t,e,n,o,-1)||Cr(t,e,n,o,1))},_r=/^(img|br|input|textarea|hr)$/i;function Cr(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:xr(t))){var i=t.parentNode;if(1!=i.nodeType||Sr(t)||_r.test(t.nodeName)||"false"==t.contentEditable)return!1;e=gr(t)+(r<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(r<0?-1:0)]).contentEditable)return!1;e=r<0?xr(t):0}}}function xr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Sr(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Er=function(t){var e=t.isCollapsed;return e&&ur.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Tr(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Mr(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Dr(t,e){return"number"==typeof t?t:t[e]}function Or(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function Ar(t,e,n){for(var o=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,a=n||t.dom;a;a=yr(a))if(1==a.nodeType){var s=a==i.body||1!=a.nodeType,l=s?Mr(i):Or(a),d=0,c=0;if(e.top<l.top+Dr(o,"top")?c=-(l.top-e.top+Dr(r,"top")):e.bottom>l.bottom-Dr(o,"bottom")&&(c=e.bottom-l.bottom+Dr(r,"bottom")),e.left<l.left+Dr(o,"left")?d=-(l.left-e.left+Dr(r,"left")):e.right>l.right-Dr(o,"right")&&(d=e.right-l.right+Dr(r,"right")),d||c)if(s)i.defaultView.scrollBy(d,c);else{var u=a.scrollLeft,p=a.scrollTop;c&&(a.scrollTop+=c),d&&(a.scrollLeft+=d);var f=a.scrollLeft-u,h=a.scrollTop-p;e={left:e.left-f,top:e.top-h,right:e.right-f,bottom:e.bottom-h}}if(s)break}}function Ir(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=yr(t));return e}function Br(t,e){for(var n=0;n<t.length;n++){var o=t[n],r=o.dom,i=o.top,a=o.left;r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Nr=null;function zr(t,e){for(var n,o,r=2e8,i=0,a=e.top,s=e.top,l=t.firstChild,d=0;l;l=l.nextSibling,d++){var c=void 0;if(1==l.nodeType)c=l.getClientRects();else{if(3!=l.nodeType)continue;c=wr(l).getClientRects()}for(var u=0;u<c.length;u++){var p=c[u];if(p.top<=a&&p.bottom>=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);var f=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(f<r){n=l,r=f,o=f&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==l.nodeType&&f&&(i=d+(e.left>=(p.left+p.right)/2?1:0));continue}}!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=d+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,o=document.createRange(),r=0;r<n;r++){o.setEnd(t,r+1),o.setStart(t,r);var i=Lr(o,1);if(i.top!=i.bottom&&Rr(e,i))return{node:t,offset:r+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,o):!n||r&&1==n.nodeType?{node:t,offset:i}:zr(n,o)}function Rr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Pr(t,e){var n,o,r,i,a=t.dom.ownerDocument;if(a.caretPositionFromPoint)try{var s=a.caretPositionFromPoint(e.left,e.top);s&&(r=(n=s).offsetNode,i=n.offset)}catch(t){}if(!r&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(e.left,e.top);l&&(r=(o=l).startContainer,i=o.startOffset)}var d,c=(t.root.elementFromPoint?t.root:a).elementFromPoint(e.left,e.top+1);if(!c||!t.dom.contains(1!=c.nodeType?c.parentNode:c)){var u=t.dom.getBoundingClientRect();if(!Rr(e,u))return null;if(!(c=function t(e,n,o){var r=e.childNodes.length;if(r&&o.top<o.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(n.top-o.top)/(o.bottom-o.top))-2)),a=i;;){var s=e.childNodes[a];if(1==s.nodeType)for(var l=s.getClientRects(),d=0;d<l.length;d++){var c=l[d];if(Rr(n,c))return t(s,n,c)}if((a=(a+1)%r)==i)break}return e}(t.dom,e,u)))return null}if(ur.safari)for(var p=c;r&&p;p=yr(p))p.draggable&&(r=i=null);if(c=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(c,e),r){if(ur.gecko&&1==r.nodeType&&(i=Math.min(i,r.childNodes.length))<r.childNodes.length){var f,h=r.childNodes[i];"IMG"==h.nodeName&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}r==t.dom&&i==r.childNodes.length-1&&1==r.lastChild.nodeType&&e.top>r.lastChild.getBoundingClientRect().bottom?d=t.state.doc.content.size:0!=i&&1==r.nodeType&&"BR"==r.childNodes[i-1].nodeName||(d=function(t,e,n,o){for(var r=-1,i=e;i!=t.dom;){var a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>o.left||s.top>o.top)r=a.posBefore;else{if(!(s.right<o.left||s.bottom<o.top))break;r=a.posAfter}}i=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,n)}(t,r,i,e))}null==d&&(d=function(t,e,n){var o=zr(e,n),r=o.node,i=o.offset,a=-1;if(1==r.nodeType&&!r.firstChild){var s=r.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,a)}(t,c,e));var m=t.docView.nearestDesc(c,!0);return{pos:d,inside:m?m.posAtStart-m.border:-1}}function Lr(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Fr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $r(t,e,n){var o=t.docView.domFromPos(e,n<0?-1:1),r=o.node,i=o.offset,a=ur.webkit||ur.gecko;if(3==r.nodeType){if(!a||!Fr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){var s=i,l=i,d=n<0?1:-1;return n<0&&!i?(l++,d=-1):n>=0&&i==r.nodeValue.length?(s--,d=1):n<0?s--:l++,Vr(Lr(wr(r,s,l),d),d<0)}var c=Lr(wr(r,i,i),n);if(ur.gecko&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){var u=Lr(wr(r,i-1,i-1),-1);if(u.top==c.top){var p=Lr(wr(r,i,i+1),-1);if(p.top!=c.top)return Vr(p,p.left<u.left)}}return c}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==xr(r))){var f=r.childNodes[i-1];if(1==f.nodeType)return jr(f.getBoundingClientRect(),!1)}if(i<xr(r)){var h=r.childNodes[i];if(1==h.nodeType)return jr(h.getBoundingClientRect(),!0)}return jr(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==xr(r))){var m=r.childNodes[i-1],v=3==m.nodeType?wr(m,xr(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return Vr(Lr(v,1),!1)}if(i<xr(r)){for(var g=r.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?wr(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return Vr(Lr(y,-1),!0)}return Vr(Lr(3==r.nodeType?wr(r):r,-n),n>=0)}function Vr(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function jr(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Wr(t,e,n){var o=t.state,r=t.root.activeElement;o!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),r!=t.dom&&r&&r.focus()}}var Hr=/[\u0590-\u08ac]/;var qr=null,Jr=null,Kr=!1;function Ur(t,e,n){return qr==e&&Jr==n?Kr:(qr=e,Jr=n,Kr="up"==n||"down"==n?function(t,e,n){var o=e.selection,r="up"==n?o.$from:o.$to;return Wr(t,e,(function(){for(var e=t.docView.domFromPos(r.pos,"up"==n?-1:1).node;;){var o=t.docView.nearestDesc(e,!0);if(!o)break;if(o.node.isBlock){e=o.dom;break}e=o.dom.parentNode}for(var i=$r(t,r.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=wr(a,0,a.nodeValue.length).getClientRects()}for(var l=0;l<s.length;l++){var d=s[l];if(d.bottom>d.top+1&&("up"==n?i.top-d.top>2*(d.bottom-i.top):d.bottom-i.bottom>2*(i.bottom-d.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var o=e.selection.$head;if(!o.parent.isTextblock)return!1;var r=o.parentOffset,i=!r,a=r==o.parent.content.size,s=t.root.getSelection();return Hr.test(o.parent.textContent)&&s.modify?Wr(t,e,(function(){var e=s.getRangeAt(0),r=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(o.depth?t.docView.domAfterPos(o.before()):t.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||r==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(e),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(t,e,n))}var Gr=function(t,e,n,o){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=0},Xr={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Gr.prototype.matchesWidget=function(){return!1},Gr.prototype.matchesMark=function(){return!1},Gr.prototype.matchesNode=function(){return!1},Gr.prototype.matchesHack=function(t){return!1},Gr.prototype.parseRule=function(){return null},Gr.prototype.stopEvent=function(){return!1},Xr.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Xr.border.get=function(){return 0},Gr.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},Gr.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var o=this.children[e];if(o==t)return n;n+=o.size}},Xr.posBefore.get=function(){return this.parent.posBeforeChild(this)},Xr.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Xr.posAfter.get=function(){return this.posBefore+this.size},Xr.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},Gr.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var o,r;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&(!(r=o.pmViewDesc)||r.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(r)+r.size:this.posAtStart}var i,a;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(t==this.dom&&this.contentDOM)s=e>gr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var l=t;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.parentNode.firstChild!=l)break}if(null==s&&e==t.childNodes.length)for(var d=t;;d=d.parentNode){if(d==this.dom){s=!0;break}if(d.parentNode.lastChild!=d)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart},Gr.prototype.nearestDesc=function(t,e){for(var n=!0,o=t;o;o=o.parentNode){var r=this.getDesc(o);if(r&&(!e||r.node)){if(!n||!r.nodeDOM||(1==r.nodeDOM.nodeType?r.nodeDOM.contains(1==t.nodeType?t:t.parentNode):r.nodeDOM==t))return r;n=!1}}},Gr.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},Gr.prototype.posFromDOM=function(t,e,n){for(var o=t;o;o=o.parentNode){var r=this.getDesc(o);if(r)return r.localPosFromDOM(t,e,n)}return-1},Gr.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var o=this.children[e],r=n+o.size;if(n==t&&r!=n){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<r)return o.descAt(t-n-o.border);n=r}},Gr.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,o=0,r=0;n<this.children.length;n++){var i=this.children[n],a=r+i.size;if(a>t||i instanceof ri){o=t-r;break}r=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,e);for(var s=void 0;n&&!(s=this.children[n-1]).size&&s instanceof Zr&&s.widget.type.side>=0;n--);if(e<=0){for(var l,d=!0;(l=n?this.children[n-1]:null)&&l.dom.parentNode!=this.contentDOM;n--,d=!1);return l&&e&&d&&!l.border&&!l.domAtom?l.domFromPos(l.size,e):{node:this.contentDOM,offset:l?gr(l.dom)+1:0}}for(var c,u=!0;(c=n<this.children.length?this.children[n]:null)&&c.dom.parentNode!=this.contentDOM;n++,u=!1);return c&&u&&!c.border&&!c.domAtom?c.domFromPos(0,e):{node:this.contentDOM,offset:c?gr(c.dom):this.contentDOM.childNodes.length}},Gr.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,r=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==o&&t<=l){var d=i+s.border;if(t>=d&&e<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,d);t=i;for(var c=a;c>0;c--){var u=this.children[c-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){o=gr(u.dom)+1;break}t-=u.size}-1==o&&(o=0)}if(o>-1&&(l>e||a==this.children.length-1)){e=l;for(var p=a+1;p<this.children.length;p++){var f=this.children[p];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){r=gr(f.dom);break}e+=f.size}-1==r&&(r=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:t,to:e,fromOffset:o,toOffset:r}},Gr.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},Gr.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,o=e.offset;if(1!=n.nodeType||o==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[o]},Gr.prototype.setSelection=function(t,e,n,o){for(var r=Math.min(t,e),i=Math.max(t,e),a=0,s=0;a<this.children.length;a++){var l=this.children[a],d=s+l.size;if(r>s&&i<d)return l.setSelection(t-s-l.border,e-s-l.border,n,o);s=d}var c=this.domFromPos(t,t?-1:1),u=e==t?c:this.domFromPos(e,e?-1:1),p=n.getSelection(),f=!1;if((ur.gecko||ur.safari)&&t==e){var h=c.node,m=c.offset;if(3==h.nodeType){if((f=m&&"\n"==h.nodeValue[m-1])&&m==h.nodeValue.length)for(var v=h,g=void 0;v;v=v.parentNode){if(g=v.nextSibling){"BR"==g.nodeName&&(c=u={node:g.parentNode,offset:gr(g)+1});break}var y=v.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{var b=h.childNodes[m-1];f=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(ur.gecko&&p.focusNode&&p.focusNode!=u.node&&1==p.focusNode.nodeType){var w=p.focusNode.childNodes[p.focusOffset];w&&"false"==w.contentEditable&&(o=!0)}if(o||f&&ur.safari||!kr(c.node,c.offset,p.anchorNode,p.anchorOffset)||!kr(u.node,u.offset,p.focusNode,p.focusOffset)){var k=!1;if((p.extend||t==e)&&!f){p.collapse(c.node,c.offset);try{t!=e&&p.extend(u.node,u.offset),k=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!k){if(t>e){var _=c;c=u,u=_}var C=document.createRange();C.setEnd(u.node,u.offset),C.setStart(c.node,c.offset),p.removeAllRanges(),p.addRange(C)}}},Gr.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},Xr.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Gr.prototype.markDirty=function(t,e){for(var n=0,o=0;o<this.children.length;o++){var r=this.children[o],i=n+r.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var a=n+r.border,s=i-r.border;if(t>=a&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=a||e!=s||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(t-a,e-a):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=i}this.dirty=2},Gr.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Xr.domAtom.get=function(){return!1},Xr.ignoreForCoords.get=function(){return!1},Object.defineProperties(Gr.prototype,Xr);var Yr=[],Zr=function(t){function e(e,n,o,r){var i,a=n.type.toDOM;if("function"==typeof a&&(a=a(o,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:r}))),!n.type.spec.raw){if(1!=a.nodeType){var s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable=!1,a.classList.add("ProseMirror-widget")}t.call(this,e,Yr,a,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},e.prototype.destroy=function(){this.widget.type.destroy(this.dom),t.prototype.destroy.call(this)},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Gr),Qr=function(t){function e(e,n,o,r){t.call(this,e,Yr,n,null),this.textDOM=o,this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(Gr),ti=function(t){function e(e,n,o,r){t.call(this,e,[],o,r),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,o,r){var i=r.nodeViews[n.type.name],a=i&&i(n,r,o);return a&&a.dom||(a=ut.renderSpec(document,n.type.spec.toDOM(n,o))),new e(t,n,a.dom,a.contentDOM||a.dom)},e.prototype.parseRule=function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var o=this.parent;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,o){var r=e.create(this.parent,this.mark,!0,o),i=this.children,a=this.size;n<a&&(i=vi(i,n,a,o)),t>0&&(i=vi(i,0,t,o));for(var s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r},e}(Gr),ei=function(t){function e(e,n,o,r,i,a,s,l,d){t.call(this,e,n.isLeaf?Yr:[],i,a),this.nodeDOM=s,this.node=n,this.outerDeco=o,this.innerDeco=r,a&&this.updateChildren(l,d)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,o,r,i,a){var s,l,d=i.nodeViews[n.type.name],c=d&&d(n,i,(function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a}),o,r),u=c&&c.dom,p=c&&c.contentDOM;if(n.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||(u=(s=ut.renderSpec(document,n.type.spec.toDOM(n))).dom,p=s.contentDOM);p||n.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable=!1),n.type.spec.draggable&&(u.draggable=!0));var f=u;return u=ui(u,o,n),c?l=new ii(t,n,o,r,u,p,f,c,i,a+1):n.isText?new oi(t,n,o,r,u,f,i):new e(t,n,o,r,u,p,f,i,a+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return"pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?i.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&pi(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,o=this.node.inlineContent,r=e,i=t.composing&&this.localCompositionInfo(t,e),a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new hi(this,a&&a.node);!function(t,e,n,o){var r=e.locals(t),i=0;if(0==r.length){for(var a=0;a<t.childCount;a++){var s=t.child(a);o(s,r,e.forChild(i,s),a),i+=s.nodeSize}return}for(var l=0,d=[],c=null,u=0;;){if(l<r.length&&r[l].to==i){for(var p=r[l++],f=void 0;l<r.length&&r[l].to==i;)(f||(f=[p])).push(r[l++]);if(f){f.sort(mi);for(var h=0;h<f.length;h++)n(f[h],u,!!c)}else n(p,u,!!c)}var m=void 0,v=void 0;if(c)v=-1,m=c,c=null;else{if(!(u<t.childCount))break;v=u,m=t.child(u++)}for(var g=0;g<d.length;g++)d[g].to<=i&&d.splice(g--,1);for(;l<r.length&&r[l].from<=i&&r[l].to>i;)d.push(r[l++]);var y=i+m.nodeSize;if(m.isText){var b=y;l<r.length&&r[l].from<b&&(b=r[l].from);for(var w=0;w<d.length;w++)d[w].to<b&&(b=d[w].to);b<y&&(c=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var k=d.length?m.isInline&&!m.isLeaf?d.filter((function(t){return!t.inline})):d.slice():Yr;o(m,k,e.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(e,i,a){e.spec.marks?l.syncToMarks(e.spec.marks,o,t):e.type.side>=0&&!a&&l.syncToMarks(i==n.node.childCount?c.none:n.node.child(i).marks,o,t),l.placeWidget(e,t,r)}),(function(e,n,a,d){var c;l.syncToMarks(e.marks,o,t),l.findNodeMatch(e,n,a,d)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(c=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(e,n,a,c,t)||l.updateNextNode(e,n,a,t,d)||l.addNode(e,n,a,t,r),r+=e.nodeSize})),l.syncToMarks(Yr,o,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(e,n,o){for(var r=e.firstChild,i=!1,a=0;a<n.length;a++){var s=n[a],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=fi(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(s instanceof ti){var d=r?r.previousSibling:e.lastChild;t(s.contentDOM,s.children,o),r=d?d.nextSibling:e.firstChild}}for(;r;)r=fi(r),i=!0;i&&o.trackWrites==e&&(o.trackWrites=null)}(this.contentDOM,this.children,t),ur.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionInfo=function(t,e){var n=t.state.selection,o=n.from,r=n.to;if(!(!(t.state.selection instanceof oe)||o<e||r>e+this.node.content.size)){var i=t.root.getSelection(),a=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];t=t.childNodes[e-1],e=xr(t)}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(i.focusNode,i.focusOffset);if(a&&this.dom.contains(a.parentNode)){if(this.node.inlineContent){var s=a.nodeValue,l=function(t,e,n,o){for(var r=0,i=0;r<t.childCount&&i<=o;){var a=t.child(r++),s=i;if(i+=a.nodeSize,a.isText){for(var l=a.text;r<t.childCount;){var d=t.child(r++);if(i+=d.nodeSize,!d.isText)break;l+=d.text}if(i>=n&&s<o){var c=l.lastIndexOf(e,o-s-1);if(c>=0&&c+e.length+s>=n)return s+c}}}return-1}(this.node.content,s,o-e,r-e);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,o=e.pos,r=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var a=new Qr(this,i,n,r);t.compositionNodes.push(a),this.children=vi(this.children,o,o+r.length,t,a)}},e.prototype.update=function(t,e,n,o){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,o),!0)},e.prototype.updateInner=function(t,e,n,o){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!pi(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=di(this.dom,this.nodeDOM,li(this.outerDeco,this.node,e),li(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(Gr);function ni(t,e,n,o,r){return ui(o,e,t),new ei(null,t,e,n,o,o,o,r,0)}var oi=function(t){function e(e,n,o,r,i,a,s){t.call(this,e,n,o,r,i,null,a,s)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,o){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,o)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,o){var r=this.node.cut(t,n),i=document.createTextNode(r.text);return new e(this.parent,r,this.outerDeco,this.innerDeco,i,i,o)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(ei),ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},n.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(e.prototype,n),e}(Gr),ii=function(t){function e(e,n,o,r,i,a,s,l,d,c){t.call(this,e,n,o,r,i,a,s,d,c),this.spec=l}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,o,r){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,o);return i&&this.updateInner(e,n,o,r),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,o,r)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,o,r){this.spec.setSelection?this.spec.setSelection(e,n,o):t.prototype.setSelection.call(this,e,n,o,r)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(ei);function ai(t){t&&(this.nodeName=t)}ai.prototype=Object.create(null);var si=[new ai];function li(t,e,n){if(0==t.length)return si;for(var o=n?si[0]:new ai,r=[o],i=0;i<t.length;i++){var a=t[i].type.attrs;if(a)for(var s in a.nodeName&&r.push(o=new ai(a.nodeName)),a){var l=a[s];null!=l&&(n&&1==r.length&&r.push(o=new ai(e.isInline?"span":"div")),"class"==s?o.class=(o.class?o.class+" ":"")+l:"style"==s?o.style=(o.style?o.style+";":"")+l:"nodeName"!=s&&(o[s]=l))}}return r}function di(t,e,n,o){if(n==si&&o==si)return e;for(var r=e,i=0;i<o.length;i++){var a=o[i],s=n[i];if(i){var l=void 0;s&&s.nodeName==a.nodeName&&r!=t&&(l=r.parentNode)&&l.tagName.toLowerCase()==a.nodeName||((l=document.createElement(a.nodeName)).pmIsDeco=!0,l.appendChild(r),s=si[0]),r=l}ci(r,s||si[0],a)}return r}function ci(t,e,n){for(var o in e)"class"==o||"style"==o||"nodeName"==o||o in n||t.removeAttribute(o);for(var r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):Yr,a=n.class?n.class.split(" ").filter(Boolean):Yr,s=0;s<i.length;s++)-1==a.indexOf(i[s])&&t.classList.remove(i[s]);for(var l=0;l<a.length;l++)-1==i.indexOf(a[l])&&t.classList.add(a[l]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var d,c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;d=c.exec(e.style);)t.style.removeProperty(d[1]);n.style&&(t.style.cssText+=n.style)}}function ui(t,e,n){return di(t,t,si,li(e,n,1!=t.nodeType))}function pi(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function fi(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var hi=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(t,e){var n=e,o=n.children.length,r=t.childCount,i=new Map,a=[];t:for(;r>0;){for(var s=void 0;;)if(o){var l=n.children[o-1];if(!(l instanceof ti)){s=l,o--;break}n=l,o=l.children.length}else{if(n==e)break t;o=n.parent.children.indexOf(n),n=n.parent}var d=s.node;if(d){if(d!=t.child(r-1))break;--r,i.set(s,r),a.push(s)}}return{index:r,matched:i,matches:a.reverse()}}(t.node.content,t)};function mi(t,e){return t.type.side-e.type.side}function vi(t,e,n,o,r){for(var i=[],a=0,s=0;a<t.length;a++){var l=t[a],d=s,c=s+=l.size;d>=n||c<=e?i.push(l):(d<e&&i.push(l.slice(0,e-d,o)),r&&(i.push(r),r=null),c>n&&i.push(l.slice(n-d,l.size,o)))}return i}function gi(t,e){var n=t.root.getSelection(),o=t.state.doc;if(!n.focusNode)return null;var r=t.docView.nearestDesc(n.focusNode),i=r&&0==r.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var s,l,d=o.resolve(a);if(Er(n)){for(s=d;r&&!r.node;)r=r.parent;if(r&&r.node.isAtom&&ie.isSelectable(r.node)&&r.parent&&(!r.node.isInline||!function(t,e,n){for(var o=0==e,r=e==xr(t);o||r;){if(t==n)return!0;var i=gr(t);if(!(t=t.parentNode))return!1;o=o&&0==i,r=r&&i==xr(t)}}(n.focusNode,n.focusOffset,r.dom))){var c=r.posBefore;l=new ie(a==c?d:o.resolve(c))}}else{var u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(u<0)return null;s=o.resolve(u)}l||(l=Ei(t,s,d,"pointer"==e||t.state.selection.head<d.pos&&!i?1:-1));return l}function yi(t){return t.editable?t.hasFocus():Ti(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function bi(t,e){var n=t.state.selection;if(xi(t,n),yi(t)){if(!e&&t.mouseDown&&t.mouseDown.allowDefault&&ur.chrome){var o=t.root.getSelection(),r=t.domObserver.currentSelection;if(o.anchorNode&&kr(o.anchorNode,o.anchorOffset,r.anchorNode,r.anchorOffset))return t.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),o=t.cursorWrapper.dom,r="IMG"==o.nodeName;r?n.setEnd(o.parentNode,gr(o)+1):n.setEnd(o,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!r&&!t.state.selection.visible&&ur.ie&&ur.ie_version<=11&&(o.disabled=!0,o.disabled=!1)}(t);else{var i,a,s=n.anchor,l=n.head;!wi||n instanceof oe||(n.$from.parent.inlineContent||(i=ki(t,n.from)),n.empty||n.$from.parent.inlineContent||(a=ki(t,n.to))),t.docView.setSelection(s,l,t.root,e),wi&&(i&&Ci(i),a&&Ci(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),o=n.anchorNode,r=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==o&&n.anchorOffset==r||(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout((function(){yi(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}hi.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},hi.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},hi.prototype.syncToMarks=function(t,e,n){for(var o=0,r=this.stack.length>>1,i=Math.min(r,t.length);o<i&&(o==r-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&!1!==t[o].type.spec.spanning;)o++;for(;o<r;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<t.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(t[r])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=ti.create(this.top,t[r],e,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,r++}},hi.prototype.findNodeMatch=function(t,e,n,o){var r,i=-1;if(o>=this.preMatch.index&&(r=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&r.matchesNode(t,e,n))i=this.top.children.indexOf(r,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var l=this.top.children[a];if(l.matchesNode(t,e,n)&&!this.preMatch.matched.has(l)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},hi.prototype.updateNodeAt=function(t,e,n,o,r){return!!this.top.children[o].update(t,e,n,r)&&(this.destroyBetween(this.index,o),this.index=o+1,!0)},hi.prototype.findIndexWithChild=function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==n)return o;return-1}t=e}},hi.prototype.updateNextNode=function(t,e,n,o,r){for(var i=this.index;i<this.top.children.length;i++){var a=this.top.children[i];if(a instanceof ei){var s=this.preMatch.matched.get(a);if(null!=s&&s!=r)return!1;var l=a.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&pi(e,a.outerDeco)))&&a.update(t,e,n,o))return this.destroyBetween(this.index,i),a.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1},hi.prototype.addNode=function(t,e,n,o,r){this.top.children.splice(this.index++,0,ei.create(this.top,t,e,n,o,r)),this.changed=!0},hi.prototype.placeWidget=function(t,e,n){var o=this.index<this.top.children.length?this.top.children[this.index]:null;if(!o||!o.matchesWidget(t)||t!=o.widget&&o.widget.type.toDOM.parentNode){var r=new Zr(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++},hi.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof ti;)t=t.children[t.children.length-1];t&&t instanceof oi&&!/\n$/.test(t.node.text)||((ur.safari||ur.chrome)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG"),this.addHackNode("BR"))},hi.prototype.addHackNode=function(t){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(t))this.index++;else{var e=document.createElement(t);"IMG"==t&&(e.className="ProseMirror-separator"),"BR"==t&&(e.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new ri(this.top,Yr,e,null)),this.changed=!0}};var wi=ur.safari||ur.chrome&&ur.chrome_version<63;function ki(t,e){var n=t.docView.domFromPos(e,0),o=n.node,r=n.offset,i=r<o.childNodes.length?o.childNodes[r]:null,a=r?o.childNodes[r-1]:null;if(ur.safari&&i&&"false"==i.contentEditable)return _i(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return _i(i);if(a)return _i(a)}}function _i(t){return t.contentEditable="true",ur.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ci(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function xi(t,e){if(e instanceof ie){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Si(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Si(t)}function Si(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function Ei(t,e,n,o){return t.someProp("createSelectionBetween",(function(o){return o(t,e,n)}))||oe.between(e,n,o)}function Ti(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Mi(t,e){var n=t.selection,o=n.$anchor,r=n.$head,i=e>0?o.max(r):o.min(r),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&te.findFrom(a,e)}function Di(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Oi(t,e,n){var o=t.state.selection;if(!(o instanceof oe)){if(o instanceof ie&&o.node.isInline)return Di(t,new oe(e>0?o.$to:o.$from));var r=Mi(t.state,e);return!!r&&Di(t,r)}if(!o.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=Mi(t.state,e);return!!(i&&i instanceof ie)&&Di(t,i)}if(!(ur.mac&&n.indexOf("m")>-1)){var a,s=o.$head,l=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var d=e<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=t.docView.descAt(d))&&!a.contentDOM)&&(ie.isSelectable(l)?Di(t,new ie(e<0?t.state.doc.resolve(s.pos-l.nodeSize):s)):!!ur.webkit&&Di(t,new oe(t.state.doc.resolve(e<0?d:d+l.nodeSize))))}}function Ai(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ii(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Bi(t){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n){var r,i,a=!1;for(ur.gecko&&1==n.nodeType&&o<Ai(n)&&Ii(n.childNodes[o])&&(a=!0);;)if(o>0){if(1!=n.nodeType)break;var s=n.childNodes[o-1];if(Ii(s))r=n,i=--o;else{if(3!=s.nodeType)break;o=(n=s).nodeValue.length}}else{if(zi(n))break;for(var l=n.previousSibling;l&&Ii(l);)r=n.parentNode,i=gr(l),l=l.previousSibling;if(l)o=Ai(n=l);else{if((n=n.parentNode)==t.dom)break;o=0}}a?Ri(t,e,n,o):r&&Ri(t,e,r,i)}}function Ni(t){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n){for(var r,i,a=Ai(n);;)if(o<a){if(1!=n.nodeType)break;if(!Ii(n.childNodes[o]))break;r=n,i=++o}else{if(zi(n))break;for(var s=n.nextSibling;s&&Ii(s);)r=s.parentNode,i=gr(s)+1,s=s.nextSibling;if(s)o=0,a=Ai(n=s);else{if((n=n.parentNode)==t.dom)break;o=a=0}}r&&Ri(t,e,r,i)}}function zi(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ri(t,e,n,o){if(Er(e)){var r=document.createRange();r.setEnd(n,o),r.setStart(n,o),e.removeAllRanges(),e.addRange(r)}else e.extend&&e.extend(n,o);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&bi(t)}),50)}function Pi(t,e,n){var o=t.state.selection;if(o instanceof oe&&!o.empty||n.indexOf("s")>-1)return!1;if(ur.mac&&n.indexOf("m")>-1)return!1;var r=o.$from,i=o.$to;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=Mi(t.state,e);if(a&&a instanceof ie)return Di(t,a)}if(!r.parent.inlineContent){var s=e<0?r:i,l=o instanceof se?te.near(s,e):te.findFrom(s,e);return!!l&&Di(t,l)}return!1}function Li(t,e){if(!(t.state.selection instanceof oe))return!0;var n=t.state.selection,o=n.$head,r=n.$anchor,i=n.empty;if(!o.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!o.textOffset&&(e<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var s=t.state.tr;return e<0?s.delete(o.pos-a.nodeSize,o.pos):s.delete(o.pos,o.pos+a.nodeSize),t.dispatch(s),!0}return!1}function Fi(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function $i(t,e){var n=e.keyCode,o=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||ur.mac&&72==n&&"c"==o?Li(t,-1)||Bi(t):46==n||ur.mac&&68==n&&"c"==o?Li(t,1)||Ni(t):13==n||27==n||(37==n?Oi(t,-1,o)||Bi(t):39==n?Oi(t,1,o)||Ni(t):38==n?Pi(t,-1,o)||Bi(t):40==n?function(t){if(ur.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n&&1==n.nodeType&&0==o&&n.firstChild&&"false"==n.firstChild.contentEditable){var r=n.firstChild;Fi(t,r,!0),setTimeout((function(){return Fi(t,r,!1)}),20)}}}(t)||Pi(t,1,o)||Ni(t):o==(ur.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Vi(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(ur.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||ur.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function ji(t,e,n,o,r){if(e<0){var a=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,s=gi(t,a);if(s&&!t.state.selection.eq(s)){var l=t.state.tr.setSelection(s);"pointer"==a?l.setMeta("pointer",!0):"key"==a&&l.scrollIntoView(),t.dispatch(l)}}else{var d=t.state.doc.resolve(e),c=d.sharedDepth(n);e=d.before(c+1),n=t.state.doc.resolve(n).after(c+1);var u=t.state.selection,p=function(t,e,n){var o=t.docView.parseRange(e,n),r=o.node,i=o.fromOffset,a=o.toOffset,s=o.from,l=o.to,d=t.root.getSelection(),c=null,u=d.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(c=[{node:u,offset:d.anchorOffset}],Er(d)||c.push({node:d.focusNode,offset:d.focusOffset})),ur.chrome&&8===t.lastKeyCode)for(var p=a;p>i;p--){var f=r.childNodes[p-1],h=f.pmViewDesc;if("BR"==f.nodeName&&!h){a=p;break}if(!h||h.size)break}var m=t.state.doc,v=t.someProp("domParser")||tt.fromSchema(t.state.schema),g=m.resolve(s),y=null,b=v.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:a,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",editableContent:!0,findPositions:c,ruleFromNode:Vi,context:g});if(c&&null!=c[0].pos){var w=c[0].pos,k=c[1]&&c[1].pos;null==k&&(k=w),y={anchor:w+s,head:k+s}}return{doc:b,sel:y,from:s,to:l}}(t,e,n);if(ur.chrome&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m,v,g=t.state.doc,y=g.slice(p.from,p.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(m=t.state.selection.to,v="end"):(m=t.state.selection.from,v="start"),t.lastKeyCode=null;var b=function(t,e,n,o,r){var i=t.findDiffStart(e,n);if(null==i)return null;var a=t.findDiffEnd(e,n+t.size,n+e.size),s=a.a,l=a.b;if("end"==r){var d=Math.max(0,i-Math.min(s,l));o-=s+d-i}if(s<i&&t.size<e.size){l=(i-=o<=i&&o>=s?i-o:0)+(l-s),s=i}else if(l<i){s=(i-=o<=i&&o>=l?i-o:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(y.content,p.doc.content,p.from,m,v);if(!b){if(!(o&&u instanceof oe&&!u.empty&&u.$head.sameParent(u.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if((ur.ios&&t.lastIOSEnter>Date.now()-225||ur.android)&&r.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})))return void(t.lastIOSEnter=0);if(p.sel){var w=Wi(t,t.state.doc,p.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:u.from,endA:u.to,endB:u.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof oe&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),ur.ie&&ur.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&"  "==p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)&&(b.start--,b.endA--,b.endB--);var k,_=p.doc.resolveNoCache(b.start-p.from),C=p.doc.resolveNoCache(b.endB-p.from),x=_.sameParent(C)&&_.parent.inlineContent;if((ur.ios&&t.lastIOSEnter>Date.now()-225&&(!x||r.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!x&&_.pos<p.doc.content.size&&(k=te.findFrom(p.doc.resolve(_.pos+1),1,!0))&&k.head==C.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,o,r){if(!o.parent.isTextblock||n-e<=r.pos-o.pos||Hi(o,!0,!1)<r.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=t.resolve(Hi(i,!0,!0));if(!a.parent.isTextblock||a.pos>n||Hi(a,!0,!1)<n)return!1;return o.parent.content.cut(o.parentOffset).eq(a.parent.content)}(g,b.start,b.endA,_,C)&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(8,"Backspace"))})))ur.android&&ur.chrome&&t.domObserver.suppressSelectionUpdates();else{ur.chrome&&ur.android&&b.toB==b.from&&(t.lastAndroidDelete=Date.now()),ur.android&&!x&&_.start()!=C.start()&&0==C.parentOffset&&_.depth==C.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,C=p.doc.resolveNoCache(b.endB-p.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))}))}),20));var S,E,T,M,D=b.start,O=b.endA;if(x)if(_.pos==C.pos)ur.ie&&ur.ie_version<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return bi(t)}),20)),S=t.state.tr.delete(D,O),E=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(M=g.resolve(b.start))&&(T=function(t,e){for(var n,o,r,a=t.firstChild.marks,s=e.firstChild.marks,l=a,d=s,c=0;c<s.length;c++)l=s[c].removeFromSet(l);for(var u=0;u<a.length;u++)d=a[u].removeFromSet(d);if(1==l.length&&0==d.length)o=l[0],n="add",r=function(t){return t.mark(o.addToSet(t.marks))};else{if(0!=l.length||1!=d.length)return null;o=d[0],n="remove",r=function(t){return t.mark(o.removeFromSet(t.marks))}}for(var p=[],f=0;f<e.childCount;f++)p.push(r(e.child(f)));if(i.from(p).eq(t))return{mark:o,type:n}}(_.parent.content.cut(_.parentOffset,C.parentOffset),M.parent.content.cut(M.parentOffset,b.endA-M.start()))))S=t.state.tr,"add"==T.type?S.addMark(D,O,T.mark):S.removeMark(D,O,T.mark);else if(_.parent.child(_.index()).isText&&_.index()==C.index()-(C.textOffset?0:1)){var A=_.parent.textBetween(_.parentOffset,C.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,D,O,A)})))return;S=t.state.tr.insertText(A,D,O)}if(S||(S=t.state.tr.replace(D,O,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var I=Wi(t,S.doc,p.sel);I&&!(ur.chrome&&ur.android&&t.composing&&I.empty&&(b.start!=b.endB||t.lastAndroidDelete<Date.now()-100)&&(I.head==D||I.head==S.mapping.map(O)-1)||ur.ie&&I.empty&&I.head==D)&&S.setSelection(I)}E&&S.ensureMarks(E),t.dispatch(S.scrollIntoView())}}}function Wi(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ei(t,e.resolve(n.anchor),e.resolve(n.head))}function Hi(t,e,n){for(var o=t.depth,r=e?t.end():t.pos;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,r++,e=!1;if(n)for(var i=t.node(o).maybeChild(t.indexAfter(o));i&&!i.isLeaf;)i=i.firstChild,r++;return r}function qi(t,e){for(var n=[],o=e.content,r=e.openStart,i=e.openEnd;r>1&&i>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,i--;var a=o.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),o=a.content}var s=t.someProp("clipboardSerializer")||ut.fromSchema(t.state.schema),l=Qi(),d=l.createElement("div");d.appendChild(s.serializeFragment(o,{document:l}));for(var c,u=d.firstChild;u&&1==u.nodeType&&(c=Yi[u.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var f=l.createElement(c[p]);d.firstChild;)f.appendChild(d.firstChild);d.appendChild(f),"tbody"!=c[p]&&(r++,i++)}u=d.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",r+" "+i+" "+JSON.stringify(n)),{dom:d,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Ji(t,e,n,o,r){var a,s,l=r.parent.type.spec.code;if(!n&&!e)return null;var d=e&&(o||l||!n);if(d){if(t.someProp("transformPastedText",(function(t){e=t(e,l||o)})),l)return e?new p(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):p.empty;var c=t.someProp("clipboardTextParser",(function(t){return t(e,r,o)}));if(c)s=c;else{var u=r.marks(),f=t.state.schema,h=ut.fromSchema(f);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=a.appendChild(document.createElement("p"));t&&e.appendChild(h.serializeNode(f.text(t,u)))}))}}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),a=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,o=Qi().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t);(n=r&&Yi[r[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""));if(o.innerHTML=t,n)for(var i=0;i<n.length;i++)o=o.querySelector(n[i])||o;return o}(n),ur.webkit&&function(t){for(var e=t.querySelectorAll(ur.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var o=e[n];1==o.childNodes.length&&" "==o.textContent&&o.parentNode&&o.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),o)}}(a);var m=a&&a.querySelector("[data-pm-slice]"),v=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!s){var g=t.someProp("clipboardParser")||t.someProp("domParser")||tt.fromSchema(t.state.schema);s=g.parseSlice(a,{preserveWhitespace:!(!d&&!v),context:r,ruleFromNode:function(t){if("BR"==t.nodeName&&!t.nextSibling&&t.parentNode&&!Ki.test(t.parentNode.nodeName))return{ignore:!0}}})}if(v)s=function(t,e){if(!t.size)return t;var n,o=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var r=t.content,a=t.openStart,s=t.openEnd,l=n.length-2;l>=0;l-=2){var d=o.nodes[n[l]];if(!d||d.hasRequiredAttrs())break;r=i.from(d.create(n[l+1],r)),a++,s++}return new p(r,a,s)}(Xi(s,+v[1],+v[2]),v[3]);else if((s=p.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var o=e.node(n).contentMatchAt(e.index(n)),r=void 0,a=[];if(t.forEach((function(t){if(a){var e,n=o.findWrapping(t.type);if(!n)return a=null;if(e=a.length&&r.length&&function t(e,n,o,r,a){if(a<e.length&&a<n.length&&e[a]==n[a]){var s=t(e,n,o,r.lastChild,a+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(a==e.length-1?o.type:e[a+1]))return r.copy(r.content.append(i.from(Ui(o,e,a+1))))}}(n,r,t,a[a.length-1],0))a[a.length-1]=e;else{a.length&&(a[a.length-1]=function t(e,n){if(0==n)return e;var o=e.content.replaceChild(e.childCount-1,t(e.lastChild,n-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.empty,!0);return e.copy(o.append(r))}(a[a.length-1],r.length));var s=Ui(t,n);a.push(s),o=o.matchType(s.type,s.attrs),r=n}}})),a)return{v:i.from(a)}},o=e.depth;o>=0;o--){var r=n(o);if(r)return r.v}return t}(s.content,r),!0)).openStart||s.openEnd){for(var y=0,b=0,w=s.content.firstChild;y<s.openStart&&!w.type.spec.isolating;y++,w=w.firstChild);for(var k=s.content.lastChild;b<s.openEnd&&!k.type.spec.isolating;b++,k=k.lastChild);s=Xi(s,y,b)}return t.someProp("transformPasted",(function(t){s=t(s)})),s}var Ki=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ui(t,e,n){void 0===n&&(n=0);for(var o=e.length-1;o>=n;o--)t=e[o].create(null,i.from(t));return t}function Gi(t,e,n,o,r,a){var s=e<0?t.firstChild:t.lastChild,l=s.content;return r<o-1&&(l=Gi(l,e,n,o,r+1,a)),r>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,t.childCount>1||a<=r).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Xi(t,e,n){return e<t.openStart&&(t=new p(Gi(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new p(Gi(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Yi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Zi=null;function Qi(){return Zi||(Zi=document.implementation.createHTMLDocument("title"))}var ta={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ea=ur.ie&&ur.ie_version<=11,na=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};na.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},na.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var oa=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);ur.ie&&ur.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new na,ea&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};oa.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},oa.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},oa.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,ta),ea&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},oa.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}ea&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},oa.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},oa.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},oa.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},oa.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&Ti(t)){var t;if(this.suppressingSelectionUpdates)return bi(this.view);if(ur.ie&&ur.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&kr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},oa.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},oa.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},oa.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ti(this.view)&&!this.ignoreSelectionChange(e),o=-1,r=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s<t.length;s++){var l=this.registerMutation(t[s],a);l&&(o=o<0?l.from:Math.min(l.from,o),r=r<0?l.to:Math.max(l.to,r),l.typeOver&&(i=!0))}if(ur.gecko&&a.length>1){var d=a.filter((function(t){return"BR"==t.nodeName}));if(2==d.length){var c=d[0],u=d[1];c.parentNode&&c.parentNode.parentNode==u.parentNode?u.remove():c.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,r),function(t){if(ra)return;ra=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(o,r,i,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||bi(this.view),this.currentSelection.set(e))}},oa.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var o=0;o<t.addedNodes.length;o++)e.push(t.addedNodes[o]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var r=t.previousSibling,i=t.nextSibling;if(ur.ie&&ur.ie_version<=11&&t.addedNodes.length)for(var a=0;a<t.addedNodes.length;a++){var s=t.addedNodes[a],l=s.previousSibling,d=s.nextSibling;(!l||Array.prototype.indexOf.call(t.addedNodes,l)<0)&&(r=l),(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(i=d)}var c=r&&r.parentNode==t.target?gr(r)+1:0,u=n.localPosFromDOM(t.target,c,-1),p=i&&i.parentNode==t.target?gr(i):t.target.childNodes.length;return{from:u,to:n.localPosFromDOM(t.target,p,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var ra=!1;var ia={},aa={};function sa(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function la(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return da(t,e)})}))}function da(t,e){return t.someProp("handleDOMEvents",(function(n){var o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)}))}function ca(t){return{left:t.clientX,top:t.clientY}}function ua(t,e,n,o,r){if(-1==o)return!1;for(var i=t.state.doc.resolve(o),a=function(o){if(t.someProp(e,(function(e){return o>i.depth?e(t,n,i.nodeAfter,i.before(o),r,!0):e(t,n,i.node(o),i.before(o),r,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if(l)return l.v}return!1}function pa(t,e,n){t.focused||t.focus();var o=t.state.tr.setSelection(e);"pointer"==n&&o.setMeta("pointer",!0),t.dispatch(o)}function fa(t,e,n,o,r){return ua(t,"handleClickOn",e,n,o)||t.someProp("handleClick",(function(n){return n(t,e,o)}))||(r?function(t,e){if(-1==e)return!1;var n,o,r=t.state.selection;r instanceof ie&&(n=r.node);for(var i=t.state.doc.resolve(e),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(ie.isSelectable(s)){o=n&&r.$from.depth>0&&a>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?i.before(r.$from.depth):i.before(a);break}}return null!=o&&(pa(t,ie.create(t.state.doc,o),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),o=n.nodeAfter;return!!(o&&o.isAtom&&ie.isSelectable(o))&&(pa(t,new ie(n),"pointer"),!0)}(t,n))}function ha(t,e,n,o){return ua(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",(function(n){return n(t,e,o)}))}function ma(t,e,n,o){return ua(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",(function(n){return n(t,e,o)}))||function(t,e,n){if(0!=n.button)return!1;var o=t.state.doc;if(-1==e)return!!o.inlineContent&&(pa(t,oe.create(o,0,o.content.size),"pointer"),!0);for(var r=o.resolve(e),i=r.depth+1;i>0;i--){var a=i>r.depth?r.nodeAfter:r.node(i),s=r.before(i);if(a.inlineContent)pa(t,oe.create(o,s+1,s+1+a.content.size),"pointer");else{if(!ie.isSelectable(a))continue;pa(t,ie.create(o,s),"pointer")}return!0}}(t,n,o)}function va(t){return Ca(t)}aa.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!ba(t,e)&&(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!ur.android||!ur.chrome||13!=e.keyCode))if(229!=e.keyCode&&t.domObserver.forceFlush(),!ur.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||$i(t,e)?e.preventDefault():sa(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},aa.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},aa.keypress=function(t,e){if(!(ba(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||ur.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof oe&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,o)}))||t.dispatch(t.state.tr.insertText(o).scrollIntoView()),e.preventDefault()}}};var ga=ur.mac?"metaKey":"ctrlKey";ia.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=va(t),o=Date.now(),r="singleClick";o-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,o=e.y-t.clientY;return n*n+o*o<100}(e,t.lastClick)&&!e[ga]&&("singleClick"==t.lastClick.type?r="doubleClick":"doubleClick"==t.lastClick.type&&(r="tripleClick")),t.lastClick={time:o,x:e.clientX,y:e.clientY,type:r};var i=t.posAtCoords(ca(e));i&&("singleClick"==r?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new ya(t,i,e,n)):("doubleClick"==r?ha:ma)(t,i.pos,i.inside,e)?e.preventDefault():sa(t,"pointer"))};var ya=function(t,e,n,o){var r,i,a=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=o,this.selectNode=n[ga],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1,e.inside>-1)r=t.state.doc.nodeAt(e.inside),i=e.inside;else{var s=t.state.doc.resolve(e.pos);r=s.parent,i=s.depth?s.before():0}this.mightDrag=null;var l=o?null:n.target,d=l?t.docView.nearestDesc(l,!0):null;this.target=d?d.dom:null;var c=t.state.selection;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||c instanceof ie&&c.from<=i&&c.to>i)&&(this.mightDrag={node:r,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&ur.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){a.view.mouseDown==a&&a.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sa(t,"pointer")};function ba(t,e){return!!t.composing||!!(ur.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}ya.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return bi(t.view)})),this.view.mouseDown=null},ya.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(ca(t))),this.allowDefault||!e?sa(this.view,"pointer"):fa(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ur.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||ur.chrome&&!(this.view.state.selection instanceof oe)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(pa(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):sa(this.view,"pointer")}},ya.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),sa(this.view,"pointer"),0==t.buttons&&this.done()},ia.touchdown=function(t){va(t),sa(t,"pointer")},ia.contextmenu=function(t){return va(t)};var wa=ur.android?5e3:-1;function ka(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Ca(t)}),e))}function _a(t){var e;for(t.composing&&(t.composing=!1,t.compositionEndedAt=((e=document.createEvent("Event")).initEvent("event",!0,!0),e.timeStamp));t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Ca(t,e){if(!(ur.android&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_a(t),e||t.docView.dirty){var n=gi(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}aa.compositionstart=aa.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Ca(t,!0),t.markCursor=null;else if(Ca(t),ur.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var o=t.root.getSelection(),r=o.focusNode,i=o.focusOffset;r&&1==r.nodeType&&0!=i;){var a=i<0?r.lastChild:r.childNodes[i-1];if(!a)break;if(3==a.nodeType){o.collapse(a,a.nodeValue.length);break}r=a,i=-1}t.composing=!0}ka(t,wa)},aa.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,ka(t,20))};var xa=ur.ie&&ur.ie_version<15||ur.ios&&ur.webkit_version<604;function Sa(t,e,n,o){var r=Ji(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,o,r||p.empty)})))return!0;if(!r)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(r),a=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(r);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ia.copy=aa.cut=function(t,e){var n=t.state.selection,o="cut"==e.type;if(!n.empty){var r=xa?null:e.clipboardData,i=qi(t,n.content()),a=i.dom,s=i.text;r?(e.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.setData("text/plain",s)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),o.removeAllRanges(),o.addRange(r),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},aa.paste=function(t,e){if(!t.composing||ur.android){var n=xa?null:e.clipboardData;n&&Sa(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,o=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout((function(){t.focus(),o.parentNode&&o.parentNode.removeChild(o),n?Sa(t,o.value,null,e):Sa(t,o.textContent,o.innerHTML,e)}),50)}}(t,e)}};var Ea=function(t,e){this.slice=t,this.move=e},Ta=ur.mac?"altKey":"ctrlKey";for(var Ma in ia.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var o=t.state.selection,r=o.empty?null:t.posAtCoords(ca(e));if(r&&r.pos>=o.from&&r.pos<=(o instanceof ie?o.to-1:o.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var a=t.state.selection.content(),s=qi(t,a),l=s.dom,d=s.text;e.dataTransfer.clearData(),e.dataTransfer.setData(xa?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",xa||e.dataTransfer.setData("text/plain",d),t.dragging=new Ea(a,!e[Ta])}},ia.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},aa.dragover=aa.dragenter=function(t,e){return e.preventDefault()},aa.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var o=t.posAtCoords(ca(e));if(o){var r=t.state.doc.resolve(o.pos);if(r){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=Ji(t,e.dataTransfer.getData(xa?"Text":"text/plain"),xa?null:e.dataTransfer.getData("text/html"),!1,r);var a=n&&!e[Ta];if(t.someProp("handleDrop",(function(n){return n(t,e,i||p.empty,a)})))e.preventDefault();else if(i){e.preventDefault();var s=i?Lt(t.state.doc,r.pos,i):r.pos;null==s&&(s=r.pos);var l=t.state.tr;a&&l.deleteSelection();var d=l.mapping.map(s),c=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;if(c?l.replaceRangeWith(d,d,i.content.firstChild):l.replaceRange(d,d,i),!l.doc.eq(u)){var f=l.doc.resolve(d);if(c&&ie.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new ie(f));else{var h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((function(t,e,n,o){return h=o})),l.setSelection(Ei(t,f,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}}}}}},ia.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&bi(t)}),20))},ia.blur=function(t,e){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.set({}),t.focused=!1)},ia.beforeinput=function(t,e){if(ur.chrome&&ur.android&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Tr(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},aa)ia[Ma]=aa[Ma];function Da(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var o in e)if(!(o in t))return!1;return!0}var Oa=function(t,e){this.spec=e||Ra,this.side=this.spec.side||0,this.toDOM=t};Oa.prototype.map=function(t,e,n,o){var r=t.mapResult(e.from+o,this.side<0?-1:1),i=r.pos;return r.deleted?null:new Ba(i-n,i-n,this)},Oa.prototype.valid=function(){return!0},Oa.prototype.eq=function(t){return this==t||t instanceof Oa&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Da(this.spec,t.spec))},Oa.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var Aa=function(t,e){this.spec=e||Ra,this.attrs=t};Aa.prototype.map=function(t,e,n,o){var r=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-n;return r>=i?null:new Ba(r,i,this)},Aa.prototype.valid=function(t,e){return e.from<e.to},Aa.prototype.eq=function(t){return this==t||t instanceof Aa&&Da(this.attrs,t.attrs)&&Da(this.spec,t.spec)},Aa.is=function(t){return t.type instanceof Aa};var Ia=function(t,e){this.spec=e||Ra,this.attrs=t};Ia.prototype.map=function(t,e,n,o){var r=t.mapResult(e.from+o,1);if(r.deleted)return null;var i=t.mapResult(e.to+o,-1);return i.deleted||i.pos<=r.pos?null:new Ba(r.pos-n,i.pos-n,this)},Ia.prototype.valid=function(t,e){var n,o=t.content.findIndex(e.from),r=o.index,i=o.offset;return i==e.from&&!(n=t.child(r)).isText&&i+n.nodeSize==e.to},Ia.prototype.eq=function(t){return this==t||t instanceof Ia&&Da(this.attrs,t.attrs)&&Da(this.spec,t.spec)};var Ba=function(t,e,n){this.from=t,this.to=e,this.type=n},Na={spec:{configurable:!0},inline:{configurable:!0}};Ba.prototype.copy=function(t,e){return new Ba(t,e,this.type)},Ba.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},Ba.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},Ba.widget=function(t,e,n){return new Ba(t,t,new Oa(e,n))},Ba.inline=function(t,e,n,o){return new Ba(t,e,new Aa(n,o))},Ba.node=function(t,e,n,o){return new Ba(t,e,new Ia(n,o))},Na.spec.get=function(){return this.type.spec},Na.inline.get=function(){return this.type instanceof Aa},Object.defineProperties(Ba.prototype,Na);var za=[],Ra={},Pa=function(t,e){this.local=t&&t.length?t:za,this.children=e&&e.length?e:za};Pa.create=function(t,e){return e.length?Wa(e,t,0,Ra):La},Pa.prototype.find=function(t,e,n){var o=[];return this.findInner(null==t?0:t,null==e?1e9:e,o,0,n),o},Pa.prototype.findInner=function(t,e,n,o,r){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=e&&a.to>=t&&(!r||r(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){var l=this.children[s]+1;this.children[s+2].findInner(t-l,e-l,n,o+l,r)}},Pa.prototype.map=function(t,e,n){return this==La||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Ra)},Pa.prototype.mapInner=function(t,e,n,o,r){for(var i,a=0;a<this.local.length;a++){var s=this.local[a].map(t,n,o);s&&s.type.valid(e,s)?(i||(i=[])).push(s):r.onRemove&&r.onRemove(this.local[a].spec)}return this.children.length?function(t,e,n,o,r,i,a){for(var s=t.slice(),l=function(t,e,n,o){for(var a=0;a<s.length;a+=3){var l=s[a+1],d=void 0;-1==l||t>l+i||(e>=s[a]+i?s[a+1]=-1:n>=r&&(d=o-n-(e-t))&&(s[a]+=d,s[a+1]+=d))}},d=0;d<n.maps.length;d++)n.maps[d].forEach(l);for(var c=!1,u=0;u<s.length;u+=3)if(-1==s[u+1]){var p=n.map(t[u]+i),f=p-r;if(f<0||f>=o.content.size){c=!0;continue}var h=n.map(t[u+1]+i,-1)-r,m=o.content.findIndex(f),v=m.index,g=m.offset,y=o.maybeChild(v);if(y&&g==f&&g+y.nodeSize==h){var b=s[u+2].mapInner(n,y,p+1,t[u]+i+1,a);b!=La?(s[u]=f,s[u+1]=h,s[u+2]=b):(s[u+1]=-2,c=!0)}else c=!0}if(c){var w=Wa(function(t,e,n,o,r,i,a){function s(t,e){for(var i=0;i<t.local.length;i++){var l=t.local[i].map(o,r,e);l?n.push(l):a.onRemove&&a.onRemove(t.local[i].spec)}for(var d=0;d<t.children.length;d+=3)s(t.children[d+2],t.children[d]+e+1)}for(var l=0;l<t.length;l+=3)-1==t[l+1]&&s(t[l+2],e[l]+i+1);return n}(s,t,e||[],n,r,i,a),o,0,a);e=w.local;for(var k=0;k<s.length;k+=3)s[k+1]<0&&(s.splice(k,3),k-=3);for(var _=0,C=0;_<w.children.length;_+=3){for(var x=w.children[_];C<s.length&&s[C]<x;)C+=3;s.splice(C,0,w.children[_],w.children[_+1],w.children[_+2])}}return new Pa(e&&e.sort(Ha),s)}(this.children,i,t,e,n,o,r):i?new Pa(i.sort(Ha)):La},Pa.prototype.add=function(t,e){return e.length?this==La?Pa.create(t,e):this.addInner(t,e,0):this},Pa.prototype.addInner=function(t,e,n){var o,r=this,i=0;t.forEach((function(t,a){var s,l=a+n;if(s=Va(e,t,l)){for(o||(o=r.children.slice());i<o.length&&o[i]<a;)i+=3;o[i]==a?o[i+2]=o[i+2].addInner(t,s,l+1):o.splice(i,0,a,a+t.nodeSize,Wa(s,t,l+1,Ra)),i+=3}}));for(var a=$a(i?ja(e):e,-n),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Pa(a.length?this.local.concat(a).sort(Ha):this.local,o||this.children)},Pa.prototype.remove=function(t){return 0==t.length||this==La?this:this.removeInner(t,0)},Pa.prototype.removeInner=function(t,e){for(var n=this.children,o=this.local,r=0;r<n.length;r+=3){for(var i=void 0,a=n[r]+e,s=n[r+1]+e,l=0,d=void 0;l<t.length;l++)(d=t[l])&&d.from>a&&d.to<s&&(t[l]=null,(i||(i=[])).push(d));if(i){n==this.children&&(n=this.children.slice());var c=n[r+2].removeInner(i,a+1);c!=La?n[r+2]=c:(n.splice(r,3),r-=3)}}if(o.length)for(var u=0,p=void 0;u<t.length;u++)if(p=t[u])for(var f=0;f<o.length;f++)o[f].eq(p,e)&&(o==this.local&&(o=this.local.slice()),o.splice(f--,1));return n==this.children&&o==this.local?this:o.length||n.length?new Pa(o,n):La},Pa.prototype.forChild=function(t,e){if(this==La)return this;if(e.isLeaf)return Pa.empty;for(var n,o,r=0;r<this.children.length;r+=3)if(this.children[r]>=t){this.children[r]==t&&(n=this.children[r+2]);break}for(var i=t+1,a=i+e.content.size,s=0;s<this.local.length;s++){var l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof Aa){var d=Math.max(i,l.from)-i,c=Math.min(a,l.to)-i;d<c&&(o||(o=[])).push(l.copy(d,c))}}if(o){var u=new Pa(o.sort(Ha));return n?new Fa([u,n]):u}return n||La},Pa.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof Pa)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},Pa.prototype.locals=function(t){return qa(this.localsInner(t))},Pa.prototype.localsInner=function(t){if(this==La)return za;if(t.inlineContent||!this.local.some(Aa.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Aa||e.push(this.local[n]);return e};var La=new Pa;Pa.empty=La,Pa.removeOverlap=qa;var Fa=function(t){this.members=t};function $a(t,e){if(!e||!t.length)return t;for(var n=[],o=0;o<t.length;o++){var r=t[o];n.push(new Ba(r.from+e,r.to+e,r.type))}return n}function Va(t,e,n){if(e.isLeaf)return null;for(var o=n+e.nodeSize,r=null,i=0,a=void 0;i<t.length;i++)(a=t[i])&&a.from>n&&a.to<o&&((r||(r=[])).push(a),t[i]=null);return r}function ja(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Wa(t,e,n,o){var r=[],i=!1;e.forEach((function(e,a){var s=Va(t,e,a+n);if(s){i=!0;var l=Wa(s,e,n+a+1,o);l!=La&&r.push(a,a+e.nodeSize,l)}}));for(var a=$a(i?ja(t):t,-n).sort(Ha),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(o.onRemove&&o.onRemove(a[s].spec),a.splice(s--,1));return a.length||r.length?new Pa(a,r):La}function Ha(t,e){return t.from-e.from||t.to-e.to}function qa(t){for(var e=t,n=0;n<e.length-1;n++){var o=e[n];if(o.from!=o.to)for(var r=n+1;r<e.length;r++){var i=e[r];if(i.from!=o.from){i.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,i.from),Ja(e,r,o.copy(i.from,o.to)));break}i.to!=o.to&&(e==t&&(e=t.slice()),e[r]=i.copy(i.from,o.to),Ja(e,r+1,i.copy(o.to,i.to)))}}return e}function Ja(t,e,n){for(;e<t.length&&Ha(n,t[e])>0;)e++;t.splice(e,0,n)}function Ka(t){var e=[];return t.someProp("decorations",(function(n){var o=n(t.state);o&&o!=La&&e.push(o)})),t.cursorWrapper&&e.push(Pa.create(t.state.doc,[t.cursorWrapper.deco])),Fa.from(e)}Fa.prototype.map=function(t,e){var n=this.members.map((function(n){return n.map(t,e,Ra)}));return Fa.from(n)},Fa.prototype.forChild=function(t,e){if(e.isLeaf)return Pa.empty;for(var n=[],o=0;o<this.members.length;o++){var r=this.members[o].forChild(t,e);r!=La&&(r instanceof Fa?n=n.concat(r.members):n.push(r))}return Fa.from(n)},Fa.prototype.eq=function(t){if(!(t instanceof Fa)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Fa.prototype.locals=function(t){for(var e,n=!0,o=0;o<this.members.length;o++){var r=this.members[o].localsInner(t);if(r.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<r.length;i++)e.push(r[i])}else e=r}return e?qa(n?e:e.sort(Ha)):za},Fa.from=function(t){switch(t.length){case 0:return La;case 1:return t[0];default:return new Fa(t)}};var Ua,Ga,Xa=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ns),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ts(this),this.markCursor=null,this.cursorWrapper=null,Qa(this),this.nodeViews=es(this),this.docView=ni(this.state.doc,Za(this),Ka(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.lastAndroidDelete=0,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new oa(t,(function(e,n,o,r){return ji(t,e,n,o,r)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=ia[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||da(t,e)||!t.editable&&e.type in aa||n(t,e)})};for(var n in ia)e(n);ur.safari&&t.dom.addEventListener("input",(function(){return null})),la(t)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Ya={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function Za(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var o in n)"class"==o&&(e.class+=" "+n[o]),"style"==o?e.style=(e.style?e.style+";":"")+n[o]:e[o]||"contenteditable"==o||"nodeName"==o||(e[o]=String(n[o]))})),[Ba.node(0,t.state.doc.content.size,e)]}function Qa(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Ba.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ts(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function es(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}function ns(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}if(Ya.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Xa.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&la(this),this._props=t,t.plugins&&(t.plugins.forEach(ns),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},Xa.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var o in e.state=this.state,t)e[o]=t[o];this.update(e)},Xa.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Xa.prototype.updateStateInner=function(t,e){var n=this,o=this.state,r=!1,i=!1;if(t.storedMarks&&this.composing&&(_a(this),i=!0),this.state=t,e){var a=es(this);(function(t,e){var n=0,o=0;for(var r in t){if(t[r]!=e[r])return!0;n++}for(var i in e)o++;return n!=o})(a,this.nodeViews)&&(this.nodeViews=a,r=!0),la(this)}this.editable=ts(this),Qa(this);var s=Ka(this),l=Za(this),d=e?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",c=r||!this.docView.matchesNode(t.doc,l,s);!c&&t.selection.eq(o.selection)||(i=!0);var u,p,f,h,m,v,g,y,b,w,k,_="preserve"==d&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,o=t.dom.getBoundingClientRect(),r=Math.max(0,o.top),i=(o.left+o.right)/2,a=r+1;a<Math.min(innerHeight,o.bottom);a+=5){var s=t.root.elementFromPoint(i,a);if(s!=t.dom&&t.dom.contains(s)){var l=s.getBoundingClientRect();if(l.top>=r-20){e=s,n=l.top;break}}}return{refDOM:e,refTop:n,stack:Ir(t.dom)}}(this);if(i){this.domObserver.stop();var C=c&&(ur.ie||ur.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&(h=o.selection,m=t.selection,v=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(v)!=m.$anchor.start(v));if(c){var x=ur.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!r&&this.docView.update(t.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ni(t.doc,l,s,this.dom,this)),x&&!this.trackWrites&&(C=!0)}C||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(u=this,p=u.docView.domFromPos(u.state.selection.anchor,0),f=u.root.getSelection(),kr(p.node,p.offset,f.anchorNode,f.anchorOffset)))?bi(this,C):(xi(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==d)this.dom.scrollTop=0;else if("to selection"==d){var S=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?Ar(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),S):Ar(this,this.coordsAtPos(t.selection.head,1),S))}else _&&(y=(g=_).refDOM,b=g.refTop,w=g.stack,k=y?y.getBoundingClientRect().top:0,Br(w,0==k?0:k-b))},Xa.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Xa.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var o=0;o<this.directPlugins.length;o++){var r=this.directPlugins[o];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}},Xa.prototype.someProp=function(t,e){var n,o=this._props&&this._props[t];if(null!=o&&(n=e?e(o):o))return n;for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r].props[t];if(null!=i&&(n=e?e(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var l=a[s].props[t];if(null!=l&&(n=e?e(l):l))return n}},Xa.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Xa.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Nr)return t.focus(Nr);var e=Ir(t);t.focus(null==Nr?{get preventScroll(){return Nr={preventScroll:!0},!0}}:void 0),Nr||(Nr=!1,Br(e,0))}(this.dom),bi(this),this.domObserver.start()},Ya.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Xa.prototype.posAtCoords=function(t){return Pr(this,t)},Xa.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),$r(this,t,e)},Xa.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Xa.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Xa.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var o=this.docView.posFromDOM(t,e,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o},Xa.prototype.endOfTextblock=function(t,e){return Ur(this,e||this.state,t)},Xa.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ka(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Ya.isDestroyed.get=function(){return null==this.docView},Xa.prototype.dispatchEvent=function(t){return function(t,e){da(t,e)||!ia[e.type]||!t.editable&&e.type in aa||ia[e.type](t,e)}(this,t)},Xa.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Xa.prototype,Ya),"undefined"!=typeof WeakMap){var rs=new WeakMap;Ua=function(t){return rs.get(t)},Ga=function(t,e){return rs.set(t,e),e}}else{var is=[],as=0;Ua=function(t){for(var e=0;e<is.length;e+=2)if(is[e]==t)return is[e+1]},Ga=function(t,e){return 10==as&&(as=0),is[as++]=t,is[as++]=e}}var ss=function(t,e,n,o){this.left=t,this.top=e,this.right=n,this.bottom=o},ls=function(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o};function ds(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function cs(t,e){var n=t.getAttribute("data-colwidth"),o=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(t){return Number(t)})):null,r=Number(t.getAttribute("colspan")||1),i={colspan:r,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:o&&o.length==r?o:null};for(var a in e){var s=e[a].getFromDOM,l=s&&s(t);null!=l&&(i[a]=l)}return i}function us(t,e){var n={};for(var o in 1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(",")),e){var r=e[o].setDOMAttr;r&&r(t.attrs[o],n)}return n}function ps(t){var e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var o in e)n[o]={default:e[o].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(t){return cs(t,e)}}],toDOM:function(t){return["td",us(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(t){return cs(t,e)}}],toDOM:function(t){return["th",us(t,e),0]}}}}function fs(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var o=t.nodes[n],r=o.spec.tableRole;r&&(e[r]=o)}return e}ls.prototype.findCell=function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var o=e%this.width,r=e/this.width|0,i=o+1,a=r+1,s=1;i<this.width&&this.map[e+s]==n;s++)i++;for(var l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return new ss(o,r,i,a)}}throw new RangeError("No cell with offset "+t+" found")},ls.prototype.colCount=function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")},ls.prototype.nextCell=function(t,e,n){var o=this.findCell(t),r=o.left,i=o.right,a=o.top,s=o.bottom;return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?0==a:s==this.height)?null:this.map[r+this.width*(n<0?a-1:s)]},ls.prototype.rectBetween=function(t,e){var n=this.findCell(t),o=n.left,r=n.right,i=n.top,a=n.bottom,s=this.findCell(e),l=s.left,d=s.right,c=s.top,u=s.bottom;return new ss(Math.min(o,l),Math.min(i,c),Math.max(r,d),Math.max(a,u))},ls.prototype.cellsInRect=function(t){for(var e=[],n={},o=t.top;o<t.bottom;o++)for(var r=t.left;r<t.right;r++){var i=o*this.width+r,a=this.map[i];n[a]||(n[a]=!0,r==t.left&&r&&this.map[i-1]==a||o==t.top&&o&&this.map[i-this.width]==a||e.push(a))}return e},ls.prototype.positionAt=function(t,e,n){for(var o=0,r=0;;o++){var i=r+n.child(o).nodeSize;if(o==t){for(var a=e+t*this.width,s=(t+1)*this.width;a<s&&this.map[a]<r;)a++;return a==s?i-1:this.map[a]}r=i}},ls.get=function(t){return Ua(t)||Ga(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,o=0;o<t.childCount;o++){var r=t.child(o),i=0;if(n)for(var a=0;a<o;a++)for(var s=t.child(a),l=0;l<s.childCount;l++){var d=s.child(l);a+d.attrs.rowspan>o&&(i+=d.attrs.colspan)}for(var c=0;c<r.childCount;c++){var u=r.child(c);i+=u.attrs.colspan,u.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,o=[],r=0,i=null,a=[],s=0,l=e*n;s<l;s++)o[s]=0;for(var d=0,c=0;d<n;d++){var u=t.child(d);c++;for(var p=0;;p++){for(;r<o.length&&0!=o[r];)r++;if(p==u.childCount)break;for(var f=u.child(p),h=f.attrs,m=h.colspan,v=h.rowspan,g=h.colwidth,y=0;y<v;y++){if(y+d>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:c,n:v-y});break}for(var b=r+y*e,w=0;w<m;w++){0==o[b+w]?o[b+w]=c:(i||(i=[])).push({type:"collision",row:d,pos:c,n:m-w});var k=g&&g[w];if(k){var _=(b+w)%e*2,C=a[_];null==C||C!=k&&1==a[_+1]?(a[_]=k,a[_+1]=1):C==k&&a[_+1]++}}}r+=m,c+=f.nodeSize}for(var x=(d+1)*e,S=0;r<x;)0==o[r++]&&S++;S&&(i||(i=[])).push({type:"missing",row:d,n:S}),c++}for(var E=new ls(e,n,o,i),T=!1,M=0;!T&&M<a.length;M+=2)null!=a[M]&&a[M+1]<n&&(T=!0);T&&function(t,e,n){t.problems||(t.problems=[]);for(var o=0,r={};o<t.map.length;o++){var i=t.map[o];if(!r[i]){r[i]=!0;for(var a=n.nodeAt(i),s=null,l=0;l<a.attrs.colspan;l++){var d=(o+l)%t.width,c=e[2*d];null==c||a.attrs.colwidth&&a.attrs.colwidth[l]==c||((s||(s=ds(a.attrs)))[l]=c)}s&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(E,a,t);return E}(t))};var hs=new _e("selectingCells");function ms(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function vs(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function gs(t){var e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:ms(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n)}for(var r=t.nodeBefore,i=t.pos;r;r=r.lastChild,i--){var a=r.type.spec.tableRole;if("cell"==a||"header_cell"==a)return t.doc.resolve(i-r.nodeSize)}}(e.$head)}function ys(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function bs(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function ws(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ks(t){return ls.get(t.node(-1)).findCell(t.pos-t.start(-1))}function _s(t){return ls.get(t.node(-1)).colCount(t.pos-t.start(-1))}function Cs(t,e,n){var o=t.start(-1),r=ls.get(t.node(-1)).nextCell(t.pos-o,e,n);return null==r?null:t.node(0).resolve(o+r)}function xs(t,e,n){var o={};for(var r in t)o[r]=t[r];return o[e]=n,o}function Ss(t,e,n){void 0===n&&(n=1);var o=xs(t,"colspan",t.colspan-n);return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some((function(t){return t>0}))||(o.colwidth=null)),o}function Es(t,e,n){void 0===n&&(n=1);var o=xs(t,"colspan",t.colspan+n);if(o.colwidth){o.colwidth=o.colwidth.slice();for(var r=0;r<n;r++)o.colwidth.splice(e,0,0)}return o}function Ts(t,e,n){for(var o=fs(e.type.schema).header_cell,r=0;r<t.height;r++)if(e.nodeAt(t.map[n+r*t.width]).type!=o)return!1;return!0}var Ms=function(t){function e(e,n){void 0===n&&(n=e);var o=e.node(-1),r=ls.get(o),i=e.start(-1),a=r.rectBetween(e.pos-i,n.pos-i),s=e.node(0),l=r.cellsInRect(a).filter((function(t){return t!=n.pos-i}));l.unshift(n.pos-i);var d=l.map((function(t){var e=o.nodeAt(t),n=t+i+1;return new ne(s.resolve(n),s.resolve(n+e.content.size))}));t.call(this,d[0].$from,d[0].$to,d),this.$anchorCell=e,this.$headCell=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,n){var o=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(ys(o)&&ys(r)&&ws(o,r)){var i=this.$anchorCell.node(-1)!=o.node(-1);return i&&this.isRowSelection()?e.rowSelection(o,r):i&&this.isColSelection()?e.colSelection(o,r):new e(o,r)}return oe.between(o,r)},e.prototype.content=function(){for(var t=this.$anchorCell.node(-1),e=ls.get(t),n=this.$anchorCell.start(-1),o=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),r={},a=[],s=o.top;s<o.bottom;s++){for(var l=[],d=s*e.width+o.left,c=o.left;c<o.right;c++,d++){var u=e.map[d];if(!r[u]){r[u]=!0;var f=e.findCell(u),h=t.nodeAt(u),m=o.left-f.left,v=f.right-o.right;if(m>0||v>0){var g=h.attrs;m>0&&(g=Ss(g,0,m)),v>0&&(g=Ss(g,g.colspan-v,v)),h=f.left<o.left?h.type.createAndFill(g):h.type.create(g,h.content)}if(f.top<o.top||f.bottom>o.bottom){var y=xs(h.attrs,"rowspan",Math.min(f.bottom,o.bottom)-Math.max(f.top,o.top));h=f.top<o.top?h.type.createAndFill(y):h.type.create(y,h.content)}l.push(h)}}a.push(t.child(s).copy(i.from(l)))}var b=this.isColSelection()&&this.isRowSelection()?t:a;return new p(i.from(b),1,1)},e.prototype.replace=function(e,n){void 0===n&&(n=p.empty);for(var o=e.steps.length,r=this.ranges,i=0;i<r.length;i++){var a=r[i],s=a.$from,l=a.$to,d=e.mapping.slice(o);e.replace(d.map(s.pos),d.map(l.pos),i?p.empty:n)}var c=t.findFrom(e.doc.resolve(e.mapping.slice(o).map(this.to)),-1);c&&e.setSelection(c)},e.prototype.replaceWith=function(t,e){this.replace(t,new p(i.from(e),0,0))},e.prototype.forEachCell=function(t){for(var e=this.$anchorCell.node(-1),n=ls.get(e),o=this.$anchorCell.start(-1),r=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o)),i=0;i<r.length;i++)t(e.nodeAt(r[i]),o+r[i])},e.prototype.isColSelection=function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,o=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount},e.colSelection=function(t,n){void 0===n&&(n=t);var o=ls.get(t.node(-1)),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.top<=a.top?(i.top>0&&(t=s.resolve(r+o.map[i.left])),a.bottom<o.height&&(n=s.resolve(r+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(r+o.map[a.left])),i.bottom<o.height&&(t=s.resolve(r+o.map[o.width*(o.height-1)+i.right-1]))),new e(t,n)},e.prototype.isRowSelection=function(){var t=ls.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),o=t.colCount(this.$headCell.pos-e);if(Math.min(n,o)>0)return!1;var r=n+this.$anchorCell.nodeAfter.attrs.colspan,i=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(r,i)==t.width},e.prototype.eq=function(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos},e.rowSelection=function(t,n){void 0===n&&(n=t);var o=ls.get(t.node(-1)),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.left<=a.left?(i.left>0&&(t=s.resolve(r+o.map[i.top*o.width])),a.right<o.width&&(n=s.resolve(r+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(r+o.map[a.top*o.width])),i.right<o.width&&(t=s.resolve(r+o.map[o.width*(i.top+1)-1]))),new e(t,n)},e.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},e.fromJSON=function(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,n,o){return void 0===o&&(o=n),new e(t.resolve(n),t.resolve(o))},e.prototype.getBookmark=function(){return new Ds(this.$anchorCell.pos,this.$headCell.pos)},e}(te);Ms.prototype.visible=!1,te.jsonID("cell",Ms);var Ds=function(t,e){this.anchor=t,this.head=e};function Os(t){if(!(t.selection instanceof Ms))return null;var e=[];return t.selection.forEachCell((function(t,n){e.push(Ba.node(n,n+t.nodeSize,{class:"selectedCell"}))})),Pa.create(t.doc,e)}function As(t){if(!t.size)return null;for(var e=t.content,n=t.openStart,o=t.openEnd;1==e.childCount&&(n>0&&o>0||"table"==e.firstChild.type.spec.tableRole);)n--,o--,e=e.firstChild.content;var r=e.firstChild,a=r.type.spec.tableRole,s=r.type.schema,l=[];if("row"==a)for(var d=0;d<e.childCount;d++){var c=e.child(d).content,u=d?0:Math.max(0,n-1),f=d<e.childCount-1?0:Math.max(0,o-1);(u||f)&&(c=Is(fs(s).row,new p(c,u,f)).content),l.push(c)}else{if("cell"!=a&&"header_cell"!=a)return null;l.push(n||o?Is(fs(s).row,new p(e,n,o)).content:e)}return function(t,e){for(var n=[],o=0;o<e.length;o++)for(var r=e[o],a=r.childCount-1;a>=0;a--)for(var s=r.child(a).attrs,l=s.rowspan,d=s.colspan,c=o;c<o+l;c++)n[c]=(n[c]||0)+d;for(var u=0,p=0;p<n.length;p++)u=Math.max(u,n[p]);for(var f=0;f<n.length;f++)if(f>=e.length&&e.push(i.empty),n[f]<u){for(var h=fs(t).cell.createAndFill(),m=[],v=n[f];v<u;v++)m.push(h);e[f]=e[f].append(i.from(m))}return{height:e.length,width:u,rows:e}}(s,l)}function Is(t,e){var n=t.createAndFill();return new wt(n).replace(0,n.content.size,e).doc}function Bs(t,e,n){var o=t.width,r=t.height,a=t.rows;if(o!=e){for(var s=[],l=[],d=0;d<a.length;d++){for(var c=a[d],u=[],p=s[d]||0,f=0;p<e;f++){var h=c.child(f%c.childCount);p+h.attrs.colspan>e&&(h=h.type.create(Ss(h.attrs,h.attrs.colspan,p+h.attrs.colspan-e),h.content)),u.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)s[d+m]=(s[d+m]||0)+h.attrs.colspan}l.push(i.from(u))}a=l,o=e}if(r!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=a[y%r],k=0;k<w.childCount;k++){var _=w.child(k);g+_.attrs.rowspan>n&&(_=_.type.create(xs(_.attrs,"rowspan",Math.max(1,n-_.attrs.rowspan)),_.content)),b.push(_)}v.push(i.from(b))}a=v,r=n}return{width:o,height:r,rows:a}}function Ns(t,e,n,o,r,i,a,s){if(0==a||a==e.height)return!1;for(var l=!1,d=r;d<i;d++){var c=a*e.width+d,u=e.map[c];if(e.map[c-e.width]==u){l=!0;var p=n.nodeAt(u),f=e.findCell(u),h=f.top,m=f.left;t.setNodeMarkup(t.mapping.slice(s).map(u+o),null,xs(p.attrs,"rowspan",a-h)),t.insert(t.mapping.slice(s).map(e.positionAt(a,m,n)),p.type.createAndFill(xs(p.attrs,"rowspan",h+p.attrs.rowspan-a))),d+=p.attrs.colspan-1}}return l}function zs(t,e,n,o,r,i,a,s){if(0==a||a==e.width)return!1;for(var l=!1,d=r;d<i;d++){var c=d*e.width+a,u=e.map[c];if(e.map[c-1]==u){l=!0;var p=n.nodeAt(u),f=e.colCount(u),h=t.mapping.slice(s).map(u+o);t.setNodeMarkup(h,null,Ss(p.attrs,a-f,p.attrs.colspan-(a-f))),t.insert(h+p.nodeSize,p.type.createAndFill(Ss(p.attrs,0,a-f))),d+=p.attrs.rowspan-1}}return l}function Rs(t,e,n,o,r){var a=n?t.doc.nodeAt(n-1):t.doc,s=ls.get(a),l=o.top,d=o.left,c=d+r.width,u=l+r.height,f=t.tr,h=0;function m(){a=n?f.doc.nodeAt(n-1):f.doc,s=ls.get(a),h=f.mapping.maps.length}(function(t,e,n,o,r,a,s){var l,d,c=fs(t.doc.type.schema);if(r>e.width)for(var u=0,p=0;u<e.height;u++){var f=n.child(u);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==c.cell?l||(l=c.cell.createAndFill()):d||(d=c.header_cell.createAndFill());for(var v=e.width;v<r;v++)h.push(m);t.insert(t.mapping.slice(s).map(p-1+o),h)}if(a>e.height){for(var g=[],y=0,b=(e.height-1)*e.width;y<Math.max(e.width,r);y++){var w=!(y>=e.width)&&n.nodeAt(e.map[b+y]).type==c.header_cell;g.push(w?d||(d=c.header_cell.createAndFill()):l||(l=c.cell.createAndFill()))}for(var k=c.row.create(null,i.from(g)),_=[],C=e.height;C<a;C++)_.push(k);t.insert(t.mapping.slice(s).map(o+n.nodeSize-2),_)}return!(!l&&!d)})(f,s,a,n,c,u,h)&&m(),Ns(f,s,a,n,d,c,l,h)&&m(),Ns(f,s,a,n,d,c,u,h)&&m(),zs(f,s,a,n,l,u,d,h)&&m(),zs(f,s,a,n,l,u,c,h)&&m();for(var v=l;v<u;v++){var g=s.positionAt(v,d,a),y=s.positionAt(v,c,a);f.replace(f.mapping.slice(h).map(g+n),f.mapping.slice(h).map(y+n),new p(r.rows[v-l],0,0))}m(),f.setSelection(new Ms(f.doc.resolve(n+s.positionAt(l,d,a)),f.doc.resolve(n+s.positionAt(u-1,c-1,a)))),e(f)}Ds.prototype.map=function(t){return new Ds(t.map(this.anchor),t.map(this.head))},Ds.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&ws(e,n)?new Ms(e,n):te.near(n,1)};var Ps=cr({ArrowLeft:Fs("horiz",-1),ArrowRight:Fs("horiz",1),ArrowUp:Fs("vert",-1),ArrowDown:Fs("vert",1),"Shift-ArrowLeft":$s("horiz",-1),"Shift-ArrowRight":$s("horiz",1),"Shift-ArrowUp":$s("vert",-1),"Shift-ArrowDown":$s("vert",1),Backspace:Vs,"Mod-Backspace":Vs,Delete:Vs,"Mod-Delete":Vs});function Ls(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Fs(t,e){return function(n,o,r){var i=n.selection;if(i instanceof Ms)return Ls(n,o,te.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;var a=qs(r,t,e);if(null==a)return!1;if("horiz"==t)return Ls(n,o,te.near(n.doc.resolve(i.head+e),e));var s,l=n.doc.resolve(a),d=Cs(l,t,e);return s=d?te.near(d,1):e<0?te.near(n.doc.resolve(l.before(-1)),-1):te.near(n.doc.resolve(l.after(-1)),1),Ls(n,o,s)}}function $s(t,e){return function(n,o,r){var i=n.selection;if(!(i instanceof Ms)){var a=qs(r,t,e);if(null==a)return!1;i=new Ms(n.doc.resolve(a))}var s=Cs(i.$headCell,t,e);return!!s&&Ls(n,o,new Ms(i.$anchorCell,s))}}function Vs(t,e){var n=t.selection;if(!(n instanceof Ms))return!1;if(e){var o=t.tr,r=fs(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(r)||o.replace(o.mapping.map(e+1),o.mapping.map(e+t.nodeSize-1),new p(r,0,0))})),o.docChanged&&e(o)}return!0}function js(t,e){var n=ms(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new Ms(n))),!0)}function Ws(t,e,n){if(!vs(t.state))return!1;var o=As(n),r=t.state.selection;if(r instanceof Ms){o||(o={width:1,height:1,rows:[i.from(Is(fs(t.state.schema).cell,n))]});var a=r.$anchorCell.node(-1),s=r.$anchorCell.start(-1),l=ls.get(a).rectBetween(r.$anchorCell.pos-s,r.$headCell.pos-s);return o=Bs(o,l.right-l.left,l.bottom-l.top),Rs(t.state,t.dispatch,s,l,o),!0}if(o){var d=gs(t.state),c=d.start(-1);return Rs(t.state,t.dispatch,c,ls.get(d.node(-1)).findCell(d.pos-c),o),!0}return!1}function Hs(t,e){if(!e.ctrlKey&&!e.metaKey){var n,o=Js(t,e.target);if(e.shiftKey&&t.state.selection instanceof Ms)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&null!=(n=ms(t.state.selection.$anchor))&&Ks(t,e).pos!=n.pos)r(n,e),e.preventDefault();else if(!o)return;t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",a)}function r(e,n){var o=Ks(t,n),r=null==hs.getState(t.state);if(!o||!ws(e,o)){if(!r)return;o=e}var i=new Ms(e,o);if(r||!t.state.selection.eq(i)){var a=t.state.tr.setSelection(i);r&&a.setMeta(hs,e.pos),t.dispatch(a)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",a),null!=hs.getState(t.state)&&t.dispatch(t.state.tr.setMeta(hs,-1))}function a(n){var a,s=hs.getState(t.state);if(null!=s)a=t.state.doc.resolve(s);else if(Js(t,n.target)!=o&&!(a=Ks(t,e)))return i();a&&r(a,n)}}function qs(t,e,n){if(!(t.state.selection instanceof oe))return null;for(var o=t.state.selection.$head,r=o.depth-1;r>=0;r--){var i=o.node(r);if((n<0?o.index(r):o.indexAfter(r))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var a=o.before(r),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?a:null}}return null}function Js(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Ks(t,e){var n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ms(t.state.doc.resolve(n.pos)):null}var Us=new _e("fix-tables");function Gs(t,e){var n,o=function(e,o){"table"==e.type.spec.tableRole&&(n=function(t,e,n,o){var r=ls.get(e);if(!r.problems)return o;o||(o=t.tr);for(var i,a,s=[],l=0;l<r.height;l++)s.push(0);for(var d=0;d<r.problems.length;d++){var c=r.problems[d];if("collision"==c.type){for(var u=e.nodeAt(c.pos),p=0;p<u.attrs.rowspan;p++)s[c.row+p]+=c.n;o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,Ss(u.attrs,u.attrs.colspan-c.n,c.n))}else if("missing"==c.type)s[c.row]+=c.n;else if("overlong_rowspan"==c.type){var f=e.nodeAt(c.pos);o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,xs(f.attrs,"rowspan",f.attrs.rowspan-c.n))}else if("colwidth mismatch"==c.type){var h=e.nodeAt(c.pos);o.setNodeMarkup(o.mapping.map(n+1+c.pos),null,xs(h.attrs,"colwidth",c.colwidth))}}for(var m=0;m<s.length;m++)s[m]&&(null==i&&(i=m),a=m);for(var v=0,g=n+1;v<r.height;v++){var y=e.child(v),b=g+y.nodeSize,w=s[v];if(w>0){var k="cell";y.firstChild&&(k=y.firstChild.type.spec.tableRole);for(var _=[],C=0;C<w;C++)_.push(fs(t.schema)[k].createAndFill());var x=0!=v&&i!=v-1||a!=v?b-1:g+1;o.insert(o.mapping.map(x),_)}g=b}return o.setMeta(Us,{fixTables:!0})}(t,e,o,n))};return e?e.doc!=t.doc&&function t(e,n,o,r){var i=e.childCount,a=n.childCount;t:for(var s=0,l=0;s<a;s++){for(var d=n.child(s),c=l,u=Math.min(i,s+3);c<u;c++)if(e.child(c)==d){l=c+1,o+=d.nodeSize;continue t}r(d,o),l<i&&e.child(l).sameMarkup(d)?t(e.child(l),d,o+1,r):d.nodesBetween(0,d.content.size,r,o+1),o+=d.nodeSize}}(e.doc,t.doc,0,o):t.doc.descendants(o),n}function Xs(t){var e,n=t.selection,o=gs(t),r=o.node(-1),i=o.start(-1),a=ls.get(r);return(e=n instanceof Ms?a.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):a.findCell(o.pos-i)).tableStart=i,e.map=a,e.table=r,e}function Ys(t,e,n){var o=e.map,r=e.tableStart,i=e.table,a=n>0?-1:0;Ts(o,i,n+a)&&(a=0==n||n==o.width?null:0);for(var s=0;s<o.height;s++){var l=s*o.width+n;if(n>0&&n<o.width&&o.map[l-1]==o.map[l]){var d=o.map[l],c=i.nodeAt(d);t.setNodeMarkup(t.mapping.map(r+d),null,Es(c.attrs,n-o.colCount(d))),s+=c.attrs.rowspan-1}else{var u=null==a?fs(i.type.schema).cell:i.nodeAt(o.map[l+a]).type,p=o.positionAt(s,n,i);t.insert(t.mapping.map(r+p),u.createAndFill())}}return t}function Zs(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(Ys(t.tr,n,n.left))}return!0}function Qs(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(Ys(t.tr,n,n.right))}return!0}function tl(t,e,n){for(var o=e.map,r=e.table,i=e.tableStart,a=t.mapping.maps.length,s=0;s<o.height;){var l=s*o.width+n,d=o.map[l],c=r.nodeAt(d);if(n>0&&o.map[l-1]==d||n<o.width-1&&o.map[l+1]==d)t.setNodeMarkup(t.mapping.slice(a).map(i+d),null,Ss(c.attrs,n-o.colCount(d)));else{var u=t.mapping.slice(a).map(i+d);t.delete(u,u+c.nodeSize)}s+=c.attrs.rowspan}}function el(t,e){if(!vs(t))return!1;if(e){var n=Xs(t),o=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var r=n.right-1;tl(o,n,r),r!=n.left;r--)n.table=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc,n.map=ls.get(n.table);e(o)}return!0}function nl(t,e,n){for(var o=fs(e.type.schema).header_cell,r=0;r<t.width;r++)if(e.nodeAt(t.map[r+n*t.width]).type!=o)return!1;return!0}function ol(t,e,n){for(var o=e.map,r=e.tableStart,i=e.table,a=r,s=0;s<n;s++)a+=i.child(s).nodeSize;var l=[],d=n>0?-1:0;nl(o,i,n+d)&&(d=0==n||n==o.height?null:0);for(var c=0,u=o.width*n;c<o.width;c++,u++)if(n>0&&n<o.height&&o.map[u]==o.map[u-o.width]){var p=o.map[u],f=i.nodeAt(p).attrs;t.setNodeMarkup(r+p,null,xs(f,"rowspan",f.rowspan+1)),c+=f.colspan-1}else{var h=null==d?fs(i.type.schema).cell:i.nodeAt(o.map[u+d*o.width]).type;l.push(h.createAndFill())}return t.insert(a,fs(i.type.schema).row.create(null,l)),t}function rl(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(ol(t.tr,n,n.top))}return!0}function il(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(ol(t.tr,n,n.bottom))}return!0}function al(t,e,n){for(var o=e.map,r=e.table,i=e.tableStart,a=0,s=0;s<n;s++)a+=r.child(s).nodeSize;var l=a+r.child(n).nodeSize,d=t.mapping.maps.length;t.delete(a+i,l+i);for(var c=0,u=n*o.width;c<o.width;c++,u++){var p=o.map[u];if(n>0&&p==o.map[u-o.width]){var f=r.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(d).map(p+i),null,xs(f,"rowspan",f.rowspan-1)),c+=f.colspan-1}else if(n<o.width&&p==o.map[u+o.width]){var h=r.nodeAt(p),m=h.type.create(xs(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=o.positionAt(n+1,c,r);t.insert(t.mapping.slice(d).map(i+v),m),c+=h.attrs.colspan-1}}}function sl(t,e){if(!vs(t))return!1;if(e){var n=Xs(t),o=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var r=n.bottom-1;al(o,n,r),r!=n.top;r--)n.table=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc,n.map=ls.get(n.table);e(o)}return!0}function ll(t){var e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function dl(t,e){var n=t.selection;if(!(n instanceof Ms)||n.$anchorCell.pos==n.$headCell.pos)return!1;var o=Xs(t),r=o.map;if(function(t,e){for(var n=t.width,o=t.height,r=t.map,i=e.top*n+e.left,a=i,s=(e.bottom-1)*n+e.left,l=i+(e.right-e.left-1),d=e.top;d<e.bottom;d++){if(e.left>0&&r[a]==r[a-1]||e.right<n&&r[l]==r[l+1])return!0;a+=n,l+=n}for(var c=e.left;c<e.right;c++){if(e.top>0&&r[i]==r[i-n]||e.bottom<o&&r[s]==r[s+n])return!0;i++,s++}return!1}(r,o))return!1;if(e){for(var a,s,l=t.tr,d={},c=i.empty,u=o.top;u<o.bottom;u++)for(var p=o.left;p<o.right;p++){var f=r.map[u*r.width+p],h=o.table.nodeAt(f);if(!d[f])if(d[f]=!0,null==a)a=f,s=h;else{ll(h)||(c=c.append(h.content));var m=l.mapping.map(f+o.tableStart);l.delete(m,m+h.nodeSize)}}if(l.setNodeMarkup(a+o.tableStart,null,xs(Es(s.attrs,s.attrs.colspan,o.right-o.left-s.attrs.colspan),"rowspan",o.bottom-o.top)),c.size){var v=a+1+s.content.size,g=ll(s)?a+1:v;l.replaceWith(g+o.tableStart,v+o.tableStart,c)}l.setSelection(new Ms(l.doc.resolve(a+o.tableStart))),e(l)}return!0}function cl(t,e){var n=fs(t.schema);return ul((function(t){var e=t.node;return n[e.type.spec.tableRole]}))(t,e)}function ul(t){return function(e,n){var o,r,i=e.selection;if(i instanceof Ms){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,r=i.$anchorCell.pos}else{if(!(o=function(t){for(var e=t.depth;e>0;e--){var n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from)))return!1;r=ms(i.$from).pos}if(1==o.attrs.colspan&&1==o.attrs.rowspan)return!1;if(n){var a=o.attrs,s=[],l=a.colwidth;a.rowspan>1&&(a=xs(a,"rowspan",1)),a.colspan>1&&(a=xs(a,"colspan",1));for(var d,c=Xs(e),u=e.tr,p=0;p<c.right-c.left;p++)s.push(l?xs(a,"colwidth",l&&l[p]?[l[p]]:null):a);for(var f=c.top;f<c.bottom;f++){var h=c.map.positionAt(f,c.left,c.table);f==c.top&&(h+=o.nodeSize);for(var m=c.left,v=0;m<c.right;m++,v++)m==c.left&&f==c.top||u.insert(d=u.mapping.map(h+c.tableStart,1),t({node:o,row:f,col:m}).createAndFill(s[v]))}u.setNodeMarkup(r,t({node:o,row:c.top,col:c.left}),s[0]),i instanceof Ms&&u.setSelection(new Ms(u.doc.resolve(i.$anchorCell.pos),d&&u.doc.resolve(d))),n(u)}return!0}}function pl(t,e){return function(n,o){if(!vs(n))return!1;var r=gs(n);if(r.nodeAfter.attrs[t]===e)return!1;if(o){var i=n.tr;n.selection instanceof Ms?n.selection.forEachCell((function(n,o){n.attrs[t]!==e&&i.setNodeMarkup(o,null,xs(n.attrs,t,e))})):i.setNodeMarkup(r.pos,null,xs(r.nodeAfter.attrs,t,e)),o(i)}return!0}}function fl(t,e,n){for(var o=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),r=0;r<o.length;r++){var i=e.table.nodeAt(o[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function hl(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!vs(e))return!1;if(n){for(var o=fs(e.schema),r=Xs(e),i=e.tr,a=r.map.cellsInRect("column"==t?new ss(r.left,0,r.right,r.map.height):"row"==t?new ss(0,r.top,r.map.width,r.bottom):r),s=a.map((function(t){return r.table.nodeAt(t)})),l=0;l<a.length;l++)s[l].type==o.header_cell&&i.setNodeMarkup(r.tableStart+a[l],o.cell,s[l].attrs);if(0==i.steps.length)for(var d=0;d<a.length;d++)i.setNodeMarkup(r.tableStart+a[d],o.header_cell,s[d].attrs);n(i)}return!0}}(t):function(e,n){if(!vs(e))return!1;if(n){var o=fs(e.schema),r=Xs(e),i=e.tr,a=fl("row",r,o),s=fl("column",r,o),l=("column"===t?a:"row"===t&&s)?1:0,d="column"==t?new ss(0,l,1,r.map.height):"row"==t?new ss(l,0,r.map.width,1):r,c="column"==t?s?o.cell:o.header_cell:"row"==t?a?o.cell:o.header_cell:o.cell;r.map.cellsInRect(d).forEach((function(t){var e=t+r.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,c,n.attrs)})),n(i)}return!0}}var ml=hl("row",{useDeprecatedLogic:!0}),vl=hl("column",{useDeprecatedLogic:!0}),gl=hl("cell",{useDeprecatedLogic:!0});function yl(t){return function(e,n){if(!vs(e))return!1;var o=function(t,e){if(e<0){var n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(var o=t.index(-1)-1,r=t.before();o>=0;o--){var i=t.node(-1).child(o);if(i.childCount)return r-1-i.lastChild.nodeSize;r-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;for(var a=t.node(-1),s=t.indexAfter(-1),l=t.after();s<a.childCount;s++){var d=a.child(s);if(d.childCount)return l+1;l+=d.nodeSize}}}(gs(e),t);if(null!=o){if(n){var r=e.doc.resolve(o);n(e.tr.setSelection(oe.between(r,bs(r))).scrollIntoView())}return!0}}}function bl(t,e){for(var n=t.selection.$anchor,o=n.depth;o>0;o--){if("table"==n.node(o).type.spec.tableRole)return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0}return!1}var wl=function(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),kl(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function kl(t,e,n,o,r,i){for(var a=0,s=!0,l=e.firstChild,d=t.firstChild,c=0,u=0;c<d.childCount;c++)for(var p=d.child(c).attrs,f=p.colspan,h=p.colwidth,m=0;m<f;m++,u++){var v=r==u?i:h&&h[m],g=v?v+"px":"";a+=v||o,v||(s=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=g}for(;l;){var y=l.nextSibling;l.parentNode.removeChild(l),l=y}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}wl.prototype.update=function(t){return t.type==this.node.type&&(this.node=t,kl(t,this.colgroup,this.table,this.cellMinWidth),!0)},wl.prototype.ignoreMutation=function(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))};var _l=new _e("tableColumnResizing");function Cl(t){void 0===t&&(t={});var e=t.handleWidth;void 0===e&&(e=5);var n=t.cellMinWidth;void 0===n&&(n=25);var o=t.View;void 0===o&&(o=wl);var r=t.lastColumnResizable;return void 0===r&&(r=!0),new be({key:_l,state:{init:function(t,e){return this.spec.props.nodeViews[fs(e.schema).table.name]=function(t,e){return new o(t,n,e)},new xl(-1,!1)},apply:function(t,e){return e.apply(t)}},props:{attributes:function(t){return _l.getState(t).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(t,n){!function(t,e,n,o,r){var i=_l.getState(t.state);if(!i.dragging){var a=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(a){var l=a.getBoundingClientRect(),d=l.left,c=l.right;e.clientX-d<=n?s=Sl(t,e,"left"):c-e.clientX<=n&&(s=Sl(t,e,"right"))}if(s!=i.activeHandle){if(!r&&-1!==s){var u=t.state.doc.resolve(s),p=u.node(-1),f=ls.get(p),h=u.start(-1);if(f.colCount(u.pos-h)+u.nodeAfter.attrs.colspan-1==f.width-1)return}Tl(t,s)}}}(t,n,e,0,r)},mouseleave:function(t){!function(t){var e=_l.getState(t.state);e.activeHandle>-1&&!e.dragging&&Tl(t,-1)}(t)},mousedown:function(t,e){!function(t,e,n){var o=_l.getState(t.state);if(-1==o.activeHandle||o.dragging)return!1;var r=t.state.doc.nodeAt(o.activeHandle),i=function(t,e,n){var o=n.colspan,r=n.colwidth,i=r&&r[r.length-1];if(i)return i;var a=t.domAtPos(e),s=a.node.childNodes[a.offset].offsetWidth,l=o;if(r)for(var d=0;d<o;d++)r[d]&&(s-=r[d],l--);return s/l}(t,o.activeHandle,r.attrs);function a(e){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var o=_l.getState(t.state);o.dragging&&(!function(t,e,n){for(var o=t.state.doc.resolve(e),r=o.node(-1),i=ls.get(r),a=o.start(-1),s=i.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,l=t.state.tr,d=0;d<i.height;d++){var c=d*i.width+s;if(!d||i.map[c]!=i.map[c-i.width]){var u=i.map[c],p=r.nodeAt(u).attrs,f=1==p.colspan?0:s-i.colCount(u);if(!p.colwidth||p.colwidth[f]!=n){var h=p.colwidth?p.colwidth.slice():Ml(p.colspan);h[f]=n,l.setNodeMarkup(a+u,null,xs(p,"colwidth",h))}}}l.docChanged&&t.dispatch(l)}(t,o.activeHandle,El(o.dragging,e,n)),t.dispatch(t.state.tr.setMeta(_l,{setDragging:null})))}function s(e){if(!e.which)return a(e);var o=_l.getState(t.state),r=El(o.dragging,e,n);!function(t,e,n,o){var r=t.state.doc.resolve(e),i=r.node(-1),a=r.start(-1),s=ls.get(i).colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=t.domAtPos(r.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;kl(i,l.firstChild,l,o,s,n)}(t,o.activeHandle,r,n)}t.dispatch(t.state.tr.setMeta(_l,{setDragging:{startX:e.clientX,startWidth:i}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),e.preventDefault()}(t,e,n)}},decorations:function(t){var e=_l.getState(t);if(e.activeHandle>-1)return function(t,e){for(var n=[],o=t.doc.resolve(e),r=o.node(-1),i=ls.get(r),a=o.start(-1),s=i.colCount(o.pos-a)+o.nodeAfter.attrs.colspan,l=0;l<i.height;l++){var d=s+l*i.width-1;if(!(s!=i.width&&i.map[d]==i.map[d+1]||0!=l&&i.map[d-1]==i.map[d-1-i.width])){var c=i.map[d],u=a+c+r.nodeAt(c).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",n.push(Ba.widget(u,p))}}return Pa.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}})}var xl=function(t,e){this.activeHandle=t,this.dragging=e};function Sl(t,e,n){var o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return-1;var r=o.pos,i=ms(t.state.doc.resolve(r));if(!i)return-1;if("right"==n)return i.pos;var a=ls.get(i.node(-1)),s=i.start(-1),l=a.map.indexOf(i.pos-s);return l%a.width==0?-1:s+a.map[l-1]}function El(t,e,n){var o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function Tl(t,e){t.dispatch(t.state.tr.setMeta(_l,{setHandle:e}))}function Ml(t){for(var e=[],n=0;n<t;n++)e.push(0);return e}function Dl(t){void 0===t&&(t={});var e=t.allowTableNodeSelection;return void 0===e&&(e=!1),new be({key:hs,state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(hs);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;var o=t.mapping.mapResult(e),r=o.deleted,i=o.pos;return r?null:i}},props:{decorations:Os,handleDOMEvents:{mousedown:Hs},createSelectionBetween:function(t){if(null!=hs.getState(t.state))return t.state.selection},handleTripleClick:js,handleKeyDown:Ps,handlePaste:Ws},appendTransaction:function(t,n,o){return function(t,e,n){var o,r,i=(e||t).selection,a=(e||t).doc;if(i instanceof ie&&(r=i.node.type.spec.tableRole)){if("cell"==r||"header_cell"==r)o=Ms.create(a,i.from);else if("row"==r){var s=a.resolve(i.from+1);o=Ms.rowSelection(s,s)}else if(!n){var l=ls.get(i.node),d=i.from+1,c=d+l.map[l.width*l.height-1];o=Ms.create(a,d+1,c)}}else i instanceof oe&&function(t){var e=t.$from,n=t.$to;if(e.pos==n.pos||e.pos<e.pos-6)return!1;for(var o=e.pos,r=n.pos,i=e.depth;i>=0&&!(e.after(i+1)<e.end(i));i--,o++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,r--);return o==r&&/row|table/.test(e.node(i).type.spec.tableRole)}(i)?o=oe.create(a,i.from):i instanceof oe&&function(t){for(var e,n,o=t.$from,r=t.$to,i=o.depth;i>0;i--){var a=o.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){e=a;break}}for(var s=r.depth;s>0;s--){var l=r.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return e!==n&&0===r.parentOffset}(i)&&(o=oe.create(a,i.$from.start(),i.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}(o,Gs(o,n),e)}})}xl.prototype.apply=function(t){var e=this,n=t.getMeta(_l);if(n&&null!=n.setHandle)return new xl(n.setHandle,null);if(n&&void 0!==n.setDragging)return new xl(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){var o=t.mapping.map(e.activeHandle,-1);ys(t.doc.resolve(o))||(o=null),e=new xl(o,e.dragging)}return e};var Ol=["blockquote",0],Al=["hr"],Il=["pre",["code",0]],Bl=["ol",0],Nl=["ul",0],zl=["li",0],Rl=function(t){for(var e,n={},o=t.attributes,r=0;r<o.length;r++)n[(e=o[r]).name]=e.value;return n},Pl=function(t){var e={};return t.forEach((function(t){e[t]={default:null}})),e},Ll=function(){return Pl(["style","class","id"])},Fl=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},$l=function(t,e){var n={};for(var o in t)o&&null!==t[o]&&o!==e&&(n[o]=t[o]);return n},Vl=function(t){var e;return(e={})[t]={name:t,inclusive:!0,parseDOM:[{tag:t}],toDOM:function(){return[t,0]}},e},jl=Ne.__assign({link:{attrs:Ne.__assign({},Ll(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:Rl}],toDOM:function(t){return["a",$l(t.attrs),0]}}},Vl("strong"),Vl("b"),Vl("em"),Vl("i"),Vl("u"),Vl("del"),Vl("sub"),Vl("sup"),Vl("code"),{style:{attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"span",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["span",$l(t.attrs),0]:["span",0]}}}),Wl=function(t){var e;return(e={})[t]={default:null,getFromDOM:function(e){return e.getAttribute(t)},setDOMAttr:function(e,n){n[t]=e}},e},Hl=Ne.__assign({},Wl("style"),Wl("class"),Wl("id"),Wl("headers")),ql={doc:{content:"colgroup*"},col:{attrs:Pl(["id","class","style","span"]),parseDOM:[{getAttrs:Rl,tag:"col"}],toDOM:function(t){return["col",t.attrs]}},colgroup:{attrs:Pl(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:Rl,tag:"colgroup"}],toDOM:function(t){return["colgroup",t.attrs,0]}},text:{inline:!0,group:"inline"}},Jl=new Z({nodes:ql,marks:{}}),Kl=ps({tableGroup:"block",cellContent:"block+",cellAttributes:Hl});Kl.table_row.attrs=Ne.__assign({},Kl.table_row.attrs,Pl([Ce,"style","class","id"])),Kl.table_row.toDOM=function(t){return["tr",$l(t.attrs),0]},Kl.table_row.parseDOM=[{tag:"tr",getAttrs:Rl}],Kl.table.attrs=Ne.__assign({},Kl.table.attrs,Pl(["style","class","id","k-colgroup-data"])),Kl.table.toDOM=function(t){var e=Fl(t.attrs)?$l(t.attrs,"k-colgroup-data"):{},n=null;if(t.attrs["k-colgroup-data"]&&!function(t){for(var e=!1,n=t.child(0),o=0;o<n.childCount;o++){if(n.child(o).attrs.colwidth){e=!0;break}}return e}(t)){var o=Oe(Me(t.attrs["k-colgroup-data"]),Jl,{preserveWhitespace:!1}),r=De(o).firstChild;if(r){var i=Array.from(r.children).map((function(t){return["col",Rl(t)]}));n=["colgroup",Rl(r)].concat(i)}}return n?["table",e,n,["tbody",0]]:["table",e,["tbody",0]]},Kl.table.parseDOM=[{tag:"table",getAttrs:function(t){var e=Rl(t),n=Array.from(t.childNodes).find((function(t){return"COLGROUP"===t.nodeName}));return n&&(e["k-colgroup-data"]=n.outerHTML),e}}];var Ul=Ne.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"p",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["p",$l(t.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"div",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["div",$l(t.attrs),0]:["div",0]}},blockquote:{attrs:Ne.__assign({},Ll()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["blockquote",$l(t.attrs),0]:Ol}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return Al}},heading:{attrs:Ne.__assign({},Ll(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:1})}},{tag:"h2",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:2})}},{tag:"h3",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:3})}},{tag:"h4",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:4})}},{tag:"h5",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:5})}},{tag:"h6",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:6})}}],toDOM:function(t){return Fl(t.attrs,"level")?["h"+t.attrs.level,$l(t.attrs,"level"),0]:["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return Il}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:Ne.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},Ll()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["img",$l(t.attrs)]:["img"]}},hard_break:{inline:!0,attrs:Ne.__assign({},Ll()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["br",$l(t.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:Ne.__assign({},Ll(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(t){return Ne.__assign({},Rl(t),{order:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"1",10):1})}}],toDOM:function(t){return 1===t.attrs.order?Fl(t.attrs,"order")?["ol",$l(t.attrs,"order"),0]:Bl:["ol",Ne.__assign({},$l(t.attrs,"order"),{start:t.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"ul",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["ul",$l(t.attrs),0]:Nl}},list_item:{content:"(paragraph | heading) block*",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"li",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["li",$l(t.attrs),0]:zl},defining:!0}},Kl),Gl=function(){};Gl.prototype.append=function(t){return t.length?(t=Gl.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Gl.prototype.prepend=function(t){return t.length?Gl.from(t).append(this):this},Gl.prototype.appendInner=function(t){return new Yl(this,t)},Gl.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Gl.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Gl.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Gl.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Gl.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var o=[];return this.forEach((function(e,n){return o.push(t(e,n))}),e,n),o},Gl.from=function(t){return t instanceof Gl?t:t&&t.length?new Xl(t):Gl.empty};var Xl=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,o){for(var r=e;r<n;r++)if(!1===t(this.values[r],o+r))return!1},e.prototype.forEachInvertedInner=function(t,e,n,o){for(var r=e-1;r>=n;r--)if(!1===t(this.values[r],o+r))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Gl);Gl.empty=new Xl([]);var Yl=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,o){var r=this.left.length;return!(e<r&&!1===this.left.forEachInner(t,e,Math.min(n,r),o))&&(!(n>r&&!1===this.right.forEachInner(t,Math.max(e-r,0),Math.min(this.length,n)-r,o+r))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,o){var r=this.left.length;return!(e>r&&!1===this.right.forEachInvertedInner(t,e-r,Math.max(n,r)-r,o+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(t,Math.min(e,r),n,o))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Gl),Zl=Gl,Ql=function(t,e){this.items=t,this.eventCount=e};Ql.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var o,r,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(o=this.remapping(i,this.items.length),r=o.maps.length);var a,s,l=t.tr,d=[],c=[];return this.items.forEach((function(t,e){if(!t.step)return o||(o=n.remapping(i,e+1),r=o.maps.length),r--,void c.push(t);if(o){c.push(new td(t.map));var u,p=t.step.map(o.slice(r));p&&l.maybeStep(p).doc&&(u=l.mapping.maps[l.mapping.maps.length-1],d.push(new td(u,null,null,d.length+c.length))),r--,u&&o.appendMap(u,r)}else l.maybeStep(t.step);return t.selection?(a=o?t.selection.map(o.slice(r)):t.selection,s=new Ql(n.items.slice(0,i).append(c.reverse().concat(d)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:a}},Ql.prototype.addTransform=function(t,e,n,o){for(var r=[],i=this.eventCount,a=this.items,s=!o&&a.length?a.get(a.length-1):null,l=0;l<t.steps.length;l++){var d,c=t.steps[l].invert(t.docs[l]),u=new td(t.mapping.maps[l],c,e);(d=s&&s.merge(u))&&(u=d,l?r.pop():a=a.slice(0,a.length-1)),r.push(u),e&&(i++,e=null),o||(s=u)}var p,f,h,m=i-n.depth;return m>nd&&(f=m,(p=a).forEach((function(t,e){if(t.selection&&0==f--)return h=e,!1})),a=p.slice(h),i-=m),new Ql(a.append(r),i)},Ql.prototype.remapping=function(t,e){var n=new yt;return this.items.forEach((function(e,o){var r=null!=e.mirrorOffset&&o-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,r)}),t,e),n},Ql.prototype.addMaps=function(t){return 0==this.eventCount?this:new Ql(this.items.append(t.map((function(t){return new td(t)}))),this.eventCount)},Ql.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],o=Math.max(0,this.items.length-e),r=t.mapping,i=t.steps.length,a=this.eventCount;this.items.forEach((function(t){t.selection&&a--}),o);var s=e;this.items.forEach((function(e){var o=r.getMirror(--s);if(null!=o){i=Math.min(i,o);var l=r.maps[o];if(e.step){var d=t.steps[o].invert(t.docs[o]),c=e.selection&&e.selection.map(r.slice(s+1,o));c&&a++,n.push(new td(l,d,c))}else n.push(new td(l))}}),o);for(var l=[],d=e;d<i;d++)l.push(new td(r.maps[d]));var c=this.items.slice(0,o).append(l).append(n),u=new Ql(c,a);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u},Ql.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Ql.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,o=[],r=0;return this.items.forEach((function(i,a){if(a>=t)o.push(i),i.selection&&r++;else if(i.step){var s=i.step.map(e.slice(n)),l=s&&s.getMap();if(n--,l&&e.appendMap(l,n),s){var d=i.selection&&i.selection.map(e.slice(n));d&&r++;var c,u=new td(l.invert(),s,d),p=o.length-1;(c=o.length&&o[p].merge(u))?o[p]=c:o.push(u)}}else i.map&&n--}),this.items.length,0),new Ql(Zl.from(o.reverse()),r)},Ql.empty=new Ql(Zl.empty,0);var td=function(t,e,n,o){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=o};td.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new td(e.getMap().invert(),e,this.selection)}};var ed=function(t,e,n,o){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=o},nd=20;function od(t){var e=[];return t.forEach((function(t,n,o,r){return e.push(o,r)})),e}function rd(t,e){if(!t)return null;for(var n=[],o=0;o<t.length;o+=2){var r=e.map(t[o],1),i=e.map(t[o+1],-1);r<=i&&n.push(r,i)}return n}function id(t,e,n,o){var r=ld(e),i=cd.get(e).spec.config,a=(o?t.undone:t.done).popEvent(e,r);if(a){var s=a.selection.resolve(a.transform.doc),l=(o?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),i,r),d=new ed(o?l:a.remaining,o?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(cd,{redo:o,historyState:d}).scrollIntoView())}}var ad=!1,sd=null;function ld(t){var e=t.plugins;if(sd!=e){ad=!1,sd=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){ad=!0;break}}return ad}function dd(t){return t.setMeta(ud,!0)}var cd=new _e("history"),ud=new _e("closeHistory");function pd(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new be({key:cd,state:{init:function(){return new ed(Ql.empty,Ql.empty,null,0)},apply:function(e,n,o){return function(t,e,n,o){var r,i=n.getMeta(cd);if(i)return i.historyState;n.getMeta(ud)&&(t=new ed(t.done,t.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(cd))return a.getMeta(cd).redo?new ed(t.done.addTransform(n,null,o,ld(e)),t.undone,od(n.mapping.maps[n.steps.length-1]),t.prevTime):new ed(t.done,t.undone.addTransform(n,null,o,ld(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new ed(t.done.rebased(n,r),t.undone.rebased(n,r),rd(t.prevRanges,n.mapping),t.prevTime):new ed(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),rd(t.prevRanges,n.mapping),t.prevTime);var s=0==t.prevTime||!a&&(t.prevTime<(n.time||0)-o.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,o){for(var r=0;r<e.length;r+=2)t<=e[r+1]&&o>=e[r]&&(n=!0)})),n}(n,t.prevRanges)),l=a?rd(t.prevRanges,n.mapping):od(n.mapping.maps[n.steps.length-1]);return new ed(t.done.addTransform(n,s?e.selection.getBookmark():null,o,ld(e)),Ql.empty,l,n.time)}(n,o,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n="historyUndo"==e.inputType?fd(t.state,t.dispatch):"historyRedo"==e.inputType&&hd(t.state,t.dispatch);return n&&e.preventDefault(),n}}}})}function fd(t,e){var n=cd.getState(t);return!(!n||0==n.done.eventCount)&&(e&&id(n,t,e,!1),!0)}function hd(t,e){var n=cd.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&id(n,t,e,!0),!0)}function md(t){var e=cd.getState(t);return e?e.done.eventCount:0}function vd(t){var e=cd.getState(t);return e?e.undone.eventCount:0}var gd=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,o,r){var i=n;if(e[1]){var a=e[0].lastIndexOf(e[1]);i+=e[0].slice(a+e[1].length);var s=(o+=a)-r;s>0&&(i=e[0].slice(a-s,a)+i,o=r)}return t.tr.insertText(i,o,r)}):e};function yd(t){var e=t.rules,n=new be({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,o,r,i){return bd(t,o,r,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var o=t.state.selection.$cursor;o&&bd(t,o.pos,o.pos,"",e,n)}))}}},isInputRules:!0});return n}function bd(t,e,n,o,r,i){if(t.composing)return!1;var a=t.state,s=a.doc.resolve(e);if(s.parent.type.spec.code)return!1;for(var l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"")+o,d=0;d<r.length;d++){var c=r[d].match.exec(l),u=c&&r[d].handler(a,c,e-(c[0].length-o.length),n);if(u)return t.dispatch(u.setMeta(i,{transform:u,from:e,to:n,text:o})),!0}return!1}function wd(t,e){for(var n=t.plugins,o=0;o<n.length;o++){var r=n[o],i=void 0;if(r.spec.isInputRules&&(i=r.getState(t))){if(e){for(var a=t.tr,s=i.transform,l=s.steps.length-1;l>=0;l--)a.step(s.steps[l].invert(s.docs[l]));if(i.text){var d=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,d))}else a.delete(i.from,i.to);e(a)}return!0}}return!1}var kd=new gd(/--$/,"—"),_d=new gd(/\.\.\.$/,"…"),Cd=new gd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),xd=new gd(/"$/,"”"),Sd=new gd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),Ed=new gd(/'$/,"’"),Td=[Cd,xd,Sd,Ed];function Md(t,e,n,o){return new gd(t,(function(t,r,i,a){var s=n instanceof Function?n(r):n,l=t.tr.delete(i,a),d=l.doc.resolve(i).blockRange(),c=d&&At(d,e,s);if(!c)return null;l.wrap(d,c);var u=l.doc.resolve(i-1).nodeBefore;return u&&u.type==e&&Nt(l.doc,i-1)&&(!o||o(r,u))&&l.join(i-1),l}))}function Dd(t,e,n){return new gd(t,(function(t,o,r,i){var a=t.doc.resolve(r),s=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?t.tr.delete(r,i).setBlockType(r,r,e,s):null}))}var Od={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},Ad={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},Id={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},Bd={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},Nd={mark:"sub"},zd={mark:"sup"},Rd={mark:"link"},Pd="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Ld=function(t,e){var n={},o=e&&e.applyToWord||!1;if(n["Mod-z"]=fd,n["Shift-Mod-z"]=hd,n.Backspace=bo(wd,Hn,qn,Kn),n.Enter=bo(eo,ro,io,so),Pd||(n["Mod-y"]=hd),t.marks.strong&&(n["Mod-b"]=Ke(dn,Ne.__assign({},Od,{applyToWord:o}))),t.marks.em&&(n["Mod-i"]=Ke(dn,Ne.__assign({},Ad,{applyToWord:o}))),t.marks.u&&(n["Mod-u"]=Ke(dn,Ne.__assign({},Id,{applyToWord:o}))),t.nodes.hard_break){var r=t.nodes.hard_break,i=bo(oo,(function(t,e){return e(t.tr.replaceSelectionWith(r.create()).scrollIntoView()),!0}));n["Shift-Enter"]=i}return n},Fd=function(t){var e,n={};return t.nodes.list_item&&(n.Enter=(e=t.nodes.list_item,function(t,n){return Rn(e)(t,(function(e){var o=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();o&&e.ensureMarks(o),n(e)}))})),n},$d=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,Vd=function(t){return/^MsoListParagraph/.test(t.className)},jd=function(t){var e=t.innerHTML;return e=(e=e.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},Wd=function(t,e){var n=document.createElement(t);return n.style.listStyleType=e,n},Hd=function(t){var e=null;return/^\d/.test(t)||(e=(/^[a-z]/.test(t)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(t)?"roman":"alpha")),e},qd=function(t,e){var n=[];Array.from(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=t;o.getAttribute("datalist")?(n.push(t),e.add(n)):Vd(o)&&n.length?n.push(t):(n=[],"DIV"===o.nodeName?qd(o.children,e):"TABLE"===o.nodeName&&Array.from(o.querySelectorAll("td,th")).forEach((function(t){qd(t.children,e)})))}}))},Jd=function(t){var e,n=t.innerHTML,o=function(t){return t.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(e=o(jd(t)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(e)?null:/^o/.test(e)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:Hd(o(jd(t)))}:void 0},Kd=function(t){var e,n=t.nodeName.toLowerCase();t.firstChild&&t.firstChild.nodeType===Node.COMMENT_NODE&&t.removeChild(t.firstChild),1===t.childNodes.length?e=t.firstChild.nodeType===Node.TEXT_NODE?jd(t):t.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.removeChild(t.firstChild),3===t.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(t.firstChild.nodeValue)&&t.removeChild(t.firstChild),/^(&nbsp;|\s)+$/i.test(t.firstChild.innerHTML)&&t.removeChild(t.firstChild),e="p"!==n?"<"+n+">"+t.innerHTML+"</"+n+">":t.innerHTML),t.parentNode.removeChild(t);var o=document.createElement("li");return o.innerHTML=e,o},Ud=function(t){var e=document.createElement("div");e.innerHTML=function(t){return t=t.replace($d,(function(t,e,n){return'datalist="'+e+'" datalevel="'+n+'" '+t}))}(t);var n=new Set;return qd(e.children,n),n.forEach((function(t){return function(t){var e,n,o,r,i,a,s,l,d,c,u,p,f,h=-1,m={};for(l=0;l<t.length;l++){var v=(f={datalist:(d=t[l]).getAttribute("datalist"),datalevel:d.getAttribute("datalevel")}).datalist,g=Jd(d);if(c=g&&g.tag){if(u=f.datalevel||parseFloat(d.style.marginLeft||0),f.datalevel||d.style.marginLeft){var y=c+v;m[u]||(m[u]={}),(!n||n<0)&&(n=u,o=v,r=(s=t.filter((function(t){return t.getAttribute("datalist")===String(o)})))[s.length-1],a=Wd(c,g&&g.style),d.parentNode.insertBefore(a,d),h=u,m[u][y]=a),i=r===d,p=m[u][y],(u>h||!p)&&(p=Wd(c,g&&g.style),m[u][y]=p,e.appendChild(p)),e=Kd(d),p.appendChild(e),i?n=h=-1:h=u}}else!e||i&&!Vd(d)||(d.style.marginLeft&&(d.style.marginLeft=""),d.style.marginLeft&&(d.style.margin=""),e.appendChild(d))}}(t)})),e.innerHTML},Gd=function(t){return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/^[\s\S]+?<!--StartFragment-->\s*([\s\S]*?)\s*<!--EndFragment-->[\s\S]+$/,"$1")).replace(/<\/?[ovw]:[^>]*?>/gi,"")).replace(/<\\?\??xml[^>]*>/gi,"")).replace(/<(?:link|meta) [^>]+?>/gi,"")).replace(/<style[^>]*?>\s*<\/style>/gi,"")).replace(/<\/?st1:.*?>/gi,"")).replace(/<a name="[a-zA-Z0-9_]+">/gim,"")).replace(/v:shapes?="[^"]+"/gi,"")).replace(/<!\[if !supportLists\]>/gi,"")).replace(/<!\[endif\]>/gi,"")},Xd=function(t){return t.replace(/<!--[\s\S]+?-->/g,"")},Yd=function(t,e){return t.replace(new RegExp("<\\/?("+e+")(?:\\s[^>]*?)?>","gi"),"")},Zd=function(t){t.ownerElement&&t.ownerElement.removeAttribute(t.name)},Qd=function(t){/^Mso/.test(t.value)&&Zd(t)},tc=/\s*;\s*/,ec=/\s*:\s*/,nc=function(t){var e,n,o=t.value.split(tc).filter((function(t){return Boolean(t)})),r=t.ownerElement.style,i="";o.forEach((function(t){var o;o=t.split(ec),e=o[0],n=o[1],void 0!==r[e]&&(i+=e+": "+n+"; ")})),(i=i.trim())?t.value=i:Zd(t)},oc=function(t,e){var n=t;if(e.convertMsLists&&(n=Ud(n)),e.stripTags&&(n=Yd(n,e.stripTags)),e.attributes){var o=document.createElement("div");o.innerHTML=n,Array.from(o.querySelectorAll("*")).forEach((function(t){return function(t,e){if(t.nodeType===Node.ELEMENT_NODE){for(var n=t.attributes.length-1;n>=0;n--){var o=t.attributes[n];e[o.name]?e[o.name](o):e["*"]&&e["*"](o)}"SPAN"===t.nodeName&&0===t.attributes.length&&function(t){var e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(t)}}(t,e.attributes)})),n=o.innerHTML}return n};function rc(t){for(var e=t.length,n=new Array(e/2),o=0;o<e;o+=2)n[o]=String.fromCharCode(parseInt(t.substring(o,o+2),16));return btoa(n.join(""))}var ic=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,ac=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,sc=new RegExp("(?:("+ac.source+"))([\\da-fA-F\\s]+)\\}","g"),lc=/[^\da-fA-F]/g,dc=/file:\/[^'"]+\.(jpg|png|gif)/i,cc=/\\(png|jpeg)blip\\/,uc=function(t,e){var n=t.match(ic);if(!n||-1===e.types.indexOf("text/rtf"))return t;var o=e.getData("text/rtf"),r=[],i=o.match(sc);if(!o||!i)return t;for(var a=0,s=i;a<s.length;a++){var l=s[a],d=cc.exec(l);if(d){var c=l.replace(ac,"").replace(lc,"");r.push("data:image/"+d[1]+";base64,"+rc(c))}}return n.length!==r.length?t:t.replace(ic,(function(t){var e=r.shift()||"";return t.replace(dc,e)}))},pc=function(t,e,n,o,r){var i,a,s,l,d,c,u=[],p=[],f=e.matchCase,h=e.matchWord,m=e.useRegExp,v=e.text;if(m&&(/^\\$/.test(v)||/[^\\]\\$/.test(v))&&(v=v.substring(0,v.length-1)),!v)return u;var g=f?"g":"gi",y=m?new RegExp(v,g):bc(v,g);return t.nodesBetween(n,o,(function(e,f,m){if(r(u))return!1;e.inlineContent&&f+e.content.size>=n&&(p.length=0,e.nodesBetween(0,e.content.size,(function(e,m,v,g){if(r(u))return!1;var b=1+f+m;if(e.isText&&b+e.nodeSize>=n){if(d=e.text||"",c=v.childCount-1>=g+1&&v.child(g+1),p.push(n<=b?{text:d,start:b}:{text:d.slice(n-b),start:n}),c&&c.isText)return;for(a=p.map((function(t){return t.text})).join(""),i=y.exec(a);null!==i&&(s=p[0].start+i.index,l=s+i[0].length,n<=s&&o>=l&&yc(i,h)&&u.push(oe.create(t,s,l)),!r(u));)i=y.exec(a)}else p.length=0})))})),u},fc=function(t,e){var n=e.backward,o=e.matchCyclic,r=Ne.__rest(e,["backward","matchCyclic"]),i=n?function(){return!1}:function(t){return t.length>0},a=t.doc,s=t.selection,l=[];return n?!(l=pc(a,r,0,s.from,i)).length&&o&&(l=pc(a,r,s.from,a.content.size,i)):!(l=pc(a,r,s.to,a.content.size,i)).length&&o&&(l=pc(a,r,0,s.to,i)),l.length?l[l.length-1]:null},hc=function(t,e){return pc(t,e,0,t.content.size,(function(){return!1}))},mc=function(t,e,n){var o=t.from,r=t.to;return n.insertText(e,o,r).setSelection(oe.create(n.doc,o,o+e.length)),n},vc=function(t,e,n){var o=hc(t.doc,n);if(0===o.length)return null;for(var r=t.tr,i=o.length-1;i>=0;i--)r.insertText(e,o[i].from,o[i].to);return r},gc=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,yc=function(t,e){if(e){if(!0===e){var n=t.input,o=n.charAt(t.index-1),r=n.charAt(t.index+t[0].length);return gc.test(o)&&gc.test(r)}return e(t)}return!0},bc=function(t,e){var n=t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,e)};function wc(t){var e={class:"k-placeholder","data-placeholder":t};return new be({key:new _e("placeholder"),props:{decorations:function(t){var n=t.doc,o=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&o.inlineContent&&0===o.childCount))return Pa.empty;var r=[];return n.descendants((function(t,n){r.push(Ba.node(n,n+t.nodeSize,e))})),Pa.create(n,r)}}})}var kc=/\s+/g,_c=/text-align/,Cc=function(){return new be({key:new _e("spaces-fix"),props:{decorations:function(t){var e,n,o,r,i=[],a=t.doc;return a.nodesBetween(0,a.content.size,(function(t,a,s){if(t.type.isText&&function(t){return _c.test(t&&t.attrs&&t.attrs.style||"")}(s))for(n=kc.exec(t.text||"");null!==n;){if(e=a+n.index,o=n[0].length,n.index+o<n.input.length)for(r=0;r<=o-1;r+=2)i.push(Ba.inline(e+r,e+r+1,{style:"white-space: normal"}));n=kc.exec(t.text||"")}})),Pa.create(a,i)}}})},xc=new _e("highlight");function Sc(t){return void 0===t&&(t=xc),new be({key:t,state:{init:function(){return null},apply:function(t){return t.getMeta(this.spec.key)}},props:{decorations:function(t){var e=(this.spec.key.getState(t)||[]).map((function(t){return Ba.inline(t.from,t.to,t.attrs)}));return Pa.create(t.doc,e)}}})}var Ec=new _e("image-resize"),Tc={southeast:{x:1,y:1},east:{x:1,y:0},south:{x:0,y:1},north:{x:0,y:-1},west:{x:-1,y:0},southwest:{x:-1,y:1},northwest:{x:-1,y:-1},northeast:{x:1,y:-1}},Mc=Object.keys(Tc),Dc=function(t,e,n){t.style[e]=n+"px"},Oc=/[^\-]width:|[^\-]height:/,Ac=/^.+$/,Ic=function(){function t(t,e,n,o){this.activeHandle=t,this.dragging=e,this.rect=n,this.nodePosition=o}return t.prototype.apply=function(e){var n=e.getMeta(Ec);return n?new t(n.activeHandle,n.setDragging,n.rect,n.nodePosition):this},t}(),Bc=function(t,e,n){var o=e.target.getAttribute("data-direction");if(!o)return!1;var r=Ec.getState(t.state);e.preventDefault();var i=t.state.tr;function a(e){!function(t,e,n){var o=Ec.getState(t.state),r=o.rect,i=o.dragging,a=o.nodePosition,s=o.activeHandle;if(i&&r){var l=t.nodeDOM(a),d=Tc[s],c=(e.clientX-i.startX)*d.x,u=(e.clientY-i.startY)*d.y,p=d.x?c+l.width:r.width,f=d.y?u+l.height:r.height;if(n.lockRatio&&d.x&&d.y){var h=Math.min(p/l.width,f/l.height),m=l.width*h,v=l.height*h;i.startX=e.clientX-(p-m)*d.x,i.startY=e.clientY-(f-v)*d.y,p=m,f=v}else i.startX=d.x?e.clientX:i.startX,i.startY=d.y?e.clientY:i.startY;Dc(l,"width",p),Dc(l,"height",f),r.top=l.offsetTop,r.left=l.offsetLeft,r.width=l.offsetWidth,r.height=l.offsetHeight;var g=l.nextElementSibling;g.style.width=r.width+"px",g.style.height=r.height+"px",g.style.top=r.top+"px",g.style.left=r.left+"px"}}(t,e,n)}return i.setMeta(Ec,{setDragging:{startX:e.clientX,startY:e.clientY},activeHandle:o,rect:r.rect,nodePosition:r.nodePosition}),i.setMeta("addToHistory",!1),t.dispatch(i),e.view.addEventListener("mouseup",(function e(n){n.view.removeEventListener("mouseup",e),n.view.removeEventListener("mousemove",a),function(t){var e=Ec.getState(t.state),n=e.rect,o=e.dragging,r=e.nodePosition;if(o&&n){var i=t.state.selection;if(i instanceof ie){var a=i.node.attrs,s=n.width,l=n.height,d=void 0;if(Oc.test(a.style||"")){var c=ze(a.style,{style:"width",value:Ac,newValue:s+"px"}),u=ze(c.style||"",{style:"height",value:Ac,newValue:l+"px"}).style;d=Ne.__assign({},a,{style:u})}else d=Ne.__assign({},a,{width:s,height:l});var p=i.node.type.createAndFill(d);if(p){var f=t.state.tr;f.replaceWith(r,r+1,p),f.setSelection(ie.create(f.doc,r)),f.setMeta("commandName","image-resize"),f.setMeta("args",d),f.setMeta(Ec,{setDragging:null,activeHandle:null,rect:n,nodePosition:r}),t.dispatch(f)}}}}(t)})),e.view.addEventListener("mousemove",a),!0},Nc=function(t){return void 0===t&&(t={node:"image",lockRatio:!0}),new be({key:Ec,view:function(e){return{resize:function(){Ec.getState(e.state).rect&&e.dispatch(e.state.tr.setMeta("resize",!0))},get window(){return e.dom.ownerDocument&&e.dom.ownerDocument.defaultView},attachResize:function(){var t=this.window;t&&(t.removeEventListener("resize",this.resize),t.addEventListener("resize",this.resize))},removeResize:function(){var t=this.window;t&&t.removeEventListener("resize",this.resize)},update:function(e,n){var o=e.state,r=o.selection,i=o.schema.nodes[t.node],a=Ec.getState(o),s=a.rect;if(r instanceof ie&&i===r.node.type){var l=e.nodeDOM(r.from),d={top:l.offsetTop,left:l.offsetLeft,width:l.offsetWidth,height:l.offsetHeight};if(!n.selection.eq(r)||s&&(s.width!==d.width||s.height!==d.height||s.top!==d.top||s.left!==d.left)){var c=o.tr;c.setMeta(Ec,{rect:d,nodePosition:r.from}),e.dispatch(c),this.attachResize()}}else s&&(a.rect=null,a.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new Ic("",null,null,-1)},apply:function(t,e){return e.apply(t)}},props:{handleDOMEvents:{mousedown:function(e,n){return Bc(e,n,t)}},decorations:function(e){var n=e.selection,o=e.schema.nodes[t.node],r=Ec.getState(e).rect;if(r&&n instanceof ie&&o===n.node.type){var i=document.createElement("div");i.className="k-editor-resize-handles-wrapper",i.style.width=r.width+"px",i.style.height=r.height+"px",i.style.top=r.top+"px",i.style.left=r.left+"px";for(var a=0;a<Mc.length;a++){var s=document.createElement("div");s.className="k-editor-resize-handle "+Mc[a],s.setAttribute("data-direction",Mc[a]),i.appendChild(s)}return Pa.create(e.doc,[Ba.widget(e.selection.from+1,i)])}return Pa.empty}}})},zc=new _e("caret-color");function Rc(){return new be({key:zc,props:{decorations:function(t){var e=t.doc,n=t.selection,o=t.storedMarks;if(!n.empty||!o)return Pa.empty;var r=tn((o||[]).find((function(t){return"style"===t.type.name})),{name:"color",value:/^.+$/});if(!r)return Pa.empty;var i=n.$anchor.parent,a=[];return e.descendants((function(t,e){t.eq(i)&&a.push(Ba.node(e,e+t.nodeSize,{style:"caret-color: "+r}))})),Pa.create(e,a)}}})}function Pc(t){return void 0===t&&(t={}),new be({view:function(e){return new Lc(e,t)}})}var Lc=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var o=function(t){return n[e](t)};return t.dom.addEventListener(e,o),{name:e,handler:o}}))};Lc.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,o=e.handler;return t.editorView.dom.removeEventListener(n,o)}))},Lc.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},Lc.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Lc.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,o=e.nodeAfter;if(n||o){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?r.bottom:r.top;n&&o&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:r.left,right:r.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var a=this.editorView.coordsAtPos(this.cursorPos);t={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,d=this.editorView.dom.offsetParent;if(this.element||(this.element=d.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!d||d==document.body&&"static"==getComputedStyle(d).position)s=-pageXOffset,l=-pageYOffset;else{var c=d.getBoundingClientRect();s=c.left-d.scrollLeft,l=c.top-d.scrollTop}this.element.style.left=t.left-s+"px",this.element.style.top=t.top-l+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},Lc.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},Lc.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=n&&n.type.spec.disableDropCursor,r="function"==typeof o?o(this.editorView,e):o;if(e&&!r){var i=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Lt(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},Lc.prototype.dragend=function(){this.scheduleRemoval(20)},Lc.prototype.drop=function(){this.scheduleRemoval(20)},Lc.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var Fc=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,o){var r=n.resolve(o.map(this.head));return e.valid(r)?new e(r):t.near(r)},e.prototype.content=function(){return p.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new $c(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),o=t.node(e);if(0!=n)for(var r=o.child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),o=t.node(e);if(n!=o.childCount)for(var r=o.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var o=e.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock},e.findFrom=function(t,n,o){t:for(;;){if(!o&&e.valid(t))return t;for(var r=t.pos,i=null,a=t.depth;;a--){var s=t.node(a);if(n>0?t.indexAfter(a)<s.childCount:t.index(a)>0){i=s.child(n>0?t.indexAfter(a):t.index(a)-1);break}if(0==a)return null;r+=n;var l=t.doc.resolve(r);if(e.valid(l))return l}for(;;){var d=n>0?i.firstChild:i.lastChild;if(!d){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*n),o=!1;continue t}break}i=d,r+=n;var c=t.doc.resolve(r);if(e.valid(c))return c}return null}},e}(te);Fc.prototype.visible=!1,te.jsonID("gapcursor",Fc);var $c=function(t){this.pos=t};$c.prototype.map=function(t){return new $c(t.map(this.pos))},$c.prototype.resolve=function(t){var e=t.resolve(this.pos);return Fc.valid(e)?new Fc(e):te.near(e)};var Vc=function(){return new be({props:{decorations:qc,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Fc.valid(n))return new Fc(n)},handleClick:Hc,handleKeyDown:jc}})},jc=cr({ArrowLeft:Wc("horiz",-1),ArrowRight:Wc("horiz",1),ArrowUp:Wc("vert",-1),ArrowDown:Wc("vert",1)});function Wc(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,o,r){var i=t.selection,a=e>0?i.$to:i.$from,s=i.empty;if(i instanceof oe){if(!r.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}var l=Fc.findFrom(a,e,s);return!!l&&(o&&o(t.tr.setSelection(new Fc(l))),!0)}}function Hc(t,e,n){if(!t.editable)return!1;var o=t.state.doc.resolve(e);if(!Fc.valid(o))return!1;var r=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&ie.isSelectable(t.state.doc.nodeAt(r)))&&(t.dispatch(t.state.tr.setSelection(new Fc(o))),!0)}function qc(t){if(!(t.selection instanceof Fc))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Pa.create(t.doc,[Ba.widget(t.selection.head,e,{key:"gapcursor"})])}var Jc=function(t,e,n){for(var o,r=t.table,i=t.table_row,a=t.table_cell,s=[],l=0;l<e+1;l++){o=[];for(var d=0;d<n+1;d++)o.push(a.createAndFill());s.push(i.createAndFill(void 0,o))}return r.createAndFill(void 0,s)},Kc=function(t,e){for(var n=t.$head,o=n.depth;o>0;o--){var r=n.node(o);if(r.type.name===e)return{pos:n.before(o),node:r}}return null},Uc=function(t,e){return rl(t,e&&function(t){var n,o=Kc(t.selection,"table_row"),r=Kc(t.selection,"table");if(o&&r&&o.node.attrs[Ce]){for(var i=0,a=0;a<r.node.nodeSize;a++)if(r.node.child(a).eq(o.node)){i=a;break}var s=r.node.child(i-1),l=o.pos-s.nodeSize;t.setNodeMarkup(l,void 0,((n={})[Ce]=o.node.attrs[Ce],n))}return e(t)})},Gc=function(t,e){return il(t,e&&function(t){var n,o=Kc(t.selection,"table_row");if(o&&o.node.attrs[Ce]){var r=o.pos+o.node.nodeSize;t.setNodeMarkup(r,void 0,((n={})[Ce]=o.node.attrs[Ce],n))}return e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(10);e.outerWidth=function(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0},e.removeEntries=function(t,e){return Object.keys(t).filter((function(t){return e(t)})).reduce((function(e,n){var o;return Object.assign(e,((o={})[n]=t[n],o))}),{})},e.removeEmptyEntries=function(t){return e.removeEntries(t,(function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]}))},e.isEmpty=function(t){return 0===Object.keys(t).length},e.isNullOrUndefined=function(t){return null==t},e.isPresent=function(t){return!e.isNullOrUndefined(t)},e.detectIE=function(){if(!o.isDocumentAvailable())return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE "),n=t.indexOf("Trident/");return e>0||n>0},e.safeString=function(t){return e.isNullOrUndefined(t)?"":t.toString()},e.first=function(t){return t[0]},e.last=function(t){return t[t.length-1]},e.unique=function(t){return Array.from(new Set(t))},e.split=function(t){return function(e){return e.split(t)}},e.trim=function(t){return t.trim()},e.filter=function(t){return function(e){return e.filter(t)}},e.toArray=function(t){return t instanceof Array?t:[t]},e.getUniqueStyleValues=function(t,n){if(t.hasNodesWithoutMarks)return"";var o=t.marks.filter((function(t){return"style"===t.type.name})).map((function(t){return t.attrs.style})).map(e.safeString).map(e.split(";")).map(e.filter((function(t){return t.includes(n)}))).map((function(t){return 0!==t.length?t:[n+": INVALID"]})).map(e.first).map(e.split(":")).map(e.last).map(e.trim).reduce((function(t,e){return t.indexOf(e)>-1?t:t.concat([e])}),[]);return o.indexOf("INVALID")>-1||1!==o.length?"":o[0]},e.conditionallyExecute=function(t){return function(e){return function(n){return e?t(n):n}}},e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e){t.exports=o},function(t,e){t.exports=r},function(t,e){t.exports=i},function(t,e){t.exports=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o,r,i){var a=t.call(this,e,n,o,r,i)||this;return a.dialog=e,a.button=n,a.editor=o,a.localization=r,a.toolsService=i,a}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.openDialog(this.dialog)},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandDialog=r},function(t,e){t.exports=s},function(t,e){t.exports=l},function(t,e){t.exports=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-format-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'tag\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]="dataItem.tag">\n <span *ngSwitchCase="\'h1\'" style="display: block; font-size: 2em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h2\'" style="display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h3\'" style="display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h4\'" style="display: block; font-size: 1em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h5\'" style="display: block; font-size: .83em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h6\'" style="display: block; font-size: .67em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'p\'" style="display: block; margin-left: 0;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchDefault>{{ dataItem.text }}</span>\n </ng-container>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FormatDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-fontfamily-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'fontName\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <span [ngStyle]="{ \'font-family\': dataItem.fontName }">\n {{ dataItem.text }}\n </span>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontFamilyDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-fontsize-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'size\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontSizeDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(17),s=n(2),l=n(9),d=n(3),c=n(7),u=n(30),p=n(16),f=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.editor=e,i.localization=n,i.dialogService=o,i.ngZone=r,i.tabindex=-1,i.disabled=!1,i.views=["palette"],i}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(t){this.views=[t]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get(this.editorCommand)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.disabled=n.disabled}))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},e.prototype.handleValueChange=function(t){this.editor.exec(this.editorCommand,t),this.editor.view.focus()},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.handleValueChange(t.color)},e.prototype.onOpen=function(t){this.valueCache=t.value,t.reset()},e.prototype.onClose=function(t){var e=this;t.value||(t.value=this.valueCache),this.editor.shouldEmitFocus=!0,this.ngZone.onStable.pipe(p.take(1)).subscribe((function(){return e.editor.view.focus()}))},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return l.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:u.ColorPickerDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,value:this.value,title:this.title,editorCommand:this.editorCommand,paletteSettings:this.paletteSettings,icon:this.icon,views:this.views})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.colorPickerButton.nativeElement.focus():this.colorPicker.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"icon",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"paletteSettings",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"editorCommand",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Array)],e.prototype,"views",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],e.prototype,"view",null),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("colorpicker",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("colorpicker",{read:a.ColorPickerComponent,static:!1}),o.__metadata("design:type",a.ColorPickerComponent)],e.prototype,"colorPicker",void 0),o.__decorate([r.ViewChild("colorPickerButton",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"colorPickerButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-colorpicker",template:'\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [attr.title]="title"\n [icon]="icon"\n [views]="views"\n [format]="\'hex\'"\n [value]="value"\n [paletteSettings]="paletteSettings"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="handleValueChange($event)"\n (activeColorClick)="handleActiveColorClick($event)"\n (open)="onOpen(colorpicker)"\n (close)="onClose(colorpicker)"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #colorPickerButton\n class="k-overflow-button"\n [icon]="icon"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[d.EditorComponent,s.EditorLocalizationService,c.DialogService,r.NgZone])],e)}(i.ToolBarToolComponent);e.EditorColorPickerComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commandIcons={alignCenter:"align-center",alignJustify:"align-justify",alignLeft:"align-left",alignRight:"align-right",backColor:"background",blockquote:"blockquote",bold:"bold",cleanFormatting:"clear-css",createLink:"link-horizontal",foreColor:"foreground-color",indent:"indent-increase",insertFile:"file-add",insertImage:"image",insertOrderedList:"list-ordered",insertUnorderedList:"list-unordered",italic:"italic",outdent:"indent-decrease",print:"print",redo:"redo",selectAll:"select-all",strikethrough:"strikethrough",subscript:"sub-script",superscript:"sup-script",underline:"underline",undo:"undo",unlink:"unlink-horizontal",viewSource:"html",insertTable:"table-insert",addColumnBefore:"table-column-insert-left",addColumnAfter:"table-column-insert-right",addRowBefore:"table-row-insert-above",addRowAfter:"table-row-insert-below",deleteRow:"table-row-delete",deleteColumn:"table-column-delete",mergeCells:"cells-merge",splitCell:"cell-split-horizontally",deleteTable:"table-delete"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(39),r=n(8);e.Schema=r.Schema;var i=r.marks,a=Object.assign(r.nodes,o.semanticNodes);e.schema=new r.Schema({marks:i,nodes:a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data="",o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.textarea.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.editor.exec("setHTML",this.getData()),this.dialog.close(),this.editor.view.focus()},e.prototype.getData=function(){return this.textarea.nativeElement.value},e.prototype.setData=function(){this.data=this.indent(this.editor.getSource())},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.indent=function(t){return t.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("textarea",{static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"textarea",void 0),e=o.__decorate([r.Component({styles:["\n >>> .k-editor-textarea {\n height: 100%;\n }\n "],template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'viewSource\') }}\n </kendo-dialog-titlebar>\n <textarea [value]="data" #textarea class="k-textarea k-editor-textarea"></textarea>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogUpdate\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.SourceDialogComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(7),s=n(8),l=n(9),d=n(2),c=n(10),u=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.src=new i.FormControl("",i.Validators.required),o.alt=new i.FormControl(""),o.width=new i.FormControl("",i.Validators.min(1)),o.height=new i.FormControl("",i.Validators.min(1)),o.data={alt:"",height:"",src:"",width:""},o.imageData=new i.FormGroup({alt:o.alt,height:o.height,src:o.src,width:o.width}),o}return o.__extends(e,t),e.prototype.ngOnInit=function(){this.srcInputId="k-"+c.guid(),this.altTextInputId="k-"+c.guid(),this.widthInputId="k-"+c.guid(),this.heightInputId="k-"+c.guid()},e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.srcInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.src.value&&(this.editor.exec("insertImage",this.getData()),this.dialog.close(),this.editor.view.focus())},e.prototype.setData=function(t){var e=s.getNodeFromSelection(t);e&&(this.src.patchValue(e.attrs.src),this.alt.patchValue(e.attrs.alt),this.width.patchValue(e.attrs.width),this.height.patchValue(e.attrs.height))},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.getData=function(){return{alt:this.alt.value,height:this.normalizeDimension(this.height.value),src:this.src.value,width:this.normalizeDimension(this.width.value)}},e.prototype.normalizeDimension=function(t){return Number.isNaN(parseInt(t,10))||parseInt(t,10)<=0?"":l.safeString(parseInt(t,10))},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("srcInput",{read:r.ElementRef,static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"srcInput",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertImage\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <div class="k-edit-label">\n <label [for]="srcInputId">{{ textFor(\'imageWebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="srcInputId" #srcInput [formControl]="src" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="altTextInputId">{{ textFor(\'imageAltText\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="altTextInputId" [formControl]="alt" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="widthInputId">{{ textFor(\'imageWidth\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="widthInputId" [formControl]="width" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="heightInputId">{{ textFor(\'imageHeight\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="heightInputId" [formControl]="height" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="imageData.invalid"\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogInsert\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[a.DialogRef,d.EditorLocalizationService])],e)}(a.DialogContentBase);e.ImageDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(7),s=n(8),l=n(9),d=n(2),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.linkForm=new i.FormGroup({href:new i.FormControl("",i.Validators.required),text:new i.FormControl({value:"",disabled:!0},i.Validators.required),title:new i.FormControl("")}),o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.hrefInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){var t=this.getData();this.editor.exec(this.command,t),this.dialog.close(),this.editor.view.focus()},Object.defineProperty(e.prototype,"titleText",{get:function(){return this.localization.get(this.command)},enumerable:!0,configurable:!0}),e.prototype.setData=function(t,e){"createLink"===this.command&&this.linkForm.addControl("target",new i.FormControl);var n=s.getMark(t,t.schema.marks.link);if(n)this.linkForm.reset({href:n.attrs.href,title:n.attrs.title,target:l.isPresent(n.attrs.target),text:this.setLinkText(t)});else if(t.selection.empty){var o=e.applyToWord?s.expandSelection(t,(function(){}),e).state:t;o.selection.empty||this.linkForm.patchValue({text:s.getSelectionText(o)})}else this.linkForm.patchValue({text:s.getSelectionText(t)})},e.prototype.textForWithPrefix=function(t){var e="createLink"===this.command?"link":"file";return this.textFor(e+t)},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.setLinkText=function(t){var e=t.selection;if(e.empty&&e.$cursor){var n=e.$cursor,o=n.index();return n.parent.child(o).text}return s.getSelectionText(t)},e.prototype.getData=function(){var t=this.linkForm.value;return l.isPresent(this.linkForm.controls.target)&&(t.target=t.target?"_blank":null),t},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"command",void 0),o.__decorate([r.ViewChild("hrefInput",{read:r.ElementRef,static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"hrefInput",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <form novalidate [formGroup]="linkForm">\n <div class="k-edit-label">\n <label (click)="hrefInput.focus()">{{ textForWithPrefix(\'WebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #hrefInput formControlName="href" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="textInput.focus()">{{ textForWithPrefix(\'Text\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #textInput formControlName="text" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="titleInput.focus()">{{ textForWithPrefix(\'Title\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #titleInput formControlName="title" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <ng-container *ngIf="command === \'createLink\'">\n <div class="k-edit-label"></div>\n <div class="k-edit-field">\n <input type="checkbox" id="k-target-blank" kendoCheckBox formControlName="target" />\n <label class="k-checkbox-label" for="k-target-blank">{{ textForWithPrefix(\'OpenInNewWindow\') }}</label>\n </div>\n </ng-container>\n </form>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="linkForm.invalid" (click)="onConfirmAction()" [primary]="true">\n {{ textFor(\'dialogInsert\') }}\n </button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[a.DialogRef,d.EditorLocalizationService])],e)}(a.DialogContentBase);e.FileLinkDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditorErrorMessages={schemaType:"Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",setSchemaOnce:"The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",pluginsCallbackType:function(t){return"plugins must be a function, but received "+JSON.stringify(t)+"."},pastedContentCallbackType:function(t){return"pastedContent must be a function, but received "+JSON.stringify(t)+"."},setPluginsOnce:"The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/",setPlaceHolderOnce:"The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/",printTool:"The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o){var r=t.call(this)||this;return r.cleanedHtml=e,r.originalHtml=n,r.originalEvent=o,r}return o.__extends(e,t),e}(n(10).PreventableEvent);e.EditorPasteEvent=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(18),d=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.formatDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("format",{tag:this.value}),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("formatDropDownList",{read:l.FormatDropDownListComponent,static:!0}),o.__metadata("design:type",l.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'format\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-format-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FormatDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(17),d=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.colorPicker.focus()}))},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.value=t.color},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec(this.editorCommand,this.value),this.dialog.close(),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor,this.value=t.value,this.editorCommand=t.editorCommand,this.paletteSettings=t.paletteSettings,this.icon=t.icon,this.views=t.view?[t.view]:t.views},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("colorpicker",{read:l.ColorPickerComponent,static:!0}),o.__metadata("design:type",l.ColorPickerComponent)],e.prototype,"colorPicker",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-colorpicker\n #colorpicker\n [views]="views"\n [format]="\'hex\'"\n [attr.title]="title"\n [icon]="icon"\n [(value)]="value"\n [paletteSettings]="paletteSettings"\n (activeColorClick)="handleActiveColorClick($event)"\n >\n </kendo-colorpicker>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.ColorPickerDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(19),d=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontFamilyDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontFamily",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("fontFamilyDropDownList",{read:l.FontFamilyDropDownListComponent,static:!0}),o.__metadata("design:type",l.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontFamily\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontfamily-dropdownlist\n #fontFamilyDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontFamilyDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o}return o.__extends(e,t),e.prototype.onCancelAction=function(){this.dialog.close(),this.editor.view.focus()},e.prototype.onCellClick=function(t){this.dialog.close(),this.editor.exec("insertTable",t),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertTable\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-ct-popup k-window-content" style="text-align: center;">\n <kendo-popup-table-grid (cellClick)="onCellClick($event)"></kendo-popup-table-grid>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.InsertTableDialogComponent=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(20),d=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontSizeDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontSize",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("fontSizeDropDownList",{read:l.FontSizeDropDownListComponent,static:!0}),o.__metadata("design:type",l.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontSize\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontsize-dropdownlist\n #fontSizeDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontsize-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontSizeDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(22),r=function(){function t(t,e,n,r,i){var a=this;this.command=t,this.button=e,this.editor=n,this.localization=r,this.toolsService=i,setTimeout((function(){var t=a.localization.get(a.command);t&&(a.button.showText="overflow",a.button.showIcon="both",a.button.text=t),a.button.toolbarOptions.icon||(a.button.icon=o.commandIcons[a.command]),a.button.title=t,a.toolsService.needsCheck.next()}))}return t.prototype.ngOnInit=function(){this.subs=this.editor.stateChange.subscribe(this.onStateChange.bind(this)),this.subs.add(this.button.click.subscribe(this.clickHandler.bind(this))),this.subs.add(this.button.pointerdown.subscribe(this.pointerdownHandler.bind(this)))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},t.prototype.clickHandler=function(){},t.prototype.pointerdownHandler=function(t){},t.prototype.onStateChange=function(t){},t}();e.EditorCommandBase=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignCenter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignJustify",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignLeft",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignRight",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"backColor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"blockquote",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"bold",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"cleanFormatting",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"createLink",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fontFamily",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fontSize",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"foreColor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"format",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"indent",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertFile",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertImage",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertOrderedList",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertUnorderedList",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"italic",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"outdent",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"print",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"redo",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"selectAll",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"strikethrough",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"subscript",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"superscript",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"underline",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"undo",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"unlink",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"viewSource",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertTable",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addColumnBefore",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addColumnAfter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addRowBefore",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addRowAfter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteColumn",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteRow",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteTable",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogApply",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogCancel",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogInsert",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogUpdate",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileTitle",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileWebAddress",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageAltText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageHeight",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageWebAddress",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageWidth",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkOpenInNewWindow",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkTitle",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkWebAddress",void 0),e}(n(11).ComponentMessages);e.Messages=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3);e.EditorComponent=o.EditorComponent;var r=n(45);e.EditorModule=r.EditorModule;var i=n(23);e.schema=i.schema,e.Schema=i.Schema;var a=n(8);e.EditorState=a.EditorState,e.Plugin=a.Plugin,e.PluginKey=a.PluginKey,e.Transaction=a.Transaction,e.EditorView=a.EditorView,e.Decoration=a.Decoration,e.DecorationSet=a.DecorationSet,e.NodeType=a.NodeType,e.Node=a.Node,e.MarkType=a.MarkType,e.Mark=a.Mark,e.InputRule=a.InputRule,e.inputRules=a.inputRules,e.wrappingInputRule=a.wrappingInputRule,e.textblockTypeInputRule=a.textblockTypeInputRule,e.keymap=a.keymap,e.baseKeymap=a.baseKeymap,e.history=a.history,e.dropCursor=a.dropCursor,e.gapCursor=a.gapCursor,e.tableNodes=a.tableNodes,e.getSelectionText=a.getSelectionText;var s=n(28);e.EditorPasteEvent=s.EditorPasteEvent},function(t,e){t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-angular-editor",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1646819765,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(40);e.semanticTagNames=["article","main","nav","header","footer","aside","section"],e.semanticNodes=e.semanticTagNames.reduce((function(t,e){var n,i;return Object.assign(t,((n={})[e]=(i=e,{content:"block*",group:"block",attrs:o.__assign({},r.commonAttributes()),parseDOM:[{tag:i,getAttrs:r.getAttributes}],toDOM:function(t){return r.hasAttrs(t.attrs)?[i,r.getAttrs(t.attrs),r.hole]:[i,r.hole]}}),n))}),{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);e.hasAttrs=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},e.getAttrs=function(t,e){var n={};for(var o in t)o&&null!==t[o]&&o!==e&&(n[o]=t[o]);return n},e.getAttributes=function(t){for(var e,n={},o=t.attributes,r=0;r<o.length;r++)n[(e=o[r]).name]=e.value;return n},e.serializeDOMAttrs=function(t){return Array.from(t.attributes).reduce((function(t,e){var n;return Object.assign({},t,((n={})[e.name]=e.value,n))}),{})},e.commonAttributes=function(){return o.__assign({},e.createDefaultAttributes(["class","id","style"]))},e.createDefaultAttributes=function(t){return void 0===t&&(t=[]),o.__assign({},t.reduce((function(t,e){var n;return o.__assign({},t,((n={})[e]={default:null},n))}),{}))},e.hole=0,e.isSchemaNode=function(t){return function(e){return e.type.name===t}},e.isTable=e.isSchemaNode("table"),e.isTableBody=e.isSchemaNode("table_body"),e.isTableHead=e.isSchemaNode("table_head"),e.isTableFoot=e.isSchemaNode("table_foot"),e.isTableRow=e.isSchemaNode("table_row"),e.isTableCell=e.isSchemaNode("table_cell"),e.isTableHeaderCell=e.isSchemaNode("table_header")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(8),i=n(42),a=function(t,e){return r.alignBlocks(r.alignRemoveRules)(t,e)},s={bold:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.bold,{applyToWord:t}))},cleanFormatting:function(t){return r.cleanFormatting(t)},createLink:function(t){return r.expandToWordWrap(r.applyLink,{mark:"link",attrs:t.value,applyToWord:t.applyToWord})},fontFamily:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"font-family",value:t.value,applyToWord:t.applyToWord})},fontSize:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"font-size",value:t.value+"px",applyToWord:t.applyToWord})},insertFile:function(t){return r.expandToWordWrap(r.applyLink,{mark:"link",attrs:t,applyToWord:t.applyToWord})},insertText:function(t){return r.insertText(t)},italic:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.italic,{applyToWord:t}))},strikethrough:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.strikethrough,{applyToWord:t}))},subscript:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.subscript,{applyToWord:t}))},superscript:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.superscript,{applyToWord:t}))},underline:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.underline,{applyToWord:t}))},unlink:function(){return r.removeLink(r.link)},foreColor:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"color",value:t.value,applyToWord:t.applyToWord})},backColor:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"background-color",value:t.value,applyToWord:t.applyToWord})},selectAll:function(){return function(t,e){return r.selectAll(t,e)}}},l={alignCenter:function(){return function(t,e){return r.isAligned(t,r.alignCenterRules)?a(t,e):r.alignBlocks(r.alignCenterRules)(t,e)}},alignJustify:function(){return function(t,e){return r.isAligned(t,r.alignJustifyRules)?a(t,e):r.alignBlocks(r.alignJustifyRules)(t,e)}},alignLeft:function(){return function(t,e){return r.isAligned(t,r.alignLeftRules)?a(t,e):r.alignBlocks(r.alignLeftRules)(t,e)}},alignRight:function(){return function(t,e){return r.isAligned(t,r.alignRightRules)?a(t,e):r.alignBlocks(r.alignRightRules)(t,e)}},format:function(t){return r.formatBlockElements(t.tag)},getHTML:function(){return r.getHtml},indent:function(){return r.indent},insertImage:function(t){return r.insertImage(t)},insertOrderedList:function(){return r.toggleOrderedList},insertUnorderedList:function(){return r.toggleUnorderedList},outdent:function(){return r.outdent},redo:function(){return r.redo},setHTML:function(t){var e=t.content,n=t.parseOptions;return r.setHtml(e,"setHTML",n)},undo:function(){return r.undo},blockquote:function(){return r.blockquote}},d={insertTable:function(t){return i.insertTable(t)},addColumnBefore:function(){return r.addColumnBefore},addColumnAfter:function(){return r.addColumnAfter},addRowBefore:function(){return r.addRowBefore},addRowAfter:function(){return r.addRowAfter},deleteRow:function(){return r.deleteRow},deleteColumn:function(){return r.deleteColumn},mergeCells:function(){return r.mergeCells},splitCell:function(){return r.splitCell},deleteTable:function(){return r.deleteTable}};e.editorCommands=Object.assign({},s,l,d)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);e.insertTable=function(t){return function(e,n){var r=o.createTable(e.schema.nodes,t.rows,t.cols);r&&o.insertNode(r,!0)(e,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8),r=n(8);e.getToolbarState=function(t,e){return{alignCenter:{selected:r.isAligned(t,r.alignCenterRules),disabled:!1},alignJustify:{selected:r.isAligned(t,r.alignJustifyRules),disabled:!1},alignLeft:{selected:r.isAligned(t,r.alignLeftRules),disabled:!1},alignRight:{selected:r.isAligned(t,r.alignRightRules),disabled:!1},bold:{selected:r.hasMark(t,r.bold),disabled:!1},cleanFormatting:{selected:!1,disabled:!o.cleanFormatting()(t)},format:{selected:r.activeNode(t),disabled:!1},blockquote:{selected:!1,disabled:!o.blockquote(t)},indent:{selected:!1,disabled:!(r.canIndentAsListItem(t,t.schema.nodes.list_item)||r.canBeIndented(t,r.indentRules))},insertOrderedList:{selected:r.hasNode(t,t.schema.nodes.ordered_list),disabled:!1},insertUnorderedList:{selected:r.hasNode(t,t.schema.nodes.bullet_list),disabled:!1},italic:{selected:r.hasMark(t,r.italic),disabled:!1},unlink:{selected:!1,disabled:!r.hasMark(t,r.link)},outdent:{selected:!1,get disabled(){return!(r.hasNode(t,t.schema.nodes.blockquote)||r.canOutdentAsListItem(t,r.outdentRules)||o.isIndented(t,r.outdentRules.nodes))}},redo:{selected:!1,disabled:!r.redo(t)},selectAll:{selected:!1,disabled:!1},strikethrough:{selected:r.hasMark(t,r.strikethrough),disabled:!1},style:{selected:r.getActiveMarks(t,t.schema.marks.style),disabled:!1},subscript:{selected:r.hasMark(t,r.subscript),disabled:!1},superscript:{selected:r.hasMark(t,r.superscript),disabled:!1},underline:{selected:r.hasMark(t,r.underline),disabled:!1},undo:{selected:!1,disabled:!r.undo(t)},createLink:{selected:!1,get disabled(){var n=t.selection.empty;return e&&e.applyToWord&&n?r.expandSelection(t,(function(){}),e).state.selection.empty:n}},insertFile:{selected:!1,disabled:t.selection.empty},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},print:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!r.addColumnBefore(t)},addColumnAfter:{selected:!1,disabled:!r.addColumnAfter(t)},addRowBefore:{selected:!1,disabled:!r.addRowBefore(t)},addRowAfter:{selected:!1,disabled:!r.addRowAfter(t)},deleteRow:{selected:!1,disabled:!r.deleteRow(t)},deleteColumn:{selected:!1,disabled:!r.deleteColumn(t)},mergeCells:{selected:!1,disabled:!r.mergeCells(t)},splitCell:{selected:!1,disabled:!r.splitCell(t)},deleteTable:{selected:!1,disabled:!r.deleteTable(t)}}},e.initialToolBarState={alignCenter:{selected:!1,disabled:!1},alignJustify:{selected:!1,disabled:!1},alignLeft:{selected:!1,disabled:!1},alignRight:{selected:!1,disabled:!1},bold:{selected:!1,disabled:!1},italic:{selected:!1,disabled:!1},underline:{selected:!1,disabled:!1},strikethrough:{selected:!1,disabled:!1},subscript:{selected:!1,disabled:!1},superscript:{selected:!1,disabled:!1},format:{selected:{text:"Format",tag:null},disabled:!1},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!1},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!1},indent:{selected:!1,disabled:!1},outdent:{selected:!1,disabled:!1},insertOrderedList:{selected:!1,disabled:!1},insertUnorderedList:{selected:!1,disabled:!1},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!1},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!1}},e.disabledToolBarState={alignCenter:{selected:!1,disabled:!0},alignJustify:{selected:!1,disabled:!0},alignLeft:{selected:!1,disabled:!0},alignRight:{selected:!1,disabled:!0},bold:{selected:!1,disabled:!0},italic:{selected:!1,disabled:!0},underline:{selected:!1,disabled:!0},strikethrough:{selected:!1,disabled:!0},subscript:{selected:!1,disabled:!0},superscript:{selected:!1,disabled:!0},format:{selected:{text:"Format",tag:null},disabled:!0},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!0},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!0},indent:{selected:!1,disabled:!0},outdent:{selected:!1,disabled:!0},insertOrderedList:{selected:!1,disabled:!0},insertUnorderedList:{selected:!1,disabled:!0},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!0},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!0},viewSource:{selected:!1,disabled:!0},insertTable:{selected:!1,disabled:!0},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultStyle='\n html, body {\n margin: 0;\n height: 100%;\n padding: 0;\n }\n\n html {\n min-height: 100%;\n }\n\n body {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n }\n\n body > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n }\n\n div.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .k-content > p {\n margin: 0 0 1em;\n }\n\n .k-content table {\n white-space: pre-wrap;\n }\n\n .k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n }\n\n .k-content .k-text-highlighted {\n background-color: #bbdefb;\n }\n\n .k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n }\n\n .ProseMirror-hideselection *::selection { background: transparent; }\n .ProseMirror-hideselection *::-moz-selection { background: transparent; }\n .ProseMirror-hideselection { caret-color: transparent; }\n\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n .k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n }\n\n .k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n }\n\n .k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n }\n\n .k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n }\n\n .k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n }\n\n .k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n }\n\n .k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n }\n\n .k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n }\n\n .k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n }\n\n .k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n }\n\n .ProseMirror .k-placeholder::before {\n content: attr(data-placeholder);\n height: 0;\n color: #8a8a8a;\n float: left;\n opacity: 1;\n cursor: text;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n li.ProseMirror-selectednode {\n outline: none;\n }\n\n li.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n }\n',e.tablesStyles='\n.ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n}\n\n.ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n}\n\n.ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n}\n\n.ProseMirror th {\n font-weight: bold;\n text-align: left;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n/* Give selected cells a blue overlay */\n.ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: "";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n}\n',e.rtlStyles="body { direction: rtl }"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(46),a=n(12),s=n(4),l=n(13),d=n(7),c=n(47),u=n(17),p=n(3),f=n(25),h=n(24),m=n(26),v=n(29),g=n(30),y=n(31),b=n(32),w=n(48),k=n(49),_=n(50),C=n(21),x=n(51),S=n(53),E=n(54),T=n(55),M=n(56),D=n(57),O=n(58),A=n(59),I=n(60),B=n(61),N=n(62),z=n(63),R=n(64),P=n(65),L=n(66),F=n(67),$=n(68),V=n(69),j=n(70),W=n(71),H=n(72),q=n(73),J=n(74),K=n(75),U=n(76),G=n(77),X=n(78),Y=n(79),Z=n(80),Q=n(81),tt=n(82),et=n(83),nt=n(84),ot=n(85),rt=n(86),it=n(87),at=n(88),st=n(89),lt=n(18),dt=n(19),ct=n(20),ut=n(33),pt=n(90),ft=n(91),ht=n(92),mt=[E.EditorAlignLeftButtonDirective,T.EditorAlignCenterButtonDirective,M.EditorAlignRightButtonDirective,D.EditorAlignJustifyButtonDirective,K.EditorInsertFileButtonDirective,A.EditorRedoButtonDirective,I.EditorUndoButtonDirective,B.EditorInsertImageButtonDirective,N.EditorIndentButtonDirective,z.EditorOutdentButtonDirective,R.EditorCreateLinkButtonDirective,P.EditorUnlinkButtonDirective,L.EditorInsertOrderedListButtonDirective,F.EditorInsertUnorderedListButtonDirective,$.EditorViewSourceButtonDirective,V.EditorBoldButtonDirective,j.EditorItalicButtonDirective,W.EditorUnderlineButtonDirective,H.EditorStrikethroughButtonDirective,q.EditorSubscriptButtonDirective,J.EditorSuperscriptButtonDirective,U.EditorForeColorDirective,G.EditorBackColorDirective,X.EditorCleanFormattingButtonDirective,Y.EditorAddColumnBeforeButtonDirective,Z.EditorAddColumnAfterButtonDirective,Q.EditorAddRowBeforeButtonDirective,tt.EditorAddRowAfterButtonDirective,et.EditorDeleteColumnButtonDirective,nt.EditorDeleteRowButtonDirective,ot.EditorDeleteTableButtonDirective,rt.EditorMergeCellsButtonDirective,it.EditorSplitCellButtonDirective,st.CustomMessagesComponent,at.LocalizedMessagesDirective,pt.DropDownToolDirective,ft.EditorPrintDirective,ht.EditorSelectAllButtonDirective,O.EditorBlockquoteDirective],vt=[k.EditorFontSizeComponent,_.EditorFontFamilyComponent,w.EditorFormatComponent,C.EditorColorPickerComponent,x.EditorInsertTableButtonComponent],gt=[m.FileLinkDialogComponent,f.ImageDialogComponent,h.SourceDialogComponent,v.FormatDialogComponent,g.ColorPickerDialogComponent,y.FontFamilyDialogComponent,ut.FontSizeDialogComponent,b.InsertTableDialogComponent],yt=[S.PopupTableGridComponent,lt.FormatDropDownListComponent,dt.FontFamilyDropDownListComponent,ct.FontSizeDropDownListComponent],bt=function(){function t(){}return t=o.__decorate([r.NgModule({declarations:[p.EditorComponent,mt,vt,gt,yt],entryComponents:[gt],exports:[p.EditorComponent,mt,vt,s.ToolBarModule,c.ButtonModule,a.FormsModule,a.ReactiveFormsModule,yt],imports:[i.CommonModule,a.FormsModule,a.ReactiveFormsModule,c.ButtonModule,u.ColorPickerModule,d.DialogModule,l.DropDownsModule,u.NumericTextBoxModule,u.CheckBoxModule,s.ToolBarModule,u.TextBoxModule]})],t)}();e.EditorModule=bt},function(t,e){t.exports=u},function(t,e){t.exports=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(7),s=n(9),l=n(3),d=n(2),c=n(29),u=n(18),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"Paragraph",tag:"p"},{text:"Heading 1",tag:"h1"},{text:"Heading 2",tag:"h2"},{text:"Heading 3",tag:"h3"},{text:"Heading 4",tag:"h4"},{text:"Heading 5",tag:"h5"},{text:"Heading 6",tag:"h6"}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.formatDropDownList||t.formatDropDownList.dropDownList.isOpen)||null===e.dataItem.tag},setTimeout((function(){t.defaultItem={text:t.title,tag:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.format,o=t.data.findIndex((function(t){return t.tag===n.selected.tag}));t.value=-1!==o?n.selected.tag:null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("format",{tag:t}),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.tag===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){var t=this.formatDropDownList.element;if(t)return s.outerWidth(t.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("format")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:c.FormatDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.formatButton.nativeElement.focus():this.formatDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("formatDropDownList",{static:!1}),o.__metadata("design:type",u.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),o.__decorate([r.ViewChild("formatButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"formatButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFormat]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-format-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #formatButton\n [tabindex]="tabindex"\n type="button"\n kendoButton\n class="k-overflow-button"\n [icon]="\'apply-format\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[l.EditorComponent,a.DialogService,d.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFormatComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(9),s=n(3),l=n(2),d=n(7),c=n(33),u=n(20),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"8px",size:8},{text:"10px",size:10},{text:"12px",size:12},{text:"14px",size:14},{text:"18px",size:18},{text:"24px",size:24},{text:"36px",size:36}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontSizeDropDownList||t.fontSizeDropDownList.dropDownList.isOpen)||null===e.dataItem.size},setTimeout((function(){t.defaultItem={text:t.title,size:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=(a.getUniqueStyleValues(n.selected,"font-size").match(/\d+/g)||[null])[0],t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("fontSize",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.size===parseInt(t,10)}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontSize")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:c.FontSizeDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontSizeButton.nativeElement.focus():this.fontSizeDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:u.FontSizeDropDownListComponent,static:!1}),o.__metadata("design:type",u.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),o.__decorate([r.ViewChild("fontSizeButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"fontSizeButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontSize]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontsize-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontsize-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontSizeButton\n class="k-overflow-button"\n [icon]="\'font-size\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[s.EditorComponent,d.DialogService,l.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontSizeComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(9),s=n(3),l=n(2),d=n(7),c=n(31),u=n(19),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"Arial",fontName:'Arial,"Helvetica Neue",Helvetica,sans-serif'},{text:"Courier New",fontName:'"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace'},{text:"Georgia",fontName:'Georgia,Times,"Times New Roman",serif'},{fontName:'Impact,Haettenschweiler,"Franklin Gothic Bold",Charcoal,"Helvetica Inserat","Bitstream Vera Sans Bold","Arial Black","sans serif"',text:"Impact"},{text:"Lucida Console",fontName:'"Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace'},{text:"Tahoma",fontName:"Tahoma,Verdana,Segoe,sans-serif"},{text:"Times New Roman",fontName:'TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif'},{text:"Trebuchet MS",fontName:'"Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif'},{text:"Verdana",fontName:"Verdana,Geneva,sans-serif"}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontFamilyDropDownList||t.fontFamilyDropDownList.dropDownList.isOpen)||null===e.dataItem.fontName},setTimeout((function(){t.defaultItem={text:t.title,fontName:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=a.getUniqueStyleValues(n.selected,"font-family")||null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("fontFamily",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.fontName===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontFamily")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:c.FontFamilyDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontFamilyButton.nativeElement.focus():this.fontFamilyDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:u.FontFamilyDropDownListComponent,static:!1}),o.__metadata("design:type",u.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),o.__decorate([r.ViewChild("fontFamilyButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"fontFamilyButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontFamily]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontfamily-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontFamilyButton\n class="k-overflow-button"\n [icon]="\'font-family\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[s.EditorComponent,d.DialogService,l.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontFamilyComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(15),a=n(16),s=n(4),l=n(52),d=n(9),c=n(3),u=n(2),p=n(7),f=n(32),h=n(10),m=function(t){function e(e,n,o,s){var l=t.call(this)||this;return l.editor=e,l.localization=n,l.popupService=o,l.dialogService=s,l.open=!1,l.buttonBlurred=new r.EventEmitter,l.cellClicked=new r.EventEmitter,l.subs=l.editor.stateChange.subscribe((function(t){var e=t.insertTable;l.disabled=e.disabled})),l.subs.add(l.buttonBlurred.pipe(a.concatMap((function(){return i.interval(200).pipe(a.take(1),a.takeUntil(l.cellClicked))}))).subscribe((function(){l.toggle(!1)}))),l}var n;return o.__extends(e,t),n=e,e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return d.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("insertTable")},enumerable:!0,configurable:!0}),e.prototype.toggle=function(t){this.open=void 0===t?!this.open:t,this.destroyPopup(),this.open&&this.createPopup()},e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:f.InsertTableDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor})},e.prototype.onBlur=function(){this.tabIndex=-1,this.buttonBlurred.emit()},e.prototype.onCellClick=function(t){this.cellClicked.emit(),this.toggle(!1),this.editor.exec("insertTable",t)},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabIndex=0,this.getButton().focus()},e.prototype.handleKey=function(t){return t.keyCode===h.Keys.Space||t.keyCode===h.Keys.Enter||(this.tabIndex=-1,!1)},e.prototype.onTableWizardClick=function(){},e.prototype.createPopup=function(){var t="rtl"===this.editor.direction?"right":"left",e={horizontal:t,vertical:"bottom"},n={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.element,anchorAlign:e,animate:!0,content:this.popupGridTemplate,popupAlign:n,popupClass:"k-ct-popup k-group k-reset k-state-border-up",positionMode:"absolute"});var o=this.popupRef.popupElement;o.style.width="190px",o.style.height="164px",o.setAttribute("dir",this.editor.direction)},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},e.prototype.getButton=function(){return(this.overflows?this.overflowElement:this.element).nativeElement},o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!1}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("overflowElement",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"overflowElement",void 0),o.__decorate([r.ViewChild("popupGridTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupGridTemplate",void 0),e=n=o.__decorate([r.Component({providers:[{provide:s.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-editor-insert-table-button",template:'\n <ng-template #toolbarTemplate>\n <button\n type="button"\n kendoButton\n #element\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="toggle()"\n (blur)="onBlur()"\n ></button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n kendoButton\n #overflowElement\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="openDialog()">\n {{ title }}\n </button>\n </ng-template>\n <ng-template #popupGridTemplate>\n <kendo-popup-table-grid (cellClick)="onCellClick($event)" (tableWizardClick)="onTableWizardClick()"></kendo-popup-table-grid>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[c.EditorComponent,u.EditorLocalizationService,l.PopupService,p.DialogService])],e)}(s.ToolBarToolComponent);e.EditorInsertTableButtonComponent=m},function(t,e){t.exports=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(){function t(){this.cellClick=new r.EventEmitter,this.tableWizardClick=new r.EventEmitter,this.state={rows:-1,cols:-1},this.rows=6,this.cols=8}return Object.defineProperty(t.prototype,"message",{get:function(){var t=this.state,e=t.rows,n=t.cols;return"Create a "+(e>-1?e+1:"")+" "+(n>-1?"x":"")+" "+(n>-1?n+1:"")+" table"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return Array.from(Array(this.rows*this.cols).keys())},enumerable:!0,configurable:!0}),t.prototype.selected=function(t){var e=this.state,n=e.rows,o=e.cols,r=Math.floor(t/this.cols),i=t%this.cols;return r<=n&&i<=o},t.prototype.setState=function(t){var e=Math.floor(t/this.cols),n=t%this.cols;this.state={rows:e,cols:n}},t.prototype.resetState=function(){this.state={rows:-1,cols:-1}},t.prototype.insertTable=function(){this.cellClick.emit(this.state)},t.prototype.openTableWizard=function(){this.tableWizardClick.emit()},o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"cellClick",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"tableWizardClick",void 0),t=o.__decorate([r.Component({selector:"kendo-popup-table-grid",template:'\n <div style="border-color: inherit;" (mouseleave)="resetState()" (click)="insertTable()">\n <span *ngFor="let i of cells"\n class="k-ct-cell"\n [class.k-state-selected]="selected(i)"\n [class.k-state-disabled]="!selected(i)"\n (mouseenter)="setState(i)">\n </span>\n </div>\n <div class="k-status" unselectable="on">{{ message }}</div>\n \x3c!-- uncomment when TableWizard is completed\n <div class="k-editor-toolbar" unselectable="on">\n <button type="button" kendoButton class="k-tool" [icon]="\'table-wizard\'" (click)="openTableWizard()" title="Table Wizard">Table Wizard</button>\n </div>\n --\x3e\n '})],t)}();e.PopupTableGridComponent=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"alignLeft",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignLeftButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignLeftButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"alignCenter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignCenterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignCenterButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"alignRight",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignRightButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignRightButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"alignJustify",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignJustifyButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignJustifyButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){var i=t.call(this,"blockquote",e,n,o,r)||this;return i.editor=n,i}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorBlockquoteButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorBlockquoteDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"redo",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorRedoButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorRedoButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"undo",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUndoButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUndoButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"insertImage",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertImageButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorInsertImageButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"indent",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorIndentButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorIndentButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"outdent",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorOutdentButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorOutdentButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"createLink",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorCreateLinkButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorCreateLinkButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"unlink",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUnlinkButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUnlinkButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"insertOrderedList",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertOrderedListButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorInsertOrderedListButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"insertUnorderedList",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertUnorderedListButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorInsertUnorderedListButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"viewSource",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorViewSourceButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorViewSourceButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"bold",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorBoldButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorBoldButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"italic",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorItalicButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorItalicButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"underline",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUnderlineButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUnderlineButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"strikethrough",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorStrikethroughButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorStrikethroughButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"subscript",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSubscriptButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSubscriptButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"superscript",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSuperscriptButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSuperscriptButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(3),a=n(14),s=n(4),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"insertFile",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertFileButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[s.ToolBarButtonComponent,i.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorInsertFileButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(21),a=n(22),s=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=a.commandIcons.foreColor,this.colorPicker.editorCommand="foreColor"}return t=o.__decorate([r.Directive({selector:"[kendoEditorForeColor]"}),o.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorForeColorDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(21),a=n(22),s=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=a.commandIcons.backColor,this.colorPicker.editorCommand="backColor"}return t=o.__decorate([r.Directive({selector:"[kendoEditorBackColor]"}),o.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorBackColorDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"cleanFormatting",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorCleanFormattingButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorCleanFormattingButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"addColumnBefore",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnBeforeButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddColumnBeforeButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"addColumnAfter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnAfterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddColumnAfterButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"addRowBefore",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowBeforeButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddRowBeforeButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"addRowAfter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowAfterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddRowAfterButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"deleteColumn",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteColumnButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteColumnButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"deleteRow",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteRowButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteRowButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"deleteTable",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteTableButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteTableButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"mergeCells",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorMergeCellsButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorMergeCellsButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"splitCell",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSplitCellButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSplitCellButtonDirective=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=n(35),s=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return o.__extends(e,t),n=e,e=n=o.__decorate([r.Directive({providers:[{provide:a.Messages,useExisting:r.forwardRef((function(){return n}))}],selector:"[kendoEditorLocalizedMessages]"}),o.__metadata("design:paramtypes",[i.LocalizationService])],e)}(a.Messages);e.LocalizedMessagesDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=n(35),s=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),e=n=o.__decorate([r.Component({providers:[{provide:a.Messages,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-editor-messages",template:""}),o.__metadata("design:paramtypes",[i.LocalizationService])],e)}(a.Messages);e.CustomMessagesComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(){function t(t,e){this.hostEl=t,this.zone=e,this.preventDefault=function(t){t.preventDefault()}}return Object.defineProperty(t.prototype,"hostElement",{get:function(){return this.hostEl.nativeElement},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.zone.runOutsideAngular((function(){t.hostElement.addEventListener("pointerdown",t.preventDefault)}))},t.prototype.ngOnDestroy=function(){this.hostElement.removeEventListener("pointerdown",this.preventDefault)},t=o.__decorate([r.Directive({selector:"[kendoEditorDropDownTool]"}),o.__metadata("design:paramtypes",[r.ElementRef,r.NgZone])],t)}();e.DropDownToolDirective=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(27),c=n(5),u=function(t){function e(e,n,o,r){var i=t.call(this,"print",e,n,o,r)||this;return i.editor=n,i}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){if(r.isDevMode&&!this.editor.iframe)throw new Error(d.EditorErrorMessages.printTool)},e.prototype.clickHandler=function(){if(this.editor.iframe){var t=this.editor.view,e=t&&t.dom,n=e&&e.ownerDocument,o=n&&n.defaultView;o&&o.print()}},e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorPrintButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorPrintDirective=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),d=n(5),c=function(t){function e(e,n,o,r){return t.call(this,"selectAll",e,n,o,r)||this}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.shouldEmitFocus=!0,t.prototype.clickHandler.call(this)},e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSelectAllButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSelectAllButtonDirective=c}])}));
20
+ var o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n}function s(t,e,n,o){var r,i=arguments.length,a=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,o);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,n,a):r(e,n))||a);return i>3&&a&&Object.defineProperty(e,n,a),a}function l(t,e){return function(n,o){e(n,o,t)}}function c(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function d(t,e,n,o){return new(n||(n=Promise))((function(r,i){function a(t){try{l(o.next(t))}catch(t){i(t)}}function s(t){try{l(o.throw(t))}catch(t){i(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))}function u(t,e){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=e.call(t,a)}catch(t){i=[6,t],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function p(t,e,n,o){void 0===o&&(o=n),t[o]=e[n]}function f(t,e){for(var n in t)"default"===n||e.hasOwnProperty(n)||(e[n]=t[n])}function h(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],o=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,r,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return a}function v(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}function g(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function y(t){return this instanceof y?(this.v=t,this):new y(t)}function b(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,r=n.apply(t,e||[]),i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(t){r[t]&&(o[t]=function(e){return new Promise((function(n,o){i.push([t,e,n,o])>1||s(t,e)}))})}function s(t,e){try{(n=r[t](e)).value instanceof y?Promise.resolve(n.value.v).then(l,c):d(i[0][2],n)}catch(t){d(i[0][3],t)}var n}function l(t){s("next",t)}function c(t){s("throw",t)}function d(t,e){t(e),i.shift(),i.length&&s(i[0][0],i[0][1])}}function w(t){var e,n;return e={},o("next"),o("throw",(function(t){throw t})),o("return"),e[Symbol.iterator]=function(){return this},e;function o(o,r){e[o]=t[o]?function(e){return(n=!n)?{value:y(t[o](e)),done:"return"===o}:r?r(e):e}:r}}function k(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=h(t),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){(function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)})(o,r,(e=t[n](e)).done,e.value)}))}}}function _(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function C(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function x(t){return t&&t.__esModule?t:{default:t}}function S(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function E(t,e,n){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,n),n}},function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=function(t){function e(e,n,o){return t.call(this,e,n,o)||this}return o.__extends(e,t),e=o.__decorate([o.__param(0,r.Inject(i.L10N_PREFIX)),o.__param(1,r.Optional()),o.__param(2,r.Optional()),o.__param(2,r.Inject(i.RTL)),o.__metadata("design:paramtypes",[String,i.MessageService,Boolean])],e)}(i.LocalizationService);e.EditorLocalizationService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(15),s=n(16),l=n(4),c=n(7),d=n(10),u=n(8),p=n(37),f=n(38),h=n(23),m=n(41),v=n(43),g=n(9),y=n(24),b=n(25),w=n(26),k=n(11),_=n(2),C=n(44),x=n(27),S=n(5),E=n(28),T={convertMsLists:!1,removeAttributes:[],removeHtmlComments:!1,removeInvalidHTML:!0,removeMsClasses:!1,removeMsStyles:!1,stripTags:[]},M=g.conditionallyExecute(u.removeComments),D=g.conditionallyExecute(u.sanitize),O=function(t){if("all"===t.removeAttributes)return{"*":u.removeAttribute};var e=g.removeEmptyEntries({style:t.removeMsStyles?u.sanitizeStyleAttr:void 0,class:t.removeMsClasses?u.sanitizeClassAttr:void 0});return t.removeAttributes.reduce((function(t,e){var n;return o.__assign({},t,((n={})[e]=u.removeAttribute,n))}),e)},A=function(){function t(t,e,n,i,s,l){var c=this;this.dialogService=t,this.localization=e,this.cdr=n,this.ngZone=i,this.element=s,this.toolsService=l,this.iframe=!0,this.applyToWord=!1,this.preserveWhitespace=!1,this.resizable=!1,this.valueChange=new r.EventEmitter,this.onFocus=new r.EventEmitter,this.paste=new r.EventEmitter,this.onBlur=new r.EventEmitter,this.hostClass=!0,this.stateChange=new a.BehaviorSubject(v.initialToolBarState),this.valueModified=new a.Subject,this._readonly=!1,this._placeholder="",this.inForm=!1,this.afterViewInit=new a.Subject,this.contentAreaLoaded=new a.Subject,this.dispatchTransaction=function(t){var e=t.docChanged;if(!(c.disabled||c.readonly&&e)){if(e){var n=t.doc,o=u.getHtml({doc:n});c.trOnChange=t,c.htmlOnChange=o,c.ngZone.run((function(){c.valueModified.next(o)}))}e&&!c.inForm||c.view.updateState(c.view.state.apply(t))}},this.transformPastedHTML=function(t){var e=o.__assign({},T,c.pasteCleanupSettings),n=g.pipe(D(e.removeInvalidHTML),M(e.removeHtmlComments))(t),r=u.pasteCleanup(n,{convertMsLists:e.convertMsLists,stripTags:e.stripTags.join("|"),attributes:O(e)});if(d.hasObservers(c.paste)){var i=new E.EditorPasteEvent(r,t,c._pasteEvent);return c.ngZone.run((function(){return c.paste.emit(i)})),i.isDefaultPrevented()?"":i.cleanedHtml}return r},this.changeValue=function(t){var e=c._value;if(c._value=t,c._view){if(c.htmlOnChange===t&&c.trOnChange)c.view.updateState(c.view.state.apply(c.trOnChange));else if((e||"")!==(t||"")){if(c.iframe&&!c.container.element.nativeElement.contentWindow)return;var n=c.view.state,o=u.parseContent(t||"",n.schema,{preserveWhitespace:c.preserveWhitespace}),r=n.tr.setSelection(new u.AllSelection(n.doc)).replaceSelectionWith(o);c.view.updateState(n.apply(r))}c.trOnChange=null,c.htmlOnChange=null}},this.onChangeCallback=function(t){c.changeValue(t)},this.onTouchedCallback=function(t){},this.onPaste=function(t,e){return c._pasteEvent=e,!1},p.validatePackage(f.packageMetadata),this.direction=e.rtl?"rtl":"ltr",this.subs=a.zip(this.afterViewInit.asObservable(),this.contentAreaLoaded.asObservable()).subscribe((function(){return c.initialize()}))}var e;return e=t,Object.defineProperty(t.prototype,"value",{get:function(){if(this.trOnChange)return this.htmlOnChange;var t=this._view?this.getSource():this._value;return"<p></p>"===t?this._value?"":this._value:t},set:function(t){this.changeValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t||!1,this._view&&this._view.updateState(this._view.state),this._disabled&&(this.readonly=!1),this._disabled||this._readonly?this.stateChange.next(v.disabledToolBarState):this.stateChange.next(v.initialToolBarState)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"readonly",{get:function(){return this._readonly},set:function(t){if(this._readonly=t||!1,this._view){var e=void 0,n=(e=this.iframe?this.container.element.nativeElement.contentWindow:window).getSelection().focusNode;this._view.dom.contains(n)&&e.getSelection().removeAllRanges();var o=this._view.state.doc,r=this._view.state.tr.setSelection(u.TextSelection.create(o,1));this._view.dispatch(r)}this._readonly?(this.toolbar&&(this.toolbar.tabindex=-1),this.stateChange.next(v.disabledToolBarState)):(this.toolbar&&(this.toolbar.tabindex=0),this.stateChange.next(v.initialToolBarState))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this._schema},set:function(t){if(r.isDevMode){if(!(t instanceof u.Schema))throw new Error(x.EditorErrorMessages.schemaType);if(this._view)throw new Error(x.EditorErrorMessages.setSchemaOnce)}this._schema=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plugins",{get:function(){return this._plugins},set:function(t){if(r.isDevMode){if("function"!=typeof t)throw new Error(x.EditorErrorMessages.pluginsCallbackType(t));if(this._view)throw new Error(x.EditorErrorMessages.setPluginsOnce)}this._plugins=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"placeholder",{get:function(){return this._placeholder},set:function(t){if(r.isDevMode&&this._view)throw new Error(x.EditorErrorMessages.setPlaceHolderOnce);this._placeholder=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resizableClass",{get:function(){return!!this.resizable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIE",{get:function(){return this.iframe&&g.detectIE()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minWidth",{get:function(){var t=this.resizable;return t.minWidth?t.minWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){var t=this.resizable;return t.maxWidth?t.maxWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){var t=this.resizable;return t.minHeight?t.minHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){var t=this.resizable;return t.maxHeight?t.maxHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"toolbar",{get:function(){return this.defaultToolbarComponent||this.userToolBarComponent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selectionText",{get:function(){return this._view&&this._view.state?u.getSelectionText(this._view.state):""},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var t=this;this.subs.add(this.localization.changes.subscribe((function(e){var n=e.rtl;t.direction=n?"rtl":"ltr"}))),this.subs.add(this.toolsService.needsCheck.subscribe((function(){return t.cdr.markForCheck()})))},t.prototype.ngAfterViewInit=function(){this.afterViewInit.next(),this.iframe||this.contentAreaLoaded.next(),this.resizable&&this.normalizeSize()},t.prototype.ngOnChanges=function(t){var e=this;t.value&&this.view&&this.changeValue(t.value.currentValue),t.iframe&&!t.iframe.isFirstChange()&&this.ngZone.onStable.pipe(s.take(1)).subscribe((function(){return e.initialize()})),t.resizable&&!t.resizable.isFirstChange()&&this.normalizeSize()},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.iframeOnLoad=function(){this.contentAreaLoaded.next()},t.prototype.exec=function(t,e){"setHTML"===t&&"string"==typeof e?e={content:e,parseOptions:{preserveWhitespace:this.preserveWhitespace}}:["fontFamily","fontSize","foreColor","backColor","createLink"].some((function(e){return e===t}))&&(e={value:e,applyToWord:this.applyToWord}),m.editorCommands[t](e)(this._view.state,this._view.dispatch,this._view)},t.prototype.openDialog=function(t){var e={createLink:{content:w.FileLinkDialogComponent},insertFile:{content:w.FileLinkDialogComponent},insertImage:{content:b.ImageDialogComponent},viewSource:{content:y.SourceDialogComponent,height:400,width:500}},n=Object.assign({appendTo:this.dialogContainer},e[t]);this.toolbar.toggle(!1);var o=this.dialogService.open(n).content.instance;"createLink"!==t&&"insertFile"!==t||(o.command=t),o.editor=this,o.setData(this._view.state,{applyToWord:this.applyToWord})},t.prototype.focus=function(){this.focusChangedProgrammatically=!0,this._view.focus(),this.focusChangedProgrammatically=!1},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,this._view.dom.blur(),this.focusChangedProgrammatically=!1},t.prototype.getSource=function(){return u.getHtml(this._view.state)},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe(),this._styleObserver&&this._styleObserver.disconnect()},t.prototype.writeValue=function(t){this.inForm=!0,this.value=null===t?void 0:t},t.prototype.registerOnChange=function(t){this.onChangeCallback=t},t.prototype.registerOnTouched=function(t){this.onTouchedCallback=t},t.prototype.isEmpty=function(){return!1},t.prototype.initialize=function(){var t=this;if(d.isDocumentAvailable()){var e=this.schema||h.schema,n=this.container.element.nativeElement,o=u.parseContent((this.value||"").trim(),e,{preserveWhitespace:this.preserveWhitespace});if(this.iframe){var r=n.contentDocument,i=r.createElement("meta");i.setAttribute("charset","utf-8"),r.head.appendChild(i),[C.defaultStyle,C.tablesStyles,"rtl"===this.dir?C.rtlStyles:void 0].forEach((function(t){if(t){var e=r.createElement("style");e.appendChild(r.createTextNode(t)),r.head.appendChild(e)}})),(l=r.createElement("div")).classList.add("k-content"),r.body.appendChild(l)}else{var l=document.createElement("div");n.appendChild(l)}var c=[new u.Plugin({key:new u.PluginKey("editor-tabindex"),props:{attributes:function(){return{tabIndex:t.readonly?"0":""}}}}),new u.Plugin({key:new u.PluginKey("toolbar-tools-update"),view:function(){return{update:function(e){t.disabled||t.stateChange.next(t.readonly?v.disabledToolBarState:v.getToolbarState(e.state,{applyToWord:t.applyToWord}))}}}}),u.history(),u.keymap(u.buildListKeymap(e)),u.keymap(u.buildKeymap(e,{applyToWord:this.applyToWord})),u.keymap(u.baseKeymap),u.gapCursor(),u.imageResizing(),u.tableEditing(),u.caretColor()];this.placeholder&&c.push(u.placeholder(this.placeholder));var p=u.EditorState.create({schema:e,doc:o,plugins:g.isPresent(this.plugins)?this.plugins(c):c});if(this.iframe?this.viewMountElement=n.contentDocument.querySelector("div"):this.viewMountElement=n.querySelector("div"),this.ngZone.runOutsideAngular((function(){t._view=new u.EditorView({mount:t.viewMountElement},{state:p,editable:function(){return!t.readonly},dispatchTransaction:t.dispatchTransaction,transformPastedHTML:t.transformPastedHTML,handleDOMEvents:{paste:t.onPaste}})})),this._view){var f=void 0,m=this.element.nativeElement.querySelector(".k-editor-content").classList;f=this.iframe?this.container.element.nativeElement.contentDocument:this.container.element.nativeElement,this.subs.add(a.fromEvent(f,"focusin").subscribe((function(e){if(t.readonly&&m.add("k-focus"),!t.focusChangedProgrammatically||t.shouldEmitFocus){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")&&!t.shouldEmitFocus||t.ngZone.run((function(){return t.onFocus.emit()})),t.shouldEmitFocus=!1}}))),this.subs.add(a.fromEvent(f,"focusout").subscribe((function(e){if(t.readonly&&m.remove("k-focus"),!t.focusChangedProgrammatically){var n=e.relatedTarget;n&&n.classList.contains("k-colorpicker")||t.ngZone.run((function(){return t.onBlur.emit()}))}})))}this.subs.add(this.stateChange.subscribe((function(){t.userToolBarComponent?t.userToolBarComponent.cdr.detectChanges():t.cdr.detectChanges()}))),this.subs.add(this.valueModified.subscribe((function(e){t.onChangeCallback(e),t.valueChange.emit(e),t.cdr.markForCheck()}))),this.subs.add(a.fromEvent(this.viewMountElement,"keyup").pipe(s.map((function(t){return t.keyCode})),s.filter((function(t){return 121===t})),s.map((function(){return t.userToolBarElement||t.defaultToolbar}))).subscribe((function(t){return t.nativeElement.focus()}))),this.subs.add(a.fromEvent(this.viewMountElement,"blur").pipe(s.filter((function(e){return!t.viewMountElement.contains(e.relatedTarget)}))).subscribe((function(){return t.onTouchedCallback()})))}},t.prototype.normalizeSize=function(){var t=this;if("object"==typeof this.resizable&&!this._styleObserver){var e=this.element.nativeElement;this._styleObserver=new MutationObserver((function(){t.ngZone.runOutsideAngular((function(){return t.normalizeProperties(e)}))})),this._styleObserver.observe(e,{attributeFilter:["style"]})}},t.prototype.normalizeProperties=function(t){var e=Object.keys(this.resizable),n=parseInt(t.style.width,10),o=parseInt(t.style.height,10),r=this.resizable;e.forEach((function(e){var i=e.startsWith("min"),a=!i,s=e.endsWith("Width"),l=!s;i&&s?n<r.minWidth&&(t.style.width=r.minWidth+"px"):i&&l?o<r.minHeight&&(t.style.height=r.minHeight+"px"):a&&s?n>r.maxWidth&&(t.style.width=r.maxWidth+"px"):o>r.maxHeight&&(t.style.height=r.maxHeight+"px")}))},o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],t.prototype,"value",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[Boolean])],t.prototype,"disabled",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[Boolean])],t.prototype,"readonly",null),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"iframe",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"applyToWord",void 0),o.__decorate([r.Input(),o.__metadata("design:type",u.Schema),o.__metadata("design:paramtypes",[u.Schema])],t.prototype,"schema",null),o.__decorate([r.Input(),o.__metadata("design:type",Function),o.__metadata("design:paramtypes",[Function])],t.prototype,"plugins",null),o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],t.prototype,"placeholder",null),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"preserveWhitespace",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"pasteCleanupSettings",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"resizable",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.Output("focus"),o.__metadata("design:type",r.EventEmitter)],t.prototype,"onFocus",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"paste",void 0),o.__decorate([r.Output("blur"),o.__metadata("design:type",r.EventEmitter)],t.prototype,"onBlur",void 0),o.__decorate([r.HostBinding("class.k-editor"),o.__metadata("design:type",Boolean)],t.prototype,"hostClass",void 0),o.__decorate([r.HostBinding("class.k-editor-resizable"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"resizableClass",null),o.__decorate([r.HostBinding("class.k-disabled"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isDisabled",null),o.__decorate([r.HostBinding("class.k-readonly"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isReadonly",null),o.__decorate([r.HostBinding("class.k-ie"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"isIE",null),o.__decorate([r.HostBinding("attr.dir"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"dir",null),o.__decorate([r.HostBinding("attr.ariaDisabled"),o.__metadata("design:type",Boolean),o.__metadata("design:paramtypes",[])],t.prototype,"ariaDisabled",null),o.__decorate([r.HostBinding("style.minWidth"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"minWidth",null),o.__decorate([r.HostBinding("style.maxWidth"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"maxWidth",null),o.__decorate([r.HostBinding("style.minHeight"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"minHeight",null),o.__decorate([r.HostBinding("style.maxHeight"),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[])],t.prototype,"maxHeight",null),o.__decorate([r.ContentChild(l.ToolBarComponent,{static:!1}),o.__metadata("design:type",l.ToolBarComponent)],t.prototype,"userToolBarComponent",void 0),o.__decorate([r.ContentChild(l.ToolBarComponent,{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],t.prototype,"userToolBarElement",void 0),o.__decorate([r.ViewChild("dialogsContainer",{read:r.ViewContainerRef,static:!0}),o.__metadata("design:type",r.ViewContainerRef)],t.prototype,"dialogContainer",void 0),o.__decorate([r.ViewChild("content",{read:r.ViewContainerRef,static:!1}),o.__metadata("design:type",r.ViewContainerRef)],t.prototype,"container",void 0),o.__decorate([r.ViewChild("defaultToolbar",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],t.prototype,"defaultToolbar",void 0),o.__decorate([r.ViewChild("defaultToolbar",{read:l.ToolBarComponent,static:!1}),o.__metadata("design:type",l.ToolBarComponent)],t.prototype,"defaultToolbarComponent",void 0),t=e=o.__decorate([r.Component({selector:"kendo-editor",providers:[_.EditorLocalizationService,S.EditorToolsService,{provide:k.LocalizationService,useExisting:_.EditorLocalizationService},{provide:k.L10N_PREFIX,useValue:"kendo.editor"},{provide:i.NG_VALUE_ACCESSOR,useExisting:r.forwardRef((function(){return e})),multi:!0},{provide:d.KendoInput,useExisting:r.forwardRef((function(){return e}))}],template:'\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter="kendo.editor.alignCenter|The title of the tool that aligns text in the center."\n alignCenter="Center text"\n i18n-alignJustify="kendo.editor.alignJustify|The title of the tool that justifies text both left and right."\n alignJustify="Justify"\n i18n-alignLeft="kendo.editor.alignLeft|The title of the tool that aligns text on the left."\n alignLeft="Align text left"\n i18n-alignRight="kendo.editor.alignRight|The title of the tool that aligns text on the right."\n alignRight="Align text right"\n i18n-backColor="kendo.editor.backColor|The title of the tool that changes the text background color."\n backColor="Background color"\n i18n-blockquote="kendo.editor.blockquote|The title of the tool that wraps an element in a blockquote"\n blockquote="Quotation"\n i18n-bold="kendo.editor.bold|The title of the tool that makes text bold."\n bold="Bold"\n i18n-cleanFormatting="kendo.editor.cleanFormatting|The title of the Clean Formatting tool."\n cleanFormatting="Clean formatting"\n i18n-createLink="kendo.editor.createLink|The title of the tool that creates hyperlinks."\n createLink="Insert link"\n i18n-dialogApply="kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs."\n dialogApply="Apply"\n i18n-dialogCancel="kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs."\n dialogCancel="Cancel"\n i18n-dialogInsert="kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs."\n dialogInsert="Insert"\n i18n-dialogUpdate="kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs."\n dialogUpdate="Update"\n i18n-fileText="kendo.editor.fileText|The caption for the file text in the insertFile dialog."\n fileText="Text"\n i18n-fileTitle="kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog."\n fileTitle="Title"\n i18n-fileWebAddress="kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog."\n fileWebAddress="Web address"\n i18n-fontFamily="kendo.editor.fontFamily|The title of the tool that changes the text font."\n fontFamily="Select font family"\n i18n-fontSize="kendo.editor.fontSize|The title of the tool that changes the text size."\n fontSize="Select font size"\n i18n-foreColor="kendo.editor.foreColor|The title of the tool that changes the text color."\n foreColor="Color"\n i18n-format="kendo.editor.format|The title of the tool that lets users choose block formats."\n format="Format"\n i18n-imageAltText="kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog."\n imageAltText="Alternate text"\n i18n-imageHeight="kendo.editor.imageHeight|The caption for the image height in the insertImage dialog."\n imageHeight="Height (px)"\n i18n-imageWebAddress="kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog."\n imageWebAddress="Web address"\n i18n-imageWidth="kendo.editor.imageWidth|The caption for the image width in the insertImage dialog."\n imageWidth="Width (px)"\n i18n-indent="kendo.editor.indent|The title of the tool that indents the content."\n indent="Indent"\n i18n-insertFile="kendo.editor.insertFile|The title of the tool that inserts links to files."\n insertFile="Insert file"\n i18n-insertImage="kendo.editor.insertImage|The title of the tool that inserts images."\n insertImage="Insert image"\n i18n-insertOrderedList="kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list."\n insertOrderedList="Insert ordered list"\n i18n-insertUnorderedList="kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list."\n insertUnorderedList="Insert unordered list"\n i18n-italic="kendo.editor.italic|The title of the tool that makes text italicized."\n italic="Italic"\n i18n-linkOpenInNewWindow="kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog."\n linkOpenInNewWindow="Open link in new window"\n i18n-linkText="kendo.editor.linkText|The caption for the link text in the createLink dialog."\n linkText="Text"\n i18n-linkTitle="kendo.editor.linkTitle|The caption for the link title in the createLink dialog."\n linkTitle="Title"\n i18n-linkWebAddress="kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog."\n linkWebAddress="Web address"\n i18n-outdent="kendo.editor.outdent|The title of the tool that outdents the content."\n outdent="Outdent"\n i18n-print="kendo.editor.print|The title of the print tool."\n print="Print"\n i18n-redo="kendo.editor.redo|The title of the tool that undos the last action."\n redo="Redo"\n i18n-selectAll="kendo.editor.selectAll|The title of the tool that selects all content."\n selectAll="Select All"\n i18n-strikethrough="kendo.editor.strikethrough|The title of the tool that strikes through text."\n strikethrough="Strikethrough"\n i18n-subscript="kendo.editor.subscript|The title of the tool that makes text subscript."\n subscript="Subscript"\n i18n-superscript="kendo.editor.superscript|The title of the tool that makes text superscript."\n superscript="Superscript"\n i18n-underline="kendo.editor.underline|The title of the tool that underlines text."\n underline="Underline"\n i18n-unlink="kendo.editor.unlink|The title of the tool that removes hyperlinks."\n unlink="Remove Link"\n i18n-undo="kendo.editor.undo|The title of the tool that undos the last action."\n undo="Undo"\n i18n-viewSource="kendo.editor.viewSource|The title of the tool that shows the editor value as HTML."\n viewSource="View source"\n i18n-insertTable="kendo.editor.insertTable|The title of the tool that inserts table."\n insertTable="Insert Table"\n i18n-addColumnBefore="kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column."\n addColumnBefore="Add column before"\n i18n-addColumnAfter="kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column."\n addColumnAfter="Add column after"\n i18n-addRowBefore="kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row."\n addRowBefore="Add row before"\n i18n-addRowAfter="kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row."\n addRowAfter="Add row after"\n i18n-deleteColumn="kendo.editor.deleteColumn|The title of the tool that deletes a table column."\n deleteColumn="Delete column"\n i18n-deleteRow="kendo.editor.deleteRow|The title of the tool that deletes a table row."\n deleteRow="Delete row"\n i18n-deleteTable="kendo.editor.deleteTable|The title of the tool that deletes a table."\n deleteTable="Delete table"\n >\n </ng-container>\n\n <ng-content select="kendo-toolbar"></ng-content>\n <kendo-toolbar [overflow]="true" [tabindex]="readonly ? -1 : 0" *ngIf="!userToolBarElement" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf="!iframe" #content [attr.dir]="direction" class="k-editor-content"></div>\n\n <div class="k-editor-content" *ngIf="iframe">\n <iframe #content srcdoc="<!DOCTYPE html>" frameborder="0" class="k-iframe" (load)="iframeOnLoad()"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ',styles:["\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "]}),o.__metadata("design:paramtypes",[c.DialogService,k.LocalizationService,r.ChangeDetectorRef,r.NgZone,r.ElementRef,S.EditorToolsService])],t)}();e.EditorComponent=A},function(t,n){t.exports=e},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(15),a=function(){function t(){this.needsCheck=new i.Subject}return t=o.__decorate([r.Injectable()],t)}();e.EditorToolsService=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o,r,i){var a=t.call(this,e,n,o,r,i)||this;return a.command=e,a.button=n,a.editor=o,a.localization=r,a.toolsService=i,a}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.exec(this.command,this.editor.applyToWord),this.editor.focus()},e.prototype.pointerdownHandler=function(t){t.preventDefault()},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandButton=r},function(t,e){t.exports=n},function(t,e,n){"use strict";function o(t){this.content=t}n.r(e),n.d(e,"getHtml",(function(){return Ie})),n.d(e,"setHtml",(function(){return Be})),n.d(e,"parseContent",(function(){return Ae})),n.d(e,"trimWhitespace",(function(){return Te})),n.d(e,"htmlToFragment",(function(){return Me})),n.d(e,"domToPmDoc",(function(){return Oe})),n.d(e,"pmDocToFragment",(function(){return De})),n.d(e,"applyInlineStyle",(function(){return dn})),n.d(e,"getInlineStyles",(function(){return sn})),n.d(e,"toggleInlineFormat",(function(){return cn})),n.d(e,"applyLink",(function(){return pn})),n.d(e,"removeLink",(function(){return un})),n.d(e,"insertText",(function(){return fn})),n.d(e,"insertImage",(function(){return hn})),n.d(e,"alignBlocks",(function(){return xn})),n.d(e,"isAligned",(function(){return Sn})),n.d(e,"cleanFormatting",(function(){return En})),n.d(e,"hasNode",(function(){return kn})),n.d(e,"activeNode",(function(){return Cn})),n.d(e,"formatBlockElements",(function(){return gn})),n.d(e,"getBlockFormats",(function(){return bn})),n.d(e,"parentBlockFormat",(function(){return _n})),n.d(e,"changeTextBlock",(function(){return mn})),n.d(e,"blockNodes",(function(){return vn})),n.d(e,"cleanTextBlockFormatting",(function(){return yn})),n.d(e,"hasMark",(function(){return Qe})),n.d(e,"getMark",(function(){return nn})),n.d(e,"getActiveMarks",(function(){return on})),n.d(e,"removeAllMarks",(function(){return Ye})),n.d(e,"cleanMarks",(function(){return Ze})),n.d(e,"selectionMarks",(function(){return en})),n.d(e,"indent",(function(){return Bo})),n.d(e,"canIndentAsListItem",(function(){return Oo})),n.d(e,"outdent",(function(){return No})),n.d(e,"canOutdentAsListItem",(function(){return Ao})),n.d(e,"isIndented",(function(){return Do})),n.d(e,"canBeIndented",(function(){return Io})),n.d(e,"indentBlocks",(function(){return Mo})),n.d(e,"toggleOrderedList",(function(){return Wo})),n.d(e,"toggleUnorderedList",(function(){return jo})),n.d(e,"toggleList",(function(){return Vo})),n.d(e,"listStyle",(function(){return $o})),n.d(e,"blockquote",(function(){return Eo})),n.d(e,"liftBlockquote",(function(){return To})),n.d(e,"hasSameMarkup",(function(){return $e})),n.d(e,"getSelectionText",(function(){return Ve})),n.d(e,"getNodeFromSelection",(function(){return je})),n.d(e,"selectedLineTextOnly",(function(){return We})),n.d(e,"expandSelection",(function(){return Je})),n.d(e,"expandToWordWrap",(function(){return Ke})),n.d(e,"canInsert",(function(){return Re})),n.d(e,"insertNode",(function(){return Fe})),n.d(e,"indentHtml",(function(){return He})),n.d(e,"alignLeftRules",(function(){return qo})),n.d(e,"alignCenterRules",(function(){return Ko})),n.d(e,"alignRightRules",(function(){return Jo})),n.d(e,"alignJustifyRules",(function(){return Uo})),n.d(e,"alignRemoveRules",(function(){return Go})),n.d(e,"indentRules",(function(){return jn})),n.d(e,"outdentRules",(function(){return Wn})),n.d(e,"nodes",(function(){return Ul})),n.d(e,"marks",(function(){return jl})),n.d(e,"buildKeymap",(function(){return Lc})),n.d(e,"buildListKeymap",(function(){return Fc})),n.d(e,"bold",(function(){return Oc})),n.d(e,"italic",(function(){return Ac})),n.d(e,"underline",(function(){return Ic})),n.d(e,"strikethrough",(function(){return Bc})),n.d(e,"subscript",(function(){return Nc})),n.d(e,"superscript",(function(){return zc})),n.d(e,"link",(function(){return Rc})),n.d(e,"sanitize",(function(){return Gc})),n.d(e,"removeComments",(function(){return Xc})),n.d(e,"removeTag",(function(){return Yc})),n.d(e,"pasteCleanup",(function(){return od})),n.d(e,"sanitizeClassAttr",(function(){return Qc})),n.d(e,"sanitizeStyleAttr",(function(){return nd})),n.d(e,"removeAttribute",(function(){return Zc})),n.d(e,"replaceImageSourcesFromRtf",(function(){return ud})),n.d(e,"convertMsLists",(function(){return Uc})),n.d(e,"find",(function(){return fd})),n.d(e,"findAt",(function(){return pd})),n.d(e,"findAll",(function(){return hd})),n.d(e,"replace",(function(){return md})),n.d(e,"replaceAll",(function(){return vd})),n.d(e,"placeholder",(function(){return wd})),n.d(e,"spacesFix",(function(){return Cd})),n.d(e,"textHighlight",(function(){return Sd})),n.d(e,"textHighlightKey",(function(){return xd})),n.d(e,"imageResizing",(function(){return Nd})),n.d(e,"imageResizeKey",(function(){return Ed})),n.d(e,"caretColor",(function(){return Rd})),n.d(e,"caretColorKey",(function(){return zd})),n.d(e,"autoJoin",(function(){return yo})),n.d(e,"baseKeymap",(function(){return So})),n.d(e,"chainCommands",(function(){return bo})),n.d(e,"createParagraphNear",(function(){return ro})),n.d(e,"deleteSelection",(function(){return Hn})),n.d(e,"exitCode",(function(){return oo})),n.d(e,"joinBackward",(function(){return qn})),n.d(e,"joinDown",(function(){return Qn})),n.d(e,"joinForward",(function(){return Gn})),n.d(e,"joinUp",(function(){return Zn})),n.d(e,"lift",(function(){return to})),n.d(e,"liftEmptyBlock",(function(){return io})),n.d(e,"macBaseKeymap",(function(){return Co})),n.d(e,"newlineInCode",(function(){return eo})),n.d(e,"pcBaseKeymap",(function(){return _o})),n.d(e,"selectAll",(function(){return co})),n.d(e,"selectNodeBackward",(function(){return Kn})),n.d(e,"selectNodeForward",(function(){return Xn})),n.d(e,"selectParentNode",(function(){return lo})),n.d(e,"selectTextblockEnd",(function(){return ho})),n.d(e,"selectTextblockStart",(function(){return fo})),n.d(e,"setBlockType",(function(){return vo})),n.d(e,"splitBlock",(function(){return ao})),n.d(e,"splitBlockKeepMarks",(function(){return so})),n.d(e,"toggleMark",(function(){return go})),n.d(e,"wrapIn",(function(){return mo})),n.d(e,"dropCursor",(function(){return Pd})),n.d(e,"GapCursor",(function(){return Fd})),n.d(e,"gapCursor",(function(){return Vd})),n.d(e,"HistoryState",(function(){return ec})),n.d(e,"closeHistory",(function(){return cc})),n.d(e,"history",(function(){return pc})),n.d(e,"redo",(function(){return hc})),n.d(e,"redoDepth",(function(){return vc})),n.d(e,"undo",(function(){return fc})),n.d(e,"undoDepth",(function(){return mc})),n.d(e,"InputRule",(function(){return gc})),n.d(e,"closeDoubleQuote",(function(){return xc})),n.d(e,"closeSingleQuote",(function(){return Ec})),n.d(e,"ellipsis",(function(){return _c})),n.d(e,"emDash",(function(){return kc})),n.d(e,"inputRules",(function(){return yc})),n.d(e,"openDoubleQuote",(function(){return Cc})),n.d(e,"openSingleQuote",(function(){return Sc})),n.d(e,"smartQuotes",(function(){return Tc})),n.d(e,"textblockTypeInputRule",(function(){return Dc})),n.d(e,"undoInputRule",(function(){return wc})),n.d(e,"wrappingInputRule",(function(){return Mc})),n.d(e,"keydownHandler",(function(){return dr})),n.d(e,"keymap",(function(){return cr})),n.d(e,"ContentMatch",(function(){return B})),n.d(e,"DOMParser",(function(){return tt})),n.d(e,"DOMSerializer",(function(){return ut})),n.d(e,"Fragment",(function(){return i})),n.d(e,"Mark",(function(){return d})),n.d(e,"MarkType",(function(){return Y})),n.d(e,"Node",(function(){return D})),n.d(e,"NodeRange",(function(){return E})),n.d(e,"NodeType",(function(){return K})),n.d(e,"ReplaceError",(function(){return u})),n.d(e,"ResolvedPos",(function(){return k})),n.d(e,"Schema",(function(){return Z})),n.d(e,"Slice",(function(){return p})),n.d(e,"addListNodes",(function(){return Nn})),n.d(e,"bulletList",(function(){return An})),n.d(e,"liftListItem",(function(){return Pn})),n.d(e,"listItem",(function(){return In})),n.d(e,"orderedList",(function(){return On})),n.d(e,"sinkListItem",(function(){return Ln})),n.d(e,"splitListItem",(function(){return Rn})),n.d(e,"wrapInList",(function(){return zn})),n.d(e,"AllSelection",(function(){return se})),n.d(e,"EditorState",(function(){return ve})),n.d(e,"NodeSelection",(function(){return ie})),n.d(e,"Plugin",(function(){return be})),n.d(e,"PluginKey",(function(){return _e})),n.d(e,"Selection",(function(){return te})),n.d(e,"SelectionRange",(function(){return ne})),n.d(e,"TextSelection",(function(){return oe})),n.d(e,"Transaction",(function(){return ue})),n.d(e,"CellSelection",(function(){return Ms})),n.d(e,"TableMap",(function(){return ls})),n.d(e,"TableView",(function(){return wl})),n.d(e,"__clipCells",(function(){return Bs})),n.d(e,"__insertCells",(function(){return Rs})),n.d(e,"__pastedCells",(function(){return As})),n.d(e,"addColSpan",(function(){return Es})),n.d(e,"addColumn",(function(){return Ys})),n.d(e,"addColumnAfter",(function(){return Qs})),n.d(e,"addColumnBefore",(function(){return Zs})),n.d(e,"addRow",(function(){return ol})),n.d(e,"cellAround",(function(){return ms})),n.d(e,"colCount",(function(){return _s})),n.d(e,"columnIsHeader",(function(){return Ts})),n.d(e,"columnResizing",(function(){return Cl})),n.d(e,"columnResizingPluginKey",(function(){return _l})),n.d(e,"deleteColumn",(function(){return el})),n.d(e,"deleteRow",(function(){return sl})),n.d(e,"deleteTable",(function(){return bl})),n.d(e,"findCell",(function(){return ks})),n.d(e,"fixTables",(function(){return Gs})),n.d(e,"fixTablesKey",(function(){return Us})),n.d(e,"goToNextCell",(function(){return yl})),n.d(e,"handlePaste",(function(){return Ws})),n.d(e,"inSameTable",(function(){return ws})),n.d(e,"isInTable",(function(){return vs})),n.d(e,"mergeCells",(function(){return cl})),n.d(e,"moveCellForward",(function(){return bs})),n.d(e,"nextCell",(function(){return Cs})),n.d(e,"pointsAtCell",(function(){return ys})),n.d(e,"removeColSpan",(function(){return Ss})),n.d(e,"removeColumn",(function(){return tl})),n.d(e,"removeRow",(function(){return al})),n.d(e,"rowIsHeader",(function(){return nl})),n.d(e,"selectedRect",(function(){return Xs})),n.d(e,"selectionCell",(function(){return gs})),n.d(e,"setAttr",(function(){return xs})),n.d(e,"setCellAttr",(function(){return pl})),n.d(e,"splitCell",(function(){return dl})),n.d(e,"splitCellWithType",(function(){return ul})),n.d(e,"tableEditing",(function(){return Dl})),n.d(e,"tableEditingKey",(function(){return hs})),n.d(e,"tableNodeTypes",(function(){return fs})),n.d(e,"tableNodes",(function(){return ps})),n.d(e,"toggleHeader",(function(){return hl})),n.d(e,"toggleHeaderCell",(function(){return gl})),n.d(e,"toggleHeaderColumn",(function(){return vl})),n.d(e,"toggleHeaderRow",(function(){return ml})),n.d(e,"updateColumnsOnResize",(function(){return kl})),n.d(e,"AddMarkStep",(function(){return $t})),n.d(e,"MapResult",(function(){return vt})),n.d(e,"Mapping",(function(){return yt})),n.d(e,"RemoveMarkStep",(function(){return Vt})),n.d(e,"ReplaceAroundStep",(function(){return Tt})),n.d(e,"ReplaceStep",(function(){return Et})),n.d(e,"Step",(function(){return xt})),n.d(e,"StepMap",(function(){return gt})),n.d(e,"StepResult",(function(){return St})),n.d(e,"Transform",(function(){return wt})),n.d(e,"TransformError",(function(){return bt})),n.d(e,"canJoin",(function(){return Nt})),n.d(e,"canSplit",(function(){return Bt})),n.d(e,"dropPoint",(function(){return Lt})),n.d(e,"findWrapping",(function(){return At})),n.d(e,"insertPoint",(function(){return Pt})),n.d(e,"joinPoint",(function(){return Rt})),n.d(e,"liftTarget",(function(){return Ot})),n.d(e,"replaceStep",(function(){return jt})),n.d(e,"Decoration",(function(){return Ba})),n.d(e,"DecorationSet",(function(){return Pa})),n.d(e,"EditorView",(function(){return Xa})),n.d(e,"__endComposition",(function(){return Ca})),n.d(e,"__parseFromClipboard",(function(){return Ji})),n.d(e,"__serializeForClipboard",(function(){return qi})),n.d(e,"createTable",(function(){return Kd})),n.d(e,"addRowAfter",(function(){return Xd})),n.d(e,"addRowBefore",(function(){return Gd})),n.d(e,"pmAddRowAfter",(function(){return il})),n.d(e,"pmAddRowBefore",(function(){return rl})),o.prototype={constructor:o,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),a=r.content.slice();return-1==i?a.push(n||t,e):(a[i+1]=e,n&&(a[i]=n)),new o(a)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new o(n)},addToStart:function(t,e){return new o([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new o(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),a=r.find(t);return i.splice(-1==a?i.length:a,0,e,n),new o(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=o.from(t)).size?new o(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=o.from(t)).size?new o(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=o.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},o.from=function(t){if(t instanceof o)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new o(e)};var r=o;var i=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},a={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};i.prototype.nodesBetween=function(t,e,n,o,r){void 0===o&&(o=0);for(var i=0,a=0;a<e;i++){var s=this.content[i],l=a+s.nodeSize;if(l>t&&!1!==n(s,o+a,r,i)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,e-c),n,o+c)}a=l}},i.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},i.prototype.textBetween=function(t,e,n,o){var r="",i=!0;return this.nodesBetween(t,e,(function(a,s){a.isText?(r+=a.text.slice(Math.max(t,s)-s,e-s),i=!n):a.isLeaf&&o?(r+="function"==typeof o?o(a):o,i=!n):!i&&a.isBlock&&(r+=n,i=!0)}),0),r},i.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,o=this.content.slice(),r=0;for(e.isText&&e.sameMarkup(n)&&(o[o.length-1]=e.withText(e.text+n.text),r=1);r<t.content.length;r++)o.push(t.content[r]);return new i(o,this.size+t.size)},i.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],o=0;if(e>t)for(var r=0,a=0;a<e;r++){var s=this.content[r],l=a+s.nodeSize;l>t&&((a<t||l>e)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,e-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,e-a-1))),n.push(s),o+=s.nodeSize),a=l}return new i(n,o)},i.prototype.cutByIndex=function(t,e){return t==e?i.empty:0==t&&e==this.content.length?this:new i(this.content.slice(t,e))},i.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var o=this.content.slice(),r=this.size+e.nodeSize-n.nodeSize;return o[t]=e,new i(o,r)},i.prototype.addToStart=function(t){return new i([t].concat(this.content),this.size+t.nodeSize)},i.prototype.addToEnd=function(t){return new i(this.content.concat(t),this.size+t.nodeSize)},i.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},a.firstChild.get=function(){return this.content.length?this.content[0]:null},a.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},a.childCount.get=function(){return this.content.length},i.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},i.prototype.maybeChild=function(t){return this.content[t]},i.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var o=this.content[e];t(o,n,e),n+=o.nodeSize}},i.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),function t(e,n,o){for(var r=0;;r++){if(r==e.childCount||r==n.childCount)return e.childCount==n.childCount?null:o;var i=e.child(r),a=n.child(r);if(i!=a){if(!i.sameMarkup(a))return o;if(i.isText&&i.text!=a.text){for(var s=0;i.text[s]==a.text[s];s++)o++;return o}if(i.content.size||a.content.size){var l=t(i.content,a.content,o+1);if(null!=l)return l}o+=i.nodeSize}else o+=i.nodeSize}}(this,t,e)},i.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),function t(e,n,o,r){for(var i=e.childCount,a=n.childCount;;){if(0==i||0==a)return i==a?null:{a:o,b:r};var s=e.child(--i),l=n.child(--a),c=s.nodeSize;if(s!=l){if(!s.sameMarkup(l))return{a:o,b:r};if(s.isText&&s.text!=l.text){for(var d=0,u=Math.min(s.text.length,l.text.length);d<u&&s.text[s.text.length-d-1]==l.text[l.text.length-d-1];)d++,o--,r--;return{a:o,b:r}}if(s.content.size||l.content.size){var p=t(s.content,l.content,o-1,r-1);if(p)return p}o-=c,r-=c}else o-=c,r-=c}}(this,t,e,n)},i.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return l(0,t);if(t==this.size)return l(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,o=0;;n++){var r=o+this.child(n).nodeSize;if(r>=t)return r==t||e>0?l(n+1,r):l(n,o);o=r}},i.prototype.toString=function(){return"<"+this.toStringInner()+">"},i.prototype.toStringInner=function(){return this.content.join(", ")},i.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},i.fromJSON=function(t,e){if(!e)return i.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new i(e.map(t.nodeFromJSON))},i.fromArray=function(t){if(!t.length)return i.empty;for(var e,n=0,o=0;o<t.length;o++){var r=t[o];n+=r.nodeSize,o&&r.isText&&t[o-1].sameMarkup(r)?(e||(e=t.slice(0,o)),e[e.length-1]=r.withText(e[e.length-1].text+r.text)):e&&e.push(r)}return new i(e||t,n)},i.from=function(t){if(!t)return i.empty;if(t instanceof i)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new i([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(i.prototype,a);var s={index:0,offset:0};function l(t,e){return s.index=t,s.offset=e,s}function c(t,e){if(t===e)return!0;if(!t||"object"!=typeof t||!e||"object"!=typeof e)return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var o=0;o<t.length;o++)if(!c(t[o],e[o]))return!1}else{for(var r in t)if(!(r in e)||!c(t[r],e[r]))return!1;for(var i in e)if(!(i in t))return!1}return!0}i.empty=new i([],0);var d=function(t,e){this.type=t,this.attrs=e};function u(t){var e=Error.call(this,t);return e.__proto__=u.prototype,e}d.prototype.addToSet=function(t){for(var e,n=!1,o=0;o<t.length;o++){var r=t[o];if(this.eq(r))return t;if(this.type.excludes(r.type))e||(e=t.slice(0,o));else{if(r.type.excludes(this.type))return t;!n&&r.type.rank>this.type.rank&&(e||(e=t.slice(0,o)),e.push(this),n=!0),e&&e.push(r)}}return e||(e=t.slice()),n||e.push(this),e},d.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},d.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},d.prototype.eq=function(t){return this==t||this.type==t.type&&c(this.attrs,t.attrs)},d.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},d.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},d.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},d.setFrom=function(t){if(!t||0==t.length)return d.none;if(t instanceof d)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},d.none=[],u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,u.prototype.name="ReplaceError";var p=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},f={size:{configurable:!0}};function h(t,e,n){if(n.openStart>t.depth)throw new u("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new u("Inconsistent open depths");return function t(e,n,o,r){var a=e.index(r),s=e.node(r);if(a==n.index(r)&&r<e.depth-o.openStart){var l=t(e,n,o,r+1);return s.copy(s.content.replaceChild(a,l))}if(o.content.size){if(o.openStart||o.openEnd||e.depth!=r||n.depth!=r){var c=function(t,e){for(var n=e.depth-t.openStart,o=e.node(n).copy(t.content),r=n-1;r>=0;r--)o=e.node(r).copy(i.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}(o,e),d=c.start,u=c.end;return b(s,function t(e,n,o,r,a){var s=e.depth>a&&v(e,n,a+1),l=r.depth>a&&v(o,r,a+1),c=[];y(null,e,a,c),s&&l&&n.index(a)==o.index(a)?(m(s,l),g(b(s,t(e,n,o,r,a+1)),c)):(s&&g(b(s,w(e,n,a+1)),c),y(n,o,a,c),l&&g(b(l,w(o,r,a+1)),c));return y(r,null,a,c),new i(c)}(e,d,u,n,r))}var p=e.parent,f=p.content;return b(p,f.cut(0,e.parentOffset).append(o.content).append(f.cut(n.parentOffset)))}return b(s,w(e,n,r))}(t,e,n,0)}function m(t,e){if(!e.type.compatibleContent(t.type))throw new u("Cannot join "+e.type.name+" onto "+t.type.name)}function v(t,e,n){var o=t.node(n);return m(o,e.node(n)),o}function g(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function y(t,e,n,o){var r=(e||t).node(n),i=0,a=e?e.index(n):r.childCount;t&&(i=t.index(n),t.depth>n?i++:t.textOffset&&(g(t.nodeAfter,o),i++));for(var s=i;s<a;s++)g(r.child(s),o);e&&e.depth==n&&e.textOffset&&g(e.nodeBefore,o)}function b(t,e){if(!t.type.validContent(e))throw new u("Invalid content for node "+t.type.name);return t.copy(e)}function w(t,e,n){var o=[];(y(null,t,n,o),t.depth>n)&&g(b(v(t,e,n+1),w(t,e,n+1)),o);return y(e,null,n,o),new i(o)}f.size.get=function(){return this.content.size-this.openStart-this.openEnd},p.prototype.insertAt=function(t,e){var n=function t(e,n,o,r){var i=e.findIndex(n),a=i.index,s=i.offset,l=e.maybeChild(a);if(s==n||l.isText)return r&&!r.canReplace(a,a,o)?null:e.cut(0,n).append(o).append(e.cut(n));var c=t(l.content,n-s-1,o);return c&&e.replaceChild(a,l.copy(c))}(this.content,t+this.openStart,e,null);return n&&new p(n,this.openStart,this.openEnd)},p.prototype.removeBetween=function(t,e){return new p(function t(e,n,o){var r=e.findIndex(n),i=r.index,a=r.offset,s=e.maybeChild(i),l=e.findIndex(o),c=l.index,d=l.offset;if(a==n||s.isText){if(d!=o&&!e.child(c).isText)throw new RangeError("Removing non-flat range");return e.cut(0,n).append(e.cut(o))}if(i!=c)throw new RangeError("Removing non-flat range");return e.replaceChild(i,s.copy(t(s.content,n-a-1,o-a-1)))}(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},p.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},p.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},p.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},p.fromJSON=function(t,e){if(!e)return p.empty;var n=e.openStart||0,o=e.openEnd||0;if("number"!=typeof n||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new p(i.fromJSON(t,e.content),n,o)},p.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,o=0,r=t.firstChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.firstChild)n++;for(var i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)o++;return new p(t,n,o)},Object.defineProperties(p.prototype,f),p.empty=new p(i.empty,0,0);var k=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},_={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};k.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},_.parent.get=function(){return this.node(this.depth)},_.doc.get=function(){return this.node(0)},k.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},k.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},k.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},k.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},k.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},k.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},k.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},_.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},_.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],o=t.child(e);return n?t.child(e).cut(n):o},_.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},k.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],o=0==e?0:this.path[3*e-1]+1,r=0;r<t;r++)o+=n.child(r).nodeSize;return o},k.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return d.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),o=t.maybeChild(e);if(!n){var r=n;n=o,o=r}for(var i=n.marks,a=0;a<i.length;a++)!1!==i[a].type.spec.inclusive||o&&i[a].isInSet(o.marks)||(i=i[a--].removeFromSet(i));return i},k.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,o=t.parent.maybeChild(t.index()),r=0;r<n.length;r++)!1!==n[r].type.spec.inclusive||o&&n[r].isInSet(o.marks)||(n=n[r--].removeFromSet(n));return n},k.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},k.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new E(this,t,n)},k.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},k.prototype.max=function(t){return t.pos>this.pos?t:this},k.prototype.min=function(t){return t.pos<this.pos?t:this},k.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},k.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],o=0,r=e,i=t;;){var a=i.content.findIndex(r),s=a.index,l=a.offset,c=r-l;if(n.push(i,s,o+l),!c)break;if((i=i.child(s)).isText)break;r=c-1,o+=l+1}return new k(e,n,r)},k.resolveCached=function(t,e){for(var n=0;n<C.length;n++){var o=C[n];if(o.pos==e&&o.doc==t)return o}var r=C[x]=k.resolve(t,e);return x=(x+1)%S,r},Object.defineProperties(k.prototype,_);var C=[],x=0,S=12,E=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},T={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};T.start.get=function(){return this.$from.before(this.depth+1)},T.end.get=function(){return this.$to.after(this.depth+1)},T.parent.get=function(){return this.$from.node(this.depth)},T.startIndex.get=function(){return this.$from.index(this.depth)},T.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(E.prototype,T);var M=Object.create(null),D=function(t,e,n,o){this.type=t,this.attrs=e,this.content=n||i.empty,this.marks=o||d.none},O={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};O.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},O.childCount.get=function(){return this.content.childCount},D.prototype.child=function(t){return this.content.child(t)},D.prototype.maybeChild=function(t){return this.content.maybeChild(t)},D.prototype.forEach=function(t){this.content.forEach(t)},D.prototype.nodesBetween=function(t,e,n,o){void 0===o&&(o=0),this.content.nodesBetween(t,e,n,o,this)},D.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},O.textContent.get=function(){return this.textBetween(0,this.content.size,"")},D.prototype.textBetween=function(t,e,n,o){return this.content.textBetween(t,e,n,o)},O.firstChild.get=function(){return this.content.firstChild},O.lastChild.get=function(){return this.content.lastChild},D.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},D.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},D.prototype.hasMarkup=function(t,e,n){return this.type==t&&c(this.attrs,e||t.defaultAttrs||M)&&d.sameSet(this.marks,n||d.none)},D.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},D.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},D.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},D.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return p.empty;var o=this.resolve(t),r=this.resolve(e),i=n?0:o.sharedDepth(e),a=o.start(i),s=o.node(i).content.cut(o.pos-a,r.pos-a);return new p(s,o.depth-i,r.depth-i)},D.prototype.replace=function(t,e,n){return h(this.resolve(t),this.resolve(e),n)},D.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),o=n.index,r=n.offset;if(!(e=e.maybeChild(o)))return null;if(r==t||e.isText)return e;t-=r+1}},D.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,o=e.offset;return{node:this.content.maybeChild(n),index:n,offset:o}},D.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,o=e.offset;if(o<t)return{node:this.content.child(n),index:n,offset:o};var r=this.content.child(n-1);return{node:r,index:n-1,offset:o-r.nodeSize}},D.prototype.resolve=function(t){return k.resolveCached(this,t)},D.prototype.resolveNoCache=function(t){return k.resolve(this,t)},D.prototype.rangeHasMark=function(t,e,n){var o=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(o=!0),!o})),o},O.isBlock.get=function(){return this.type.isBlock},O.isTextblock.get=function(){return this.type.isTextblock},O.inlineContent.get=function(){return this.type.inlineContent},O.isInline.get=function(){return this.type.isInline},O.isText.get=function(){return this.type.isText},O.isLeaf.get=function(){return this.type.isLeaf},O.isAtom.get=function(){return this.type.isAtom},D.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),I(this.marks,t)},D.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},D.prototype.canReplace=function(t,e,n,o,r){void 0===n&&(n=i.empty),void 0===o&&(o=0),void 0===r&&(r=n.childCount);var a=this.contentMatchAt(t).matchFragment(n,o,r),s=a&&a.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(var l=o;l<r;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0},D.prototype.canReplaceWith=function(t,e,n,o){if(o&&!this.type.allowsMarks(o))return!1;var r=this.contentMatchAt(t).matchType(n),i=r&&r.matchFragment(this.content,e);return!!i&&i.validEnd},D.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},D.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));for(var t=d.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!d.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(t){return t.type.name})));this.content.forEach((function(t){return t.check()}))},D.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},D.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var o=i.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,o,n)},Object.defineProperties(D.prototype,O);var A=function(t){function e(e,n,o,r){if(t.call(this,e,n,null,r),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):I(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(D);function I(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var B=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},N={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};B.parse=function(t,e){var n=new z(t,e);if(null==n.next)return B.empty;var o=P(n);n.next&&n.err("Unexpected trailing text");var r=function(t){var e=Object.create(null);return function n(o){var r=[];o.forEach((function(e){t[e].forEach((function(e){var n=e.term,o=e.to;if(n){var i=r.indexOf(n),a=i>-1&&r[i+1];W(t,o).forEach((function(t){a||r.push(n,a=[]),-1==a.indexOf(t)&&a.push(t)}))}}))}));for(var i=e[o.join(",")]=new B(o.indexOf(t.length-1)>-1),a=0;a<r.length;a+=2){var s=r[a+1].sort(j);i.next.push(r[a],e[s.join(",")]||n(s))}return i}(W(t,0))}(function(t){var e=[[]];return r(function t(e,i){if("choice"==e.type)return e.exprs.reduce((function(e,n){return e.concat(t(n,i))}),[]);if("seq"==e.type)for(var a=0;;a++){var s=t(e.exprs[a],i);if(a==e.exprs.length-1)return s;r(s,i=n())}else{if("star"==e.type){var l=n();return o(i,l),r(t(e.expr,l),l),[o(l)]}if("plus"==e.type){var c=n();return r(t(e.expr,i),c),r(t(e.expr,c),c),[o(c)]}if("opt"==e.type)return[o(i)].concat(t(e.expr,i));if("range"==e.type){for(var d=i,u=0;u<e.min;u++){var p=n();r(t(e.expr,d),p),d=p}if(-1==e.max)r(t(e.expr,d),d);else for(var f=e.min;f<e.max;f++){var h=n();o(d,h),r(t(e.expr,d),h),d=h}return[o(d)]}if("name"==e.type)return[o(i,null,e.value)]}}(t,0),n()),e;function n(){return e.push([])-1}function o(t,n,o){var r={term:o,to:n};return e[t].push(r),r}function r(t,e){t.forEach((function(t){return t.to=e}))}}(o));return function(t,e){for(var n=0,o=[t];n<o.length;n++){for(var r=o[n],i=!r.validEnd,a=[],s=0;s<r.next.length;s+=2){var l=r.next[s],c=r.next[s+1];a.push(l.name),!i||l.isText||l.hasRequiredAttrs()||(i=!1),-1==o.indexOf(c)&&o.push(c)}i&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(r,n),r},B.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},B.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var o=this,r=e;o&&r<n;r++)o=o.matchType(t.child(r).type);return o},N.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},N.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},B.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},B.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var o=[this];return function r(a,s){var l=a.matchFragment(t,n);if(l&&(!e||l.validEnd))return i.from(s.map((function(t){return t.createAndFill()})));for(var c=0;c<a.next.length;c+=2){var d=a.next[c],u=a.next[c+1];if(!d.isText&&!d.hasRequiredAttrs()&&-1==o.indexOf(u)){o.push(u);var p=r(u,s.concat(d));if(p)return p}}}(this,[])},B.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},B.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var o=n.shift(),r=o.match;if(r.matchType(t)){for(var i=[],a=o;a.type;a=a.via)i.push(a.type);return i.reverse()}for(var s=0;s<r.next.length;s+=2){var l=r.next[s];l.isLeaf||l.hasRequiredAttrs()||l.name in e||o.type&&!r.next[s+1].validEnd||(n.push({match:l.contentMatch,type:l,via:o}),e[l.name]=!0)}}},N.edgeCount.get=function(){return this.next.length>>1},B.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},B.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var o=1;o<n.next.length;o+=2)-1==t.indexOf(n.next[o])&&e(n.next[o])}(this),t.map((function(e,n){for(var o=n+(e.validEnd?"*":" ")+" ",r=0;r<e.next.length;r+=2)o+=(r?", ":"")+e.next[r].name+"->"+t.indexOf(e.next[r+1]);return o})).join("\n")},Object.defineProperties(B.prototype,N),B.empty=new B(!0);var z=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},R={next:{configurable:!0}};function P(t){var e=[];do{e.push(L(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function L(t){var e=[];do{e.push(F(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function F(t){for(var e=function(t){if(t.eat("(")){var e=P(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,o=n[e];if(o)return[o];var r=[];for(var i in n){var a=n[i];a.groups.indexOf(e)>-1&&r.push(a)}0==r.length&&t.err("No node type or group '"+e+"' found");return r}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=V(t,e)}return e}function $(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function V(t,e){var n=$(t),o=n;return t.eat(",")&&(o="}"!=t.next?$(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function j(t,e){return e-t}function W(t,e){var n=[];return function e(o){var r=t[o];if(1==r.length&&!r[0].term)return e(r[0].to);n.push(o);for(var i=0;i<r.length;i++){var a=r[i],s=a.term,l=a.to;s||-1!=n.indexOf(l)||e(l)}}(e),n.sort(j)}function H(t){var e=Object.create(null);for(var n in t){var o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function q(t,e){var n=Object.create(null);for(var o in t){var r=e&&e[o];if(void 0===r){var i=t[o];if(!i.hasDefault)throw new RangeError("No value supplied for attribute "+o);r=i.default}n[o]=r}return n}function J(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new G(t[n]);return e}R.next.get=function(){return this.tokens[this.pos]},z.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},z.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(z.prototype,R);var K=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=J(n.attrs),this.defaultAttrs=H(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},U={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};U.isInline.get=function(){return!this.isBlock},U.isTextblock.get=function(){return this.isBlock&&this.inlineContent},U.isLeaf.get=function(){return this.contentMatch==B.empty},U.isAtom.get=function(){return this.isLeaf||this.spec.atom},U.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},K.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},K.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},K.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:q(this.attrs,t)},K.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new D(this,this.computeAttrs(t),i.from(e),d.setFrom(n))},K.prototype.createChecked=function(t,e,n){if(e=i.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new D(this,this.computeAttrs(t),e,d.setFrom(n))},K.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=i.from(e)).size){var o=this.contentMatch.fillBefore(e);if(!o)return null;e=o.append(e)}var r=this.contentMatch.matchFragment(e).fillBefore(i.empty,!0);return r?new D(this,t,e.append(r),d.setFrom(n)):null},K.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},K.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},K.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},K.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:d.empty:t},K.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,o){return n[t]=new K(t,e,o)}));var o=e.spec.topNode||"doc";if(!n[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var r in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(K.prototype,U);var G=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},X={isRequired:{configurable:!0}};X.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(G.prototype,X);var Y=function(t,e,n,o){this.name=t,this.schema=n,this.spec=o,this.attrs=J(o.attrs),this.rank=e,this.excluded=null;var r=H(this.attrs);this.instance=r&&new d(this,r)};Y.prototype.create=function(t){return!t&&this.instance?this.instance:new d(this,q(this.attrs,t))},Y.compile=function(t,e){var n=Object.create(null),o=0;return t.forEach((function(t,r){return n[t]=new Y(t,o++,e,r)})),n},Y.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},Y.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},Y.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var Z=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=r.from(t.nodes),this.spec.marks=r.from(t.marks),this.nodes=K.compile(this.spec.nodes,this),this.marks=Y.compile(this.spec.marks,this);var n=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var i=this.nodes[o],a=i.spec.content||"",s=i.spec.marks;i.contentMatch=n[a]||(n[a]=B.parse(a,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==s?null:s?Q(this,s.split(" ")):""!=s&&i.inlineContent?null:[]}for(var l in this.marks){var c=this.marks[l],d=c.spec.excludes;c.excluded=null==d?[c]:""==d?[]:Q(this,d.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Q(t,e){for(var n=[],o=0;o<e.length;o++){var r=e[o],i=t.marks[r],a=i;if(i)n.push(i);else for(var s in t.marks){var l=t.marks[s];("_"==r||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}Z.prototype.node=function(t,e,n,o){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof K))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,o)},Z.prototype.text=function(t,e){var n=this.nodes.text;return new A(n,n.defaultAttrs,t,d.setFrom(e))},Z.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},Z.prototype.nodeFromJSON=function(t){return D.fromJSON(this,t)},Z.prototype.markFromJSON=function(t){return d.fromJSON(this,t)},Z.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var tt=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};tt.prototype.parse=function(t,e){void 0===e&&(e={});var n=new at(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},tt.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new at(this,e,!0);return n.addAll(t,null,e.from,e.to),p.maxOpen(n.finish())},tt.prototype.matchTag=function(t,e,n){for(var o=n?this.tags.indexOf(n)+1:0;o<this.tags.length;o++){var r=this.tags[o];if(lt(t,r.tag)&&(void 0===r.namespace||t.namespaceURI==r.namespace)&&(!r.context||e.matchesContext(r.context))){if(r.getAttrs){var i=r.getAttrs(t);if(!1===i)continue;r.attrs=i}return r}}},tt.prototype.matchStyle=function(t,e,n,o){for(var r=o?this.styles.indexOf(o)+1:0;r<this.styles.length;r++){var i=this.styles[r];if(!(0!=i.style.indexOf(t)||i.context&&!n.matchesContext(i.context)||i.style.length>t.length&&(61!=i.style.charCodeAt(t.length)||i.style.slice(t.length+1)!=e))){if(i.getAttrs){var a=i.getAttrs(e);if(!1===a)continue;i.attrs=a}return i}}},tt.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,o=0;o<e.length;o++){var r=e[o];if((null==r.priority?50:r.priority)<n)break}e.splice(o,0,t)}var o=function(e){var o=t.marks[e].spec.parseDOM;o&&o.forEach((function(t){n(t=ct(t)),t.mark=e}))};for(var r in t.marks)o(r);var i;for(var a in t.nodes)i=void 0,(i=t.nodes[a].spec.parseDOM)&&i.forEach((function(t){n(t=ct(t)),t.node=a}));return e},tt.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new tt(t,tt.schemaRules(t)))};var et={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},nt={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ot={ol:!0,ul:!0};function rt(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var it=function(t,e,n,o,r,i,a){this.type=t,this.attrs=e,this.solid=r,this.match=i||(4&a?null:t.contentMatch),this.options=a,this.content=[],this.marks=n,this.activeMarks=d.none,this.pendingMarks=o,this.stashMarks=[]};it.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(i.from(t));if(!e){var n,o=this.type.contentMatch;return(n=o.findWrapping(t.type))?(this.match=o,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},it.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var o=i.from(this.content);return!t&&this.match&&(o=o.append(this.match.fillBefore(i.empty,!0))),this.type?this.type.create(this.attrs,o,this.marks):o},it.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},it.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var o=n[e];(this.type?this.type.allowsMarkType(o.type):dt(o.type,t))&&!o.isInSet(this.activeMarks)&&(this.activeMarks=o.addToSet(this.activeMarks),this.pendingMarks=o.removeFromSet(this.pendingMarks))}},it.prototype.inlineContext=function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!et.hasOwnProperty(t.parentNode.nodeName.toLowerCase())};var at=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var o,r=e.topNode,i=rt(null,e.preserveWhitespace,0)|(n?4:0);o=r?new it(r.type,r.attrs,d.none,d.none,!0,e.topMatch||r.type.contentMatch,i):new it(n?null:t.schema.topNodeType,null,d.none,d.none,!0,null,i),this.nodes=[o],this.open=0,this.find=e.findPositions,this.needsBlock=!1},st={top:{configurable:!0},currentPos:{configurable:!0}};function lt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ct(t){var e={};for(var n in t)e[n]=t[n];return e}function dt(t,e){var n=e.schema.nodes,o=function(o){var r=n[o];if(r.allowsMarkType(t)){var i=[],a=function(t){i.push(t);for(var n=0;n<t.edgeCount;n++){var o=t.edge(n),r=o.type,s=o.next;if(r==e)return!0;if(i.indexOf(s)<0&&a(s))return!0}};return a(r.contentMatch)?{v:!0}:void 0}};for(var r in n){var i=o(r);if(i)return i.v}}st.top.get=function(){return this.nodes[this.open]},at.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,o=[];for(;e=n.exec(t);)o.push(e[1],e[2].trim());return o}(e)):null,o=this.top;if(null!=n)for(var r=0;r<n.length;r++)this.addPendingMark(n[r]);if(this.addElement(t),null!=n)for(var i=0;i<n.length;i++)this.removePendingMark(n[i],o)}},at.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var o=n.content[n.content.length-1],r=t.previousSibling;(!o||r&&"BR"==r.nodeName||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},at.prototype.addElement=function(t,e){var n,o=t.nodeName.toLowerCase();ot.hasOwnProperty(o)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var o=1==e.nodeType?e.nodeName.toLowerCase():null;o&&ot.hasOwnProperty(o)&&n?(n.appendChild(e),e=n):"li"==o?n=e:o&&(n=null)}}(t);var r=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(r?r.ignore:nt.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t);else if(!r||r.skip||r.closeParent){r&&r.closeParent?this.open=Math.max(0,this.open-1):r&&r.skip.nodeType&&(t=r.skip);var i,a=this.top,s=this.needsBlock;if(et.hasOwnProperty(o))i=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),i&&this.sync(a),this.needsBlock=s}else this.addElementByRule(t,r,!1===r.consuming?n:null)},at.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},at.prototype.ignoreFallback=function(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},at.prototype.readStyles=function(t){var e=d.none;t:for(var n=0;n<t.length;n+=2)for(var o=null;;){var r=this.parser.matchStyle(t[n],t[n+1],this,o);if(!r)continue t;if(r.ignore)return null;if(e=this.parser.schema.marks[r.mark].create(r.attrs).addToSet(e),!1!==r.consuming)break;o=r}return e},at.prototype.addElementByRule=function(t,e,n){var o,r,i,a=this;e.node?(r=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(r.create(e.attrs))||this.leafFallback(t):o=this.enter(r,e.attrs,e.preserveWhitespace):(i=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(i));var s=this.top;if(r&&r.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return a.insertNode(t)}));else{var l=e.contentElement;"string"==typeof l?l=t.querySelector(l):"function"==typeof l&&(l=l(t)),l||(l=t),this.findAround(t,l,!0),this.addAll(l,o)}o&&(this.sync(s),this.open--),i&&this.removePendingMark(i,s)},at.prototype.addAll=function(t,e,n,o){for(var r=n||0,i=n?t.childNodes[n]:t.firstChild,a=null==o?null:t.childNodes[o];i!=a;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i),e&&et.hasOwnProperty(i.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,r)},at.prototype.findPlace=function(t){for(var e,n,o=this.open;o>=0;o--){var r=this.nodes[o],i=r.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,n=r,!i.length))break;if(r.solid)break}if(!e)return!1;this.sync(n);for(var a=0;a<e.length;a++)this.enterInner(e[a],null,!1);return!0},at.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var o=n.activeMarks,r=0;r<t.marks.length;r++)n.type&&!n.type.allowsMarkType(t.marks[r].type)||(o=t.marks[r].addToSet(o));return n.content.push(t.mark(o)),!0}return!1},at.prototype.enter=function(t,e,n){var o=this.findPlace(t.create(e));return o&&this.enterInner(t,e,!0,n),o},at.prototype.enterInner=function(t,e,n,o){this.closeExtra();var r=this.top;r.applyPending(t),r.match=r.match&&r.match.matchType(t,e);var i=rt(t,o,r.options);4&r.options&&0==r.content.length&&(i|=4),this.nodes.push(new it(t,e,r.activeMarks,r.pendingMarks,n,null,i)),this.open++},at.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},at.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},at.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},st.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,o=n.length-1;o>=0;o--)t+=n[o].nodeSize;e&&t++}return t},at.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},at.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},at.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var o=0;o<this.find.length;o++){if(null==this.find[o].pos&&1==t.nodeType&&t.contains(this.find[o].node))e.compareDocumentPosition(this.find[o].node)&(n?2:4)&&(this.find[o].pos=this.currentPos)}},at.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},at.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),o=this.options.context,r=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),i=-(o?o.depth+1:0)+(r?0:1),a=function(t,s){for(;t>=0;t--){var l=n[t];if(""==l){if(t==n.length-1||0==t)continue;for(;s>=i;s--)if(a(t-1,s))return!0;return!1}var c=s>0||0==s&&r?e.nodes[s].type:o&&s>=i?o.node(s-i).type:null;if(!c||c.name!=l&&-1==c.groups.indexOf(l))return!1;s--}return!0};return a(n.length-1,this.open)},at.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var o in this.parser.schema.nodes){var r=this.parser.schema.nodes[o];if(r.isTextblock&&r.defaultAttrs)return r}},at.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},at.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var o=this.nodes[n];if(o.pendingMarks.lastIndexOf(t)>-1)o.pendingMarks=t.removeFromSet(o.pendingMarks);else{o.activeMarks=t.removeFromSet(o.activeMarks);var r=o.popFromStashMark(t);r&&o.type&&o.type.allowsMarkType(r.type)&&(o.activeMarks=r.addToSet(o.activeMarks))}if(o==e)break}},Object.defineProperties(at.prototype,st);var ut=function(t,e){this.nodes=t||{},this.marks=e||{}};function pt(t){var e={};for(var n in t){var o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function ft(t){return t.document||window.document}ut.prototype.serializeFragment=function(t,e,n){var o=this;void 0===e&&(e={}),n||(n=ft(e).createDocumentFragment());var r=n,i=null;return t.forEach((function(t){if(i||t.marks.length){i||(i=[]);for(var n=0,a=0;n<i.length&&a<t.marks.length;){var s=t.marks[a];if(o.marks[s.type.name]){if(!s.eq(i[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<i.length;)r=i.pop(),i.pop();for(;a<t.marks.length;){var l=t.marks[a++],c=o.serializeMark(l,t.isInline,e);c&&(i.push(l,r),r.appendChild(c.dom),r=c.contentDOM||c.dom)}}r.appendChild(o.serializeNodeInner(t,e))})),n},ut.prototype.serializeNodeInner=function(t,e){void 0===e&&(e={});var n=ut.renderSpec(ft(e),this.nodes[t.type.name](t)),o=n.dom,r=n.contentDOM;if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,r,e):this.serializeFragment(t.content,e,r)}return o},ut.prototype.serializeNode=function(t,e){void 0===e&&(e={});for(var n=this.serializeNodeInner(t,e),o=t.marks.length-1;o>=0;o--){var r=this.serializeMark(t.marks[o],t.isInline,e);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n},ut.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var o=this.marks[t.type.name];return o&&ut.renderSpec(ft(n),o(t,e))},ut.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var o=e[0],r=o.indexOf(" ");r>0&&(n=o.slice(0,r),o=o.slice(r+1));var i=null,a=n?t.createElementNS(n,o):t.createElement(o),s=e[1],l=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s))for(var c in l=2,s)if(null!=s[c]){var d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),s[c]):a.setAttribute(c,s[c])}for(var u=l;u<e.length;u++){var p=e[u];if(0===p){if(u<e.length-1||u>l)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var f=ut.renderSpec(t,p,n),h=f.dom,m=f.contentDOM;if(a.appendChild(h),m){if(i)throw new RangeError("Multiple content holes");i=m}}return{dom:a,contentDOM:i}},ut.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new ut(this.nodesFromSchema(t),this.marksFromSchema(t)))},ut.nodesFromSchema=function(t){var e=pt(t.nodes);return e.text||(e.text=function(t){return t.text}),e},ut.marksFromSchema=function(t){return pt(t.marks)};var ht=Math.pow(2,16);function mt(t){return 65535&t}var vt=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},gt=function t(e,n){if(void 0===n&&(n=!1),!e.length&&t.empty)return t.empty;this.ranges=e,this.inverted=n};gt.prototype.recover=function(t){var e=0,n=mt(t);if(!this.inverted)for(var o=0;o<n;o++)e+=this.ranges[3*o+2]-this.ranges[3*o+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ht}(t)},gt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},gt.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},gt.prototype._map=function(t,e,n){for(var o=0,r=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?o:0);if(s>t)break;var l=this.ranges[a+r],c=this.ranges[a+i],d=s+l;if(t<=d){var u=s+o+((l?t==s?-1:t==d?1:e:e)<0?0:c);if(n)return u;var p=t==(e<0?s:d)?null:a/3+(t-s)*ht;return new vt(u,e<0?t!=s:t!=d,p)}o+=c-l}return n?t+o:new vt(t+o)},gt.prototype.touches=function(t,e){for(var n=0,o=mt(e),r=this.inverted?2:1,i=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>t)break;var l=this.ranges[a+r];if(t<=s+l&&a==3*o)return!0;n+=this.ranges[a+i]-l}return!1},gt.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,o=0,r=0;o<this.ranges.length;o+=3){var i=this.ranges[o],a=i-(this.inverted?r:0),s=i+(this.inverted?0:r),l=this.ranges[o+e],c=this.ranges[o+n];t(a,a+l,s,s+c),r+=c-l}},gt.prototype.invert=function(){return new gt(this.ranges,!this.inverted)},gt.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},gt.offset=function(t){return 0==t?gt.empty:new gt(t<0?[0,-t,0]:[0,0,t])},gt.empty=new gt([]);var yt=function(t,e,n,o){this.maps=t||[],this.from=n||0,this.to=null==o?this.maps.length:o,this.mirror=e};function bt(t){var e=Error.call(this,t);return e.__proto__=bt.prototype,e}yt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new yt(this.maps,this.mirror,t,e)},yt.prototype.copy=function(){return new yt(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},yt.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},yt.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var o=t.getMirror(e);this.appendMap(t.maps[e],null!=o&&o<e?n+o:null)}},yt.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},yt.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},yt.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var o=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=o&&o>e?n-o-1:null)}},yt.prototype.invert=function(){var t=new yt;return t.appendMappingInverted(this),t},yt.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},yt.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},yt.prototype._map=function(t,e,n){for(var o=!1,r=this.from;r<this.to;r++){var i=this.maps[r].mapResult(t,e);if(null!=i.recover){var a=this.getMirror(r);if(null!=a&&a>r&&a<this.to){r=a,t=this.maps[a].recover(i.recover);continue}}i.deleted&&(o=!0),t=i.pos}return n?t:new vt(t,o)},bt.prototype=Object.create(Error.prototype),bt.prototype.constructor=bt,bt.prototype.name="TransformError";var wt=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new yt},kt={before:{configurable:!0},docChanged:{configurable:!0}};function _t(){throw new Error("Override me")}kt.before.get=function(){return this.docs.length?this.docs[0]:this.doc},wt.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new bt(e.failed);return this},wt.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},kt.docChanged.get=function(){return this.steps.length>0},wt.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(wt.prototype,kt);var Ct=Object.create(null),xt=function(){};xt.prototype.apply=function(t){return _t()},xt.prototype.getMap=function(){return gt.empty},xt.prototype.invert=function(t){return _t()},xt.prototype.map=function(t){return _t()},xt.prototype.merge=function(t){return null},xt.prototype.toJSON=function(){return _t()},xt.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ct[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},xt.jsonID=function(t,e){if(t in Ct)throw new RangeError("Duplicate use of step JSON ID "+t);return Ct[t]=e,e.prototype.jsonID=t,e};var St=function(t,e){this.doc=t,this.failed=e};St.ok=function(t){return new St(t,null)},St.fail=function(t){return new St(null,t)},St.fromReplace=function(t,e,n,o){try{return St.ok(t.replace(e,n,o))}catch(t){if(t instanceof u)return St.fail(t.message);throw t}};var Et=function(t){function e(e,n,o,r){t.call(this),this.from=e,this.to=n,this.slice=o,this.structure=!!r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Mt(t,this.from,this.to)?St.fail("Structure replace would overwrite content"):St.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new gt([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted?null:new e(n.pos,Math.max(n.pos,o.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?p.empty:new p(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var o=this.slice.size+t.slice.size==0?p.empty:new p(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),o,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,p.fromJSON(t,n.slice),!!n.structure)},e}(xt);xt.jsonID("replace",Et);var Tt=function(t){function e(e,n,o,r,i,a,s){t.call(this),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=r,this.slice=i,this.insert=a,this.structure=!!s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Mt(t,this.from,this.gapFrom)||Mt(t,this.gapTo,this.to)))return St.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return St.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?St.fromReplace(t,this.from,this.to,n):St.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new gt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1),r=t.map(this.gapFrom,-1),i=t.map(this.gapTo,1);return n.deleted&&o.deleted||r<n.pos||i>o.pos?null:new e(n.pos,o.pos,r,i,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,p.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(xt);function Mt(t,e,n){for(var o=t.resolve(e),r=n-e,i=o.depth;r>0&&i>0&&o.indexAfter(i)==o.node(i).childCount;)i--,r--;if(r>0)for(var a=o.node(i).maybeChild(o.indexAfter(i));r>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,r--}return!1}function Dt(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ot(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var o=t.$from.node(n),r=t.$from.index(n),i=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(r,i,e))return n;if(0==n||o.type.spec.isolating||!Dt(o,r,i))break}}function At(t,e,n,o){void 0===o&&(o=t);var r=function(t,e){var n=t.parent,o=t.startIndex,r=t.endIndex,i=n.contentMatchAt(o).findWrapping(e);if(!i)return null;var a=i.length?i[0]:e;return n.canReplaceWith(o,r,a)?i:null}(t,e),i=r&&function(t,e){var n=t.parent,o=t.startIndex,r=t.endIndex,i=n.child(o),a=e.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,l=o;s&&l<r;l++)s=s.matchType(n.child(l).type);if(!s||!s.validEnd)return null;return a}(o,e);return i?r.map(It).concat({type:e,attrs:n}).concat(i.map(It)):null}function It(t){return{type:t,attrs:null}}function Bt(t,e,n,o){void 0===n&&(n=1);var r=t.resolve(e),i=r.depth-n,a=o&&o[o.length-1]||r.parent;if(i<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!a.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(var s=r.depth-1,l=n-2;s>i;s--,l--){var c=r.node(s),d=r.index(s);if(c.type.spec.isolating)return!1;var u=c.content.cutByIndex(d,c.childCount),p=o&&o[l]||c;if(p!=c&&(u=u.replaceChild(0,p.type.create(p.attrs))),!c.canReplace(d+1,c.childCount)||!p.type.validContent(u))return!1}var f=r.indexAfter(i),h=o&&o[0];return r.node(i).canReplaceWith(f,f,h?h.type:r.node(i+1).type)}function Nt(t,e){var n=t.resolve(e),o=n.index();return zt(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function zt(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function Rt(t,e,n){void 0===n&&(n=-1);for(var o=t.resolve(e),r=o.depth;;r--){var i=void 0,a=void 0,s=o.index(r);if(r==o.depth?(i=o.nodeBefore,a=o.nodeAfter):n>0?(i=o.node(r+1),s++,a=o.node(r).maybeChild(s)):(i=o.node(r).maybeChild(s-1),a=o.node(r+1)),i&&!i.isTextblock&&zt(i,a)&&o.node(r).canReplace(s,s+1))return e;if(0==r)break;e=n<0?o.before(r):o.after(r)}}function Pt(t,e,n){var o=t.resolve(e);if(o.parent.canReplaceWith(o.index(),o.index(),n))return e;if(0==o.parentOffset)for(var r=o.depth-1;r>=0;r--){var i=o.index(r);if(o.node(r).canReplaceWith(i,i,n))return o.before(r+1);if(i>0)return null}if(o.parentOffset==o.parent.content.size)for(var a=o.depth-1;a>=0;a--){var s=o.indexAfter(a);if(o.node(a).canReplaceWith(s,s,n))return o.after(a+1);if(s<o.node(a).childCount)return null}}function Lt(t,e,n){var o=t.resolve(e);if(!n.content.size)return e;for(var r=n.content,i=0;i<n.openStart;i++)r=r.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=o.depth;s>=0;s--){var l=s==o.depth?0:o.pos<=(o.start(s+1)+o.end(s+1))/2?-1:1,c=o.index(s)+(l>0?1:0),d=o.node(s),u=!1;if(1==a)u=d.canReplace(c,c,r);else{var p=d.contentMatchAt(c).findWrapping(r.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return 0==l?o.pos:l<0?o.before(s+1):o.after(s+1)}return null}function Ft(t,e,n){for(var o=[],r=0;r<t.childCount;r++){var a=t.child(r);a.content.size&&(a=a.copy(Ft(a.content,e,a))),a.isInline&&(a=e(a,n,r)),o.push(a)}return i.fromArray(o)}xt.jsonID("replaceAround",Tt),wt.prototype.lift=function(t,e){for(var n=t.$from,o=t.$to,r=t.depth,a=n.before(r+1),s=o.after(r+1),l=a,c=s,d=i.empty,u=0,f=r,h=!1;f>e;f--)h||n.index(f)>0?(h=!0,d=i.from(n.node(f).copy(d)),u++):l--;for(var m=i.empty,v=0,g=r,y=!1;g>e;g--)y||o.after(g+1)<o.end(g)?(y=!0,m=i.from(o.node(g).copy(m)),v++):c++;return this.step(new Tt(l,c,a,s,new p(d.append(m),u,v),d.size-u,!0))},wt.prototype.wrap=function(t,e){for(var n=i.empty,o=e.length-1;o>=0;o--){if(n.size){var r=e[o].type.contentMatch.matchFragment(n);if(!r||!r.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=i.from(e[o].type.create(e[o].attrs,n))}var a=t.start,s=t.end;return this.step(new Tt(a,s,a,s,new p(n,0,0),e.length,!0))},wt.prototype.setBlockType=function(t,e,n,o){var r=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,o)&&function(t,e,n){var o=t.resolve(e),r=o.index();return o.parent.canReplaceWith(r,r+1,n)}(r.doc,r.mapping.slice(a).map(e),n)){r.clearIncompatible(r.mapping.slice(a).map(e,1),n);var s=r.mapping.slice(a),l=s.map(e,1),c=s.map(e+t.nodeSize,1);return r.step(new Tt(l,c,l+1,c-1,new p(i.from(n.create(o,null,t.marks)),0,0),1,!0)),!1}})),this},wt.prototype.setNodeMarkup=function(t,e,n,o){var r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at given position");e||(e=r.type);var a=e.create(n,null,o||r.marks);if(r.isLeaf)return this.replaceWith(t,t+r.nodeSize,a);if(!e.validContent(r.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Tt(t,t+r.nodeSize,t+1,t+r.nodeSize-1,new p(i.from(a),0,0),1,!0))},wt.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var o=this.doc.resolve(t),r=i.empty,a=i.empty,s=o.depth,l=o.depth-e,c=e-1;s>l;s--,c--){r=i.from(o.node(s).copy(r));var d=n&&n[c];a=i.from(d?d.type.create(d.attrs,a):o.node(s).copy(a))}return this.step(new Et(t,t,new p(r.append(a),e,e),!0))},wt.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Et(t-e,t+e,p.empty,!0);return this.step(n)};var $t=function(t){function e(e,n,o){t.call(this),this.from=e,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=t.resolve(this.from),r=o.node(o.sharedDepth(this.to)),i=new p(Ft(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),r),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,i)},e.prototype.invert=function(){return new Vt(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new e(n.pos,o.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);xt.jsonID("addMark",$t);var Vt=function(t){function e(e,n,o){t.call(this),this.from=e,this.to=n,this.mark=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),o=new p(Ft(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return St.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new $t(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new e(n.pos,o.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(xt);function jt(t,e,n,o){if(void 0===n&&(n=e),void 0===o&&(o=p.empty),e==n&&!o.size)return null;var r=t.resolve(e),i=t.resolve(n);return Wt(r,i,o)?new Et(e,n,o):new Ht(r,i,o).fit()}function Wt(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}xt.jsonID("removeMark",Vt),wt.prototype.addMark=function(t,e,n){var o=this,r=[],i=[],a=null,s=null;return this.doc.nodesBetween(t,e,(function(o,l,c){if(o.isInline){var d=o.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){for(var u=Math.max(l,t),p=Math.min(l+o.nodeSize,e),f=n.addToSet(d),h=0;h<d.length;h++)d[h].isInSet(f)||(a&&a.to==u&&a.mark.eq(d[h])?a.to=p:r.push(a=new Vt(u,p,d[h])));s&&s.to==u?s.to=p:i.push(s=new $t(u,p,n))}}})),r.forEach((function(t){return o.step(t)})),i.forEach((function(t){return o.step(t)})),this},wt.prototype.removeMark=function(t,e,n){var o=this;void 0===n&&(n=null);var r=[],i=0;return this.doc.nodesBetween(t,e,(function(o,a){if(o.isInline){i++;var s=null;if(n instanceof Y)for(var l,c=o.marks;l=n.isInSet(c);)(s||(s=[])).push(l),c=l.removeFromSet(c);else n?n.isInSet(o.marks)&&(s=[n]):s=o.marks;if(s&&s.length)for(var d=Math.min(a+o.nodeSize,e),u=0;u<s.length;u++){for(var p=s[u],f=void 0,h=0;h<r.length;h++){var m=r[h];m.step==i-1&&p.eq(r[h].style)&&(f=m)}f?(f.to=d,f.step=i):r.push({style:p,from:Math.max(a,t),to:d,step:i})}}})),r.forEach((function(t){return o.step(new Vt(t.from,t.to,t.style))})),this},wt.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var o=this.doc.nodeAt(t),r=[],a=t+1,s=0;s<o.childCount;s++){var l=o.child(s),c=a+l.nodeSize,d=n.matchType(l.type,l.attrs);if(d){n=d;for(var u=0;u<l.marks.length;u++)e.allowsMarkType(l.marks[u].type)||this.step(new Vt(a,c,l.marks[u]))}else r.push(new Et(a,c,p.empty));a=c}if(!n.validEnd){var f=n.fillBefore(i.empty,!0);this.replace(a,a,new p(f,0,0))}for(var h=r.length-1;h>=0;h--)this.step(r[h]);return this},wt.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=p.empty);var o=jt(this.doc,t,e,n);return o&&this.step(o),this},wt.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new p(i.from(n),0,0))},wt.prototype.delete=function(t,e){return this.replace(t,e,p.empty)},wt.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var Ht=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var o=0;o<=t.depth;o++){var r=t.node(o);this.frontier.push({type:r.type,match:r.contentMatchAt(t.indexAfter(o))})}this.placed=i.empty;for(var a=t.depth;a>0;a--)this.placed=i.from(t.node(a).copy(this.placed))},qt={depth:{configurable:!0}};function Jt(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(Jt(t.firstChild.content,e-1,n)))}function Kt(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Kt(t.lastChild.content,e-1,n)))}function Ut(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function Gt(t,e,n){if(e<=0)return t;var o=t.content;return e>1&&(o=o.replaceChild(0,Gt(o.firstChild,e-1,1==o.childCount?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(i.empty,!0)))),t.copy(o)}function Xt(t,e,n,o,r){var i=t.node(e),a=r?t.indexAfter(e):t.index(e);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=o.fillBefore(i.content,!0,a);return s&&!function(t,e,n){for(var o=n;o<e.childCount;o++)if(!t.allowsMarks(e.child(o).marks))return!0;return!1}(n,i.content,a)?s:null}function Yt(t,e,n,o,r){if(e<n){var a=t.firstChild;t=t.replaceChild(0,a.copy(Yt(a.content,e+1,n,o,a)))}if(e>o){var s=r.contentMatchAt(0),l=s.fillBefore(t).append(t);t=l.append(s.matchFragment(l).fillBefore(i.empty,!0))}return t}function Zt(t,e){for(var n=[],o=Math.min(t.depth,e.depth);o>=0;o--){var r=t.start(o);if(r<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(r==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==r-1)&&n.push(o)}return n}qt.depth.get=function(){return this.frontier.length-1},Ht.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,r=this.close(e<0?this.$to:o.doc.resolve(e));if(!r)return null;for(var i=this.placed,a=o.depth,s=r.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var l=new p(i,a,s);return e>-1?new Tt(o.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new Et(o.pos,r.pos,l):void 0},Ht.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,o=(e?(n=Ut(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,r=this.depth;r>=0;r--){var a=this.frontier[r],s=a.type,l=a.match,c=void 0,d=void 0;if(1==t&&(o?l.matchType(o.type)||(d=l.fillBefore(i.from(o),!1)):s.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:r,parent:n,inject:d};if(2==t&&o&&(c=l.findWrapping(o.type)))return{sliceDepth:e,frontierDepth:r,parent:n,wrap:c};if(n&&l.matchType(n.type))break}},Ht.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,r=Ut(e,n);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new p(e,n+1,Math.max(o,r.size+n>=e.size-o?n+1:0)),!0)},Ht.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,o=t.openEnd,r=Ut(e,n);if(r.childCount<=1&&n>0){var i=e.size-n<=n+r.size;this.unplaced=new p(Jt(e,n-1,1),n-1,i?n-1:o)}else this.unplaced=new p(Jt(e,n,1),n,o)},Ht.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,o=t.parent,r=t.inject,a=t.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var s=0;s<a.length;s++)this.openFrontierNode(a[s]);var l=this.unplaced,c=o?o.content:l.content,d=l.openStart-e,u=0,f=[],h=this.frontier[n],m=h.match,v=h.type;if(r){for(var g=0;g<r.childCount;g++)f.push(r.child(g));m=m.matchFragment(r)}for(var y=c.size+e-(l.content.size-l.openEnd);u<c.childCount;){var b=c.child(u),w=m.matchType(b.type);if(!w)break;(++u>1||0==d||b.content.size)&&(m=w,f.push(Gt(b.mark(v.allowedMarks(b.marks)),1==u?d:0,u==c.childCount?y:-1)))}var k=u==c.childCount;k||(y=-1),this.placed=Kt(this.placed,n,i.from(f)),this.frontier[n].match=m,k&&y<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var _=0,C=c;_<y;_++){var x=C.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),C=x.content}this.unplaced=k?0==e?p.empty:new p(Jt(l.content,e-1,1),e-1,y<0?l.openEnd:e-1):new p(Jt(l.content,e,u),l.openStart,l.openEnd)},Ht.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!Xt(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,o=this.$to.after(n);n>1&&o==this.$to.end(--n);)++o;return o},Ht.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],o=n.match,r=n.type,i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=Xt(t,e,r,o,i);if(a){for(var s=e-1;s>=0;s--){var l=this.frontier[s],c=l.match,d=Xt(t,s,l.type,c,!0);if(!d||d.childCount)continue t}return{depth:e,fit:a,move:i?t.doc.resolve(t.after(e+1)):t}}}},Ht.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Kt(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var o=t.node(n),r=o.type.contentMatch.fillBefore(o.content,!0,t.index(n));this.openFrontierNode(o.type,o.attrs,r)}return t},Ht.prototype.openFrontierNode=function(t,e,n){var o=this.frontier[this.depth];o.match=o.match.matchType(t),this.placed=Kt(this.placed,this.depth,i.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},Ht.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(i.empty,!0);t.childCount&&(this.placed=Kt(this.placed,this.frontier.length,t))},Object.defineProperties(Ht.prototype,qt),wt.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var o=this.doc.resolve(t),r=this.doc.resolve(e);if(Wt(o,r,n))return this.step(new Et(t,e,n));var i=Zt(o,this.doc.resolve(e));0==i[i.length-1]&&i.pop();var a=-(o.depth+1);i.unshift(a);for(var s=o.depth,l=o.pos-1;s>0;s--,l--){var c=o.node(s).type.spec;if(c.defining||c.isolating)break;i.indexOf(s)>-1?a=s:o.before(s)==l&&i.splice(1,0,-s)}for(var d=i.indexOf(a),u=[],f=n.openStart,h=n.content,m=0;;m++){var v=h.firstChild;if(u.push(v),m==n.openStart)break;h=v.content}f>0&&u[f-1].type.spec.defining&&o.node(d).type!=u[f-1].type?f-=1:f>=2&&u[f-1].isTextblock&&u[f-2].type.spec.defining&&o.node(d).type!=u[f-2].type&&(f-=2);for(var g=n.openStart;g>=0;g--){var y=(g+f+1)%(n.openStart+1),b=u[y];if(b)for(var w=0;w<i.length;w++){var k=i[(w+d)%i.length],_=!0;k<0&&(_=!1,k=-k);var C=o.node(k-1),x=o.index(k-1);if(C.canReplaceWith(x,x,b.type,b.marks))return this.replace(o.before(k),_?r.after(k):e,new p(Yt(n.content,0,n.openStart,y),y,n.openEnd))}}for(var S=this.steps.length,E=i.length-1;E>=0&&(this.replace(t,e,n),!(this.steps.length>S));E--){var T=i[E];T<0||(t=o.before(T),e=r.after(T))}return this},wt.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var o=Pt(this.doc,t,n.type);null!=o&&(t=e=o)}return this.replaceRange(t,e,new p(i.from(n),0,0))},wt.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),o=this.doc.resolve(e),r=Zt(n,o),i=0;i<r.length;i++){var a=r[i],s=i==r.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),o.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),o.indexAfter(a-1))))return this.delete(n.before(a),o.after(a))}for(var l=1;l<=n.depth&&l<=o.depth;l++)if(t-n.start(l)==n.depth-l&&e>n.end(l)&&o.end(l)-e!=o.depth-l)return this.delete(n.before(l),e);return this.delete(t,e)};var Qt=Object.create(null),te=function(t,e,n){this.ranges=n||[new ne(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},ee={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};ee.anchor.get=function(){return this.$anchor.pos},ee.head.get=function(){return this.$head.pos},ee.from.get=function(){return this.$from.pos},ee.to.get=function(){return this.$to.pos},ee.$from.get=function(){return this.ranges[0].$from},ee.$to.get=function(){return this.ranges[0].$to},ee.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},te.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},te.prototype.replace=function(t,e){void 0===e&&(e=p.empty);for(var n=e.content.lastChild,o=null,r=0;r<e.openEnd;r++)o=n,n=n.lastChild;for(var i=t.steps.length,a=this.ranges,s=0;s<a.length;s++){var l=a[s],c=l.$from,d=l.$to,u=t.mapping.slice(i);t.replaceRange(u.map(c.pos),u.map(d.pos),s?p.empty:e),0==s&&de(t,i,(n?n.isInline:o&&o.isTextblock)?-1:1)}},te.prototype.replaceWith=function(t,e){for(var n=t.steps.length,o=this.ranges,r=0;r<o.length;r++){var i=o[r],a=i.$from,s=i.$to,l=t.mapping.slice(n),c=l.map(a.pos),d=l.map(s.pos);r?t.deleteRange(c,d):(t.replaceRangeWith(c,d,e),de(t,n,e.isInline?-1:1))}},te.findFrom=function(t,e,n){var o=t.parent.inlineContent?new oe(t):ce(t.node(0),t.parent,t.pos,t.index(),e,n);if(o)return o;for(var r=t.depth-1;r>=0;r--){var i=e<0?ce(t.node(0),t.node(r),t.before(r+1),t.index(r),e,n):ce(t.node(0),t.node(r),t.after(r+1),t.index(r)+1,e,n);if(i)return i}},te.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new se(t.node(0))},te.atStart=function(t){return ce(t,t,0,0,1)||new se(t)},te.atEnd=function(t){return ce(t,t,t.content.size,t.childCount,-1)||new se(t)},te.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Qt[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},te.jsonID=function(t,e){if(t in Qt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Qt[t]=e,e.prototype.jsonID=t,e},te.prototype.getBookmark=function(){return oe.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(te.prototype,ee),te.prototype.visible=!0;var ne=function(t,e){this.$from=t,this.$to=e},oe=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,o){var r=n.resolve(o.map(this.head));if(!r.parent.inlineContent)return t.near(r);var i=n.resolve(o.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)},e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),t.prototype.replace.call(this,e,n),n==p.empty){var o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new re(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var o=t.resolve(e);return new this(o,n==e?o:t.resolve(n))},e.between=function(n,o,r){var i=n.pos-o.pos;if(r&&!i||(r=i>=0?1:-1),!o.parent.inlineContent){var a=t.findFrom(o,r,!0)||t.findFrom(o,-r,!0);if(!a)return t.near(o,r);o=a.$head}return n.parent.inlineContent||(0==i||(n=(t.findFrom(n,-r,!0)||t.findFrom(n,r,!0)).$anchor).pos<o.pos!=i<0)&&(n=o),new e(n,o)},Object.defineProperties(e.prototype,n),e}(te);te.jsonID("text",oe);var re=function(t,e){this.anchor=t,this.head=e};re.prototype.map=function(t){return new re(t.map(this.anchor),t.map(this.head))},re.prototype.resolve=function(t){return oe.between(t.resolve(this.anchor),t.resolve(this.head))};var ie=function(t){function e(e){var n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,o),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,o){var r=o.mapResult(this.anchor),i=r.deleted,a=r.pos,s=n.resolve(a);return i?t.near(s):new e(s)},e.prototype.content=function(){return new p(i.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new ae(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(te);ie.prototype.visible=!1,te.jsonID("node",ie);var ae=function(t){this.anchor=t};ae.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,o=e.pos;return n?new re(o,o):new ae(o)},ae.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&ie.isSelectable(n)?new ie(e):te.near(e)};var se=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=p.empty),n==p.empty){e.delete(0,e.doc.content.size);var o=t.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return le},e}(te);te.jsonID("all",se);var le={map:function(){return this},resolve:function(t){return new se(t)}};function ce(t,e,n,o,r,i){if(e.inlineContent)return oe.create(t,n);for(var a=o-(r>0?0:1);r>0?a<e.childCount:a>=0;a+=r){var s=e.child(a);if(s.isAtom){if(!i&&ie.isSelectable(s))return ie.create(t,n-(r<0?s.nodeSize:0))}else{var l=ce(t,s,n+r,r<0?s.childCount:0,r,i);if(l)return l}n+=s.nodeSize*r}}function de(t,e,n){var o=t.steps.length-1;if(!(o<e)){var r,i=t.steps[o];if(i instanceof Et||i instanceof Tt)t.mapping.maps[o].forEach((function(t,e,n,o){null==r&&(r=o)})),t.setSelection(te.near(t.doc.resolve(r),n))}}var ue=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return d.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||d.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var o=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(o.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var r=this.storedMarks;if(!r){var i=this.doc.resolve(e);r=n==e?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,o.text(t,r)),this.selection.empty||this.setSelection(te.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(wt);function pe(t,e){return e&&t?t.bind(e):t}var fe=function(t,e,n){this.name=t,this.init=pe(e.init,n),this.apply=pe(e.apply,n)},he=[new fe("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new fe("selection",{init:function(t,e){return t.selection||te.atStart(e.doc)},apply:function(t){return t.selection}}),new fe("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,o){return o.selection.$cursor?t.storedMarks:null}}),new fe("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],me=function(t,e){var n=this;this.schema=t,this.fields=he.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new fe(t.key,t.spec.state,t))}))},ve=function(t){this.config=t},ge={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};ge.schema.get=function(){return this.config.schema},ge.plugins.get=function(){return this.config.plugins},ve.prototype.apply=function(t){return this.applyTransaction(t).state},ve.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var o=this.config.plugins[n];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,t,this))return!1}return!0},ve.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),o=null;;){for(var r=!1,i=0;i<this.config.plugins.length;i++){var a=this.config.plugins[i];if(a.spec.appendTransaction){var s=o?o[i].n:0,l=o?o[i].state:this,c=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,l,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",t),!o){o=[];for(var d=0;d<this.config.plugins.length;d++)o.push(d<i?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),r=!0}o&&(o[i]={state:n,n:e.length})}}if(!r)return{state:n,transactions:e}}},ve.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new ve(this.config),n=this.config.fields,o=0;o<n.length;o++){var r=n[o];e[r.name]=r.apply(t,this[r.name],this,e)}for(var i=0;i<ye.length;i++)ye[i](this,t,e);return e},ge.tr.get=function(){return new ue(this)},ve.create=function(t){for(var e=new me(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new ve(e),o=0;o<e.fields.length;o++)n[e.fields[o].name]=e.fields[o].init(t,n);return n},ve.prototype.reconfigure=function(t){for(var e=new me(this.schema,t.plugins),n=e.fields,o=new ve(e),r=0;r<n.length;r++){var i=n[r].name;o[i]=this.hasOwnProperty(i)?this[i]:n[r].init(t,o)}return o},ve.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==typeof t)for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var o=t[n],r=o.spec.state;r&&r.toJSON&&(e[n]=r.toJSON.call(o,this[o.key]))}return e},ve.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var o=new me(t.schema,t.plugins),r=new ve(o);return o.fields.forEach((function(o){if("doc"==o.name)r.doc=D.fromJSON(t.schema,e.doc);else if("selection"==o.name)r.selection=te.fromJSON(r.doc,e.selection);else if("storedMarks"==o.name)e.storedMarks&&(r.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var i in n){var a=n[i],s=a.spec.state;if(a.key==o.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(r[o.name]=s.fromJSON.call(a,t,e[i],r))}r[o.name]=o.init(t,r)}})),r},ve.addApplyListener=function(t){ye.push(t)},ve.removeApplyListener=function(t){var e=ye.indexOf(t);e>-1&&ye.splice(e,1)},Object.defineProperties(ve.prototype,ge);var ye=[];var be=function(t){this.props={},t.props&&function t(e,n,o){for(var r in e){var i=e[r];i instanceof Function?i=i.bind(n):"handleDOMEvents"==r&&(i=t(i,n,{})),o[r]=i}return o}(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:ke("plugin")};be.prototype.getState=function(t){return t[this.key]};var we=Object.create(null);function ke(t){return t in we?t+"$"+ ++we[t]:(we[t]=0,t+"$")}var _e=function(t){void 0===t&&(t="key"),this.key=ke(t)};_e.prototype.get=function(t){return t.config.pluginsByKey[this.key]},_e.prototype.getState=function(t){return t[this.key]};var Ce="k-parent-node",xe=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],Se=function(t,e){var n=(t.ownerDocument||document).createElement(e);Array.from(t.rows).filter((function(t){return t.getAttribute(Ce)===e})).forEach((function(t){t.removeAttribute(Ce),n.appendChild(t)})),n.children.length&&t.appendChild(n)},Ee=function(t,e){var n=e.toUpperCase();t.filter((function(t){return t.nodeName===n})).forEach((function(t){Array.from(t.children).forEach((function(n){n.setAttribute(Ce,e),t.parentNode&&t.parentNode.insertBefore(n,t)})),t.remove()}))},Te=function(t,e){void 0===e&&(e=xe);var n=e.join("|");return t.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},Me=function(t){var e,n=document.createElement("template");if("content"in n)n.innerHTML=t,e=n.content;else{var o=(new DOMParser).parseFromString(t,"text/html");e=document.createDocumentFragment();for(var r=o.body;r&&r.firstChild;)e.appendChild(r.firstChild)}return e},De=function(t){var e=ut.fromSchema(t.type.schema).serializeFragment(t.content);return function(t){Array.from(t.querySelectorAll("table")).forEach((function(t){Se(t,"thead"),Se(t,"tbody"),Se(t,"tfoot");var e=Array.from(t.children).find((function(t){return 0===t.children.length}));e&&e.remove()}))}(e),e},Oe=function(t,e,n){return tt.fromSchema(e).parse(t,n)},Ae=function(t,e,n){var o,r=Me(t);return o=r,Array.from(o.querySelectorAll("table")).forEach((function(t){var e=Array.from(t.children);e.some((function(t){return"THEAD"===t.nodeName||"TFOOT"===t.nodeName}))&&(Ee(e,"thead"),Ee(e,"tbody"),Ee(e,"tfoot"));var n=e.find((function(t){return"COLGROUP"===t.nodeName}));n&&(t.setAttribute("k-colgroup-data",n.outerHTML),n.remove())})),Oe(r,e,n)},Ie=function(t){var e=De(t.doc),n=document.createElement("div");return n.appendChild(e),n.innerHTML},Be=function(t,e,n){return void 0===e&&(e="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(o,r){return r(o.tr.setSelection(new se(o.doc)).replaceSelectionWith(Ae(t,o.schema,n)).setMeta("commandName",e))}},Ne=n(0),ze=function(t,e){var n=e.style,o=e.value,r=e.newValue;if(!t)return{changed:!1,style:null};var i=t.split(/\s*;\s*/).filter((function(t){return Boolean(t)})),a=i.filter((function(t){var e=t.split(/\s*:\s*/);return!(e[0].toLowerCase()===n&&o.test(e[1]))}));return r&&a.push(n+": "+r),{style:a.join("; ")+(a.length?";":""),changed:Boolean(r)||a.length!==i.length}},Re=function(t,e){for(var n=t.selection.$from,o=n.depth;o>=0;o--){var r=n.index(o);if(n.node(o).canReplaceWith(r,r,e))return!0}return!1},Pe=function(t){return t instanceof D?t.type.name:t.name},Le=function(t,e){return void 0===e&&(e=1),function(n){return function(t,e){return void 0===e&&(e=1),function(n){for(var o=n.$from,r=o.depth;r>0;r--){var i=o.node(r);if(t(i)&&0===(e-=1))return{depth:r,node:i}}}}((function(e){return Pe(e)===Pe(t)}),e)(n)}},Fe=function(t,e){return function(n,o){var r=n.tr.replaceSelectionWith(t);e&&r.scrollIntoView(),o(r)}},$e=function(t,e,n,o){var r=i.from(Ae(t,n,o)),a=i.from(Ae(e,n,o));return r.eq(a)},Ve=function(t){var e=t.selection;if(e instanceof oe||e instanceof se){var n=e.content().content;return n.textBetween(0,n.size)}return""},je=function(t){if(t.selection instanceof ie)return t.selection.node},We=function(t){var e="",n=!1,o=t.selection,r=t.doc,i=o.$from,a=o.$to,s=o.from,l=o.to;return i.sameParent(a)&&(r.nodesBetween(s,l,(function(t){n=n||t.isLeaf&&!t.isText})),n||(e=Ve(t))),e},He=function(t){return t.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},qe={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i},Je=function(t,e,n){if(!n.applyToWord||!t.selection.empty)return{state:t,dispatch:e};var o=!0===n.applyToWord?qe:n.applyToWord,r=null,i=t.tr,a=t.selection,s=a.$head.nodeBefore,l=a.$head.nodeAfter;if(s&&"text"===s.type.name&&s.text&&l&&"text"===l.type.name&&l.text){var c=[];a.$head.parent.descendants((function(t,e){return c.push({node:t,pos:e}),!1}));for(var d=a.$head.parentOffset,u=c.findIndex((function(t){var e=t.node,n=t.pos;return n<=d&&n+e.nodeSize>=d})),p=c[u].node.text,f=!1,h=u-1;h>=0;h--){var m=c[h];!f&&m&&"text"===m.node.type.name?p=m.node.text+p:(f=!0,d-=m.node.nodeSize)}for(h=u+1;h<c.length;h++){if(!(m=c[h])||"text"!==m.node.type.name)break;p+=m.node.text}var v=p.substring(0,d),g=p.substring(d),y=o.before.exec(v),b=o.after.exec(g);if(y&&b){var w=y[0].length,k=b[0].length,_=r=a.from;i.setSelection(oe.create(t.doc,_-w,_+k));return{state:{tr:i,selection:i.selection,doc:i.doc,storedMarks:null,schema:i.doc.type.schema},dispatch:function(t){t.setSelection(oe.create(t.doc,r)),e(t)}}}}return{state:t,dispatch:e}},Ke=function(t,e){return function(n,o,r){var i=Je(n,o,e),a=i.state,s=i.dispatch;return t(e)(a,s)}},Ue=function(t,e,n){for(var o=function(o){var r=e[o],i=r.$from,a=r.$to,s=0===i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},r=0;r<e.length;r++){var i=o(r);if(i)return i.v}return!1},Ge=function(t,e,n){return function(o,r){var i=o.selection,a=i.empty,s=i.$cursor,l=i.ranges;if(a&&!s||!Ue(o.doc,l,t))return!1;if(r)if(s)t.isInSet(o.storedMarks||s.marks())?r(n.removeStoredMark(t)):r(n.addStoredMark(t.create(e)));else{for(var c=!1,d=0;!c&&d<l.length;d++){var u=l[d],p=u.$from,f=u.$to;c=o.doc.rangeHasMark(p.pos,f.pos,t)}for(d=0;d<l.length;d++){var h=l[d];p=h.$from,f=h.$to;c?n.removeMark(p.pos,f.pos,t):n.addMark(p.pos,f.pos,t.create(e))}r(n.scrollIntoView())}return!0}},Xe=function(t,e,n,o){void 0===o&&(o=null);var r=[],i=0;return t.doc.nodesBetween(e,n,(function(t,a){if(t.isInline){i++;var s=null;if(o instanceof Y){var l=o.isInSet(t.marks);l&&(s=[l])}else o?o.isInSet(t.marks)&&(s=[o]):s=t.marks;if(s&&s.length)for(var c=Math.min(a+t.nodeSize,n),d=0;d<s.length;d++){for(var u=s[d],p=void 0,f=0;f<r.length;f++){var h=r[f];h.step===i-1&&u.eq(h.style)&&(p=h)}p?(p.to=c,p.step=i):r.push({style:u,from:Math.max(a,e),to:c,step:i})}}})),r.forEach((function(e){return t.step(new Vt(e.from,e.to,e.style))})),t},Ye=function(t){var e=(void 0===t?{}:t).except,n=void 0===e?[]:e;return function(t,e){var o,r=t.tr;Ze(r,{except:(o=n,o instanceof Array?o:[o])}),r.docChanged&&e(r)}},Ze=function(t,e){var n=e.except,o=t.doc,r=t.selection,i=o.type.schema,a=r.empty,s=r.ranges,l=(n||[]).map((function(t){return t.name}));if(!a){var c=Object.keys(i.marks).map((function(t){return i.marks[t]})).filter((function(t){return-1===l.indexOf(t.name)}));s.forEach((function(e){var n=e.$from,o=e.$to;c.forEach((function(e){return t.removeMark(n.pos,o.pos,e)}))}))}},Qe=function(t,e){var n,o=t.schema.marks,r=(e.altMarks||[]).filter((function(t){return o[t]})),i=e.altStyle,a=t.selection,s=a.from,l=a.$from,c=a.to,d=a.empty,u=o[e.mark],p=t.doc,f=!1;return d?(n=t.storedMarks||l.marks(),f=u&&u.isInSet(n)||r.some((function(t){return o[t].isInSet(n)}))):f=u&&p.rangeHasMark(s,c,u)||r.some((function(t){return p.rangeHasMark(s,c,o[t])})),!f&&i&&o.style?en(t,o.style).some((function(t){return null!==tn(t,i)})):Boolean(f)},tn=function(t,e){for(var n=(t&&t.attrs.style||"").split(/\s*;\s*/).filter((function(t){return Boolean(t)})),o=0;o<n.length;o++){var r=n[o].split(/\s*:\s*/);if(r[0].toLowerCase()===e.name&&e.value.test(r[1]))return r[1]}return null},en=function(t,e){var n=t.selection,o=n.from,r=n.$from,i=n.to,a=n.empty,s=[];return a?s.push(e.isInSet(t.storedMarks||r.marks())):t.doc.nodesBetween(o,i,(function(t){t.isInline&&s.push(e.isInSet(t.marks))})),s},nn=function(t,e){var n=en(t,e),o=n.filter((function(t){return Boolean(t)}));return n.length===o.length?n[0]:void 0},on=function(t,e){var n=en(t,e),o=n.filter((function(t){return Boolean(t)}));return{hasNodesWithoutMarks:n.length!==o.length,marks:o}},rn=function(t,e){var n=t.find((function(t){return"style"===t.type.name})),o=n&&n.attrs.style;return ze(o,e)},an=function(t,e,n,o,r){var i=r.create({style:o.style}),a=[],s=[],l=null,c=null;return t.doc.nodesBetween(e,n,(function(t,d,u){if(t.isInline){var p=t.marks;if(!i.isInSet(p)&&u.type.allowsMarkType(i.type)){var f=Math.max(d,e),h=Math.min(d+t.nodeSize,n),m=rn(p,o);if(m.changed||o.newValue){for(var v=m.changed?{style:m.style||null}:{style:[o.style]+": "+o.newValue+";"},g=r.isInSet(p)?p.find((function(t){return"style"===t.type.name})):null,y=g?Ne.__assign({},g.attrs,v):v,b=r.create(y),w=b.addToSet(p),k=0;k<p.length;k++)p[k].isInSet(w)||(l&&l.to===f&&l.mark.eq(p[k])?l.to=h:(l=new Vt(f,h,p[k]),a.push(l)));var _=c&&c.to===f,C=_&&b.attrs.style===c.mark.attrs.style;_&&C?c.to=h:Object.keys(y).some((function(t){return null!==y[t]}))&&(c=new $t(f,h,b),s.push(c))}}}})),a.forEach((function(e){return t.step(e)})),s.forEach((function(e){return t.step(e)})),a.length+s.length>0},sn=function(t,e){var n=t.schema.marks.style;return(n?en(t,n):[]).map((function(t){return tn(t,e)})).filter((function(t){return null!==t}))},ln=function(t,e){return function(n,o,r){var i=n.selection,a=i.empty,s=i.$cursor,l=i.ranges;if(a&&!s||!Ue(n.doc,l,t))return!1;var c,d,u,p,f=!1;if(o){var h=r||n.tr;if(s){var m=n.storedMarks||s.marks();if(t.isInSet(m)){var v=rn(m,e),g=m.find((function(t){return"style"===t.type.name})),y=Ne.__assign({},g?g.attrs:{},{style:v.style||null});if(c=g.attrs,d=y,u=Object.keys(c),p=Object.keys(d),u.length===p.length&&u.every((function(t){return c[t]===d[t]})))return!1;o(h.removeStoredMark(t)),Object.keys(y).some((function(t){return null!==y[t]}))&&o(h.addStoredMark(t.create(y))),f=!0}}else{for(var b=0;b<l.length;b++){var w=l[b],k=w.$from,_=w.$to;f=an(h,k.pos,_.pos,e,t)}f&&(h.scrollIntoView(),o(h))}}return f}},cn=function(t,e,n){return function(o,r){var i=o.schema.marks,a=t.altStyle,s=t.altMarks,l=void 0===s?[]:s,c=t.mark,d=e||o.tr,u=!1,p=!1,f=function(){return p=!0};a&&i.style&&(u=ln(i.style,{style:a.name,value:a.value})(o,f,d));var h=[c].concat(l).filter((function(t){return i[t]})).map((function(t){return Qe(o,{mark:t})&&i[t]})).filter((function(t){return t}));return h.length?function(t,e,n,o){var r=e.selection,i=r.$cursor,a=r.ranges;if(o=o||e.tr,i)t.forEach((function(t){t.isInSet(e.storedMarks||i.marks())&&n(o.removeStoredMark(t))}));else{for(var s=function(e){var n=a[e],r=n.$from,i=n.$to;t.forEach((function(t){Xe(o,r.pos,i.pos,t)}))},l=0;l<a.length;l++)s(l);n(o.scrollIntoView())}}(h,o,f,d):u||Ge(i[c],n,d)(o,f),p&&r(d),p}},dn=function(t,e){return function(n,o){var r=n.schema.marks.style,i={style:t.style,value:/^.+$/,newValue:t.value},a=n.tr;e&&a.setMeta("commandName",e),a.setMeta("args",t);var s=n.selection,l=s.empty,c=s.$cursor,d=s.ranges;if(l&&!c||!r||!Ue(n.doc,d,r))return!1;if(c){var u=n.storedMarks||c.marks(),p=r.isInSet(u)?u.find((function(t){return"style"===t.type.name})):null,f={style:null};if(p&&p.attrs.style){var h=ze(p.attrs.style,i);h.changed&&h.style&&(f.style=h.style)}else i.newValue&&(f.style=[i.style]+": "+i.newValue+";");var m=p?Ne.__assign({},p.attrs,f):f;return Object.keys(m).some((function(t){return null!==m[t]}))?o(a.addStoredMark(r.create(m))):o(a.removeStoredMark(r)),!0}return ln(r,i)(n,o,a)}},un=function(t,e){return function(n,o){var r=n.selection.$cursor;if(r){var i=r.parent,a=r.index(),s=n.schema.marks[t.mark],l=i.child(a).marks.find((function(t){return t.type===s})),c=i.childCount,d=r.pos-r.textOffset,u=i.child(a).nodeSize,p=void 0,f=void 0;for(p=a-1;p>=0&&l.isInSet(i.child(p).marks);)u+=f=i.child(p).nodeSize,d-=f,p-=1;for(p=a+1;p<c&&l.isInSet(i.child(p).marks);)u+=i.child(p).nodeSize,p+=1;o(Xe(e||n.tr,d,d+u,l))}else cn(t,e)(n,o)}},pn=function(t,e){var n=t.mark,o=t.attrs;return void 0===e&&(e="link"),function(t,r){var i=t.schema.marks,a=t.tr;e&&(a.setMeta("commandName",e),a.setMeta("args",o));var s=!1,l=function(){return s=!0};if(function(t,e){var n=en(t,e);return 1===n.length&&n[0]?n[0]:null}(t,i[n]))!function(t,e){return function(n,o){var r=n.selection,i=r.$cursor,a=r.from,s=r.to,l=n.schema.marks[t.mark];if(i){var c=i.parent,d=i.index(),u=c.child(d).marks.find((function(t){return t.type===l})),p=c.childCount,f=i.pos-i.textOffset,h=c.child(d).nodeSize,m=void 0,v=void 0;for(m=d-1;m>=0&&u.isInSet(c.child(m).marks);)h+=v=c.child(m).nodeSize,f-=v,m-=1;for(m=d+1;m<p&&u.isInSet(c.child(m).marks);)h+=c.child(m).nodeSize,m+=1;e.removeMark(f,f+h,l),e.addMark(f,f+h,l.create(t.attrs)),o(e)}else e.doc.nodesBetween(a,s,(function(n,r){n.isInline&&l.isInSet(n.marks)&&(e.removeMark(r,r+n.nodeSize,l),e.addMark(r,r+n.nodeSize,l.create(t.attrs)),o(e))}))}}({mark:n,attrs:o},a)(t,l);else{var c=t;Qe(t,{mark:n})&&(un({mark:n,attrs:o},a)(t,l),c=ve.create({doc:a.doc,selection:a.selection})),s?Ge(i[n],o,a)(c,l):cn({mark:n},a,o)(c,l)}return s&&r(a),s}},fn=function(t){return function(e,n){n(e.tr.insertText(t.text,t.from,t.to))}},hn=function(t){return function(e,n){var o=e.schema.nodes.image,r=o.createAndFill(t);Fe(r)(e,(function(e){return n(e.setMeta("commandName","insertImage").setMeta("args",t))}))}},mn=function(t,e,n,o){if(!n.isTextblock)return!1;t.selection.ranges.forEach((function(r){var a=t.steps.length,s=r.$from.pos,l=r.$to.pos;t.doc.nodesBetween(s,l,(function(r,s){if(r.eq(e)&&r.isTextblock&&!r.hasMarkup(n,o)&&function(t,e,n){var o=t.resolve(e),r=o.index();return o.parent.canReplaceWith(r,r+1,n)}(t.doc,t.mapping.slice(a).map(s),n)){t.clearIncompatible(t.mapping.slice(a).map(s,1),n);var l=t.mapping.slice(a),c=l.map(s,1),d=l.map(s+r.nodeSize,1),u=new p(i.from(n.create(o,null,r.marks)),0,0);return t.step(new Tt(c,d,c+1,d-1,u,1,!0)),!1}}))}))},vn=function(t,e){void 0===e&&(e={blocksInSelection:!1});var n=t.doc,o=t.selection,r=o.$from,i=o.ranges,a=e.blocksInSelection,s=[],l=o instanceof ie?o.node:void 0;return l?l.isBlock?(s.push(l),l.nodesBetween(0,l.content.size,(function(t){t.isBlock&&s.push(t)}))):!a&&r.parent&&r.parent.isBlock&&s.push(r.parent):i.forEach((function(t){var e=t.$from.pos,o=t.$to.pos;n.nodesBetween(e,o,(function(t,n,r,i){t.isBlock&&(!a||n>=e&&n+t.content.size+2<=o)&&s.push(t)}))})),s},gn=function(t,e){return function(n,o){var r=vn(n),i=n.schema.nodes,a=n.tr;a.setMeta("commandName",e),a.setMeta("args",{value:t}),r.forEach((function(e){if(e.type.isTextblock)if("p"===t){var n=e.attrs,o=n.level,r=Ne.__rest(n,["level"]);mn(a,e,i.paragraph,r)}else if(/^h[1-6]$/i.test(t)){o=parseInt(t.substr(1),10);mn(a,e,i.heading,Ne.__assign({},e.attrs,{level:o}))}else if("blockquote"===t){var s=e.attrs;o=s.level,r=Ne.__rest(s,["level"]);mn(a,e,i.blockquote,r)}}));var s=a.docChanged;return s&&o(a.scrollIntoView()),s}},yn=function(t,e){void 0===e&&(e={blocksInSelection:!0});var n=t.doc,o=t.selection,r=e.blocksInSelection,i=e.blockNodeType;vn({doc:n,selection:o},{blocksInSelection:r}).filter((function(t){return t.isTextblock})).forEach((function(e){var n=e.attrs||{},o=n.style,r=void 0===o?"":o,a=n.class,s=void 0===a?"":a,l=Ne.__rest(n,["style","class"]),c=i||e.type;(r||s||c!==e.type)&&mn(t,e,c,l)}))},bn=function(t){var e=vn(t),n=t.schema.nodes,o=[];return e.forEach((function(t){t.type===n.paragraph?o.push("p"):t.type===n.heading?o.push("h"+t.attrs.level):t.type===n.blockquote&&n.blockquote.isTextblock&&o.push("blockquote")})),o},wn=function(t,e){var n,o,r=t.attrs.style;r&&e.forEach((function(t){o={style:t.name,value:/^.+$/,newValue:t.value},n=ze(r,o),r=n.changed?n.style:r}));return r=r||e.reduce((function(t,e){return(t&&e.value?t+" ":"")+e.value?e.name+": "+e.value+";":""}),""),Object.assign({},t.attrs,{style:r||null})},kn=function(t,e){var n=t.selection,o=n.from,r=n.to,i=!1;return t.doc.nodesBetween(o,r,(function(t){return!(i=i||t.type===e)})),i},_n=function(t){var e=bn(t);return 1===new Set(e).size?e[0]:null},Cn=function(t){return{tag:_n(t)||""}},xn=function(t,e){return function(n,o){var r=vn(n),i=n.tr;i.setMeta("commandName",e),r.forEach((function(e){if(e.type.isTextblock){var n={},o=t.find((function(t){return t.node===e.type.name}));o&&(n=wn(e,o.style)),mn(i,e,e.type,n)}}));var a=i.docChanged;return a&&o(i.scrollIntoView()),a}},Sn=function(t,e){var n=vn(t),o=!1;return n.forEach((function(t){if(!o&&t.type.isTextblock&&t.attrs.style){var n=e.find((function(e){return e.node===t.type.name}));n&&(o=n.style.every((function(e){return!!e.value&&new RegExp(e.name+":\\s?"+e.value,"i").test(t.attrs.style)})))}})),o},En=function(t){return void 0===t&&(t={blocksInSelection:!0}),function(e,n){var o=e.tr,r=t.blocksInSelection,i=t.blockNodeType,a=(t.exceptMarks||[e.schema.marks.link]).filter(Boolean);Ze(o,{except:a}),yn(o,{blocksInSelection:r,blockNodeType:i});var s=o.docChanged;return s&&n&&n(o),s}},Tn=["ol",0],Mn=["ul",0],Dn=["li",0],On={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?Tn:["ol",{start:t.attrs.order},0]}},An={parseDOM:[{tag:"ul"}],toDOM:function(){return Mn}},In={parseDOM:[{tag:"li"}],toDOM:function(){return Dn},defining:!0};function Bn(t,e){var n={};for(var o in t)n[o]=t[o];for(var r in e)n[r]=e[r];return n}function Nn(t,e,n){return t.append({ordered_list:Bn(On,{content:"list_item+",group:n}),bullet_list:Bn(An,{content:"list_item+",group:n}),list_item:Bn(In,{content:e})})}function zn(t,e){return function(n,o){var r=n.selection,a=r.$from,s=r.$to,l=a.blockRange(s),c=!1,d=l;if(!l)return!1;if(l.depth>=2&&a.node(l.depth-1).type.compatibleContent(t)&&0==l.startIndex){if(0==a.index(l.depth-1))return!1;var u=n.doc.resolve(l.start-2);d=new E(u,u,l.depth),l.endIndex<l.parent.childCount&&(l=new E(a,n.doc.resolve(s.end(l.depth)),l.depth)),c=!0}var f=At(d,t,e,l);return!!f&&(o&&o(function(t,e,n,o,r){for(var a=i.empty,s=n.length-1;s>=0;s--)a=i.from(n[s].type.create(n[s].attrs,a));t.step(new Tt(e.start-(o?2:0),e.end,e.start,e.end,new p(a,0,0),n.length,!0));for(var l=0,c=0;c<n.length;c++)n[c].type==r&&(l=c+1);for(var d=n.length-l,u=e.start+n.length-(o?2:0),f=e.parent,h=e.startIndex,m=e.endIndex,v=!0;h<m;h++,v=!1)!v&&Bt(t.doc,u,d)&&(t.split(u,d),u+=2*d),u+=f.child(h).nodeSize;return t}(n.tr,l,f,c,t).scrollIntoView()),!0)}}function Rn(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=o.node;if(s&&s.isBlock||r.depth<2||!r.sameParent(a))return!1;var l=r.node(-1);if(l.type!=t)return!1;if(0==r.parent.content.size&&r.node(-1).childCount==r.indexAfter(-1)){if(2==r.depth||r.node(-3).type!=t||r.index(-2)!=r.node(-2).childCount-1)return!1;if(n){for(var c=i.empty,d=r.index(-1)?1:r.index(-2)?2:3,u=r.depth-d;u>=r.depth-3;u--)c=i.from(r.node(u).copy(c));var f=r.indexAfter(-1)<r.node(-2).childCount?1:r.indexAfter(-2)<r.node(-3).childCount?2:3;c=c.append(i.from(t.createAndFill()));var h=r.before(r.depth-(d-1)),m=e.tr.replace(h,r.after(-f),new p(c,4-d,0)),v=-1;m.doc.nodesBetween(h,m.doc.content.size,(function(t,e){if(v>-1)return!1;t.isTextblock&&0==t.content.size&&(v=e+1)})),v>-1&&m.setSelection(e.selection.constructor.near(m.doc.resolve(v))),n(m.scrollIntoView())}return!0}var g=a.pos==r.end()?l.contentMatchAt(0).defaultType:null,y=e.tr.delete(r.pos,a.pos),b=g&&[null,{type:g}];return!!Bt(y.doc,r.pos,2,b)&&(n&&n(y.split(r.pos,2,b).scrollIntoView()),!0)}}function Pn(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=r.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));return!!s&&(!n||(r.node(s.depth-1).type==t?function(t,e,n,o){var r=t.tr,a=o.end,s=o.$to.end(o.depth);a<s&&(r.step(new Tt(a-1,s,a,s,new p(i.from(n.create(null,o.parent.copy())),1,0),1,!0)),o=new E(r.doc.resolve(o.$from.pos),r.doc.resolve(s),o.depth));return e(r.lift(o,Ot(o)).scrollIntoView()),!0}(e,n,t,s):function(t,e,n){for(var o=t.tr,r=n.parent,a=n.end,s=n.endIndex-1,l=n.startIndex;s>l;s--)a-=r.child(s).nodeSize,o.delete(a-1,a+1);var c=o.doc.resolve(n.start),d=c.nodeAfter;if(o.mapping.map(n.end)!=n.start+c.nodeAfter.nodeSize)return!1;var u=0==n.startIndex,f=n.endIndex==r.childCount,h=c.node(-1),m=c.index(-1);if(!h.canReplace(m+(u?0:1),m+1,d.content.append(f?i.empty:i.from(r))))return!1;var v=c.pos,g=v+d.nodeSize;return o.step(new Tt(v-(u?1:0),g+(f?1:0),v+1,g-1,new p((u?i.empty:i.from(r.copy(i.empty))).append(f?i.empty:i.from(r.copy(i.empty))),u?0:1,f?0:1),u?0:1)),e(o.scrollIntoView()),!0}(e,n,s)))}}function Ln(t){return function(e,n){var o=e.selection,r=o.$from,a=o.$to,s=r.blockRange(a,(function(e){return e.childCount&&e.firstChild.type==t}));if(!s)return!1;var l=s.startIndex;if(0==l)return!1;var c=s.parent,d=c.child(l-1);if(d.type!=t)return!1;if(n){var u=d.lastChild&&d.lastChild.type==c.type,f=i.from(u?t.create():null),h=new p(i.from(t.create(null,i.from(c.type.create(null,f)))),u?3:1,0),m=s.start,v=s.end;n(e.tr.step(new Tt(m-(u?3:1),v,m,v,h,1,!0)).scrollIntoView())}return!0}}var Fn={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},$n={listType:Fn.orderedList,types:Ne.__assign({},Fn)},Vn={listType:Fn.bulletList,types:Ne.__assign({},Fn)},jn={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:Ne.__assign({},Fn)},Wn={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:Ne.__assign({},Fn)};function Hn(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function qn(t,e,n){var o=t.selection.$cursor;if(!o||(n?!n.endOfTextblock("backward",t):o.parentOffset>0))return!1;var r=Un(o);if(!r){var i=o.blockRange(),a=i&&Ot(i);return null!=a&&(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}var s=r.nodeBefore;if(!s.type.spec.isolating&&uo(t,r,e))return!0;if(0==o.parent.content.size&&(Jn(s,"end")||ie.isSelectable(s))){var l=jt(t.doc,o.before(),o.after(),p.empty);if(l.slice.size<l.to-l.from){if(e){var c=t.tr.step(l);c.setSelection(Jn(s,"end")?te.findFrom(c.doc.resolve(c.mapping.map(r.pos,-1)),-1):ie.create(c.doc,r.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}}return!(!s.isAtom||r.depth!=o.depth-1)&&(e&&e(t.tr.delete(r.pos-s.nodeSize,r.pos).scrollIntoView()),!0)}function Jn(t,e,n){for(;t;t="start"==e?t.firstChild:t.lastChild){if(t.isTextblock)return!0;if(n&&1!=t.childCount)return!1}return!1}function Kn(t,e,n){var o=t.selection,r=o.$head,i=r;if(!o.empty)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;i=Un(r)}var a=i&&i.nodeBefore;return!(!a||!ie.isSelectable(a))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)}function Un(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Gn(t,e,n){var o=t.selection.$cursor;if(!o||(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size))return!1;var r=Yn(o);if(!r)return!1;var i=r.nodeAfter;if(uo(t,r,e))return!0;if(0==o.parent.content.size&&(Jn(i,"start")||ie.isSelectable(i))){var a=jt(t.doc,o.before(),o.after(),p.empty);if(a.slice.size<a.to-a.from){if(e){var s=t.tr.step(a);s.setSelection(Jn(i,"start")?te.findFrom(s.doc.resolve(s.mapping.map(r.pos)),1):ie.create(s.doc,s.mapping.map(r.pos))),e(s.scrollIntoView())}return!0}}return!(!i.isAtom||r.depth!=o.depth-1)&&(e&&e(t.tr.delete(r.pos,r.pos+i.nodeSize).scrollIntoView()),!0)}function Xn(t,e,n){var o=t.selection,r=o.$head,i=r;if(!o.empty)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;i=Yn(r)}var a=i&&i.nodeAfter;return!(!a||!ie.isSelectable(a))&&(e&&e(t.tr.setSelection(ie.create(t.doc,i.pos)).scrollIntoView()),!0)}function Yn(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Zn(t,e){var n,o=t.selection,r=o instanceof ie;if(r){if(o.node.isTextblock||!Nt(t.doc,o.from))return!1;n=o.from}else if(null==(n=Rt(t.doc,o.from,-1)))return!1;if(e){var i=t.tr.join(n);r&&i.setSelection(ie.create(i.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0}function Qn(t,e){var n,o=t.selection;if(o instanceof ie){if(o.node.isTextblock||!Nt(t.doc,o.to))return!1;n=o.to}else if(null==(n=Rt(t.doc,o.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}function to(t,e){var n=t.selection,o=n.$from,r=n.$to,i=o.blockRange(r),a=i&&Ot(i);return null!=a&&(e&&e(t.tr.lift(i,a).scrollIntoView()),!0)}function eo(t,e){var n=t.selection,o=n.$head,r=n.$anchor;return!(!o.parent.type.spec.code||!o.sameParent(r))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}function no(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function oo(t,e){var n=t.selection,o=n.$head,r=n.$anchor;if(!o.parent.type.spec.code||!o.sameParent(r))return!1;var i=o.node(-1),a=o.indexAfter(-1),s=no(i.contentMatchAt(a));if(!i.canReplaceWith(a,a,s))return!1;if(e){var l=o.after(),c=t.tr.replaceWith(l,l,s.createAndFill());c.setSelection(te.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0}function ro(t,e){var n=t.selection,o=n.$from,r=n.$to;if(n instanceof se||o.parent.inlineContent||r.parent.inlineContent)return!1;var i=no(r.parent.contentMatchAt(r.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){var a=(!o.parentOffset&&r.index()<r.parent.childCount?o:r).pos,s=t.tr.insert(a,i.createAndFill());s.setSelection(oe.create(s.doc,a+1)),e(s.scrollIntoView())}return!0}function io(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var o=n.before();if(Bt(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}var r=n.blockRange(),i=r&&Ot(r);return null!=i&&(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)}function ao(t,e){var n=t.selection,o=n.$from,r=n.$to;if(t.selection instanceof ie&&t.selection.node.isBlock)return!(!o.parentOffset||!Bt(t.doc,o.pos))&&(e&&e(t.tr.split(o.pos).scrollIntoView()),!0);if(!o.parent.isBlock)return!1;if(e){var i=r.parentOffset==r.parent.content.size,a=t.tr;(t.selection instanceof oe||t.selection instanceof se)&&a.deleteSelection();var s=0==o.depth?null:no(o.node(-1).contentMatchAt(o.indexAfter(-1))),l=i&&s?[{type:s}]:null,c=Bt(a.doc,a.mapping.map(o.pos),1,l);if(l||c||!Bt(a.doc,a.mapping.map(o.pos),1,s&&[{type:s}])||(l=[{type:s}],c=!0),c&&(a.split(a.mapping.map(o.pos),1,l),!i&&!o.parentOffset&&o.parent.type!=s)){var d=a.mapping.map(o.before()),u=a.doc.resolve(d);o.node(-1).canReplaceWith(u.index(),u.index()+1,s)&&a.setNodeMarkup(a.mapping.map(o.before()),s)}e(a.scrollIntoView())}return!0}function so(t,e){return ao(t,e&&function(n){var o=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();o&&n.ensureMarks(o),e(n)})}function lo(t,e){var n,o=t.selection,r=o.$from,i=o.to,a=r.sharedDepth(i);return 0!=a&&(n=r.before(a),e&&e(t.tr.setSelection(ie.create(t.doc,n))),!0)}function co(t,e){return e&&e(t.tr.setSelection(new se(t.doc))),!0}function uo(t,e,n){var o,r,a=e.nodeBefore,s=e.nodeAfter;if(a.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,n){var o=e.nodeBefore,r=e.nodeAfter,i=e.index();return!!(o&&r&&o.type.compatibleContent(r.type))&&(!o.content.size&&e.parent.canReplace(i-1,i)?(n&&n(t.tr.delete(e.pos-o.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(i,i+1)||!r.isTextblock&&!Nt(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,o.type,o.contentMatchAt(o.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(r=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&r.matchType(o[0]||s.type).validEnd){if(n){for(var c=e.pos+s.nodeSize,d=i.empty,u=o.length-1;u>=0;u--)d=i.from(o[u].create(null,d));d=i.from(a.copy(d));var f=t.tr.step(new Tt(e.pos-1,c,e.pos,c,new p(d,1,0),o.length,!0)),h=c+2*o.length;Nt(f.doc,h)&&f.join(h),n(f.scrollIntoView())}return!0}var m=te.findFrom(e,1),v=m&&m.$from.blockRange(m.$to),g=v&&Ot(v);if(null!=g&&g>=e.depth)return n&&n(t.tr.lift(v,g).scrollIntoView()),!0;if(l&&Jn(s,"start",!0)&&Jn(a,"end")){for(var y=a,b=[];b.push(y),!y.isTextblock;)y=y.lastChild;for(var w=s,k=1;!w.isTextblock;w=w.firstChild)k++;if(y.canReplace(y.childCount,y.childCount,w.content)){if(n){for(var _=i.empty,C=b.length-1;C>=0;C--)_=i.from(b[C].copy(_));n(t.tr.step(new Tt(e.pos-b.length,e.pos+s.nodeSize,e.pos+k,e.pos+s.nodeSize-k,new p(_,b.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function po(t){return function(e,n){for(var o=e.selection,r=t<0?o.$from:o.$to,i=r.depth;r.node(i).isInline;){if(!i)return!1;i--}return!!r.node(i).isTextblock&&(n&&n(e.tr.setSelection(oe.create(e.doc,t<0?r.start(i):r.end(i)))),!0)}}var fo=po(-1),ho=po(1);function mo(t,e){return function(n,o){var r=n.selection,i=r.$from,a=r.$to,s=i.blockRange(a),l=s&&At(s,t,e);return!!l&&(o&&o(n.tr.wrap(s,l).scrollIntoView()),!0)}}function vo(t,e){return function(n,o){var r=n.selection,i=r.from,a=r.to,s=!1;return n.doc.nodesBetween(i,a,(function(o,r){if(s)return!1;if(o.isTextblock&&!o.hasMarkup(t,e))if(o.type==t)s=!0;else{var i=n.doc.resolve(r),a=i.index();s=i.parent.canReplaceWith(a,a+1,t)}})),!!s&&(o&&o(n.tr.setBlockType(i,a,t,e).scrollIntoView()),!0)}}function go(t,e){return function(n,o){var r=n.selection,i=r.empty,a=r.$cursor,s=r.ranges;if(i&&!a||!function(t,e,n){for(var o=function(o){var r=e[o],i=r.$from,a=r.$to,s=0==i.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(i.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},r=0;r<e.length;r++){var i=o(r);if(i)return i.v}return!1}(n.doc,s,t))return!1;if(o)if(a)t.isInSet(n.storedMarks||a.marks())?o(n.tr.removeStoredMark(t)):o(n.tr.addStoredMark(t.create(e)));else{for(var l=!1,c=n.tr,d=0;!l&&d<s.length;d++){var u=s[d],p=u.$from,f=u.$to;l=n.doc.rangeHasMark(p.pos,f.pos,t)}for(var h=0;h<s.length;h++){var m=s[h],v=m.$from,g=m.$to;if(l)c.removeMark(v.pos,g.pos,t);else{var y=v.pos,b=g.pos,w=v.nodeAfter,k=g.nodeBefore,_=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,C=k&&k.isText?/\s*$/.exec(k.text)[0].length:0;y+_<b&&(y+=_,b-=C),c.addMark(y,b,t.create(e))}}o(c.scrollIntoView())}return!0}}function yo(t,e){if(Array.isArray(e)){var n=e;e=function(t){return n.indexOf(t.type.name)>-1}}return function(n,o,r){return t(n,o&&function(t,e){return function(n){if(!n.isGeneric)return t(n);for(var o=[],r=0;r<n.mapping.maps.length;r++){for(var i=n.mapping.maps[r],a=0;a<o.length;a++)o[a]=i.map(o[a]);i.forEach((function(t,e,n,r){return o.push(n,r)}))}for(var s=[],l=0;l<o.length;l+=2)for(var c=o[l],d=o[l+1],u=n.doc.resolve(c),p=u.sharedDepth(d),f=u.node(p),h=u.indexAfter(p),m=u.after(p+1);m<=d;++h){var v=f.maybeChild(h);if(!v)break;if(h&&-1==s.indexOf(m)){var g=f.child(h-1);g.type==v.type&&e(g,v)&&s.push(m)}m+=v.nodeSize}s.sort((function(t,e){return t-e}));for(var y=s.length-1;y>=0;y--)Nt(n.doc,s[y])&&n.join(s[y]);t(n)}}(o,e),r)}}function bo(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,o){for(var r=0;r<t.length;r++)if(t[r](e,n,o))return!0;return!1}}var wo=bo(Hn,qn,Kn),ko=bo(Hn,Gn,Xn),_o={Enter:bo(eo,ro,io,ao),"Mod-Enter":oo,Backspace:wo,"Mod-Backspace":wo,"Shift-Backspace":wo,Delete:ko,"Mod-Delete":ko,"Mod-a":co},Co={"Ctrl-h":_o.Backspace,"Alt-Backspace":_o["Mod-Backspace"],"Ctrl-d":_o.Delete,"Ctrl-Alt-Backspace":_o["Mod-Delete"],"Alt-Delete":_o["Mod-Delete"],"Alt-d":_o["Mod-Delete"],"Ctrl-a":fo,"Ctrl-e":ho};for(var xo in _o)Co[xo]=_o[xo];_o.Home=fo,_o.End=ho;var So=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?Co:_o,Eo=function(t,e){return mo(t.schema.nodes.blockquote)(t,e)},To=function(t,e){var n=t.selection,o=n.$from,r=n.$to,i=t.schema.nodes.blockquote,a=t.doc,s=-1,l=o.blockRange(r);l&&a.nodesBetween(l.start,l.end,(function(t,e,n,o){t.type===i&&(s=e)}));var c=-1!==s;return e&&c&&e(t.tr.lift(l,a.resolve(s).depth)),c},Mo=function(t,e,n){return function(o,r){var i=vn(o),a=o.tr;a.setMeta("commandName",e),i.forEach((function(e){if(e.type.isTextblock){var o=void 0,r=t.find((function(t){return t.node===e.type.name}));if(r){var i="rtl"===n?r.rtlStyle:r.style,s={name:i,value:r.step>0?""+r.step+r.unit:""};if(e.attrs.style){var l=new RegExp(i+":\\s?(\\d+)"+r.unit,"i"),c=e.attrs.style.match(l);if(c){var d=parseFloat(c[1])+r.step;d=d<=0?"":d,s.value=""+d+(d?r.unit:"")}}o=wn(e,[s])}o&&mn(a,e,e.type,o)}}));var s=a.docChanged;return s&&r(a.scrollIntoView()),s}},Do=function(t,e,n){var o=vn(t),r=!1;return o.forEach((function(t){if(!r&&t.type.isTextblock&&t.attrs.style){var o=e.find((function(e){return e.node===t.type.name}));if(o){var i="rtl"===n?o.rtlStyle:o.style,a=new RegExp(i+":\\s?\\d+"+o.unit,"i");r=a.test(t.attrs.style)}}})),r},Oo=function(t,e){return Ln(e)(t)},Ao=function(t,e){var n=t.schema.nodes[e.listsTypes.listItem],o=t.schema.nodes[e.listsTypes.orderedList],r=t.schema.nodes[e.listsTypes.bulletList],i=!!Le(o,2)(t.selection),a=!!Le(r,2)(t.selection);return(i||a)&&Pn(n)(t)},Io=function(t,e){var n=t.schema.nodes,o=n[jn.listsTypes.listItem];return(Do(t,e.nodes)||jn.nodes.some((function(e){return n[e.node]&&kn(t,n[e.node])})))&&!kn(t,o)},Bo=function(t,e){var n=t.schema.nodes[jn.listsTypes.listItem],o=Io(t,jn);Oo(t,n)?Ln(n)(t,e):o&&Mo(jn.nodes)(t,e)},No=function(t,e){var n=t.schema.nodes,o=n[Wn.listsTypes.listItem],r=Io(t,Wn);kn(t,n.blockquote)?To(t,e):Ao(t,Wn)?Pn(o)(t,e):r&&Mo(Wn.nodes)(t,e)},zo=function(t,e,n){for(var o=e.depth,r=t.nodes[n.bulletList],i=t.nodes[n.orderedList],a=t.nodes[n.listItem],s=e.depth;s>0;s--){var l=e.node(s);if(l.type!==r&&l.type!==i||(o=s),l.type!==r&&l.type!==i&&l.type!==a)break}return o-1};function Ro(t){return function(e,n,o){if(!o)return!1;var r=(e=o.state).schema.nodes[t.listType],i=e.selection,a=i.$from,s=i.$to,l=a.node(-2),c=a.node(-3),d=function(t,e,n,o){return 0===function(t,e,n){var o=Array(),r=function(t,e){var n=["blockquote","bulletList","orderedList"];if(1===e.depth)return e;var o=e.node(e.depth),r=e;for(;e.depth>=1;)e=t.resolve(e.before(e.depth)),(o=e.node(e.depth))&&-1!==n.indexOf(o.type.name)&&(r=e);return r}(t,e).depth,i=t.resolve(e.start(r));for(;i.pos<=n.start(n.depth);){var a=Math.min(i.depth,r),s=i.node(a);if(s&&o.push(s),0===a)break;var l=t.resolve(i.after(a));if(l.start(a)>=t.nodeSize-2)break;l.depth!==i.depth&&(l=t.resolve(l.pos+2)),i=l.depth?t.resolve(l.start(l.depth)):t.resolve(l.end(l.depth))}return o}(t,e,n).filter((function(t){return t.type!==o})).length}(e.doc,a,s,r);return(l&&l.type===r||c&&c.type===r)&&d?Lo(t)(e,n):(d||(Lo(t)(e,n),e=o.state),function(t,e){void 0===e&&(e={});return yo(zn(t,e),(function(e,n){return e.type===n.type&&e.type===t}))}(r,t.listAttrs)(e,n))}}function Po(t,e,n,o){var r=o||t.schema.nodes.listItem,a=e.$from,s=e.$to,l=a.blockRange(s,(function(t){return t.childCount&&t.firstChild.type===r}));if(!l||l.depth<2||a.node(l.depth-1).type!==r)return n;var c=l.end,d=s.end(l.depth);return c<d&&(n.step(new Tt(c-1,d,c,d,new p(i.from(r.create(void 0,l.parent.copy())),1,0),1,!0)),l=new E(n.doc.resolve(a.pos),n.doc.resolve(d),l.depth)),n.lift(l,Ot(l)).scrollIntoView()}function Lo(t){return function(e,n){var o=e.tr,r=e.selection,i=r.$from,a=r.$to;return o.doc.nodesBetween(i.pos,a.pos,(function(n,r){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var i=new ie(o.doc.resolve(o.mapping.map(r))),a=i.$from.blockRange(i.$to);if(!a||i.$from.parent.type!==e.schema.nodes[t.listItem])return!1;var s=a&&Ot(a);if(null==s)return!1;o.lift(a,s)}})),n&&n(o),!0}}var Fo=/list\-style\-type:\s?([\w-]+)/,$o=function(t){var e=t.style||"",n=Fo.exec(e);return n&&n[1]||""},Vo=function(t,e,n,o,r){var i=o.listType,a=o.listAttrs,s=void 0===a?{style:null}:a,l=t.selection,c=l.$from.node(l.$from.depth-2),d=l.$to.node(l.$to.depth-2);if(c&&c.type.name===i&&$o(c.attrs)===$o(s)&&d&&d.type.name===i&&$o(d.attrs)===$o(s)){var u=n.state.schema.nodes,p={bulletList:u[o.bulletList],orderedList:u[o.orderedList],listItem:u[o.listItem]},f=function(t,e){for(var n,o=e.bulletList,r=e.orderedList,i=e.listItem,a=t.depth-1;a>0;a--){var s=t.node(a);if(s.type!==o&&s.type!==r||(n=a),s.type!==o&&s.type!==r&&s.type!==i)break}return n}(l.$to,p),h=function(t,e,n,o,r,i){i||(i=t.schema.nodes.listItem);var a=!1;return r.doc.nodesBetween(e,n,(function(n,s){if(!a&&n.type===i&&s>e){a=!0;for(var l=o+3;l>o+2;){var c=r.doc.resolve(r.mapping.map(s));l=c.depth;var d=r.doc.resolve(r.mapping.map(s+n.textContent.length)),u=new oe(c,d);r=Po(t,u,r,i)}}})),r}(t,l.$to.pos,l.$to.end(f),f,n.state.tr,p.listItem);return(h=function(t,e,n){var o=t.selection,r=o.from,i=o.to,a=t.schema.nodes,s=a.paragraph,l=a.heading,c=[];e.doc.nodesBetween(r,i,(function(t,e){t.type!==s&&t.type!==l||c.push({node:t,pos:e})}));for(var d=c.length-1;d>=0;d--){var u=c[d],p=e.doc.resolve(e.mapping.map(u.pos));if(p.depth>0){var f=void 0;f=u.node.textContent&&u.node.textContent.length>0?e.doc.resolve(e.mapping.map(u.pos+u.node.textContent.length)):e.doc.resolve(e.mapping.map(u.pos+1));var h=p.blockRange(f);h&&e.lift(h,zo(t.schema,p,n))}}return e}(t,h,o)).setMeta("commandName",r),e(h),!0}return Ro(o)(t,e,n)};function jo(t,e,n){return Vo(t,e,n,Ne.__assign({listType:Vn.listType},Vn.types))}function Wo(t,e,n){return Vo(t,e,n,Ne.__assign({listType:$n.listType},$n.types))}for(var Ho=function(t,e){return{name:t,value:e}},qo=[{node:"paragraph",style:[Ho("text-align","left")]},{node:"heading",style:[Ho("text-align","left")]}],Jo=[{node:"paragraph",style:[Ho("text-align","right")]},{node:"heading",style:[Ho("text-align","right")]}],Ko=[{node:"paragraph",style:[Ho("text-align","center")]},{node:"heading",style:[Ho("text-align","center")]}],Uo=[{node:"paragraph",style:[Ho("text-align","justify")]},{node:"heading",style:[Ho("text-align","justify")]}],Go=[{node:"paragraph",style:[Ho("text-align","")]},{node:"heading",style:[Ho("text-align","")]}],Xo={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Yo={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Zo="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Qo="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),tr="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),er="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),nr="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),or=Zo&&(er||+Zo[1]<57)||tr&&er,rr=0;rr<10;rr++)Xo[48+rr]=Xo[96+rr]=String(rr);for(rr=1;rr<=24;rr++)Xo[rr+111]="F"+rr;for(rr=65;rr<=90;rr++)Xo[rr]=String.fromCharCode(rr+32),Yo[rr]=String.fromCharCode(rr);for(var ir in Xo)Yo.hasOwnProperty(ir)||(Yo[ir]=Xo[ir]);var ar="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function sr(t){var e,n,o,r,i=t.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s<i.length-1;s++){var l=i[s];if(/^(cmd|meta|m)$/i.test(l))r=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))n=!0;else if(/^s(hift)?$/i.test(l))o=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);ar?r=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),r&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function lr(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function cr(t){return new be({props:{handleKeyDown:dr(t)}})}function dr(t){var e=function(t){var e=Object.create(null);for(var n in t)e[sr(n)]=t[n];return e}(t);return function(t,n){var o,r=function(t){var e=!(or&&(t.ctrlKey||t.altKey||t.metaKey)||(Qo||nr)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?Yo:Xo)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),i=1==r.length&&" "!=r,a=e[lr(r,n,!i)];if(a&&a(t.state,t.dispatch,t))return!0;if(i&&(n.shiftKey||n.altKey||n.metaKey||r.charCodeAt(0)>127)&&(o=Xo[n.keyCode])&&o!=r){var s=e[lr(o,n,!0)];if(s&&s(t.state,t.dispatch,t))return!0}else if(i&&n.shiftKey){var l=e[lr(r,n,!0)];if(l&&l(t.state,t.dispatch,t))return!0}return!1}}var ur={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var pr=/Edge\/(\d+)/.exec(navigator.userAgent),fr=/MSIE \d/.test(navigator.userAgent),hr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),mr=ur.ie=!!(fr||hr||pr);ur.ie_version=fr?document.documentMode||6:hr?+hr[1]:pr?+pr[1]:null,ur.gecko=!mr&&/gecko\/(\d+)/i.test(navigator.userAgent),ur.gecko_version=ur.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var vr=!mr&&/Chrome\/(\d+)/.exec(navigator.userAgent);ur.chrome=!!vr,ur.chrome_version=vr&&+vr[1],ur.safari=!mr&&/Apple Computer/.test(navigator.vendor),ur.ios=ur.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),ur.mac=ur.ios||/Mac/.test(navigator.platform),ur.android=/Android \d/.test(navigator.userAgent),ur.webkit="webkitFontSmoothing"in document.documentElement.style,ur.webkit_version=ur.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var gr=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},yr=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},br=null,wr=function(t,e,n){var o=br||(br=document.createRange());return o.setEnd(t,null==n?t.nodeValue.length:n),o.setStart(t,e||0),o},kr=function(t,e,n,o){return n&&(Cr(t,e,n,o,-1)||Cr(t,e,n,o,1))},_r=/^(img|br|input|textarea|hr)$/i;function Cr(t,e,n,o,r){for(;;){if(t==n&&e==o)return!0;if(e==(r<0?0:xr(t))){var i=t.parentNode;if(!i||1!=i.nodeType||Sr(t)||_r.test(t.nodeName)||"false"==t.contentEditable)return!1;e=gr(t)+(r<0?0:1),t=i}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(r<0?-1:0)]).contentEditable)return!1;e=r<0?xr(t):0}}}function xr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Sr(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Er=function(t){var e=t.isCollapsed;return e&&ur.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function Tr(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function Mr(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Dr(t,e){return"number"==typeof t?t:t[e]}function Or(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function Ar(t,e,n){for(var o=t.someProp("scrollThreshold")||0,r=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument,a=n||t.dom;a;a=yr(a))if(1==a.nodeType){var s=a==i.body||1!=a.nodeType,l=s?Mr(i):Or(a),c=0,d=0;if(e.top<l.top+Dr(o,"top")?d=-(l.top-e.top+Dr(r,"top")):e.bottom>l.bottom-Dr(o,"bottom")&&(d=e.bottom-l.bottom+Dr(r,"bottom")),e.left<l.left+Dr(o,"left")?c=-(l.left-e.left+Dr(r,"left")):e.right>l.right-Dr(o,"right")&&(c=e.right-l.right+Dr(r,"right")),c||d)if(s)i.defaultView.scrollBy(c,d);else{var u=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);var f=a.scrollLeft-u,h=a.scrollTop-p;e={left:e.left-f,top:e.top-h,right:e.right-f,bottom:e.bottom-h}}if(s)break}}function Ir(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=yr(t));return e}function Br(t,e){for(var n=0;n<t.length;n++){var o=t[n],r=o.dom,i=o.top,a=o.left;r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Nr=null;function zr(t,e){for(var n,o,r=2e8,i=0,a=e.top,s=e.top,l=t.firstChild,c=0;l;l=l.nextSibling,c++){var d=void 0;if(1==l.nodeType)d=l.getClientRects();else{if(3!=l.nodeType)continue;d=wr(l).getClientRects()}for(var u=0;u<d.length;u++){var p=d[u];if(p.top<=a&&p.bottom>=s){a=Math.max(p.bottom,a),s=Math.min(p.top,s);var f=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(f<r){n=l,r=f,o=f&&3==n.nodeType?{left:p.right<e.left?p.right:p.left,top:e.top}:e,1==l.nodeType&&f&&(i=c+(e.left>=(p.left+p.right)/2?1:0));continue}}!n&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=c+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,o=document.createRange(),r=0;r<n;r++){o.setEnd(t,r+1),o.setStart(t,r);var i=Lr(o,1);if(i.top!=i.bottom&&Rr(e,i))return{node:t,offset:r+(e.left>=(i.left+i.right)/2?1:0)}}return{node:t,offset:0}}(n,o):!n||r&&1==n.nodeType?{node:t,offset:i}:zr(n,o)}function Rr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Pr(t,e){var n,o,r,i,a=t.dom.ownerDocument;if(a.caretPositionFromPoint)try{var s=a.caretPositionFromPoint(e.left,e.top);s&&(r=(n=s).offsetNode,i=n.offset)}catch(t){}if(!r&&a.caretRangeFromPoint){var l=a.caretRangeFromPoint(e.left,e.top);l&&(r=(o=l).startContainer,i=o.startOffset)}var c,d=(t.root.elementFromPoint?t.root:a).elementFromPoint(e.left,e.top+1);if(!d||!t.dom.contains(1!=d.nodeType?d.parentNode:d)){var u=t.dom.getBoundingClientRect();if(!Rr(e,u))return null;if(!(d=function t(e,n,o){var r=e.childNodes.length;if(r&&o.top<o.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(n.top-o.top)/(o.bottom-o.top))-2)),a=i;;){var s=e.childNodes[a];if(1==s.nodeType)for(var l=s.getClientRects(),c=0;c<l.length;c++){var d=l[c];if(Rr(n,d))return t(s,n,d)}if((a=(a+1)%r)==i)break}return e}(t.dom,e,u)))return null}if(ur.safari)for(var p=d;r&&p;p=yr(p))p.draggable&&(r=i=null);if(d=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(d,e),r){if(ur.gecko&&1==r.nodeType&&(i=Math.min(i,r.childNodes.length))<r.childNodes.length){var f,h=r.childNodes[i];"IMG"==h.nodeName&&(f=h.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}r==t.dom&&i==r.childNodes.length-1&&1==r.lastChild.nodeType&&e.top>r.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:0!=i&&1==r.nodeType&&"BR"==r.childNodes[i-1].nodeName||(c=function(t,e,n,o){for(var r=-1,i=e;i!=t.dom;){var a=t.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>o.left||s.top>o.top)r=a.posBefore;else{if(!(s.right<o.left||s.bottom<o.top))break;r=a.posAfter}}i=a.dom.parentNode}return r>-1?r:t.docView.posFromDOM(e,n)}(t,r,i,e))}null==c&&(c=function(t,e,n){var o=zr(e,n),r=o.node,i=o.offset,a=-1;if(1==r.nodeType&&!r.firstChild){var s=r.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,a)}(t,d,e));var m=t.docView.nearestDesc(d,!0);return{pos:c,inside:m?m.posAtStart-m.border:-1}}function Lr(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Fr=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function $r(t,e,n){var o=t.docView.domFromPos(e,n<0?-1:1),r=o.node,i=o.offset,a=ur.webkit||ur.gecko;if(3==r.nodeType){if(!a||!Fr.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){var s=i,l=i,c=n<0?1:-1;return n<0&&!i?(l++,c=-1):n>=0&&i==r.nodeValue.length?(s--,c=1):n<0?s--:l++,Vr(Lr(wr(r,s,l),c),c<0)}var d=Lr(wr(r,i,i),n);if(ur.gecko&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){var u=Lr(wr(r,i-1,i-1),-1);if(u.top==d.top){var p=Lr(wr(r,i,i+1),-1);if(p.top!=d.top)return Vr(p,p.left<u.left)}}return d}if(!t.state.doc.resolve(e).parent.inlineContent){if(i&&(n<0||i==xr(r))){var f=r.childNodes[i-1];if(1==f.nodeType)return jr(f.getBoundingClientRect(),!1)}if(i<xr(r)){var h=r.childNodes[i];if(1==h.nodeType)return jr(h.getBoundingClientRect(),!0)}return jr(r.getBoundingClientRect(),n>=0)}if(i&&(n<0||i==xr(r))){var m=r.childNodes[i-1],v=3==m.nodeType?wr(m,xr(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return Vr(Lr(v,1),!1)}if(i<xr(r)){for(var g=r.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?wr(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return Vr(Lr(y,-1),!0)}return Vr(Lr(3==r.nodeType?wr(r):r,-n),n>=0)}function Vr(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function jr(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Wr(t,e,n){var o=t.state,r=t.root.activeElement;o!=e&&t.updateState(e),r!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),r!=t.dom&&r&&r.focus()}}var Hr=/[\u0590-\u08ac]/;var qr=null,Jr=null,Kr=!1;function Ur(t,e,n){return qr==e&&Jr==n?Kr:(qr=e,Jr=n,Kr="up"==n||"down"==n?function(t,e,n){var o=e.selection,r="up"==n?o.$from:o.$to;return Wr(t,e,(function(){for(var e=t.docView.domFromPos(r.pos,"up"==n?-1:1).node;;){var o=t.docView.nearestDesc(e,!0);if(!o)break;if(o.node.isBlock){e=o.dom;break}e=o.dom.parentNode}for(var i=$r(t,r.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=wr(a,0,a.nodeValue.length).getClientRects()}for(var l=0;l<s.length;l++){var c=s[l];if(c.bottom>c.top+1&&("up"==n?i.top-c.top>2*(c.bottom-i.top):c.bottom-i.bottom>2*(i.bottom-c.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var o=e.selection.$head;if(!o.parent.isTextblock)return!1;var r=o.parentOffset,i=!r,a=r==o.parent.content.size,s=t.root.getSelection();return Hr.test(o.parent.textContent)&&s.modify?Wr(t,e,(function(){var e=s.getRangeAt(0),r=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(o.depth?t.docView.domAfterPos(o.before()):t.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||r==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(e),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(t,e,n))}var Gr=function(t,e,n,o){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=o,this.dirty=0},Xr={size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};Gr.prototype.matchesWidget=function(){return!1},Gr.prototype.matchesMark=function(){return!1},Gr.prototype.matchesNode=function(){return!1},Gr.prototype.matchesHack=function(t){return!1},Gr.prototype.parseRule=function(){return null},Gr.prototype.stopEvent=function(){return!1},Xr.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Xr.border.get=function(){return 0},Gr.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},Gr.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var o=this.children[e];if(o==t)return n;n+=o.size}},Xr.posBefore.get=function(){return this.parent.posBeforeChild(this)},Xr.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Xr.posAfter.get=function(){return this.posBefore+this.size},Xr.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},Gr.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var o,r;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&(!(r=o.pmViewDesc)||r.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(r)+r.size:this.posAtStart}var i,a;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&(!(a=i.pmViewDesc)||a.parent!=this);)i=i.nextSibling;return i?this.posBeforeChild(a):this.posAtEnd}var s;if(t==this.dom&&this.contentDOM)s=e>gr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var l=t;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.parentNode.firstChild!=l)break}if(null==s&&e==t.childNodes.length)for(var c=t;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.parentNode.lastChild!=c)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart},Gr.prototype.nearestDesc=function(t,e){for(var n=!0,o=t;o;o=o.parentNode){var r=this.getDesc(o);if(r&&(!e||r.node)){if(!n||!r.nodeDOM||(1==r.nodeDOM.nodeType?r.nodeDOM.contains(1==t.nodeType?t:t.parentNode):r.nodeDOM==t))return r;n=!1}}},Gr.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},Gr.prototype.posFromDOM=function(t,e,n){for(var o=t;o;o=o.parentNode){var r=this.getDesc(o);if(r)return r.localPosFromDOM(t,e,n)}return-1},Gr.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var o=this.children[e],r=n+o.size;if(n==t&&r!=n){for(;!o.border&&o.children.length;)o=o.children[0];return o}if(t<r)return o.descAt(t-n-o.border);n=r}},Gr.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,o=0,r=0;n<this.children.length;n++){var i=this.children[n],a=r+i.size;if(a>t||i instanceof ri){o=t-r;break}r=a}if(o)return this.children[n].domFromPos(o-this.children[n].border,e);for(var s=void 0;n&&!(s=this.children[n-1]).size&&s instanceof Zr&&s.widget.type.side>=0;n--);if(e<=0){for(var l,c=!0;(l=n?this.children[n-1]:null)&&l.dom.parentNode!=this.contentDOM;n--,c=!1);return l&&e&&c&&!l.border&&!l.domAtom?l.domFromPos(l.size,e):{node:this.contentDOM,offset:l?gr(l.dom)+1:0}}for(var d,u=!0;(d=n<this.children.length?this.children[n]:null)&&d.dom.parentNode!=this.contentDOM;n++,u=!1);return d&&u&&!d.border&&!d.domAtom?d.domFromPos(0,e):{node:this.contentDOM,offset:d?gr(d.dom):this.contentDOM.childNodes.length}},Gr.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var o=-1,r=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==o&&t<=l){var c=i+s.border;if(t>=c&&e<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,c);t=i;for(var d=a;d>0;d--){var u=this.children[d-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){o=gr(u.dom)+1;break}t-=u.size}-1==o&&(o=0)}if(o>-1&&(l>e||a==this.children.length-1)){e=l;for(var p=a+1;p<this.children.length;p++){var f=this.children[p];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){r=gr(f.dom);break}e+=f.size}-1==r&&(r=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:t,to:e,fromOffset:o,toOffset:r}},Gr.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},Gr.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,o=e.offset;if(1!=n.nodeType||o==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[o]},Gr.prototype.setSelection=function(t,e,n,o){for(var r=Math.min(t,e),i=Math.max(t,e),a=0,s=0;a<this.children.length;a++){var l=this.children[a],c=s+l.size;if(r>s&&i<c)return l.setSelection(t-s-l.border,e-s-l.border,n,o);s=c}var d=this.domFromPos(t,t?-1:1),u=e==t?d:this.domFromPos(e,e?-1:1),p=n.getSelection(),f=!1;if((ur.gecko||ur.safari)&&t==e){var h=d.node,m=d.offset;if(3==h.nodeType){if((f=m&&"\n"==h.nodeValue[m-1])&&m==h.nodeValue.length)for(var v=h,g=void 0;v;v=v.parentNode){if(g=v.nextSibling){"BR"==g.nodeName&&(d=u={node:g.parentNode,offset:gr(g)+1});break}var y=v.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{var b=h.childNodes[m-1];f=b&&("BR"==b.nodeName||"false"==b.contentEditable)}}if(ur.gecko&&p.focusNode&&p.focusNode!=u.node&&1==p.focusNode.nodeType){var w=p.focusNode.childNodes[p.focusOffset];w&&"false"==w.contentEditable&&(o=!0)}if(o||f&&ur.safari||!kr(d.node,d.offset,p.anchorNode,p.anchorOffset)||!kr(u.node,u.offset,p.focusNode,p.focusOffset)){var k=!1;if((p.extend||t==e)&&!f){p.collapse(d.node,d.offset);try{t!=e&&p.extend(u.node,u.offset),k=!0}catch(t){if(!(t instanceof DOMException))throw t}}if(!k){if(t>e){var _=d;d=u,u=_}var C=document.createRange();C.setEnd(u.node,u.offset),C.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(C)}}},Gr.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},Xr.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Gr.prototype.markDirty=function(t,e){for(var n=0,o=0;o<this.children.length;o++){var r=this.children[o],i=n+r.size;if(n==i?t<=i&&e>=n:t<i&&e>n){var a=n+r.border,s=i-r.border;if(t>=a&&e<=s)return this.dirty=t==n||e==i?2:1,void(t!=a||e!=s||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(t-a,e-a):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=i}this.dirty=2},Gr.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Xr.domAtom.get=function(){return!1},Xr.ignoreForCoords.get=function(){return!1},Object.defineProperties(Gr.prototype,Xr);var Yr=[],Zr=function(t){function e(e,n,o,r){var i,a=n.type.toDOM;if("function"==typeof a&&(a=a(o,(function(){return i?i.parent?i.parent.posBeforeChild(i):void 0:r}))),!n.type.spec.raw){if(1!=a.nodeType){var s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable=!1,a.classList.add("ProseMirror-widget")}t.call(this,e,Yr,a,null),this.widget=n,i=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},e.prototype.destroy=function(){this.widget.type.destroy(this.dom),t.prototype.destroy.call(this)},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Gr),Qr=function(t){function e(e,n,o,r){t.call(this,e,Yr,n,null),this.textDOM=o,this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(Gr),ti=function(t){function e(e,n,o,r){t.call(this,e,[],o,r),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,o,r){var i=r.nodeViews[n.type.name],a=i&&i(n,r,o);return a&&a.dom||(a=ut.renderSpec(document,n.type.spec.toDOM(n,o))),new e(t,n,a.dom,a.contentDOM||a.dom)},e.prototype.parseRule=function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var o=this.parent;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,o){var r=e.create(this.parent,this.mark,!0,o),i=this.children,a=this.size;n<a&&(i=vi(i,n,a,o)),t>0&&(i=vi(i,0,t,o));for(var s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r},e}(Gr),ei=function(t){function e(e,n,o,r,i,a,s,l,c){t.call(this,e,n.isLeaf?Yr:[],i,a),this.nodeDOM=s,this.node=n,this.outerDeco=o,this.innerDeco=r,a&&this.updateChildren(l,c)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,o,r,i,a){var s,l,c=i.nodeViews[n.type.name],d=c&&c(n,i,(function(){return l?l.parent?l.parent.posBeforeChild(l):void 0:a}),o,r),u=d&&d.dom,p=d&&d.contentDOM;if(n.isText)if(u){if(3!=u.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||(u=(s=ut.renderSpec(document,n.type.spec.toDOM(n))).dom,p=s.contentDOM);p||n.isText||"BR"==u.nodeName||(u.hasAttribute("contenteditable")||(u.contentEditable=!1),n.type.spec.draggable&&(u.draggable=!0));var f=u;return u=ui(u,o,n),d?l=new ii(t,n,o,r,u,p,f,d,i,a+1):n.isText?new oi(t,n,o,r,u,f,i):new e(t,n,o,r,u,p,f,i,a+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return"pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?i.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&pi(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,o=this.node.inlineContent,r=e,i=t.composing&&this.localCompositionInfo(t,e),a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new hi(this,a&&a.node);!function(t,e,n,o){var r=e.locals(t),i=0;if(0==r.length){for(var a=0;a<t.childCount;a++){var s=t.child(a);o(s,r,e.forChild(i,s),a),i+=s.nodeSize}return}for(var l=0,c=[],d=null,u=0;;){if(l<r.length&&r[l].to==i){for(var p=r[l++],f=void 0;l<r.length&&r[l].to==i;)(f||(f=[p])).push(r[l++]);if(f){f.sort(mi);for(var h=0;h<f.length;h++)n(f[h],u,!!d)}else n(p,u,!!d)}var m=void 0,v=void 0;if(d)v=-1,m=d,d=null;else{if(!(u<t.childCount))break;v=u,m=t.child(u++)}for(var g=0;g<c.length;g++)c[g].to<=i&&c.splice(g--,1);for(;l<r.length&&r[l].from<=i&&r[l].to>i;)c.push(r[l++]);var y=i+m.nodeSize;if(m.isText){var b=y;l<r.length&&r[l].from<b&&(b=r[l].from);for(var w=0;w<c.length;w++)c[w].to<b&&(b=c[w].to);b<y&&(d=m.cut(b-i),m=m.cut(0,b-i),y=b,v=-1)}var k=c.length?m.isInline&&!m.isLeaf?c.filter((function(t){return!t.inline})):c.slice():Yr;o(m,k,e.forChild(i,m),v),i=y}}(this.node,this.innerDeco,(function(e,i,a){e.spec.marks?l.syncToMarks(e.spec.marks,o,t):e.type.side>=0&&!a&&l.syncToMarks(i==n.node.childCount?d.none:n.node.child(i).marks,o,t),l.placeWidget(e,t,r)}),(function(e,n,a,c){var d;l.syncToMarks(e.marks,o,t),l.findNodeMatch(e,n,a,c)||s&&t.state.selection.from>r&&t.state.selection.to<r+e.nodeSize&&(d=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(e,n,a,d,t)||l.updateNextNode(e,n,a,t,c)||l.addNode(e,n,a,t,r),r+=e.nodeSize})),l.syncToMarks(Yr,o,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),function t(e,n,o){for(var r=e.firstChild,i=!1,a=0;a<n.length;a++){var s=n[a],l=s.dom;if(l.parentNode==e){for(;l!=r;)r=fi(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(s instanceof ti){var c=r?r.previousSibling:e.lastChild;t(s.contentDOM,s.children,o),r=c?c.nextSibling:e.firstChild}}for(;r;)r=fi(r),i=!0;i&&o.trackWrites==e&&(o.trackWrites=null)}(this.contentDOM,this.children,t),ur.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionInfo=function(t,e){var n=t.state.selection,o=n.from,r=n.to;if(!(!(t.state.selection instanceof oe)||o<e||r>e+this.node.content.size)){var i=t.root.getSelection(),a=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];t=t.childNodes[e-1],e=xr(t)}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(i.focusNode,i.focusOffset);if(a&&this.dom.contains(a.parentNode)){if(this.node.inlineContent){var s=a.nodeValue,l=function(t,e,n,o){for(var r=0,i=0;r<t.childCount&&i<=o;){var a=t.child(r++),s=i;if(i+=a.nodeSize,a.isText){for(var l=a.text;r<t.childCount;){var c=t.child(r++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=n&&s<o){var d=l.lastIndexOf(e,o-s-1);if(d>=0&&d+e.length+s>=n)return s+d}}}return-1}(this.node.content,s,o-e,r-e);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,o=e.pos,r=e.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=null)}var a=new Qr(this,i,n,r);t.compositionNodes.push(a),this.children=vi(this.children,o,o+r.length,t,a)}},e.prototype.update=function(t,e,n,o){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,o),!0)},e.prototype.updateInner=function(t,e,n,o){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!pi(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=ci(this.dom,this.nodeDOM,li(this.outerDeco,this.node,e),li(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(Gr);function ni(t,e,n,o,r){return ui(o,e,t),new ei(null,t,e,n,o,o,o,r,0)}var oi=function(t){function e(e,n,o,r,i,a,s){t.call(this,e,n,o,r,i,null,a,s)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,o){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,o)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,o){var r=this.node.cut(t,n),i=document.createTextNode(r.text);return new e(this.parent,r,this.outerDeco,this.innerDeco,i,i,o)},e.prototype.markDirty=function(e,n){t.prototype.markDirty.call(this,e,n),this.dom==this.nodeDOM||0!=e&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(ei),ri=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(t){return 0==this.dirty&&this.dom.nodeName==t},n.domAtom.get=function(){return!0},n.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(e.prototype,n),e}(Gr),ii=function(t){function e(e,n,o,r,i,a,s,l,c,d){t.call(this,e,n,o,r,i,a,s,c,d),this.spec=l}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,o,r){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,n,o);return i&&this.updateInner(e,n,o,r),i}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,o,r)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,o,r){this.spec.setSelection?this.spec.setSelection(e,n,o):t.prototype.setSelection.call(this,e,n,o,r)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(ei);function ai(t){t&&(this.nodeName=t)}ai.prototype=Object.create(null);var si=[new ai];function li(t,e,n){if(0==t.length)return si;for(var o=n?si[0]:new ai,r=[o],i=0;i<t.length;i++){var a=t[i].type.attrs;if(a)for(var s in a.nodeName&&r.push(o=new ai(a.nodeName)),a){var l=a[s];null!=l&&(n&&1==r.length&&r.push(o=new ai(e.isInline?"span":"div")),"class"==s?o.class=(o.class?o.class+" ":"")+l:"style"==s?o.style=(o.style?o.style+";":"")+l:"nodeName"!=s&&(o[s]=l))}}return r}function ci(t,e,n,o){if(n==si&&o==si)return e;for(var r=e,i=0;i<o.length;i++){var a=o[i],s=n[i];if(i){var l=void 0;s&&s.nodeName==a.nodeName&&r!=t&&(l=r.parentNode)&&l.tagName.toLowerCase()==a.nodeName||((l=document.createElement(a.nodeName)).pmIsDeco=!0,l.appendChild(r),s=si[0]),r=l}di(r,s||si[0],a)}return r}function di(t,e,n){for(var o in e)"class"==o||"style"==o||"nodeName"==o||o in n||t.removeAttribute(o);for(var r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){for(var i=e.class?e.class.split(" ").filter(Boolean):Yr,a=n.class?n.class.split(" ").filter(Boolean):Yr,s=0;s<i.length;s++)-1==a.indexOf(i[s])&&t.classList.remove(i[s]);for(var l=0;l<a.length;l++)-1==i.indexOf(a[l])&&t.classList.add(a[l]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var c,d=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=d.exec(e.style);)t.style.removeProperty(c[1]);n.style&&(t.style.cssText+=n.style)}}function ui(t,e,n){return ci(t,t,si,li(e,n,1!=t.nodeType))}function pi(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function fi(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var hi=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(t,e){var n=e,o=n.children.length,r=t.childCount,i=new Map,a=[];t:for(;r>0;){for(var s=void 0;;)if(o){var l=n.children[o-1];if(!(l instanceof ti)){s=l,o--;break}n=l,o=l.children.length}else{if(n==e)break t;o=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=t.child(r-1))break;--r,i.set(s,r),a.push(s)}}return{index:r,matched:i,matches:a.reverse()}}(t.node.content,t)};function mi(t,e){return t.type.side-e.type.side}function vi(t,e,n,o,r){for(var i=[],a=0,s=0;a<t.length;a++){var l=t[a],c=s,d=s+=l.size;c>=n||d<=e?i.push(l):(c<e&&i.push(l.slice(0,e-c,o)),r&&(i.push(r),r=null),d>n&&i.push(l.slice(n-c,l.size,o)))}return i}function gi(t,e){var n=t.root.getSelection(),o=t.state.doc;if(!n.focusNode)return null;var r=t.docView.nearestDesc(n.focusNode),i=r&&0==r.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var s,l,c=o.resolve(a);if(Er(n)){for(s=c;r&&!r.node;)r=r.parent;if(r&&r.node.isAtom&&ie.isSelectable(r.node)&&r.parent&&(!r.node.isInline||!function(t,e,n){for(var o=0==e,r=e==xr(t);o||r;){if(t==n)return!0;var i=gr(t);if(!(t=t.parentNode))return!1;o=o&&0==i,r=r&&i==xr(t)}}(n.focusNode,n.focusOffset,r.dom))){var d=r.posBefore;l=new ie(a==d?c:o.resolve(d))}}else{var u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(u<0)return null;s=o.resolve(u)}l||(l=Ei(t,s,c,"pointer"==e||t.state.selection.head<c.pos&&!i?1:-1));return l}function yi(t){return t.editable?t.hasFocus():Ti(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function bi(t,e){var n=t.state.selection;if(xi(t,n),yi(t)){if(!e&&t.mouseDown&&t.mouseDown.allowDefault&&ur.chrome){var o=t.root.getSelection(),r=t.domObserver.currentSelection;if(o.anchorNode&&kr(o.anchorNode,o.anchorOffset,r.anchorNode,r.anchorOffset))return t.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),o=t.cursorWrapper.dom,r="IMG"==o.nodeName;r?n.setEnd(o.parentNode,gr(o)+1):n.setEnd(o,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!r&&!t.state.selection.visible&&ur.ie&&ur.ie_version<=11&&(o.disabled=!0,o.disabled=!1)}(t);else{var i,a,s=n.anchor,l=n.head;!wi||n instanceof oe||(n.$from.parent.inlineContent||(i=ki(t,n.from)),n.empty||n.$from.parent.inlineContent||(a=ki(t,n.to))),t.docView.setSelection(s,l,t.root,e),wi&&(i&&Ci(i),a&&Ci(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),o=n.anchorNode,r=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==o&&n.anchorOffset==r||(e.removeEventListener("selectionchange",t.hideSelectionGuard),setTimeout((function(){yi(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}hi.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},hi.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},hi.prototype.syncToMarks=function(t,e,n){for(var o=0,r=this.stack.length>>1,i=Math.min(r,t.length);o<i&&(o==r-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&!1!==t[o].type.spec.spanning;)o++;for(;o<r;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),r--;for(;r<t.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(t[r])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=ti.create(this.top,t[r],e,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,r++}},hi.prototype.findNodeMatch=function(t,e,n,o){var r,i=-1;if(o>=this.preMatch.index&&(r=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&r.matchesNode(t,e,n))i=this.top.children.indexOf(r,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var l=this.top.children[a];if(l.matchesNode(t,e,n)&&!this.preMatch.matched.has(l)){i=a;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},hi.prototype.updateNodeAt=function(t,e,n,o,r){return!!this.top.children[o].update(t,e,n,r)&&(this.destroyBetween(this.index,o),this.index=o+1,!0)},hi.prototype.findIndexWithChild=function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==n)return o;return-1}t=e}},hi.prototype.updateNextNode=function(t,e,n,o,r){for(var i=this.index;i<this.top.children.length;i++){var a=this.top.children[i];if(a instanceof ei){var s=this.preMatch.matched.get(a);if(null!=s&&s!=r)return!1;var l=a.dom;if(!(this.lock&&(l==this.lock||1==l.nodeType&&l.contains(this.lock.parentNode))&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&pi(e,a.outerDeco)))&&a.update(t,e,n,o))return this.destroyBetween(this.index,i),a.dom!=l&&(this.changed=!0),this.index++,!0;break}}return!1},hi.prototype.addNode=function(t,e,n,o,r){this.top.children.splice(this.index++,0,ei.create(this.top,t,e,n,o,r)),this.changed=!0},hi.prototype.placeWidget=function(t,e,n){var o=this.index<this.top.children.length?this.top.children[this.index]:null;if(!o||!o.matchesWidget(t)||t!=o.widget&&o.widget.type.toDOM.parentNode){var r=new Zr(this.top,t,e,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++},hi.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof ti;)t=t.children[t.children.length-1];t&&t instanceof oi&&!/\n$/.test(t.node.text)||((ur.safari||ur.chrome)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG"),this.addHackNode("BR"))},hi.prototype.addHackNode=function(t){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(t))this.index++;else{var e=document.createElement(t);"IMG"==t&&(e.className="ProseMirror-separator"),"BR"==t&&(e.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new ri(this.top,Yr,e,null)),this.changed=!0}};var wi=ur.safari||ur.chrome&&ur.chrome_version<63;function ki(t,e){var n=t.docView.domFromPos(e,0),o=n.node,r=n.offset,i=r<o.childNodes.length?o.childNodes[r]:null,a=r?o.childNodes[r-1]:null;if(ur.safari&&i&&"false"==i.contentEditable)return _i(i);if(!(i&&"false"!=i.contentEditable||a&&"false"!=a.contentEditable)){if(i)return _i(i);if(a)return _i(a)}}function _i(t){return t.contentEditable="true",ur.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Ci(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function xi(t,e){if(e instanceof ie){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Si(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Si(t)}function Si(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function Ei(t,e,n,o){return t.someProp("createSelectionBetween",(function(o){return o(t,e,n)}))||oe.between(e,n,o)}function Ti(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Mi(t,e){var n=t.selection,o=n.$anchor,r=n.$head,i=e>0?o.max(r):o.min(r),a=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return a&&te.findFrom(a,e)}function Di(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Oi(t,e,n){var o=t.state.selection;if(!(o instanceof oe)){if(o instanceof ie&&o.node.isInline)return Di(t,new oe(e>0?o.$to:o.$from));var r=Mi(t.state,e);return!!r&&Di(t,r)}if(!o.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var i=Mi(t.state,e);return!!(i&&i instanceof ie)&&Di(t,i)}if(!(ur.mac&&n.indexOf("m")>-1)){var a,s=o.$head,l=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var c=e<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM)&&(ie.isSelectable(l)?Di(t,new ie(e<0?t.state.doc.resolve(s.pos-l.nodeSize):s)):!!ur.webkit&&Di(t,new oe(t.state.doc.resolve(e<0?c:c+l.nodeSize))))}}function Ai(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ii(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Bi(t){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n){var r,i,a=!1;for(ur.gecko&&1==n.nodeType&&o<Ai(n)&&Ii(n.childNodes[o])&&(a=!0);;)if(o>0){if(1!=n.nodeType)break;var s=n.childNodes[o-1];if(Ii(s))r=n,i=--o;else{if(3!=s.nodeType)break;o=(n=s).nodeValue.length}}else{if(zi(n))break;for(var l=n.previousSibling;l&&Ii(l);)r=n.parentNode,i=gr(l),l=l.previousSibling;if(l)o=Ai(n=l);else{if((n=n.parentNode)==t.dom)break;o=0}}a?Ri(t,e,n,o):r&&Ri(t,e,r,i)}}function Ni(t){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n){for(var r,i,a=Ai(n);;)if(o<a){if(1!=n.nodeType)break;if(!Ii(n.childNodes[o]))break;r=n,i=++o}else{if(zi(n))break;for(var s=n.nextSibling;s&&Ii(s);)r=s.parentNode,i=gr(s)+1,s=s.nextSibling;if(s)o=0,a=Ai(n=s);else{if((n=n.parentNode)==t.dom)break;o=a=0}}r&&Ri(t,e,r,i)}}function zi(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Ri(t,e,n,o){if(Er(e)){var r=document.createRange();r.setEnd(n,o),r.setStart(n,o),e.removeAllRanges(),e.addRange(r)}else e.extend&&e.extend(n,o);t.domObserver.setCurSelection();var i=t.state;setTimeout((function(){t.state==i&&bi(t)}),50)}function Pi(t,e,n){var o=t.state.selection;if(o instanceof oe&&!o.empty||n.indexOf("s")>-1)return!1;if(ur.mac&&n.indexOf("m")>-1)return!1;var r=o.$from,i=o.$to;if(!r.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=Mi(t.state,e);if(a&&a instanceof ie)return Di(t,a)}if(!r.parent.inlineContent){var s=e<0?r:i,l=o instanceof se?te.near(s,e):te.findFrom(s,e);return!!l&&Di(t,l)}return!1}function Li(t,e){if(!(t.state.selection instanceof oe))return!0;var n=t.state.selection,o=n.$head,r=n.$anchor,i=n.empty;if(!o.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!o.textOffset&&(e<0?o.nodeBefore:o.nodeAfter);if(a&&!a.isText){var s=t.state.tr;return e<0?s.delete(o.pos-a.nodeSize,o.pos):s.delete(o.pos,o.pos+a.nodeSize),t.dispatch(s),!0}return!1}function Fi(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function $i(t,e){var n=e.keyCode,o=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||ur.mac&&72==n&&"c"==o?Li(t,-1)||Bi(t):46==n||ur.mac&&68==n&&"c"==o?Li(t,1)||Ni(t):13==n||27==n||(37==n?Oi(t,-1,o)||Bi(t):39==n?Oi(t,1,o)||Ni(t):38==n?Pi(t,-1,o)||Bi(t):40==n?function(t){if(ur.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,o=e.focusOffset;if(n&&1==n.nodeType&&0==o&&n.firstChild&&"false"==n.firstChild.contentEditable){var r=n.firstChild;Fi(t,r,!0),setTimeout((function(){return Fi(t,r,!1)}),20)}}}(t)||Pi(t,1,o)||Ni(t):o==(ur.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Vi(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(ur.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||ur.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function ji(t,e,n,o,r){if(e<0){var a=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,s=gi(t,a);if(s&&!t.state.selection.eq(s)){var l=t.state.tr.setSelection(s);"pointer"==a?l.setMeta("pointer",!0):"key"==a&&l.scrollIntoView(),t.dispatch(l)}}else{var c=t.state.doc.resolve(e),d=c.sharedDepth(n);e=c.before(d+1),n=t.state.doc.resolve(n).after(d+1);var u=t.state.selection,p=function(t,e,n){var o=t.docView.parseRange(e,n),r=o.node,i=o.fromOffset,a=o.toOffset,s=o.from,l=o.to,c=t.root.getSelection(),d=null,u=c.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],Er(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ur.chrome&&8===t.lastKeyCode)for(var p=a;p>i;p--){var f=r.childNodes[p-1],h=f.pmViewDesc;if("BR"==f.nodeName&&!h){a=p;break}if(!h||h.size)break}var m=t.state.doc,v=t.someProp("domParser")||tt.fromSchema(t.state.schema),g=m.resolve(s),y=null,b=v.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:i,to:a,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",editableContent:!0,findPositions:d,ruleFromNode:Vi,context:g});if(d&&null!=d[0].pos){var w=d[0].pos,k=d[1]&&d[1].pos;null==k&&(k=w),y={anchor:w+s,head:k+s}}return{doc:b,sel:y,from:s,to:l}}(t,e,n);if(ur.chrome&&t.cursorWrapper&&p.sel&&p.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,h=f&&f.nodeValue?f.nodeValue.length:1;p.sel={anchor:p.sel.anchor+h,head:p.sel.anchor+h}}var m,v,g=t.state.doc,y=g.slice(p.from,p.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(m=t.state.selection.to,v="end"):(m=t.state.selection.from,v="start"),t.lastKeyCode=null;var b=function(t,e,n,o,r){var i=t.findDiffStart(e,n);if(null==i)return null;var a=t.findDiffEnd(e,n+t.size,n+e.size),s=a.a,l=a.b;if("end"==r){var c=Math.max(0,i-Math.min(s,l));o-=s+c-i}if(s<i&&t.size<e.size){l=(i-=o<=i&&o>=s?i-o:0)+(l-s),s=i}else if(l<i){s=(i-=o<=i&&o>=l?i-o:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(y.content,p.doc.content,p.from,m,v);if(!b){if(!(o&&u instanceof oe&&!u.empty&&u.$head.sameParent(u.$anchor))||t.composing||p.sel&&p.sel.anchor!=p.sel.head){if((ur.ios&&t.lastIOSEnter>Date.now()-225||ur.android)&&r.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})))return void(t.lastIOSEnter=0);if(p.sel){var w=Wi(t,t.state.doc,p.sel);w&&!w.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(w))}return}b={start:u.from,endA:u.to,endB:u.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof oe&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),ur.ie&&ur.ie_version<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>p.from&&"  "==p.doc.textBetween(b.start-p.from-1,b.start-p.from+1)&&(b.start--,b.endA--,b.endB--);var k,_=p.doc.resolveNoCache(b.start-p.from),C=p.doc.resolveNoCache(b.endB-p.from),x=_.sameParent(C)&&_.parent.inlineContent;if((ur.ios&&t.lastIOSEnter>Date.now()-225&&(!x||r.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!x&&_.pos<p.doc.content.size&&(k=te.findFrom(p.doc.resolve(_.pos+1),1,!0))&&k.head==C.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>b.start&&function(t,e,n,o,r){if(!o.parent.isTextblock||n-e<=r.pos-o.pos||Hi(o,!0,!1)<r.pos)return!1;var i=t.resolve(e);if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;var a=t.resolve(Hi(i,!0,!0));if(!a.parent.isTextblock||a.pos>n||Hi(a,!0,!1)<n)return!1;return o.parent.content.cut(o.parentOffset).eq(a.parent.content)}(g,b.start,b.endA,_,C)&&t.someProp("handleKeyDown",(function(e){return e(t,Tr(8,"Backspace"))})))ur.android&&ur.chrome&&t.domObserver.suppressSelectionUpdates();else{ur.chrome&&ur.android&&b.toB==b.from&&(t.lastAndroidDelete=Date.now()),ur.android&&!x&&_.start()!=C.start()&&0==C.parentOffset&&_.depth==C.depth&&p.sel&&p.sel.anchor==p.sel.head&&p.sel.head==b.endA&&(b.endB-=2,C=p.doc.resolveNoCache(b.endB-p.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))}))}),20));var S,E,T,M,D=b.start,O=b.endA;if(x)if(_.pos==C.pos)ur.ie&&ur.ie_version<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return bi(t)}),20)),S=t.state.tr.delete(D,O),E=g.resolve(b.start).marksAcross(g.resolve(b.endA));else if(b.endA==b.endB&&(M=g.resolve(b.start))&&(T=function(t,e){for(var n,o,r,a=t.firstChild.marks,s=e.firstChild.marks,l=a,c=s,d=0;d<s.length;d++)l=s[d].removeFromSet(l);for(var u=0;u<a.length;u++)c=a[u].removeFromSet(c);if(1==l.length&&0==c.length)o=l[0],n="add",r=function(t){return t.mark(o.addToSet(t.marks))};else{if(0!=l.length||1!=c.length)return null;o=c[0],n="remove",r=function(t){return t.mark(o.removeFromSet(t.marks))}}for(var p=[],f=0;f<e.childCount;f++)p.push(r(e.child(f)));if(i.from(p).eq(t))return{mark:o,type:n}}(_.parent.content.cut(_.parentOffset,C.parentOffset),M.parent.content.cut(M.parentOffset,b.endA-M.start()))))S=t.state.tr,"add"==T.type?S.addMark(D,O,T.mark):S.removeMark(D,O,T.mark);else if(_.parent.child(_.index()).isText&&_.index()==C.index()-(C.textOffset?0:1)){var A=_.parent.textBetween(_.parentOffset,C.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,D,O,A)})))return;S=t.state.tr.insertText(A,D,O)}if(S||(S=t.state.tr.replace(D,O,p.doc.slice(b.start-p.from,b.endB-p.from))),p.sel){var I=Wi(t,S.doc,p.sel);I&&!(ur.chrome&&ur.android&&t.composing&&I.empty&&(b.start!=b.endB||t.lastAndroidDelete<Date.now()-100)&&(I.head==D||I.head==S.mapping.map(O)-1)||ur.ie&&I.empty&&I.head==D)&&S.setSelection(I)}E&&S.ensureMarks(E),t.dispatch(S.scrollIntoView())}}}function Wi(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Ei(t,e.resolve(n.anchor),e.resolve(n.head))}function Hi(t,e,n){for(var o=t.depth,r=e?t.end():t.pos;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,r++,e=!1;if(n)for(var i=t.node(o).maybeChild(t.indexAfter(o));i&&!i.isLeaf;)i=i.firstChild,r++;return r}function qi(t,e){for(var n=[],o=e.content,r=e.openStart,i=e.openEnd;r>1&&i>1&&1==o.childCount&&1==o.firstChild.childCount;){r--,i--;var a=o.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),o=a.content}var s=t.someProp("clipboardSerializer")||ut.fromSchema(t.state.schema),l=Qi(),c=l.createElement("div");c.appendChild(s.serializeFragment(o,{document:l}));for(var d,u=c.firstChild;u&&1==u.nodeType&&(d=Yi[u.nodeName.toLowerCase()]);){for(var p=d.length-1;p>=0;p--){for(var f=l.createElement(d[p]);c.firstChild;)f.appendChild(c.firstChild);c.appendChild(f),"tbody"!=d[p]&&(r++,i++)}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",r+" "+i+" "+JSON.stringify(n)),{dom:c,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Ji(t,e,n,o,r){var a,s,l=r.parent.type.spec.code;if(!n&&!e)return null;var c=e&&(o||l||!n);if(c){if(t.someProp("transformPastedText",(function(t){e=t(e,l||o)})),l)return e?new p(i.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):p.empty;var d=t.someProp("clipboardTextParser",(function(t){return t(e,r,o)}));if(d)s=d;else{var u=r.marks(),f=t.state.schema,h=ut.fromSchema(f);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=a.appendChild(document.createElement("p"));t&&e.appendChild(h.serializeNode(f.text(t,u)))}))}}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),a=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,o=Qi().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t);(n=r&&Yi[r[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""));if(o.innerHTML=t,n)for(var i=0;i<n.length;i++)o=o.querySelector(n[i])||o;return o}(n),ur.webkit&&function(t){for(var e=t.querySelectorAll(ur.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var o=e[n];1==o.childNodes.length&&" "==o.textContent&&o.parentNode&&o.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),o)}}(a);var m=a&&a.querySelector("[data-pm-slice]"),v=m&&/^(\d+) (\d+) (.*)/.exec(m.getAttribute("data-pm-slice"));if(!s){var g=t.someProp("clipboardParser")||t.someProp("domParser")||tt.fromSchema(t.state.schema);s=g.parseSlice(a,{preserveWhitespace:!(!c&&!v),context:r,ruleFromNode:function(t){if("BR"==t.nodeName&&!t.nextSibling&&t.parentNode&&!Ki.test(t.parentNode.nodeName))return{ignore:!0}}})}if(v)s=function(t,e){if(!t.size)return t;var n,o=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(e){return t}for(var r=t.content,a=t.openStart,s=t.openEnd,l=n.length-2;l>=0;l-=2){var c=o.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;r=i.from(c.create(n[l+1],r)),a++,s++}return new p(r,a,s)}(Xi(s,+v[1],+v[2]),v[3]);else if((s=p.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var o=e.node(n).contentMatchAt(e.index(n)),r=void 0,a=[];if(t.forEach((function(t){if(a){var e,n=o.findWrapping(t.type);if(!n)return a=null;if(e=a.length&&r.length&&function t(e,n,o,r,a){if(a<e.length&&a<n.length&&e[a]==n[a]){var s=t(e,n,o,r.lastChild,a+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(a==e.length-1?o.type:e[a+1]))return r.copy(r.content.append(i.from(Ui(o,e,a+1))))}}(n,r,t,a[a.length-1],0))a[a.length-1]=e;else{a.length&&(a[a.length-1]=function t(e,n){if(0==n)return e;var o=e.content.replaceChild(e.childCount-1,t(e.lastChild,n-1)),r=e.contentMatchAt(e.childCount).fillBefore(i.empty,!0);return e.copy(o.append(r))}(a[a.length-1],r.length));var s=Ui(t,n);a.push(s),o=o.matchType(s.type,s.attrs),r=n}}})),a)return{v:i.from(a)}},o=e.depth;o>=0;o--){var r=n(o);if(r)return r.v}return t}(s.content,r),!0)).openStart||s.openEnd){for(var y=0,b=0,w=s.content.firstChild;y<s.openStart&&!w.type.spec.isolating;y++,w=w.firstChild);for(var k=s.content.lastChild;b<s.openEnd&&!k.type.spec.isolating;b++,k=k.lastChild);s=Xi(s,y,b)}return t.someProp("transformPasted",(function(t){s=t(s)})),s}var Ki=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Ui(t,e,n){void 0===n&&(n=0);for(var o=e.length-1;o>=n;o--)t=e[o].create(null,i.from(t));return t}function Gi(t,e,n,o,r,a){var s=e<0?t.firstChild:t.lastChild,l=s.content;return r<o-1&&(l=Gi(l,e,n,o,r+1,a)),r>=n&&(l=e<0?s.contentMatchAt(0).fillBefore(l,t.childCount>1||a<=r).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(i.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(l))}function Xi(t,e,n){return e<t.openStart&&(t=new p(Gi(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new p(Gi(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var Yi={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Zi=null;function Qi(){return Zi||(Zi=document.implementation.createHTMLDocument("title"))}var ta={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ea=ur.ie&&ur.ie_version<=11,na=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};na.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},na.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var oa=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);ur.ie&&ur.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new na,ea&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};oa.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},oa.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},oa.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,ta),ea&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},oa.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}ea&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},oa.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},oa.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},oa.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},oa.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&Ti(t)){var t;if(this.suppressingSelectionUpdates)return bi(this.view);if(ur.ie&&ur.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&kr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},oa.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},oa.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},oa.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&Ti(this.view)&&!this.ignoreSelectionChange(e),o=-1,r=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s<t.length;s++){var l=this.registerMutation(t[s],a);l&&(o=o<0?l.from:Math.min(l.from,o),r=r<0?l.to:Math.max(l.to,r),l.typeOver&&(i=!0))}if(ur.gecko&&a.length>1){var c=a.filter((function(t){return"BR"==t.nodeName}));if(2==c.length){var d=c[0],u=c[1];d.parentNode&&d.parentNode.parentNode==u.parentNode?u.remove():d.remove()}}(o>-1||n)&&(o>-1&&(this.view.docView.markDirty(o,r),function(t){if(ra)return;ra=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(o,r,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||bi(this.view),this.currentSelection.set(e))}},oa.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var o=0;o<t.addedNodes.length;o++)e.push(t.addedNodes[o]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var r=t.previousSibling,i=t.nextSibling;if(ur.ie&&ur.ie_version<=11&&t.addedNodes.length)for(var a=0;a<t.addedNodes.length;a++){var s=t.addedNodes[a],l=s.previousSibling,c=s.nextSibling;(!l||Array.prototype.indexOf.call(t.addedNodes,l)<0)&&(r=l),(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(i=c)}var d=r&&r.parentNode==t.target?gr(r)+1:0,u=n.localPosFromDOM(t.target,d,-1),p=i&&i.parentNode==t.target?gr(i):t.target.childNodes.length;return{from:u,to:n.localPosFromDOM(t.target,p,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var ra=!1;var ia={},aa={};function sa(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function la(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return ca(t,e)})}))}function ca(t,e){return t.someProp("handleDOMEvents",(function(n){var o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)}))}function da(t){return{left:t.clientX,top:t.clientY}}function ua(t,e,n,o,r){if(-1==o)return!1;for(var i=t.state.doc.resolve(o),a=function(o){if(t.someProp(e,(function(e){return o>i.depth?e(t,n,i.nodeAfter,i.before(o),r,!0):e(t,n,i.node(o),i.before(o),r,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if(l)return l.v}return!1}function pa(t,e,n){t.focused||t.focus();var o=t.state.tr.setSelection(e);"pointer"==n&&o.setMeta("pointer",!0),t.dispatch(o)}function fa(t,e,n,o,r){return ua(t,"handleClickOn",e,n,o)||t.someProp("handleClick",(function(n){return n(t,e,o)}))||(r?function(t,e){if(-1==e)return!1;var n,o,r=t.state.selection;r instanceof ie&&(n=r.node);for(var i=t.state.doc.resolve(e),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(ie.isSelectable(s)){o=n&&r.$from.depth>0&&a>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?i.before(r.$from.depth):i.before(a);break}}return null!=o&&(pa(t,ie.create(t.state.doc,o),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),o=n.nodeAfter;return!!(o&&o.isAtom&&ie.isSelectable(o))&&(pa(t,new ie(n),"pointer"),!0)}(t,n))}function ha(t,e,n,o){return ua(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",(function(n){return n(t,e,o)}))}function ma(t,e,n,o){return ua(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",(function(n){return n(t,e,o)}))||function(t,e,n){if(0!=n.button)return!1;var o=t.state.doc;if(-1==e)return!!o.inlineContent&&(pa(t,oe.create(o,0,o.content.size),"pointer"),!0);for(var r=o.resolve(e),i=r.depth+1;i>0;i--){var a=i>r.depth?r.nodeAfter:r.node(i),s=r.before(i);if(a.inlineContent)pa(t,oe.create(o,s+1,s+1+a.content.size),"pointer");else{if(!ie.isSelectable(a))continue;pa(t,ie.create(o,s),"pointer")}return!0}}(t,n,o)}function va(t){return Ca(t)}aa.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!ba(t,e)&&(t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!ur.android||!ur.chrome||13!=e.keyCode))if(229!=e.keyCode&&t.domObserver.forceFlush(),!ur.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||$i(t,e)?e.preventDefault():sa(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,Tr(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},aa.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},aa.keypress=function(t,e){if(!(ba(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||ur.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof oe&&n.$from.sameParent(n.$to))){var o=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,o)}))||t.dispatch(t.state.tr.insertText(o).scrollIntoView()),e.preventDefault()}}};var ga=ur.mac?"metaKey":"ctrlKey";ia.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=va(t),o=Date.now(),r="singleClick";o-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,o=e.y-t.clientY;return n*n+o*o<100}(e,t.lastClick)&&!e[ga]&&("singleClick"==t.lastClick.type?r="doubleClick":"doubleClick"==t.lastClick.type&&(r="tripleClick")),t.lastClick={time:o,x:e.clientX,y:e.clientY,type:r};var i=t.posAtCoords(da(e));i&&("singleClick"==r?(t.mouseDown&&t.mouseDown.done(),t.mouseDown=new ya(t,i,e,n)):("doubleClick"==r?ha:ma)(t,i.pos,i.inside,e)?e.preventDefault():sa(t,"pointer"))};var ya=function(t,e,n,o){var r,i,a=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=o,this.selectNode=n[ga],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1,e.inside>-1)r=t.state.doc.nodeAt(e.inside),i=e.inside;else{var s=t.state.doc.resolve(e.pos);r=s.parent,i=s.depth?s.before():0}this.mightDrag=null;var l=o?null:n.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c?c.dom:null;var d=t.state.selection;(0==n.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||d instanceof ie&&d.from<=i&&d.to>i)&&(this.mightDrag={node:r,pos:i,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&ur.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){a.view.mouseDown==a&&a.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),sa(t,"pointer")};function ba(t,e){return!!t.composing||!!(ur.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}ya.prototype.done=function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return bi(t.view)})),this.view.mouseDown=null},ya.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(da(t))),this.allowDefault||!e?sa(this.view,"pointer"):fa(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ur.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||ur.chrome&&!(this.view.state.selection instanceof oe)&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(pa(this.view,te.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):sa(this.view,"pointer")}},ya.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),sa(this.view,"pointer"),0==t.buttons&&this.done()},ia.touchdown=function(t){va(t),sa(t,"pointer")},ia.contextmenu=function(t){return va(t)};var wa=ur.android?5e3:-1;function ka(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return Ca(t)}),e))}function _a(t){var e;for(t.composing&&(t.composing=!1,t.compositionEndedAt=((e=document.createEvent("Event")).initEvent("event",!0,!0),e.timeStamp));t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function Ca(t,e){if(!(ur.android&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),_a(t),e||t.docView&&t.docView.dirty){var n=gi(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}aa.compositionstart=aa.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),Ca(t,!0),t.markCursor=null;else if(Ca(t),ur.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var o=t.root.getSelection(),r=o.focusNode,i=o.focusOffset;r&&1==r.nodeType&&0!=i;){var a=i<0?r.lastChild:r.childNodes[i-1];if(!a)break;if(3==a.nodeType){o.collapse(a,a.nodeValue.length);break}r=a,i=-1}t.composing=!0}ka(t,wa)},aa.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,ka(t,20))};var xa=ur.ie&&ur.ie_version<15||ur.ios&&ur.webkit_version<604;function Sa(t,e,n,o){var r=Ji(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,o,r||p.empty)})))return!0;if(!r)return!1;var i=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(r),a=i?t.state.tr.replaceSelectionWith(i,t.shiftKey):t.state.tr.replaceSelection(r);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ia.copy=aa.cut=function(t,e){var n=t.state.selection,o="cut"==e.type;if(!n.empty){var r=xa?null:e.clipboardData,i=qi(t,n.content()),a=i.dom,s=i.text;r?(e.preventDefault(),r.clearData(),r.setData("text/html",a.innerHTML),r.setData("text/plain",s)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var o=getSelection(),r=document.createRange();r.selectNodeContents(e),t.dom.blur(),o.removeAllRanges(),o.addRange(r),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},aa.paste=function(t,e){if(!t.composing||ur.android){var n=xa?null:e.clipboardData;n&&Sa(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,o=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus(),setTimeout((function(){t.focus(),o.parentNode&&o.parentNode.removeChild(o),n?Sa(t,o.value,null,e):Sa(t,o.textContent,o.innerHTML,e)}),50)}}(t,e)}};var Ea=function(t,e){this.slice=t,this.move=e},Ta=ur.mac?"altKey":"ctrlKey";for(var Ma in ia.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var o=t.state.selection,r=o.empty?null:t.posAtCoords(da(e));if(r&&r.pos>=o.from&&r.pos<=(o instanceof ie?o.to-1:o.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var i=t.docView.nearestDesc(e.target,!0);i&&i.node.type.spec.draggable&&i!=t.docView&&t.dispatch(t.state.tr.setSelection(ie.create(t.state.doc,i.posBefore)))}var a=t.state.selection.content(),s=qi(t,a),l=s.dom,c=s.text;e.dataTransfer.clearData(),e.dataTransfer.setData(xa?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",xa||e.dataTransfer.setData("text/plain",c),t.dragging=new Ea(a,!e[Ta])}},ia.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},aa.dragover=aa.dragenter=function(t,e){return e.preventDefault()},aa.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var o=t.posAtCoords(da(e));if(o){var r=t.state.doc.resolve(o.pos);if(r){var i=n&&n.slice;i?t.someProp("transformPasted",(function(t){i=t(i)})):i=Ji(t,e.dataTransfer.getData(xa?"Text":"text/plain"),xa?null:e.dataTransfer.getData("text/html"),!1,r);var a=n&&!e[Ta];if(t.someProp("handleDrop",(function(n){return n(t,e,i||p.empty,a)})))e.preventDefault();else if(i){e.preventDefault();var s=i?Lt(t.state.doc,r.pos,i):r.pos;null==s&&(s=r.pos);var l=t.state.tr;a&&l.deleteSelection();var c=l.mapping.map(s),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=l.doc;if(d?l.replaceRangeWith(c,c,i.content.firstChild):l.replaceRange(c,c,i),!l.doc.eq(u)){var f=l.doc.resolve(c);if(d&&ie.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new ie(f));else{var h=l.mapping.map(s);l.mapping.maps[l.mapping.maps.length-1].forEach((function(t,e,n,o){return h=o})),l.setSelection(Ei(t,f,l.doc.resolve(h)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))}}}}}},ia.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&bi(t)}),20))},ia.blur=function(t,e){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),e.relatedTarget&&t.dom.contains(e.relatedTarget)&&t.domObserver.currentSelection.set({}),t.focused=!1)},ia.beforeinput=function(t,e){if(ur.chrome&&ur.android&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Tr(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},aa)ia[Ma]=aa[Ma];function Da(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var o in e)if(!(o in t))return!1;return!0}var Oa=function(t,e){this.spec=e||Ra,this.side=this.spec.side||0,this.toDOM=t};Oa.prototype.map=function(t,e,n,o){var r=t.mapResult(e.from+o,this.side<0?-1:1),i=r.pos;return r.deleted?null:new Ba(i-n,i-n,this)},Oa.prototype.valid=function(){return!0},Oa.prototype.eq=function(t){return this==t||t instanceof Oa&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Da(this.spec,t.spec))},Oa.prototype.destroy=function(t){this.spec.destroy&&this.spec.destroy(t)};var Aa=function(t,e){this.spec=e||Ra,this.attrs=t};Aa.prototype.map=function(t,e,n,o){var r=t.map(e.from+o,this.spec.inclusiveStart?-1:1)-n,i=t.map(e.to+o,this.spec.inclusiveEnd?1:-1)-n;return r>=i?null:new Ba(r,i,this)},Aa.prototype.valid=function(t,e){return e.from<e.to},Aa.prototype.eq=function(t){return this==t||t instanceof Aa&&Da(this.attrs,t.attrs)&&Da(this.spec,t.spec)},Aa.is=function(t){return t.type instanceof Aa};var Ia=function(t,e){this.spec=e||Ra,this.attrs=t};Ia.prototype.map=function(t,e,n,o){var r=t.mapResult(e.from+o,1);if(r.deleted)return null;var i=t.mapResult(e.to+o,-1);return i.deleted||i.pos<=r.pos?null:new Ba(r.pos-n,i.pos-n,this)},Ia.prototype.valid=function(t,e){var n,o=t.content.findIndex(e.from),r=o.index,i=o.offset;return i==e.from&&!(n=t.child(r)).isText&&i+n.nodeSize==e.to},Ia.prototype.eq=function(t){return this==t||t instanceof Ia&&Da(this.attrs,t.attrs)&&Da(this.spec,t.spec)};var Ba=function(t,e,n){this.from=t,this.to=e,this.type=n},Na={spec:{configurable:!0},inline:{configurable:!0}};Ba.prototype.copy=function(t,e){return new Ba(t,e,this.type)},Ba.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},Ba.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},Ba.widget=function(t,e,n){return new Ba(t,t,new Oa(e,n))},Ba.inline=function(t,e,n,o){return new Ba(t,e,new Aa(n,o))},Ba.node=function(t,e,n,o){return new Ba(t,e,new Ia(n,o))},Na.spec.get=function(){return this.type.spec},Na.inline.get=function(){return this.type instanceof Aa},Object.defineProperties(Ba.prototype,Na);var za=[],Ra={},Pa=function(t,e){this.local=t&&t.length?t:za,this.children=e&&e.length?e:za};Pa.create=function(t,e){return e.length?Wa(e,t,0,Ra):La},Pa.prototype.find=function(t,e,n){var o=[];return this.findInner(null==t?0:t,null==e?1e9:e,o,0,n),o},Pa.prototype.findInner=function(t,e,n,o,r){for(var i=0;i<this.local.length;i++){var a=this.local[i];a.from<=e&&a.to>=t&&(!r||r(a.spec))&&n.push(a.copy(a.from+o,a.to+o))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){var l=this.children[s]+1;this.children[s+2].findInner(t-l,e-l,n,o+l,r)}},Pa.prototype.map=function(t,e,n){return this==La||0==t.maps.length?this:this.mapInner(t,e,0,0,n||Ra)},Pa.prototype.mapInner=function(t,e,n,o,r){for(var i,a=0;a<this.local.length;a++){var s=this.local[a].map(t,n,o);s&&s.type.valid(e,s)?(i||(i=[])).push(s):r.onRemove&&r.onRemove(this.local[a].spec)}return this.children.length?function(t,e,n,o,r,i,a){for(var s=t.slice(),l=function(t,e,n,o){for(var a=0;a<s.length;a+=3){var l=s[a+1],c=void 0;-1==l||t>l+i||(e>=s[a]+i?s[a+1]=-1:n>=r&&(c=o-n-(e-t))&&(s[a]+=c,s[a+1]+=c))}},c=0;c<n.maps.length;c++)n.maps[c].forEach(l);for(var d=!1,u=0;u<s.length;u+=3)if(-1==s[u+1]){var p=n.map(t[u]+i),f=p-r;if(f<0||f>=o.content.size){d=!0;continue}var h=n.map(t[u+1]+i,-1)-r,m=o.content.findIndex(f),v=m.index,g=m.offset,y=o.maybeChild(v);if(y&&g==f&&g+y.nodeSize==h){var b=s[u+2].mapInner(n,y,p+1,t[u]+i+1,a);b!=La?(s[u]=f,s[u+1]=h,s[u+2]=b):(s[u+1]=-2,d=!0)}else d=!0}if(d){var w=Wa(function(t,e,n,o,r,i,a){function s(t,e){for(var i=0;i<t.local.length;i++){var l=t.local[i].map(o,r,e);l?n.push(l):a.onRemove&&a.onRemove(t.local[i].spec)}for(var c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+e+1)}for(var l=0;l<t.length;l+=3)-1==t[l+1]&&s(t[l+2],e[l]+i+1);return n}(s,t,e||[],n,r,i,a),o,0,a);e=w.local;for(var k=0;k<s.length;k+=3)s[k+1]<0&&(s.splice(k,3),k-=3);for(var _=0,C=0;_<w.children.length;_+=3){for(var x=w.children[_];C<s.length&&s[C]<x;)C+=3;s.splice(C,0,w.children[_],w.children[_+1],w.children[_+2])}}return new Pa(e&&e.sort(Ha),s)}(this.children,i,t,e,n,o,r):i?new Pa(i.sort(Ha)):La},Pa.prototype.add=function(t,e){return e.length?this==La?Pa.create(t,e):this.addInner(t,e,0):this},Pa.prototype.addInner=function(t,e,n){var o,r=this,i=0;t.forEach((function(t,a){var s,l=a+n;if(s=Va(e,t,l)){for(o||(o=r.children.slice());i<o.length&&o[i]<a;)i+=3;o[i]==a?o[i+2]=o[i+2].addInner(t,s,l+1):o.splice(i,0,a,a+t.nodeSize,Wa(s,t,l+1,Ra)),i+=3}}));for(var a=$a(i?ja(e):e,-n),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new Pa(a.length?this.local.concat(a).sort(Ha):this.local,o||this.children)},Pa.prototype.remove=function(t){return 0==t.length||this==La?this:this.removeInner(t,0)},Pa.prototype.removeInner=function(t,e){for(var n=this.children,o=this.local,r=0;r<n.length;r+=3){for(var i=void 0,a=n[r]+e,s=n[r+1]+e,l=0,c=void 0;l<t.length;l++)(c=t[l])&&c.from>a&&c.to<s&&(t[l]=null,(i||(i=[])).push(c));if(i){n==this.children&&(n=this.children.slice());var d=n[r+2].removeInner(i,a+1);d!=La?n[r+2]=d:(n.splice(r,3),r-=3)}}if(o.length)for(var u=0,p=void 0;u<t.length;u++)if(p=t[u])for(var f=0;f<o.length;f++)o[f].eq(p,e)&&(o==this.local&&(o=this.local.slice()),o.splice(f--,1));return n==this.children&&o==this.local?this:o.length||n.length?new Pa(o,n):La},Pa.prototype.forChild=function(t,e){if(this==La)return this;if(e.isLeaf)return Pa.empty;for(var n,o,r=0;r<this.children.length;r+=3)if(this.children[r]>=t){this.children[r]==t&&(n=this.children[r+2]);break}for(var i=t+1,a=i+e.content.size,s=0;s<this.local.length;s++){var l=this.local[s];if(l.from<a&&l.to>i&&l.type instanceof Aa){var c=Math.max(i,l.from)-i,d=Math.min(a,l.to)-i;c<d&&(o||(o=[])).push(l.copy(c,d))}}if(o){var u=new Pa(o.sort(Ha));return n?new Fa([u,n]):u}return n||La},Pa.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof Pa)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},Pa.prototype.locals=function(t){return qa(this.localsInner(t))},Pa.prototype.localsInner=function(t){if(this==La)return za;if(t.inlineContent||!this.local.some(Aa.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Aa||e.push(this.local[n]);return e};var La=new Pa;Pa.empty=La,Pa.removeOverlap=qa;var Fa=function(t){this.members=t};function $a(t,e){if(!e||!t.length)return t;for(var n=[],o=0;o<t.length;o++){var r=t[o];n.push(new Ba(r.from+e,r.to+e,r.type))}return n}function Va(t,e,n){if(e.isLeaf)return null;for(var o=n+e.nodeSize,r=null,i=0,a=void 0;i<t.length;i++)(a=t[i])&&a.from>n&&a.to<o&&((r||(r=[])).push(a),t[i]=null);return r}function ja(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Wa(t,e,n,o){var r=[],i=!1;e.forEach((function(e,a){var s=Va(t,e,a+n);if(s){i=!0;var l=Wa(s,e,n+a+1,o);l!=La&&r.push(a,a+e.nodeSize,l)}}));for(var a=$a(i?ja(t):t,-n).sort(Ha),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(o.onRemove&&o.onRemove(a[s].spec),a.splice(s--,1));return a.length||r.length?new Pa(a,r):La}function Ha(t,e){return t.from-e.from||t.to-e.to}function qa(t){for(var e=t,n=0;n<e.length-1;n++){var o=e[n];if(o.from!=o.to)for(var r=n+1;r<e.length;r++){var i=e[r];if(i.from!=o.from){i.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,i.from),Ja(e,r,o.copy(i.from,o.to)));break}i.to!=o.to&&(e==t&&(e=t.slice()),e[r]=i.copy(i.from,o.to),Ja(e,r+1,i.copy(o.to,i.to)))}}return e}function Ja(t,e,n){for(;e<t.length&&Ha(n,t[e])>0;)e++;t.splice(e,0,n)}function Ka(t){var e=[];return t.someProp("decorations",(function(n){var o=n(t.state);o&&o!=La&&e.push(o)})),t.cursorWrapper&&e.push(Pa.create(t.state.doc,[t.cursorWrapper.deco])),Fa.from(e)}Fa.prototype.map=function(t,e){var n=this.members.map((function(n){return n.map(t,e,Ra)}));return Fa.from(n)},Fa.prototype.forChild=function(t,e){if(e.isLeaf)return Pa.empty;for(var n=[],o=0;o<this.members.length;o++){var r=this.members[o].forChild(t,e);r!=La&&(r instanceof Fa?n=n.concat(r.members):n.push(r))}return Fa.from(n)},Fa.prototype.eq=function(t){if(!(t instanceof Fa)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Fa.prototype.locals=function(t){for(var e,n=!0,o=0;o<this.members.length;o++){var r=this.members[o].localsInner(t);if(r.length)if(e){n&&(e=e.slice(),n=!1);for(var i=0;i<r.length;i++)e.push(r[i])}else e=r}return e?qa(n?e:e.sort(Ha)):za},Fa.from=function(t){switch(t.length){case 0:return La;case 1:return t[0];default:return new Fa(t)}};var Ua,Ga,Xa=function(t,e){this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ns),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=ts(this),this.markCursor=null,this.cursorWrapper=null,Qa(this),this.nodeViews=es(this),this.docView=ni(this.state.doc,Za(this),Ka(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.lastAndroidDelete=0,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new oa(t,(function(e,n,o,r){return ji(t,e,n,o,r)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=ia[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||ca(t,e)||!t.editable&&e.type in aa||n(t,e)})};for(var n in ia)e(n);ur.safari&&t.dom.addEventListener("input",(function(){return null})),la(t)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Ya={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function Za(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var o in n)"class"==o&&(e.class+=" "+n[o]),"style"==o?e.style=(e.style?e.style+";":"")+n[o]:e[o]||"contenteditable"==o||"nodeName"==o||(e[o]=String(n[o]))})),[Ba.node(0,t.state.doc.content.size,e)]}function Qa(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:Ba.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ts(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function es(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}function ns(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}if(Ya.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Xa.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&la(this),this._props=t,t.plugins&&(t.plugins.forEach(ns),this.directPlugins=t.plugins),this.updateStateInner(t.state,!0)},Xa.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var o in e.state=this.state,t)e[o]=t[o];this.update(e)},Xa.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Xa.prototype.updateStateInner=function(t,e){var n=this,o=this.state,r=!1,i=!1;if(t.storedMarks&&this.composing&&(_a(this),i=!0),this.state=t,e){var a=es(this);(function(t,e){var n=0,o=0;for(var r in t){if(t[r]!=e[r])return!0;n++}for(var i in e)o++;return n!=o})(a,this.nodeViews)&&(this.nodeViews=a,r=!0),la(this)}this.editable=ts(this),Qa(this);var s=Ka(this),l=Za(this),c=e?"reset":t.scrollToSelection>o.scrollToSelection?"to selection":"preserve",d=r||!this.docView.matchesNode(t.doc,l,s);!d&&t.selection.eq(o.selection)||(i=!0);var u,p,f,h,m,v,g,y,b,w,k,_="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,o=t.dom.getBoundingClientRect(),r=Math.max(0,o.top),i=(o.left+o.right)/2,a=r+1;a<Math.min(innerHeight,o.bottom);a+=5){var s=t.root.elementFromPoint(i,a);if(s!=t.dom&&t.dom.contains(s)){var l=s.getBoundingClientRect();if(l.top>=r-20){e=s,n=l.top;break}}}return{refDOM:e,refTop:n,stack:Ir(t.dom)}}(this);if(i){this.domObserver.stop();var C=d&&(ur.ie||ur.chrome)&&!this.composing&&!o.selection.empty&&!t.selection.empty&&(h=o.selection,m=t.selection,v=Math.min(h.$anchor.sharedDepth(h.head),m.$anchor.sharedDepth(m.head)),h.$anchor.start(v)!=m.$anchor.start(v));if(d){var x=ur.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!r&&this.docView.update(t.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ni(t.doc,l,s,this.dom,this)),x&&!this.trackWrites&&(C=!0)}C||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(u=this,p=u.docView.domFromPos(u.state.selection.anchor,0),f=u.root.getSelection(),kr(p.node,p.offset,f.anchorNode,f.anchorOffset)))?bi(this,C):(xi(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(o),"reset"==c)this.dom.scrollTop=0;else if("to selection"==c){var S=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof ie?Ar(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),S):Ar(this,this.coordsAtPos(t.selection.head,1),S))}else _&&(y=(g=_).refDOM,b=g.refTop,w=g.stack,k=y?y.getBoundingClientRect().top:0,Br(w,0==k?0:k-b))},Xa.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Xa.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var o=0;o<this.directPlugins.length;o++){var r=this.directPlugins[o];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(var i=0;i<this.state.plugins.length;i++){var a=this.state.plugins[i];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}},Xa.prototype.someProp=function(t,e){var n,o=this._props&&this._props[t];if(null!=o&&(n=e?e(o):o))return n;for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r].props[t];if(null!=i&&(n=e?e(i):i))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var l=a[s].props[t];if(null!=l&&(n=e?e(l):l))return n}},Xa.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Xa.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(Nr)return t.focus(Nr);var e=Ir(t);t.focus(null==Nr?{get preventScroll(){return Nr={preventScroll:!0},!0}}:void 0),Nr||(Nr=!1,Br(e,0))}(this.dom),bi(this),this.domObserver.start()},Ya.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Xa.prototype.posAtCoords=function(t){return Pr(this,t)},Xa.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),$r(this,t,e)},Xa.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Xa.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Xa.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var o=this.docView.posFromDOM(t,e,n);if(null==o)throw new RangeError("DOM position not inside the editor");return o},Xa.prototype.endOfTextblock=function(t,e){return Ur(this,e||this.state,t)},Xa.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ka(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Ya.isDestroyed.get=function(){return null==this.docView},Xa.prototype.dispatchEvent=function(t){return function(t,e){ca(t,e)||!ia[e.type]||!t.editable&&e.type in aa||ia[e.type](t,e)}(this,t)},Xa.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Xa.prototype,Ya),"undefined"!=typeof WeakMap){var rs=new WeakMap;Ua=function(t){return rs.get(t)},Ga=function(t,e){return rs.set(t,e),e}}else{var is=[],as=0;Ua=function(t){for(var e=0;e<is.length;e+=2)if(is[e]==t)return is[e+1]},Ga=function(t,e){return 10==as&&(as=0),is[as++]=t,is[as++]=e}}var ss=function(t,e,n,o){this.left=t,this.top=e,this.right=n,this.bottom=o},ls=function(t,e,n,o){this.width=t,this.height=e,this.map=n,this.problems=o};function cs(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function ds(t,e){var n=t.getAttribute("data-colwidth"),o=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(t){return Number(t)})):null,r=Number(t.getAttribute("colspan")||1),i={colspan:r,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:o&&o.length==r?o:null};for(var a in e){var s=e[a].getFromDOM,l=s&&s(t);null!=l&&(i[a]=l)}return i}function us(t,e){var n={};for(var o in 1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(",")),e){var r=e[o].setDOMAttr;r&&r(t.attrs[o],n)}return n}function ps(t){var e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var o in e)n[o]={default:e[o].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(t){return ds(t,e)}}],toDOM:function(t){return["td",us(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(t){return ds(t,e)}}],toDOM:function(t){return["th",us(t,e),0]}}}}function fs(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var o=t.nodes[n],r=o.spec.tableRole;r&&(e[r]=o)}return e}ls.prototype.findCell=function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var o=e%this.width,r=e/this.width|0,i=o+1,a=r+1,s=1;i<this.width&&this.map[e+s]==n;s++)i++;for(var l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return new ss(o,r,i,a)}}throw new RangeError("No cell with offset "+t+" found")},ls.prototype.colCount=function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")},ls.prototype.nextCell=function(t,e,n){var o=this.findCell(t),r=o.left,i=o.right,a=o.top,s=o.bottom;return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?0==a:s==this.height)?null:this.map[r+this.width*(n<0?a-1:s)]},ls.prototype.rectBetween=function(t,e){var n=this.findCell(t),o=n.left,r=n.right,i=n.top,a=n.bottom,s=this.findCell(e),l=s.left,c=s.right,d=s.top,u=s.bottom;return new ss(Math.min(o,l),Math.min(i,d),Math.max(r,c),Math.max(a,u))},ls.prototype.cellsInRect=function(t){for(var e=[],n={},o=t.top;o<t.bottom;o++)for(var r=t.left;r<t.right;r++){var i=o*this.width+r,a=this.map[i];n[a]||(n[a]=!0,r==t.left&&r&&this.map[i-1]==a||o==t.top&&o&&this.map[i-this.width]==a||e.push(a))}return e},ls.prototype.positionAt=function(t,e,n){for(var o=0,r=0;;o++){var i=r+n.child(o).nodeSize;if(o==t){for(var a=e+t*this.width,s=(t+1)*this.width;a<s&&this.map[a]<r;)a++;return a==s?i-1:this.map[a]}r=i}},ls.get=function(t){return Ua(t)||Ga(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,o=0;o<t.childCount;o++){var r=t.child(o),i=0;if(n)for(var a=0;a<o;a++)for(var s=t.child(a),l=0;l<s.childCount;l++){var c=s.child(l);a+c.attrs.rowspan>o&&(i+=c.attrs.colspan)}for(var d=0;d<r.childCount;d++){var u=r.child(d);i+=u.attrs.colspan,u.attrs.rowspan>1&&(n=!0)}-1==e?e=i:e!=i&&(e=Math.max(e,i))}return e}(t),n=t.childCount,o=[],r=0,i=null,a=[],s=0,l=e*n;s<l;s++)o[s]=0;for(var c=0,d=0;c<n;c++){var u=t.child(c);d++;for(var p=0;;p++){for(;r<o.length&&0!=o[r];)r++;if(p==u.childCount)break;for(var f=u.child(p),h=f.attrs,m=h.colspan,v=h.rowspan,g=h.colwidth,y=0;y<v;y++){if(y+c>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:d,n:v-y});break}for(var b=r+y*e,w=0;w<m;w++){0==o[b+w]?o[b+w]=d:(i||(i=[])).push({type:"collision",row:c,pos:d,n:m-w});var k=g&&g[w];if(k){var _=(b+w)%e*2,C=a[_];null==C||C!=k&&1==a[_+1]?(a[_]=k,a[_+1]=1):C==k&&a[_+1]++}}}r+=m,d+=f.nodeSize}for(var x=(c+1)*e,S=0;r<x;)0==o[r++]&&S++;S&&(i||(i=[])).push({type:"missing",row:c,n:S}),d++}for(var E=new ls(e,n,o,i),T=!1,M=0;!T&&M<a.length;M+=2)null!=a[M]&&a[M+1]<n&&(T=!0);T&&function(t,e,n){t.problems||(t.problems=[]);for(var o=0,r={};o<t.map.length;o++){var i=t.map[o];if(!r[i]){r[i]=!0;for(var a=n.nodeAt(i),s=null,l=0;l<a.attrs.colspan;l++){var c=(o+l)%t.width,d=e[2*c];null==d||a.attrs.colwidth&&a.attrs.colwidth[l]==d||((s||(s=cs(a.attrs)))[l]=d)}s&&t.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:s})}}}(E,a,t);return E}(t))};var hs=new _e("selectingCells");function ms(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function vs(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function gs(t){var e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:ms(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var o=e.type.spec.tableRole;if("cell"==o||"header_cell"==o)return t.doc.resolve(n)}for(var r=t.nodeBefore,i=t.pos;r;r=r.lastChild,i--){var a=r.type.spec.tableRole;if("cell"==a||"header_cell"==a)return t.doc.resolve(i-r.nodeSize)}}(e.$head)}function ys(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function bs(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function ws(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ks(t){return ls.get(t.node(-1)).findCell(t.pos-t.start(-1))}function _s(t){return ls.get(t.node(-1)).colCount(t.pos-t.start(-1))}function Cs(t,e,n){var o=t.start(-1),r=ls.get(t.node(-1)).nextCell(t.pos-o,e,n);return null==r?null:t.node(0).resolve(o+r)}function xs(t,e,n){var o={};for(var r in t)o[r]=t[r];return o[e]=n,o}function Ss(t,e,n){void 0===n&&(n=1);var o=xs(t,"colspan",t.colspan-n);return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(e,n),o.colwidth.some((function(t){return t>0}))||(o.colwidth=null)),o}function Es(t,e,n){void 0===n&&(n=1);var o=xs(t,"colspan",t.colspan+n);if(o.colwidth){o.colwidth=o.colwidth.slice();for(var r=0;r<n;r++)o.colwidth.splice(e,0,0)}return o}function Ts(t,e,n){for(var o=fs(e.type.schema).header_cell,r=0;r<t.height;r++)if(e.nodeAt(t.map[n+r*t.width]).type!=o)return!1;return!0}var Ms=function(t){function e(e,n){void 0===n&&(n=e);var o=e.node(-1),r=ls.get(o),i=e.start(-1),a=r.rectBetween(e.pos-i,n.pos-i),s=e.node(0),l=r.cellsInRect(a).filter((function(t){return t!=n.pos-i}));l.unshift(n.pos-i);var c=l.map((function(t){var e=o.nodeAt(t),n=t+i+1;return new ne(s.resolve(n),s.resolve(n+e.content.size))}));t.call(this,c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(t,n){var o=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(ys(o)&&ys(r)&&ws(o,r)){var i=this.$anchorCell.node(-1)!=o.node(-1);return i&&this.isRowSelection()?e.rowSelection(o,r):i&&this.isColSelection()?e.colSelection(o,r):new e(o,r)}return oe.between(o,r)},e.prototype.content=function(){for(var t=this.$anchorCell.node(-1),e=ls.get(t),n=this.$anchorCell.start(-1),o=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),r={},a=[],s=o.top;s<o.bottom;s++){for(var l=[],c=s*e.width+o.left,d=o.left;d<o.right;d++,c++){var u=e.map[c];if(!r[u]){r[u]=!0;var f=e.findCell(u),h=t.nodeAt(u),m=o.left-f.left,v=f.right-o.right;if(m>0||v>0){var g=h.attrs;m>0&&(g=Ss(g,0,m)),v>0&&(g=Ss(g,g.colspan-v,v)),h=f.left<o.left?h.type.createAndFill(g):h.type.create(g,h.content)}if(f.top<o.top||f.bottom>o.bottom){var y=xs(h.attrs,"rowspan",Math.min(f.bottom,o.bottom)-Math.max(f.top,o.top));h=f.top<o.top?h.type.createAndFill(y):h.type.create(y,h.content)}l.push(h)}}a.push(t.child(s).copy(i.from(l)))}var b=this.isColSelection()&&this.isRowSelection()?t:a;return new p(i.from(b),1,1)},e.prototype.replace=function(e,n){void 0===n&&(n=p.empty);for(var o=e.steps.length,r=this.ranges,i=0;i<r.length;i++){var a=r[i],s=a.$from,l=a.$to,c=e.mapping.slice(o);e.replace(c.map(s.pos),c.map(l.pos),i?p.empty:n)}var d=t.findFrom(e.doc.resolve(e.mapping.slice(o).map(this.to)),-1);d&&e.setSelection(d)},e.prototype.replaceWith=function(t,e){this.replace(t,new p(i.from(e),0,0))},e.prototype.forEachCell=function(t){for(var e=this.$anchorCell.node(-1),n=ls.get(e),o=this.$anchorCell.start(-1),r=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o)),i=0;i<r.length;i++)t(e.nodeAt(r[i]),o+r[i])},e.prototype.isColSelection=function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,o=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,o)==this.$headCell.node(-1).childCount},e.colSelection=function(t,n){void 0===n&&(n=t);var o=ls.get(t.node(-1)),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.top<=a.top?(i.top>0&&(t=s.resolve(r+o.map[i.left])),a.bottom<o.height&&(n=s.resolve(r+o.map[o.width*(o.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(r+o.map[a.left])),i.bottom<o.height&&(t=s.resolve(r+o.map[o.width*(o.height-1)+i.right-1]))),new e(t,n)},e.prototype.isRowSelection=function(){var t=ls.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),o=t.colCount(this.$headCell.pos-e);if(Math.min(n,o)>0)return!1;var r=n+this.$anchorCell.nodeAfter.attrs.colspan,i=o+this.$headCell.nodeAfter.attrs.colspan;return Math.max(r,i)==t.width},e.prototype.eq=function(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos},e.rowSelection=function(t,n){void 0===n&&(n=t);var o=ls.get(t.node(-1)),r=t.start(-1),i=o.findCell(t.pos-r),a=o.findCell(n.pos-r),s=t.node(0);return i.left<=a.left?(i.left>0&&(t=s.resolve(r+o.map[i.top*o.width])),a.right<o.width&&(n=s.resolve(r+o.map[o.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(r+o.map[a.top*o.width])),i.right<o.width&&(t=s.resolve(r+o.map[o.width*(i.top+1)-1]))),new e(t,n)},e.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},e.fromJSON=function(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,n,o){return void 0===o&&(o=n),new e(t.resolve(n),t.resolve(o))},e.prototype.getBookmark=function(){return new Ds(this.$anchorCell.pos,this.$headCell.pos)},e}(te);Ms.prototype.visible=!1,te.jsonID("cell",Ms);var Ds=function(t,e){this.anchor=t,this.head=e};function Os(t){if(!(t.selection instanceof Ms))return null;var e=[];return t.selection.forEachCell((function(t,n){e.push(Ba.node(n,n+t.nodeSize,{class:"selectedCell"}))})),Pa.create(t.doc,e)}function As(t){if(!t.size)return null;for(var e=t.content,n=t.openStart,o=t.openEnd;1==e.childCount&&(n>0&&o>0||"table"==e.firstChild.type.spec.tableRole);)n--,o--,e=e.firstChild.content;var r=e.firstChild,a=r.type.spec.tableRole,s=r.type.schema,l=[];if("row"==a)for(var c=0;c<e.childCount;c++){var d=e.child(c).content,u=c?0:Math.max(0,n-1),f=c<e.childCount-1?0:Math.max(0,o-1);(u||f)&&(d=Is(fs(s).row,new p(d,u,f)).content),l.push(d)}else{if("cell"!=a&&"header_cell"!=a)return null;l.push(n||o?Is(fs(s).row,new p(e,n,o)).content:e)}return function(t,e){for(var n=[],o=0;o<e.length;o++)for(var r=e[o],a=r.childCount-1;a>=0;a--)for(var s=r.child(a).attrs,l=s.rowspan,c=s.colspan,d=o;d<o+l;d++)n[d]=(n[d]||0)+c;for(var u=0,p=0;p<n.length;p++)u=Math.max(u,n[p]);for(var f=0;f<n.length;f++)if(f>=e.length&&e.push(i.empty),n[f]<u){for(var h=fs(t).cell.createAndFill(),m=[],v=n[f];v<u;v++)m.push(h);e[f]=e[f].append(i.from(m))}return{height:e.length,width:u,rows:e}}(s,l)}function Is(t,e){var n=t.createAndFill();return new wt(n).replace(0,n.content.size,e).doc}function Bs(t,e,n){var o=t.width,r=t.height,a=t.rows;if(o!=e){for(var s=[],l=[],c=0;c<a.length;c++){for(var d=a[c],u=[],p=s[c]||0,f=0;p<e;f++){var h=d.child(f%d.childCount);p+h.attrs.colspan>e&&(h=h.type.create(Ss(h.attrs,h.attrs.colspan,p+h.attrs.colspan-e),h.content)),u.push(h),p+=h.attrs.colspan;for(var m=1;m<h.attrs.rowspan;m++)s[c+m]=(s[c+m]||0)+h.attrs.colspan}l.push(i.from(u))}a=l,o=e}if(r!=n){for(var v=[],g=0,y=0;g<n;g++,y++){for(var b=[],w=a[y%r],k=0;k<w.childCount;k++){var _=w.child(k);g+_.attrs.rowspan>n&&(_=_.type.create(xs(_.attrs,"rowspan",Math.max(1,n-_.attrs.rowspan)),_.content)),b.push(_)}v.push(i.from(b))}a=v,r=n}return{width:o,height:r,rows:a}}function Ns(t,e,n,o,r,i,a,s){if(0==a||a==e.height)return!1;for(var l=!1,c=r;c<i;c++){var d=a*e.width+c,u=e.map[d];if(e.map[d-e.width]==u){l=!0;var p=n.nodeAt(u),f=e.findCell(u),h=f.top,m=f.left;t.setNodeMarkup(t.mapping.slice(s).map(u+o),null,xs(p.attrs,"rowspan",a-h)),t.insert(t.mapping.slice(s).map(e.positionAt(a,m,n)),p.type.createAndFill(xs(p.attrs,"rowspan",h+p.attrs.rowspan-a))),c+=p.attrs.colspan-1}}return l}function zs(t,e,n,o,r,i,a,s){if(0==a||a==e.width)return!1;for(var l=!1,c=r;c<i;c++){var d=c*e.width+a,u=e.map[d];if(e.map[d-1]==u){l=!0;var p=n.nodeAt(u),f=e.colCount(u),h=t.mapping.slice(s).map(u+o);t.setNodeMarkup(h,null,Ss(p.attrs,a-f,p.attrs.colspan-(a-f))),t.insert(h+p.nodeSize,p.type.createAndFill(Ss(p.attrs,0,a-f))),c+=p.attrs.rowspan-1}}return l}function Rs(t,e,n,o,r){var a=n?t.doc.nodeAt(n-1):t.doc,s=ls.get(a),l=o.top,c=o.left,d=c+r.width,u=l+r.height,f=t.tr,h=0;function m(){a=n?f.doc.nodeAt(n-1):f.doc,s=ls.get(a),h=f.mapping.maps.length}(function(t,e,n,o,r,a,s){var l,c,d=fs(t.doc.type.schema);if(r>e.width)for(var u=0,p=0;u<e.height;u++){var f=n.child(u);p+=f.nodeSize;var h=[],m=void 0;m=null==f.lastChild||f.lastChild.type==d.cell?l||(l=d.cell.createAndFill()):c||(c=d.header_cell.createAndFill());for(var v=e.width;v<r;v++)h.push(m);t.insert(t.mapping.slice(s).map(p-1+o),h)}if(a>e.height){for(var g=[],y=0,b=(e.height-1)*e.width;y<Math.max(e.width,r);y++){var w=!(y>=e.width)&&n.nodeAt(e.map[b+y]).type==d.header_cell;g.push(w?c||(c=d.header_cell.createAndFill()):l||(l=d.cell.createAndFill()))}for(var k=d.row.create(null,i.from(g)),_=[],C=e.height;C<a;C++)_.push(k);t.insert(t.mapping.slice(s).map(o+n.nodeSize-2),_)}return!(!l&&!c)})(f,s,a,n,d,u,h)&&m(),Ns(f,s,a,n,c,d,l,h)&&m(),Ns(f,s,a,n,c,d,u,h)&&m(),zs(f,s,a,n,l,u,c,h)&&m(),zs(f,s,a,n,l,u,d,h)&&m();for(var v=l;v<u;v++){var g=s.positionAt(v,c,a),y=s.positionAt(v,d,a);f.replace(f.mapping.slice(h).map(g+n),f.mapping.slice(h).map(y+n),new p(r.rows[v-l],0,0))}m(),f.setSelection(new Ms(f.doc.resolve(n+s.positionAt(l,c,a)),f.doc.resolve(n+s.positionAt(u-1,d-1,a)))),e(f)}Ds.prototype.map=function(t){return new Ds(t.map(this.anchor),t.map(this.head))},Ds.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&ws(e,n)?new Ms(e,n):te.near(n,1)};var Ps=dr({ArrowLeft:Fs("horiz",-1),ArrowRight:Fs("horiz",1),ArrowUp:Fs("vert",-1),ArrowDown:Fs("vert",1),"Shift-ArrowLeft":$s("horiz",-1),"Shift-ArrowRight":$s("horiz",1),"Shift-ArrowUp":$s("vert",-1),"Shift-ArrowDown":$s("vert",1),Backspace:Vs,"Mod-Backspace":Vs,Delete:Vs,"Mod-Delete":Vs});function Ls(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Fs(t,e){return function(n,o,r){var i=n.selection;if(i instanceof Ms)return Ls(n,o,te.near(i.$headCell,e));if("horiz"!=t&&!i.empty)return!1;var a=qs(r,t,e);if(null==a)return!1;if("horiz"==t)return Ls(n,o,te.near(n.doc.resolve(i.head+e),e));var s,l=n.doc.resolve(a),c=Cs(l,t,e);return s=c?te.near(c,1):e<0?te.near(n.doc.resolve(l.before(-1)),-1):te.near(n.doc.resolve(l.after(-1)),1),Ls(n,o,s)}}function $s(t,e){return function(n,o,r){var i=n.selection;if(!(i instanceof Ms)){var a=qs(r,t,e);if(null==a)return!1;i=new Ms(n.doc.resolve(a))}var s=Cs(i.$headCell,t,e);return!!s&&Ls(n,o,new Ms(i.$anchorCell,s))}}function Vs(t,e){var n=t.selection;if(!(n instanceof Ms))return!1;if(e){var o=t.tr,r=fs(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(r)||o.replace(o.mapping.map(e+1),o.mapping.map(e+t.nodeSize-1),new p(r,0,0))})),o.docChanged&&e(o)}return!0}function js(t,e){var n=ms(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new Ms(n))),!0)}function Ws(t,e,n){if(!vs(t.state))return!1;var o=As(n),r=t.state.selection;if(r instanceof Ms){o||(o={width:1,height:1,rows:[i.from(Is(fs(t.state.schema).cell,n))]});var a=r.$anchorCell.node(-1),s=r.$anchorCell.start(-1),l=ls.get(a).rectBetween(r.$anchorCell.pos-s,r.$headCell.pos-s);return o=Bs(o,l.right-l.left,l.bottom-l.top),Rs(t.state,t.dispatch,s,l,o),!0}if(o){var c=gs(t.state),d=c.start(-1);return Rs(t.state,t.dispatch,d,ls.get(c.node(-1)).findCell(c.pos-d),o),!0}return!1}function Hs(t,e){if(!e.ctrlKey&&!e.metaKey){var n,o=Js(t,e.target);if(e.shiftKey&&t.state.selection instanceof Ms)r(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&o&&null!=(n=ms(t.state.selection.$anchor))&&Ks(t,e).pos!=n.pos)r(n,e),e.preventDefault();else if(!o)return;t.root.addEventListener("mouseup",i),t.root.addEventListener("dragstart",i),t.root.addEventListener("mousemove",a)}function r(e,n){var o=Ks(t,n),r=null==hs.getState(t.state);if(!o||!ws(e,o)){if(!r)return;o=e}var i=new Ms(e,o);if(r||!t.state.selection.eq(i)){var a=t.state.tr.setSelection(i);r&&a.setMeta(hs,e.pos),t.dispatch(a)}}function i(){t.root.removeEventListener("mouseup",i),t.root.removeEventListener("dragstart",i),t.root.removeEventListener("mousemove",a),null!=hs.getState(t.state)&&t.dispatch(t.state.tr.setMeta(hs,-1))}function a(n){var a,s=hs.getState(t.state);if(null!=s)a=t.state.doc.resolve(s);else if(Js(t,n.target)!=o&&!(a=Ks(t,e)))return i();a&&r(a,n)}}function qs(t,e,n){if(!(t.state.selection instanceof oe))return null;for(var o=t.state.selection.$head,r=o.depth-1;r>=0;r--){var i=o.node(r);if((n<0?o.index(r):o.indexAfter(r))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var a=o.before(r),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?a:null}}return null}function Js(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Ks(t,e){var n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?ms(t.state.doc.resolve(n.pos)):null}var Us=new _e("fix-tables");function Gs(t,e){var n,o=function(e,o){"table"==e.type.spec.tableRole&&(n=function(t,e,n,o){var r=ls.get(e);if(!r.problems)return o;o||(o=t.tr);for(var i,a,s=[],l=0;l<r.height;l++)s.push(0);for(var c=0;c<r.problems.length;c++){var d=r.problems[c];if("collision"==d.type){for(var u=e.nodeAt(d.pos),p=0;p<u.attrs.rowspan;p++)s[d.row+p]+=d.n;o.setNodeMarkup(o.mapping.map(n+1+d.pos),null,Ss(u.attrs,u.attrs.colspan-d.n,d.n))}else if("missing"==d.type)s[d.row]+=d.n;else if("overlong_rowspan"==d.type){var f=e.nodeAt(d.pos);o.setNodeMarkup(o.mapping.map(n+1+d.pos),null,xs(f.attrs,"rowspan",f.attrs.rowspan-d.n))}else if("colwidth mismatch"==d.type){var h=e.nodeAt(d.pos);o.setNodeMarkup(o.mapping.map(n+1+d.pos),null,xs(h.attrs,"colwidth",d.colwidth))}}for(var m=0;m<s.length;m++)s[m]&&(null==i&&(i=m),a=m);for(var v=0,g=n+1;v<r.height;v++){var y=e.child(v),b=g+y.nodeSize,w=s[v];if(w>0){var k="cell";y.firstChild&&(k=y.firstChild.type.spec.tableRole);for(var _=[],C=0;C<w;C++)_.push(fs(t.schema)[k].createAndFill());var x=0!=v&&i!=v-1||a!=v?b-1:g+1;o.insert(o.mapping.map(x),_)}g=b}return o.setMeta(Us,{fixTables:!0})}(t,e,o,n))};return e?e.doc!=t.doc&&function t(e,n,o,r){var i=e.childCount,a=n.childCount;t:for(var s=0,l=0;s<a;s++){for(var c=n.child(s),d=l,u=Math.min(i,s+3);d<u;d++)if(e.child(d)==c){l=d+1,o+=c.nodeSize;continue t}r(c,o),l<i&&e.child(l).sameMarkup(c)?t(e.child(l),c,o+1,r):c.nodesBetween(0,c.content.size,r,o+1),o+=c.nodeSize}}(e.doc,t.doc,0,o):t.doc.descendants(o),n}function Xs(t){var e,n=t.selection,o=gs(t),r=o.node(-1),i=o.start(-1),a=ls.get(r);return(e=n instanceof Ms?a.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):a.findCell(o.pos-i)).tableStart=i,e.map=a,e.table=r,e}function Ys(t,e,n){var o=e.map,r=e.tableStart,i=e.table,a=n>0?-1:0;Ts(o,i,n+a)&&(a=0==n||n==o.width?null:0);for(var s=0;s<o.height;s++){var l=s*o.width+n;if(n>0&&n<o.width&&o.map[l-1]==o.map[l]){var c=o.map[l],d=i.nodeAt(c);t.setNodeMarkup(t.mapping.map(r+c),null,Es(d.attrs,n-o.colCount(c))),s+=d.attrs.rowspan-1}else{var u=null==a?fs(i.type.schema).cell:i.nodeAt(o.map[l+a]).type,p=o.positionAt(s,n,i);t.insert(t.mapping.map(r+p),u.createAndFill())}}return t}function Zs(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(Ys(t.tr,n,n.left))}return!0}function Qs(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(Ys(t.tr,n,n.right))}return!0}function tl(t,e,n){for(var o=e.map,r=e.table,i=e.tableStart,a=t.mapping.maps.length,s=0;s<o.height;){var l=s*o.width+n,c=o.map[l],d=r.nodeAt(c);if(n>0&&o.map[l-1]==c||n<o.width-1&&o.map[l+1]==c)t.setNodeMarkup(t.mapping.slice(a).map(i+c),null,Ss(d.attrs,n-o.colCount(c)));else{var u=t.mapping.slice(a).map(i+c);t.delete(u,u+d.nodeSize)}s+=d.attrs.rowspan}}function el(t,e){if(!vs(t))return!1;if(e){var n=Xs(t),o=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var r=n.right-1;tl(o,n,r),r!=n.left;r--)n.table=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc,n.map=ls.get(n.table);e(o)}return!0}function nl(t,e,n){for(var o=fs(e.type.schema).header_cell,r=0;r<t.width;r++)if(e.nodeAt(t.map[r+n*t.width]).type!=o)return!1;return!0}function ol(t,e,n){for(var o=e.map,r=e.tableStart,i=e.table,a=r,s=0;s<n;s++)a+=i.child(s).nodeSize;var l=[],c=n>0?-1:0;nl(o,i,n+c)&&(c=0==n||n==o.height?null:0);for(var d=0,u=o.width*n;d<o.width;d++,u++)if(n>0&&n<o.height&&o.map[u]==o.map[u-o.width]){var p=o.map[u],f=i.nodeAt(p).attrs;t.setNodeMarkup(r+p,null,xs(f,"rowspan",f.rowspan+1)),d+=f.colspan-1}else{var h=null==c?fs(i.type.schema).cell:i.nodeAt(o.map[u+c*o.width]).type;l.push(h.createAndFill())}return t.insert(a,fs(i.type.schema).row.create(null,l)),t}function rl(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(ol(t.tr,n,n.top))}return!0}function il(t,e){if(!vs(t))return!1;if(e){var n=Xs(t);e(ol(t.tr,n,n.bottom))}return!0}function al(t,e,n){for(var o=e.map,r=e.table,i=e.tableStart,a=0,s=0;s<n;s++)a+=r.child(s).nodeSize;var l=a+r.child(n).nodeSize,c=t.mapping.maps.length;t.delete(a+i,l+i);for(var d=0,u=n*o.width;d<o.width;d++,u++){var p=o.map[u];if(n>0&&p==o.map[u-o.width]){var f=r.nodeAt(p).attrs;t.setNodeMarkup(t.mapping.slice(c).map(p+i),null,xs(f,"rowspan",f.rowspan-1)),d+=f.colspan-1}else if(n<o.width&&p==o.map[u+o.width]){var h=r.nodeAt(p),m=h.type.create(xs(h.attrs,"rowspan",h.attrs.rowspan-1),h.content),v=o.positionAt(n+1,d,r);t.insert(t.mapping.slice(c).map(i+v),m),d+=h.attrs.colspan-1}}}function sl(t,e){if(!vs(t))return!1;if(e){var n=Xs(t),o=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var r=n.bottom-1;al(o,n,r),r!=n.top;r--)n.table=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc,n.map=ls.get(n.table);e(o)}return!0}function ll(t){var e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function cl(t,e){var n=t.selection;if(!(n instanceof Ms)||n.$anchorCell.pos==n.$headCell.pos)return!1;var o=Xs(t),r=o.map;if(function(t,e){for(var n=t.width,o=t.height,r=t.map,i=e.top*n+e.left,a=i,s=(e.bottom-1)*n+e.left,l=i+(e.right-e.left-1),c=e.top;c<e.bottom;c++){if(e.left>0&&r[a]==r[a-1]||e.right<n&&r[l]==r[l+1])return!0;a+=n,l+=n}for(var d=e.left;d<e.right;d++){if(e.top>0&&r[i]==r[i-n]||e.bottom<o&&r[s]==r[s+n])return!0;i++,s++}return!1}(r,o))return!1;if(e){for(var a,s,l=t.tr,c={},d=i.empty,u=o.top;u<o.bottom;u++)for(var p=o.left;p<o.right;p++){var f=r.map[u*r.width+p],h=o.table.nodeAt(f);if(!c[f])if(c[f]=!0,null==a)a=f,s=h;else{ll(h)||(d=d.append(h.content));var m=l.mapping.map(f+o.tableStart);l.delete(m,m+h.nodeSize)}}if(l.setNodeMarkup(a+o.tableStart,null,xs(Es(s.attrs,s.attrs.colspan,o.right-o.left-s.attrs.colspan),"rowspan",o.bottom-o.top)),d.size){var v=a+1+s.content.size,g=ll(s)?a+1:v;l.replaceWith(g+o.tableStart,v+o.tableStart,d)}l.setSelection(new Ms(l.doc.resolve(a+o.tableStart))),e(l)}return!0}function dl(t,e){var n=fs(t.schema);return ul((function(t){var e=t.node;return n[e.type.spec.tableRole]}))(t,e)}function ul(t){return function(e,n){var o,r,i=e.selection;if(i instanceof Ms){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;o=i.$anchorCell.nodeAfter,r=i.$anchorCell.pos}else{if(!(o=function(t){for(var e=t.depth;e>0;e--){var n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(i.$from)))return!1;r=ms(i.$from).pos}if(1==o.attrs.colspan&&1==o.attrs.rowspan)return!1;if(n){var a=o.attrs,s=[],l=a.colwidth;a.rowspan>1&&(a=xs(a,"rowspan",1)),a.colspan>1&&(a=xs(a,"colspan",1));for(var c,d=Xs(e),u=e.tr,p=0;p<d.right-d.left;p++)s.push(l?xs(a,"colwidth",l&&l[p]?[l[p]]:null):a);for(var f=d.top;f<d.bottom;f++){var h=d.map.positionAt(f,d.left,d.table);f==d.top&&(h+=o.nodeSize);for(var m=d.left,v=0;m<d.right;m++,v++)m==d.left&&f==d.top||u.insert(c=u.mapping.map(h+d.tableStart,1),t({node:o,row:f,col:m}).createAndFill(s[v]))}u.setNodeMarkup(r,t({node:o,row:d.top,col:d.left}),s[0]),i instanceof Ms&&u.setSelection(new Ms(u.doc.resolve(i.$anchorCell.pos),c&&u.doc.resolve(c))),n(u)}return!0}}function pl(t,e){return function(n,o){if(!vs(n))return!1;var r=gs(n);if(r.nodeAfter.attrs[t]===e)return!1;if(o){var i=n.tr;n.selection instanceof Ms?n.selection.forEachCell((function(n,o){n.attrs[t]!==e&&i.setNodeMarkup(o,null,xs(n.attrs,t,e))})):i.setNodeMarkup(r.pos,null,xs(r.nodeAfter.attrs,t,e)),o(i)}return!0}}function fl(t,e,n){for(var o=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),r=0;r<o.length;r++){var i=e.table.nodeAt(o[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function hl(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!vs(e))return!1;if(n){for(var o=fs(e.schema),r=Xs(e),i=e.tr,a=r.map.cellsInRect("column"==t?new ss(r.left,0,r.right,r.map.height):"row"==t?new ss(0,r.top,r.map.width,r.bottom):r),s=a.map((function(t){return r.table.nodeAt(t)})),l=0;l<a.length;l++)s[l].type==o.header_cell&&i.setNodeMarkup(r.tableStart+a[l],o.cell,s[l].attrs);if(0==i.steps.length)for(var c=0;c<a.length;c++)i.setNodeMarkup(r.tableStart+a[c],o.header_cell,s[c].attrs);n(i)}return!0}}(t):function(e,n){if(!vs(e))return!1;if(n){var o=fs(e.schema),r=Xs(e),i=e.tr,a=fl("row",r,o),s=fl("column",r,o),l=("column"===t?a:"row"===t&&s)?1:0,c="column"==t?new ss(0,l,1,r.map.height):"row"==t?new ss(l,0,r.map.width,1):r,d="column"==t?s?o.cell:o.header_cell:"row"==t?a?o.cell:o.header_cell:o.cell;r.map.cellsInRect(c).forEach((function(t){var e=t+r.tableStart,n=i.doc.nodeAt(e);n&&i.setNodeMarkup(e,d,n.attrs)})),n(i)}return!0}}var ml=hl("row",{useDeprecatedLogic:!0}),vl=hl("column",{useDeprecatedLogic:!0}),gl=hl("cell",{useDeprecatedLogic:!0});function yl(t){return function(e,n){if(!vs(e))return!1;var o=function(t,e){if(e<0){var n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(var o=t.index(-1)-1,r=t.before();o>=0;o--){var i=t.node(-1).child(o);if(i.childCount)return r-1-i.lastChild.nodeSize;r-=i.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;for(var a=t.node(-1),s=t.indexAfter(-1),l=t.after();s<a.childCount;s++){var c=a.child(s);if(c.childCount)return l+1;l+=c.nodeSize}}}(gs(e),t);if(null!=o){if(n){var r=e.doc.resolve(o);n(e.tr.setSelection(oe.between(r,bs(r))).scrollIntoView())}return!0}}}function bl(t,e){for(var n=t.selection.$anchor,o=n.depth;o>0;o--){if("table"==n.node(o).type.spec.tableRole)return e&&e(t.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0}return!1}var wl=function(t,e){this.node=t,this.cellMinWidth=e,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),kl(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function kl(t,e,n,o,r,i){for(var a=0,s=!0,l=e.firstChild,c=t.firstChild,d=0,u=0;d<c.childCount;d++)for(var p=c.child(d).attrs,f=p.colspan,h=p.colwidth,m=0;m<f;m++,u++){var v=r==u?i:h&&h[m],g=v?v+"px":"";a+=v||o,v||(s=!1),l?(l.style.width!=g&&(l.style.width=g),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=g}for(;l;){var y=l.nextSibling;l.parentNode.removeChild(l),l=y}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}wl.prototype.update=function(t){return t.type==this.node.type&&(this.node=t,kl(t,this.colgroup,this.table,this.cellMinWidth),!0)},wl.prototype.ignoreMutation=function(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))};var _l=new _e("tableColumnResizing");function Cl(t){void 0===t&&(t={});var e=t.handleWidth;void 0===e&&(e=5);var n=t.cellMinWidth;void 0===n&&(n=25);var o=t.View;void 0===o&&(o=wl);var r=t.lastColumnResizable;return void 0===r&&(r=!0),new be({key:_l,state:{init:function(t,e){return this.spec.props.nodeViews[fs(e.schema).table.name]=function(t,e){return new o(t,n,e)},new xl(-1,!1)},apply:function(t,e){return e.apply(t)}},props:{attributes:function(t){return _l.getState(t).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(t,n){!function(t,e,n,o,r){var i=_l.getState(t.state);if(!i.dragging){var a=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(a){var l=a.getBoundingClientRect(),c=l.left,d=l.right;e.clientX-c<=n?s=Sl(t,e,"left"):d-e.clientX<=n&&(s=Sl(t,e,"right"))}if(s!=i.activeHandle){if(!r&&-1!==s){var u=t.state.doc.resolve(s),p=u.node(-1),f=ls.get(p),h=u.start(-1);if(f.colCount(u.pos-h)+u.nodeAfter.attrs.colspan-1==f.width-1)return}Tl(t,s)}}}(t,n,e,0,r)},mouseleave:function(t){!function(t){var e=_l.getState(t.state);e.activeHandle>-1&&!e.dragging&&Tl(t,-1)}(t)},mousedown:function(t,e){!function(t,e,n){var o=_l.getState(t.state);if(-1==o.activeHandle||o.dragging)return!1;var r=t.state.doc.nodeAt(o.activeHandle),i=function(t,e,n){var o=n.colspan,r=n.colwidth,i=r&&r[r.length-1];if(i)return i;var a=t.domAtPos(e),s=a.node.childNodes[a.offset].offsetWidth,l=o;if(r)for(var c=0;c<o;c++)r[c]&&(s-=r[c],l--);return s/l}(t,o.activeHandle,r.attrs);function a(e){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var o=_l.getState(t.state);o.dragging&&(!function(t,e,n){for(var o=t.state.doc.resolve(e),r=o.node(-1),i=ls.get(r),a=o.start(-1),s=i.colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,l=t.state.tr,c=0;c<i.height;c++){var d=c*i.width+s;if(!c||i.map[d]!=i.map[d-i.width]){var u=i.map[d],p=r.nodeAt(u).attrs,f=1==p.colspan?0:s-i.colCount(u);if(!p.colwidth||p.colwidth[f]!=n){var h=p.colwidth?p.colwidth.slice():Ml(p.colspan);h[f]=n,l.setNodeMarkup(a+u,null,xs(p,"colwidth",h))}}}l.docChanged&&t.dispatch(l)}(t,o.activeHandle,El(o.dragging,e,n)),t.dispatch(t.state.tr.setMeta(_l,{setDragging:null})))}function s(e){if(!e.which)return a(e);var o=_l.getState(t.state),r=El(o.dragging,e,n);!function(t,e,n,o){var r=t.state.doc.resolve(e),i=r.node(-1),a=r.start(-1),s=ls.get(i).colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,l=t.domAtPos(r.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;kl(i,l.firstChild,l,o,s,n)}(t,o.activeHandle,r,n)}t.dispatch(t.state.tr.setMeta(_l,{setDragging:{startX:e.clientX,startWidth:i}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),e.preventDefault()}(t,e,n)}},decorations:function(t){var e=_l.getState(t);if(e.activeHandle>-1)return function(t,e){for(var n=[],o=t.doc.resolve(e),r=o.node(-1),i=ls.get(r),a=o.start(-1),s=i.colCount(o.pos-a)+o.nodeAfter.attrs.colspan,l=0;l<i.height;l++){var c=s+l*i.width-1;if(!(s!=i.width&&i.map[c]==i.map[c+1]||0!=l&&i.map[c-1]==i.map[c-1-i.width])){var d=i.map[c],u=a+d+r.nodeAt(d).nodeSize-1,p=document.createElement("div");p.className="column-resize-handle",n.push(Ba.widget(u,p))}}return Pa.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}})}var xl=function(t,e){this.activeHandle=t,this.dragging=e};function Sl(t,e,n){var o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return-1;var r=o.pos,i=ms(t.state.doc.resolve(r));if(!i)return-1;if("right"==n)return i.pos;var a=ls.get(i.node(-1)),s=i.start(-1),l=a.map.indexOf(i.pos-s);return l%a.width==0?-1:s+a.map[l-1]}function El(t,e,n){var o=e.clientX-t.startX;return Math.max(n,t.startWidth+o)}function Tl(t,e){t.dispatch(t.state.tr.setMeta(_l,{setHandle:e}))}function Ml(t){for(var e=[],n=0;n<t;n++)e.push(0);return e}function Dl(t){void 0===t&&(t={});var e=t.allowTableNodeSelection;return void 0===e&&(e=!1),new be({key:hs,state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(hs);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;var o=t.mapping.mapResult(e),r=o.deleted,i=o.pos;return r?null:i}},props:{decorations:Os,handleDOMEvents:{mousedown:Hs},createSelectionBetween:function(t){if(null!=hs.getState(t.state))return t.state.selection},handleTripleClick:js,handleKeyDown:Ps,handlePaste:Ws},appendTransaction:function(t,n,o){return function(t,e,n){var o,r,i=(e||t).selection,a=(e||t).doc;if(i instanceof ie&&(r=i.node.type.spec.tableRole)){if("cell"==r||"header_cell"==r)o=Ms.create(a,i.from);else if("row"==r){var s=a.resolve(i.from+1);o=Ms.rowSelection(s,s)}else if(!n){var l=ls.get(i.node),c=i.from+1,d=c+l.map[l.width*l.height-1];o=Ms.create(a,c+1,d)}}else i instanceof oe&&function(t){var e=t.$from,n=t.$to;if(e.pos==n.pos||e.pos<e.pos-6)return!1;for(var o=e.pos,r=n.pos,i=e.depth;i>=0&&!(e.after(i+1)<e.end(i));i--,o++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,r--);return o==r&&/row|table/.test(e.node(i).type.spec.tableRole)}(i)?o=oe.create(a,i.from):i instanceof oe&&function(t){for(var e,n,o=t.$from,r=t.$to,i=o.depth;i>0;i--){var a=o.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){e=a;break}}for(var s=r.depth;s>0;s--){var l=r.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return e!==n&&0===r.parentOffset}(i)&&(o=oe.create(a,i.$from.start(),i.$from.end()));return o&&(e||(e=t.tr)).setSelection(o),e}(o,Gs(o,n),e)}})}xl.prototype.apply=function(t){var e=this,n=t.getMeta(_l);if(n&&null!=n.setHandle)return new xl(n.setHandle,null);if(n&&void 0!==n.setDragging)return new xl(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){var o=t.mapping.map(e.activeHandle,-1);ys(t.doc.resolve(o))||(o=null),e=new xl(o,e.dragging)}return e};var Ol=["blockquote",0],Al=["hr"],Il=["pre",["code",0]],Bl=["ol",0],Nl=["ul",0],zl=["li",0],Rl=function(t){for(var e,n={},o=t.attributes,r=0;r<o.length;r++)n[(e=o[r]).name]=e.value;return n},Pl=function(t){var e={};return t.forEach((function(t){e[t]={default:null}})),e},Ll=function(){return Pl(["style","class","id"])},Fl=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},$l=function(t,e){var n={};for(var o in t)o&&null!==t[o]&&o!==e&&(n[o]=t[o]);return n},Vl=function(t){var e;return(e={})[t]={name:t,inclusive:!0,parseDOM:[{tag:t}],toDOM:function(){return[t,0]}},e},jl=Ne.__assign({link:{attrs:Ne.__assign({},Ll(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:Rl}],toDOM:function(t){return["a",$l(t.attrs),0]}}},Vl("strong"),Vl("b"),Vl("em"),Vl("i"),Vl("u"),Vl("del"),Vl("sub"),Vl("sup"),Vl("code"),{style:{attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"span",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["span",$l(t.attrs),0]:["span",0]}}}),Wl=function(t){var e;return(e={})[t]={default:null,getFromDOM:function(e){return e.getAttribute(t)},setDOMAttr:function(e,n){n[t]=e}},e},Hl=Ne.__assign({},Wl("style"),Wl("class"),Wl("id"),Wl("headers")),ql={doc:{content:"colgroup*"},col:{attrs:Pl(["id","class","style","span"]),parseDOM:[{getAttrs:Rl,tag:"col"}],toDOM:function(t){return["col",t.attrs]}},colgroup:{attrs:Pl(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:Rl,tag:"colgroup"}],toDOM:function(t){return["colgroup",t.attrs,0]}},text:{inline:!0,group:"inline"}},Jl=new Z({nodes:ql,marks:{}}),Kl=ps({tableGroup:"block",cellContent:"block+",cellAttributes:Hl});Kl.table_row.attrs=Ne.__assign({},Kl.table_row.attrs,Pl([Ce,"style","class","id"])),Kl.table_row.toDOM=function(t){return["tr",$l(t.attrs),0]},Kl.table_row.parseDOM=[{tag:"tr",getAttrs:Rl}],Kl.table.attrs=Ne.__assign({},Kl.table.attrs,Pl(["style","class","id","k-colgroup-data"])),Kl.table.toDOM=function(t){var e=Fl(t.attrs)?$l(t.attrs,"k-colgroup-data"):{},n=null;if(t.attrs["k-colgroup-data"]&&!function(t){for(var e=!1,n=t.child(0),o=0;o<n.childCount;o++){if(n.child(o).attrs.colwidth){e=!0;break}}return e}(t)){var o=Oe(Me(t.attrs["k-colgroup-data"]),Jl,{preserveWhitespace:!1}),r=De(o).firstChild;if(r){var i=Array.from(r.children).map((function(t){return["col",Rl(t)]}));n=["colgroup",Rl(r)].concat(i)}}return n?["table",e,n,["tbody",0]]:["table",e,["tbody",0]]},Kl.table.parseDOM=[{tag:"table",getAttrs:function(t){var e=Rl(t),n=Array.from(t.childNodes).find((function(t){return"COLGROUP"===t.nodeName}));return n&&(e["k-colgroup-data"]=n.outerHTML),e}}];var Ul=Ne.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"p",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["p",$l(t.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"div",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["div",$l(t.attrs),0]:["div",0]}},blockquote:{attrs:Ne.__assign({},Ll()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["blockquote",$l(t.attrs),0]:Ol}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return Al}},heading:{attrs:Ne.__assign({},Ll(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:1})}},{tag:"h2",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:2})}},{tag:"h3",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:3})}},{tag:"h4",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:4})}},{tag:"h5",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:5})}},{tag:"h6",getAttrs:function(t){return Ne.__assign({},Rl(t),{level:6})}}],toDOM:function(t){return Fl(t.attrs,"level")?["h"+t.attrs.level,$l(t.attrs,"level"),0]:["h"+t.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return Il}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:Ne.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},Ll()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["img",$l(t.attrs)]:["img"]}},hard_break:{inline:!0,attrs:Ne.__assign({},Ll()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["br",$l(t.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:Ne.__assign({},Ll(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(t){return Ne.__assign({},Rl(t),{order:t.hasAttribute("start")?parseInt(t.getAttribute("start")||"1",10):1})}}],toDOM:function(t){return 1===t.attrs.order?Fl(t.attrs,"order")?["ol",$l(t.attrs,"order"),0]:Bl:["ol",Ne.__assign({},$l(t.attrs,"order"),{start:t.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"ul",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["ul",$l(t.attrs),0]:Nl}},list_item:{content:"(paragraph | heading) block*",attrs:Ne.__assign({},Ll()),parseDOM:[{tag:"li",getAttrs:Rl}],toDOM:function(t){return Fl(t.attrs)?["li",$l(t.attrs),0]:zl},defining:!0}},Kl),Gl=function(){};Gl.prototype.append=function(t){return t.length?(t=Gl.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Gl.prototype.prepend=function(t){return t.length?Gl.from(t).append(this):this},Gl.prototype.appendInner=function(t){return new Yl(this,t)},Gl.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Gl.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Gl.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Gl.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Gl.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var o=[];return this.forEach((function(e,n){return o.push(t(e,n))}),e,n),o},Gl.from=function(t){return t instanceof Gl?t:t&&t.length?new Xl(t):Gl.empty};var Xl=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,o){for(var r=e;r<n;r++)if(!1===t(this.values[r],o+r))return!1},e.prototype.forEachInvertedInner=function(t,e,n,o){for(var r=e-1;r>=n;r--)if(!1===t(this.values[r],o+r))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Gl);Gl.empty=new Xl([]);var Yl=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,o){var r=this.left.length;return!(e<r&&!1===this.left.forEachInner(t,e,Math.min(n,r),o))&&(!(n>r&&!1===this.right.forEachInner(t,Math.max(e-r,0),Math.min(this.length,n)-r,o+r))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,o){var r=this.left.length;return!(e>r&&!1===this.right.forEachInvertedInner(t,e-r,Math.max(n,r)-r,o+r))&&(!(n<r&&!1===this.left.forEachInvertedInner(t,Math.min(e,r),n,o))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Gl),Zl=Gl,Ql=function(t,e){this.items=t,this.eventCount=e};Ql.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var o,r,i=this.items.length;;i--){if(this.items.get(i-1).selection){--i;break}}e&&(o=this.remapping(i,this.items.length),r=o.maps.length);var a,s,l=t.tr,c=[],d=[];return this.items.forEach((function(t,e){if(!t.step)return o||(o=n.remapping(i,e+1),r=o.maps.length),r--,void d.push(t);if(o){d.push(new tc(t.map));var u,p=t.step.map(o.slice(r));p&&l.maybeStep(p).doc&&(u=l.mapping.maps[l.mapping.maps.length-1],c.push(new tc(u,null,null,c.length+d.length))),r--,u&&o.appendMap(u,r)}else l.maybeStep(t.step);return t.selection?(a=o?t.selection.map(o.slice(r)):t.selection,s=new Ql(n.items.slice(0,i).append(d.reverse().concat(c)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:l,selection:a}},Ql.prototype.addTransform=function(t,e,n,o){for(var r=[],i=this.eventCount,a=this.items,s=!o&&a.length?a.get(a.length-1):null,l=0;l<t.steps.length;l++){var c,d=t.steps[l].invert(t.docs[l]),u=new tc(t.mapping.maps[l],d,e);(c=s&&s.merge(u))&&(u=c,l?r.pop():a=a.slice(0,a.length-1)),r.push(u),e&&(i++,e=null),o||(s=u)}var p,f,h,m=i-n.depth;return m>nc&&(f=m,(p=a).forEach((function(t,e){if(t.selection&&0==f--)return h=e,!1})),a=p.slice(h),i-=m),new Ql(a.append(r),i)},Ql.prototype.remapping=function(t,e){var n=new yt;return this.items.forEach((function(e,o){var r=null!=e.mirrorOffset&&o-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,r)}),t,e),n},Ql.prototype.addMaps=function(t){return 0==this.eventCount?this:new Ql(this.items.append(t.map((function(t){return new tc(t)}))),this.eventCount)},Ql.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],o=Math.max(0,this.items.length-e),r=t.mapping,i=t.steps.length,a=this.eventCount;this.items.forEach((function(t){t.selection&&a--}),o);var s=e;this.items.forEach((function(e){var o=r.getMirror(--s);if(null!=o){i=Math.min(i,o);var l=r.maps[o];if(e.step){var c=t.steps[o].invert(t.docs[o]),d=e.selection&&e.selection.map(r.slice(s+1,o));d&&a++,n.push(new tc(l,c,d))}else n.push(new tc(l))}}),o);for(var l=[],c=e;c<i;c++)l.push(new tc(r.maps[c]));var d=this.items.slice(0,o).append(l).append(n),u=new Ql(d,a);return u.emptyItemCount()>500&&(u=u.compress(this.items.length-n.length)),u},Ql.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},Ql.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,o=[],r=0;return this.items.forEach((function(i,a){if(a>=t)o.push(i),i.selection&&r++;else if(i.step){var s=i.step.map(e.slice(n)),l=s&&s.getMap();if(n--,l&&e.appendMap(l,n),s){var c=i.selection&&i.selection.map(e.slice(n));c&&r++;var d,u=new tc(l.invert(),s,c),p=o.length-1;(d=o.length&&o[p].merge(u))?o[p]=d:o.push(u)}}else i.map&&n--}),this.items.length,0),new Ql(Zl.from(o.reverse()),r)},Ql.empty=new Ql(Zl.empty,0);var tc=function(t,e,n,o){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=o};tc.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new tc(e.getMap().invert(),e,this.selection)}};var ec=function(t,e,n,o){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=o},nc=20;function oc(t){var e=[];return t.forEach((function(t,n,o,r){return e.push(o,r)})),e}function rc(t,e){if(!t)return null;for(var n=[],o=0;o<t.length;o+=2){var r=e.map(t[o],1),i=e.map(t[o+1],-1);r<=i&&n.push(r,i)}return n}function ic(t,e,n,o){var r=lc(e),i=dc.get(e).spec.config,a=(o?t.undone:t.done).popEvent(e,r);if(a){var s=a.selection.resolve(a.transform.doc),l=(o?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),i,r),c=new ec(o?l:a.remaining,o?a.remaining:l,null,0);n(a.transform.setSelection(s).setMeta(dc,{redo:o,historyState:c}).scrollIntoView())}}var ac=!1,sc=null;function lc(t){var e=t.plugins;if(sc!=e){ac=!1,sc=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){ac=!0;break}}return ac}function cc(t){return t.setMeta(uc,!0)}var dc=new _e("history"),uc=new _e("closeHistory");function pc(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new be({key:dc,state:{init:function(){return new ec(Ql.empty,Ql.empty,null,0)},apply:function(e,n,o){return function(t,e,n,o){var r,i=n.getMeta(dc);if(i)return i.historyState;n.getMeta(uc)&&(t=new ec(t.done,t.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(dc))return a.getMeta(dc).redo?new ec(t.done.addTransform(n,null,o,lc(e)),t.undone,oc(n.mapping.maps[n.steps.length-1]),t.prevTime):new ec(t.done,t.undone.addTransform(n,null,o,lc(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(r=n.getMeta("rebased"))?new ec(t.done.rebased(n,r),t.undone.rebased(n,r),rc(t.prevRanges,n.mapping),t.prevTime):new ec(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),rc(t.prevRanges,n.mapping),t.prevTime);var s=0==t.prevTime||!a&&(t.prevTime<(n.time||0)-o.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,o){for(var r=0;r<e.length;r+=2)t<=e[r+1]&&o>=e[r]&&(n=!0)})),n}(n,t.prevRanges)),l=a?rc(t.prevRanges,n.mapping):oc(n.mapping.maps[n.steps.length-1]);return new ec(t.done.addTransform(n,s?e.selection.getBookmark():null,o,lc(e)),Ql.empty,l,n.time)}(n,o,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n="historyUndo"==e.inputType?fc(t.state,t.dispatch):"historyRedo"==e.inputType&&hc(t.state,t.dispatch);return n&&e.preventDefault(),n}}}})}function fc(t,e){var n=dc.getState(t);return!(!n||0==n.done.eventCount)&&(e&&ic(n,t,e,!1),!0)}function hc(t,e){var n=dc.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&ic(n,t,e,!0),!0)}function mc(t){var e=dc.getState(t);return e?e.done.eventCount:0}function vc(t){var e=dc.getState(t);return e?e.undone.eventCount:0}var gc=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,o,r){var i=n;if(e[1]){var a=e[0].lastIndexOf(e[1]);i+=e[0].slice(a+e[1].length);var s=(o+=a)-r;s>0&&(i=e[0].slice(a-s,a)+i,o=r)}return t.tr.insertText(i,o,r)}):e};function yc(t){var e=t.rules,n=new be({state:{init:function(){return null},apply:function(t,e){var n=t.getMeta(this);return n||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,o,r,i){return bc(t,o,r,i,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var o=t.state.selection.$cursor;o&&bc(t,o.pos,o.pos,"",e,n)}))}}},isInputRules:!0});return n}function bc(t,e,n,o,r,i){if(t.composing)return!1;var a=t.state,s=a.doc.resolve(e);if(s.parent.type.spec.code)return!1;for(var l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"")+o,c=0;c<r.length;c++){var d=r[c].match.exec(l),u=d&&r[c].handler(a,d,e-(d[0].length-o.length),n);if(u)return t.dispatch(u.setMeta(i,{transform:u,from:e,to:n,text:o})),!0}return!1}function wc(t,e){for(var n=t.plugins,o=0;o<n.length;o++){var r=n[o],i=void 0;if(r.spec.isInputRules&&(i=r.getState(t))){if(e){for(var a=t.tr,s=i.transform,l=s.steps.length-1;l>=0;l--)a.step(s.steps[l].invert(s.docs[l]));if(i.text){var c=a.doc.resolve(i.from).marks();a.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else a.delete(i.from,i.to);e(a)}return!0}}return!1}var kc=new gc(/--$/,"—"),_c=new gc(/\.\.\.$/,"…"),Cc=new gc(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),xc=new gc(/"$/,"”"),Sc=new gc(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),Ec=new gc(/'$/,"’"),Tc=[Cc,xc,Sc,Ec];function Mc(t,e,n,o){return new gc(t,(function(t,r,i,a){var s=n instanceof Function?n(r):n,l=t.tr.delete(i,a),c=l.doc.resolve(i).blockRange(),d=c&&At(c,e,s);if(!d)return null;l.wrap(c,d);var u=l.doc.resolve(i-1).nodeBefore;return u&&u.type==e&&Nt(l.doc,i-1)&&(!o||o(r,u))&&l.join(i-1),l}))}function Dc(t,e,n){return new gc(t,(function(t,o,r,i){var a=t.doc.resolve(r),s=n instanceof Function?n(o):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?t.tr.delete(r,i).setBlockType(r,r,e,s):null}))}var Oc={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},Ac={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},Ic={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},Bc={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},Nc={mark:"sub"},zc={mark:"sup"},Rc={mark:"link"},Pc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Lc=function(t,e){var n={},o=e&&e.applyToWord||!1;if(n["Mod-z"]=fc,n["Shift-Mod-z"]=hc,n.Backspace=bo(wc,Hn,qn,Kn),n.Enter=bo(eo,ro,io,so),Pc||(n["Mod-y"]=hc),t.marks.strong&&(n["Mod-b"]=Ke(cn,Ne.__assign({},Oc,{applyToWord:o}))),t.marks.em&&(n["Mod-i"]=Ke(cn,Ne.__assign({},Ac,{applyToWord:o}))),t.marks.u&&(n["Mod-u"]=Ke(cn,Ne.__assign({},Ic,{applyToWord:o}))),t.nodes.hard_break){var r=t.nodes.hard_break,i=bo(oo,(function(t,e){return e(t.tr.replaceSelectionWith(r.create()).scrollIntoView()),!0}));n["Shift-Enter"]=i}return n},Fc=function(t){var e,n={};return t.nodes.list_item&&(n.Enter=(e=t.nodes.list_item,function(t,n){return Rn(e)(t,(function(e){var o=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();o&&e.ensureMarks(o),n(e)}))})),n},$c=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,Vc=function(t){return/^MsoListParagraph/.test(t.className)},jc=function(t){var e=t.innerHTML;return e=(e=e.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},Wc=function(t,e){var n=document.createElement(t);return n.style.listStyleType=e,n},Hc=function(t){var e=null;return/^\d/.test(t)||(e=(/^[a-z]/.test(t)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(t)?"roman":"alpha")),e},qc=function(t,e){var n=[];Array.from(t).forEach((function(t){if(t.nodeType===Node.ELEMENT_NODE){var o=t;o.getAttribute("datalist")?(n.push(t),e.add(n)):Vc(o)&&n.length?n.push(t):(n=[],"DIV"===o.nodeName?qc(o.children,e):"TABLE"===o.nodeName&&Array.from(o.querySelectorAll("td,th")).forEach((function(t){qc(t.children,e)})))}}))},Jc=function(t){var e,n=t.innerHTML,o=function(t){return t.replace(/^(?:&nbsp;|[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(e=o(jc(t)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(e)?null:/^o/.test(e)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:Hc(o(jc(t)))}:void 0},Kc=function(t){var e,n=t.nodeName.toLowerCase();t.firstChild&&t.firstChild.nodeType===Node.COMMENT_NODE&&t.removeChild(t.firstChild),1===t.childNodes.length?e=t.firstChild.nodeType===Node.TEXT_NODE?jc(t):t.firstChild.innerHTML.replace(/^\w+[\.\)](&nbsp;)+ /,""):(t.removeChild(t.firstChild),3===t.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(t.firstChild.nodeValue)&&t.removeChild(t.firstChild),/^(&nbsp;|\s)+$/i.test(t.firstChild.innerHTML)&&t.removeChild(t.firstChild),e="p"!==n?"<"+n+">"+t.innerHTML+"</"+n+">":t.innerHTML),t.parentNode.removeChild(t);var o=document.createElement("li");return o.innerHTML=e,o},Uc=function(t){var e=document.createElement("div");e.innerHTML=function(t){return t=t.replace($c,(function(t,e,n){return'datalist="'+e+'" datalevel="'+n+'" '+t}))}(t);var n=new Set;return qc(e.children,n),n.forEach((function(t){return function(t){var e,n,o,r,i,a,s,l,c,d,u,p,f,h=-1,m={};for(l=0;l<t.length;l++){var v=(f={datalist:(c=t[l]).getAttribute("datalist"),datalevel:c.getAttribute("datalevel")}).datalist,g=Jc(c);if(d=g&&g.tag){if(u=f.datalevel||parseFloat(c.style.marginLeft||0),f.datalevel||c.style.marginLeft){var y=d+v;m[u]||(m[u]={}),(!n||n<0)&&(n=u,o=v,r=(s=t.filter((function(t){return t.getAttribute("datalist")===String(o)})))[s.length-1],a=Wc(d,g&&g.style),c.parentNode.insertBefore(a,c),h=u,m[u][y]=a),i=r===c,p=m[u][y],(u>h||!p)&&(p=Wc(d,g&&g.style),m[u][y]=p,e.appendChild(p)),e=Kc(c),p.appendChild(e),i?n=h=-1:h=u}}else!e||i&&!Vc(c)||(c.style.marginLeft&&(c.style.marginLeft=""),c.style.marginLeft&&(c.style.margin=""),e.appendChild(c))}}(t)})),e.innerHTML},Gc=function(t){return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(/^[\s\S]+?<!--StartFragment-->\s*([\s\S]*?)\s*<!--EndFragment-->[\s\S]+$/,"$1")).replace(/<\/?[ovw]:[^>]*?>/gi,"")).replace(/<\\?\??xml[^>]*>/gi,"")).replace(/<(?:link|meta) [^>]+?>/gi,"")).replace(/<style[^>]*?>\s*<\/style>/gi,"")).replace(/<\/?st1:.*?>/gi,"")).replace(/<a name="[a-zA-Z0-9_]+">/gim,"")).replace(/v:shapes?="[^"]+"/gi,"")).replace(/<!\[if !supportLists\]>/gi,"")).replace(/<!\[endif\]>/gi,"")},Xc=function(t){return t.replace(/<!--[\s\S]+?-->/g,"")},Yc=function(t,e){return t.replace(new RegExp("<\\/?("+e+")(?:\\s[^>]*?)?>","gi"),"")},Zc=function(t){t.ownerElement&&t.ownerElement.removeAttribute(t.name)},Qc=function(t){/^Mso/.test(t.value)&&Zc(t)},td=/\s*;\s*/,ed=/\s*:\s*/,nd=function(t){var e,n,o=t.value.split(td).filter((function(t){return Boolean(t)})),r=t.ownerElement.style,i="";o.forEach((function(t){var o;o=t.split(ed),e=o[0],n=o[1],void 0!==r[e]&&(i+=e+": "+n+"; ")})),(i=i.trim())?t.value=i:Zc(t)},od=function(t,e){var n=t;if(e.convertMsLists&&(n=Uc(n)),e.stripTags&&(n=Yc(n,e.stripTags)),e.attributes){var o=document.createElement("div");o.innerHTML=n,Array.from(o.querySelectorAll("*")).forEach((function(t){return function(t,e){if(t.nodeType===Node.ELEMENT_NODE){for(var n=t.attributes.length-1;n>=0;n--){var o=t.attributes[n];e[o.name]?e[o.name](o):e["*"]&&e["*"](o)}"SPAN"===t.nodeName&&0===t.attributes.length&&function(t){var e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}}(t)}}(t,e.attributes)})),n=o.innerHTML}return n};function rd(t){for(var e=t.length,n=new Array(e/2),o=0;o<e;o+=2)n[o]=String.fromCharCode(parseInt(t.substring(o,o+2),16));return btoa(n.join(""))}var id=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,ad=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,sd=new RegExp("(?:("+ad.source+"))([\\da-fA-F\\s]+)\\}","g"),ld=/[^\da-fA-F]/g,cd=/file:\/[^'"]+\.(jpg|png|gif)/i,dd=/\\(png|jpeg)blip\\/,ud=function(t,e){var n=t.match(id);if(!n||-1===e.types.indexOf("text/rtf"))return t;var o=e.getData("text/rtf"),r=[],i=o.match(sd);if(!o||!i)return t;for(var a=0,s=i;a<s.length;a++){var l=s[a],c=dd.exec(l);if(c){var d=l.replace(ad,"").replace(ld,"");r.push("data:image/"+c[1]+";base64,"+rd(d))}}return n.length!==r.length?t:t.replace(id,(function(t){var e=r.shift()||"";return t.replace(cd,e)}))},pd=function(t,e,n,o,r){var i,a,s,l,c,d,u=[],p=[],f=e.matchCase,h=e.matchWord,m=e.useRegExp,v=e.text;if(m&&(/^\\$/.test(v)||/[^\\]\\$/.test(v))&&(v=v.substring(0,v.length-1)),!v)return u;var g=f?"g":"gi",y=m?new RegExp(v,g):bd(v,g);return t.nodesBetween(n,o,(function(e,f,m){if(r(u))return!1;e.inlineContent&&f+e.content.size>=n&&(p.length=0,e.nodesBetween(0,e.content.size,(function(e,m,v,g){if(r(u))return!1;var b=1+f+m;if(e.isText&&b+e.nodeSize>=n){if(c=e.text||"",d=v.childCount-1>=g+1&&v.child(g+1),p.push(n<=b?{text:c,start:b}:{text:c.slice(n-b),start:n}),d&&d.isText)return;for(a=p.map((function(t){return t.text})).join(""),i=y.exec(a);null!==i&&(s=p[0].start+i.index,l=s+i[0].length,n<=s&&o>=l&&yd(i,h)&&u.push(oe.create(t,s,l)),!r(u));)i=y.exec(a)}else p.length=0})))})),u},fd=function(t,e){var n=e.backward,o=e.matchCyclic,r=Ne.__rest(e,["backward","matchCyclic"]),i=n?function(){return!1}:function(t){return t.length>0},a=t.doc,s=t.selection,l=[];return n?!(l=pd(a,r,0,s.from,i)).length&&o&&(l=pd(a,r,s.from,a.content.size,i)):!(l=pd(a,r,s.to,a.content.size,i)).length&&o&&(l=pd(a,r,0,s.to,i)),l.length?l[l.length-1]:null},hd=function(t,e){return pd(t,e,0,t.content.size,(function(){return!1}))},md=function(t,e,n){var o=t.from,r=t.to;return n.insertText(e,o,r).setSelection(oe.create(n.doc,o,o+e.length)),n},vd=function(t,e,n){var o=hd(t.doc,n);if(0===o.length)return null;for(var r=t.tr,i=o.length-1;i>=0;i--)r.insertText(e,o[i].from,o[i].to);return r},gd=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,yd=function(t,e){if(e){if(!0===e){var n=t.input,o=n.charAt(t.index-1),r=n.charAt(t.index+t[0].length);return gd.test(o)&&gd.test(r)}return e(t)}return!0},bd=function(t,e){var n=t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,e)};function wd(t){var e={class:"k-placeholder","data-placeholder":t};return new be({key:new _e("placeholder"),props:{decorations:function(t){var n=t.doc,o=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&o.inlineContent&&0===o.childCount))return Pa.empty;var r=[];return n.descendants((function(t,n){r.push(Ba.node(n,n+t.nodeSize,e))})),Pa.create(n,r)}}})}var kd=/\s+/g,_d=/text-align/,Cd=function(){return new be({key:new _e("spaces-fix"),props:{decorations:function(t){var e,n,o,r,i=[],a=t.doc;return a.nodesBetween(0,a.content.size,(function(t,a,s){if(t.type.isText&&function(t){return _d.test(t&&t.attrs&&t.attrs.style||"")}(s))for(n=kd.exec(t.text||"");null!==n;){if(e=a+n.index,o=n[0].length,n.index+o<n.input.length)for(r=0;r<=o-1;r+=2)i.push(Ba.inline(e+r,e+r+1,{style:"white-space: normal"}));n=kd.exec(t.text||"")}})),Pa.create(a,i)}}})},xd=new _e("highlight");function Sd(t){return void 0===t&&(t=xd),new be({key:t,state:{init:function(){return null},apply:function(t){return t.getMeta(this.spec.key)}},props:{decorations:function(t){var e=(this.spec.key.getState(t)||[]).map((function(t){return Ba.inline(t.from,t.to,t.attrs)}));return Pa.create(t.doc,e)}}})}var Ed=new _e("image-resize"),Td={southeast:{x:1,y:1},east:{x:1,y:0},south:{x:0,y:1},north:{x:0,y:-1},west:{x:-1,y:0},southwest:{x:-1,y:1},northwest:{x:-1,y:-1},northeast:{x:1,y:-1}},Md=Object.keys(Td),Dd=function(t,e,n){t.style[e]=n+"px"},Od=/[^\-]width:|[^\-]height:/,Ad=/^.+$/,Id=function(){function t(t,e,n,o){this.activeHandle=t,this.dragging=e,this.rect=n,this.nodePosition=o}return t.prototype.apply=function(e){var n=e.getMeta(Ed);return n?new t(n.activeHandle,n.setDragging,n.rect,n.nodePosition):this},t}(),Bd=function(t,e,n){var o=e.target.getAttribute("data-direction");if(!o)return!1;var r=Ed.getState(t.state);e.preventDefault();var i=t.state.tr;function a(e){!function(t,e,n){var o=Ed.getState(t.state),r=o.rect,i=o.dragging,a=o.nodePosition,s=o.activeHandle;if(i&&r){var l=t.nodeDOM(a),c=Td[s],d=(e.clientX-i.startX)*c.x,u=(e.clientY-i.startY)*c.y,p=c.x?d+l.width:r.width,f=c.y?u+l.height:r.height;if(n.lockRatio&&c.x&&c.y){var h=Math.min(p/l.width,f/l.height),m=l.width*h,v=l.height*h;i.startX=e.clientX-(p-m)*c.x,i.startY=e.clientY-(f-v)*c.y,p=m,f=v}else i.startX=c.x?e.clientX:i.startX,i.startY=c.y?e.clientY:i.startY;Dd(l,"width",p),Dd(l,"height",f),r.top=l.offsetTop,r.left=l.offsetLeft,r.width=l.offsetWidth,r.height=l.offsetHeight;var g=l.nextElementSibling;g.style.width=r.width+"px",g.style.height=r.height+"px",g.style.top=r.top+"px",g.style.left=r.left+"px"}}(t,e,n)}return i.setMeta(Ed,{setDragging:{startX:e.clientX,startY:e.clientY},activeHandle:o,rect:r.rect,nodePosition:r.nodePosition}),i.setMeta("addToHistory",!1),t.dispatch(i),e.view.addEventListener("mouseup",(function e(n){n.view.removeEventListener("mouseup",e),n.view.removeEventListener("mousemove",a),function(t){var e=Ed.getState(t.state),n=e.rect,o=e.dragging,r=e.nodePosition;if(o&&n){var i=t.state.selection;if(i instanceof ie){var a=i.node.attrs,s=n.width,l=n.height,c=void 0;if(Od.test(a.style||"")){var d=ze(a.style,{style:"width",value:Ad,newValue:s+"px"}),u=ze(d.style||"",{style:"height",value:Ad,newValue:l+"px"}).style;c=Ne.__assign({},a,{style:u})}else c=Ne.__assign({},a,{width:s,height:l});var p=i.node.type.createAndFill(c);if(p){var f=t.state.tr;f.replaceWith(r,r+1,p),f.setSelection(ie.create(f.doc,r)),f.setMeta("commandName","image-resize"),f.setMeta("args",c),f.setMeta(Ed,{setDragging:null,activeHandle:null,rect:n,nodePosition:r}),t.dispatch(f)}}}}(t)})),e.view.addEventListener("mousemove",a),!0},Nd=function(t){return void 0===t&&(t={node:"image",lockRatio:!0}),new be({key:Ed,view:function(e){return{resize:function(){Ed.getState(e.state).rect&&e.dispatch(e.state.tr.setMeta("resize",!0))},get window(){return e.dom.ownerDocument&&e.dom.ownerDocument.defaultView},attachResize:function(){var t=this.window;t&&(t.removeEventListener("resize",this.resize),t.addEventListener("resize",this.resize))},removeResize:function(){var t=this.window;t&&t.removeEventListener("resize",this.resize)},update:function(e,n){var o=e.state,r=o.selection,i=o.schema.nodes[t.node],a=Ed.getState(o),s=a.rect;if(r instanceof ie&&i===r.node.type){var l=e.nodeDOM(r.from),c={top:l.offsetTop,left:l.offsetLeft,width:l.offsetWidth,height:l.offsetHeight};if(!n.selection.eq(r)||s&&(s.width!==c.width||s.height!==c.height||s.top!==c.top||s.left!==c.left)){var d=o.tr;d.setMeta(Ed,{rect:c,nodePosition:r.from}),e.dispatch(d),this.attachResize()}}else s&&(a.rect=null,a.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new Id("",null,null,-1)},apply:function(t,e){return e.apply(t)}},props:{handleDOMEvents:{mousedown:function(e,n){return Bd(e,n,t)}},decorations:function(e){var n=e.selection,o=e.schema.nodes[t.node],r=Ed.getState(e).rect;if(r&&n instanceof ie&&o===n.node.type){var i=document.createElement("div");i.className="k-editor-resize-handles-wrapper",i.style.width=r.width+"px",i.style.height=r.height+"px",i.style.top=r.top+"px",i.style.left=r.left+"px";for(var a=0;a<Md.length;a++){var s=document.createElement("div");s.className="k-editor-resize-handle "+Md[a],s.setAttribute("data-direction",Md[a]),i.appendChild(s)}return Pa.create(e.doc,[Ba.widget(e.selection.from+1,i)])}return Pa.empty}}})},zd=new _e("caret-color");function Rd(){return new be({key:zd,props:{decorations:function(t){var e=t.doc,n=t.selection,o=t.storedMarks;if(!n.empty||!o)return Pa.empty;var r=tn((o||[]).find((function(t){return"style"===t.type.name})),{name:"color",value:/^.+$/});if(!r)return Pa.empty;var i=n.$anchor.parent,a=[];return e.descendants((function(t,e){t.eq(i)&&a.push(Ba.node(e,e+t.nodeSize,{style:"caret-color: "+r}))})),Pa.create(e,a)}}})}function Pd(t){return void 0===t&&(t={}),new be({view:function(e){return new Ld(e,t)}})}var Ld=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var o=function(t){return n[e](t)};return t.dom.addEventListener(e,o),{name:e,handler:o}}))};Ld.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,o=e.handler;return t.editorView.dom.removeEventListener(n,o)}))},Ld.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())},Ld.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Ld.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,o=e.nodeAfter;if(n||o){var r=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?r.bottom:r.top;n&&o&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:r.left,right:r.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!t){var a=this.editorView.coordsAtPos(this.cursorPos);t={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)s=-pageXOffset,l=-pageYOffset;else{var d=c.getBoundingClientRect();s=d.left-c.scrollLeft,l=d.top-c.scrollTop}this.element.style.left=t.left-s+"px",this.element.style.top=t.top-l+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},Ld.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},Ld.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),o=n&&n.type.spec.disableDropCursor,r="function"==typeof o?o(this.editorView,e):o;if(e&&!r){var i=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Lt(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}},Ld.prototype.dragend=function(){this.scheduleRemoval(20)},Ld.prototype.drop=function(){this.scheduleRemoval(20)},Ld.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var Fd=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,o){var r=n.resolve(o.map(this.head));return e.valid(r)?new e(r):t.near(r)},e.prototype.content=function(){return p.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new $d(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),o=t.node(e);if(0!=n)for(var r=o.child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),o=t.node(e);if(n!=o.childCount)for(var r=o.child(n);;r=r.firstChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}else if(o.type.spec.isolating)return!0}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var o=e.contentMatchAt(t.index()).defaultType;return o&&o.isTextblock},e.findFrom=function(t,n,o){t:for(;;){if(!o&&e.valid(t))return t;for(var r=t.pos,i=null,a=t.depth;;a--){var s=t.node(a);if(n>0?t.indexAfter(a)<s.childCount:t.index(a)>0){i=s.child(n>0?t.indexAfter(a):t.index(a)-1);break}if(0==a)return null;r+=n;var l=t.doc.resolve(r);if(e.valid(l))return l}for(;;){var c=n>0?i.firstChild:i.lastChild;if(!c){if(i.isAtom&&!i.isText&&!ie.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*n),o=!1;continue t}break}i=c,r+=n;var d=t.doc.resolve(r);if(e.valid(d))return d}return null}},e}(te);Fd.prototype.visible=!1,te.jsonID("gapcursor",Fd);var $d=function(t){this.pos=t};$d.prototype.map=function(t){return new $d(t.map(this.pos))},$d.prototype.resolve=function(t){var e=t.resolve(this.pos);return Fd.valid(e)?new Fd(e):te.near(e)};var Vd=function(){return new be({props:{decorations:Jd,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&Fd.valid(n))return new Fd(n)},handleClick:Hd,handleKeyDown:jd,handleDOMEvents:{beforeinput:qd}}})},jd=dr({ArrowLeft:Wd("horiz",-1),ArrowRight:Wd("horiz",1),ArrowUp:Wd("vert",-1),ArrowDown:Wd("vert",1)});function Wd(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,o,r){var i=t.selection,a=e>0?i.$to:i.$from,s=i.empty;if(i instanceof oe){if(!r.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}var l=Fd.findFrom(a,e,s);return!!l&&(o&&o(t.tr.setSelection(new Fd(l))),!0)}}function Hd(t,e,n){if(!t.editable)return!1;var o=t.state.doc.resolve(e);if(!Fd.valid(o))return!1;var r=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(r>-1&&ie.isSelectable(t.state.doc.nodeAt(r)))&&(t.dispatch(t.state.tr.setSelection(new Fd(o))),!0)}function qd(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Fd))return!1;var n=t.state.selection.$from,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;for(var r=i.empty,a=o.length-1;a>=0;a--)r=i.from(o[a].createAndFill(null,r));var s=t.state.tr.replace(n.pos,n.pos,new p(r,0,0));return s.setSelection(oe.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function Jd(t){if(!(t.selection instanceof Fd))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",Pa.create(t.doc,[Ba.widget(t.selection.head,e,{key:"gapcursor"})])}var Kd=function(t,e,n){for(var o,r=t.table,i=t.table_row,a=t.table_cell,s=[],l=0;l<e+1;l++){o=[];for(var c=0;c<n+1;c++)o.push(a.createAndFill());s.push(i.createAndFill(void 0,o))}return r.createAndFill(void 0,s)},Ud=function(t,e){for(var n=t.$head,o=n.depth;o>0;o--){var r=n.node(o);if(r.type.name===e)return{pos:n.before(o),node:r}}return null},Gd=function(t,e){return rl(t,e&&function(t){var n,o=Ud(t.selection,"table_row"),r=Ud(t.selection,"table");if(o&&r&&o.node.attrs[Ce]){for(var i=0,a=0;a<r.node.nodeSize;a++)if(r.node.child(a).eq(o.node)){i=a;break}var s=r.node.child(i-1),l=o.pos-s.nodeSize;t.setNodeMarkup(l,void 0,((n={})[Ce]=o.node.attrs[Ce],n))}return e(t)})},Xd=function(t,e){return il(t,e&&function(t){var n,o=Ud(t.selection,"table_row");if(o&&o.node.attrs[Ce]){var r=o.pos+o.node.nodeSize;t.setNodeMarkup(r,void 0,((n={})[Ce]=o.node.attrs[Ce],n))}return e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(10);e.outerWidth=function(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0},e.removeEntries=function(t,e){return Object.keys(t).filter((function(t){return e(t)})).reduce((function(e,n){var o;return Object.assign(e,((o={})[n]=t[n],o))}),{})},e.removeEmptyEntries=function(t){return e.removeEntries(t,(function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]}))},e.isEmpty=function(t){return 0===Object.keys(t).length},e.isNullOrUndefined=function(t){return null==t},e.isPresent=function(t){return!e.isNullOrUndefined(t)},e.detectIE=function(){if(!o.isDocumentAvailable())return!1;var t=window.navigator.userAgent,e=t.indexOf("MSIE "),n=t.indexOf("Trident/");return e>0||n>0},e.safeString=function(t){return e.isNullOrUndefined(t)?"":t.toString()},e.first=function(t){return t[0]},e.last=function(t){return t[t.length-1]},e.unique=function(t){return Array.from(new Set(t))},e.split=function(t){return function(e){return e.split(t)}},e.trim=function(t){return t.trim()},e.filter=function(t){return function(e){return e.filter(t)}},e.toArray=function(t){return t instanceof Array?t:[t]},e.getUniqueStyleValues=function(t,n){if(t.hasNodesWithoutMarks)return"";var o=t.marks.filter((function(t){return"style"===t.type.name})).map((function(t){return t.attrs.style})).map(e.safeString).map(e.split(";")).map(e.filter((function(t){return t.includes(n)}))).map((function(t){return 0!==t.length?t:[n+": INVALID"]})).map(e.first).map(e.split(":")).map(e.last).map(e.trim).reduce((function(t,e){return t.indexOf(e)>-1?t:t.concat([e])}),[]);return o.indexOf("INVALID")>-1||1!==o.length?"":o[0]},e.conditionallyExecute=function(t){return function(e){return function(n){return e?t(n):n}}},e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return t.reduce((function(t,e){return e(t)}),e)}}},function(t,e){t.exports=o},function(t,e){t.exports=r},function(t,e){t.exports=i},function(t,e){t.exports=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o,r,i){var a=t.call(this,e,n,o,r,i)||this;return a.dialog=e,a.button=n,a.editor=o,a.localization=r,a.toolsService=i,a}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.openDialog(this.dialog)},e.prototype.onStateChange=function(t){this.button.selected=t[this.command].selected,this.button.disabled=t[this.command].disabled},e}(n(34).EditorCommandBase);e.EditorCommandDialog=r},function(t,e){t.exports=s},function(t,e){t.exports=l},function(t,e){t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-format-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'tag\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <ng-container [ngSwitch]="dataItem.tag">\n <span *ngSwitchCase="\'h1\'" style="display: block; font-size: 2em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h2\'" style="display: block; font-size: 1.5em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h3\'" style="display: block; font-size: 1.17em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h4\'" style="display: block; font-size: 1em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h5\'" style="display: block; font-size: .83em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'h6\'" style="display: block; font-size: .67em; margin-left: 0; font-weight: bold;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchCase="\'p\'" style="display: block; margin-left: 0;">\n {{ dataItem.text }}\n </span>\n\n <span *ngSwitchDefault>{{ dataItem.text }}</span>\n </ng-container>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FormatDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-fontfamily-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'fontName\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n <ng-template kendoDropDownListItemTemplate let-dataItem>\n <span [ngStyle]="{ \'font-family\': dataItem.fontName }">\n {{ dataItem.text }}\n </span>\n </ng-template>\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontFamilyDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(13),a=function(){function t(){this.valueChange=new r.EventEmitter}return t.prototype.onValueChange=function(t){this.valueChange.emit(t)},t.prototype.focus=function(){this.dropDownList.focus()},o.__decorate([r.Input(),o.__metadata("design:type",Array)],t.prototype,"data",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],t.prototype,"defaultItem",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Function)],t.prototype,"itemDisabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],t.prototype,"title",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Number)],t.prototype,"tabindex",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("element",{static:!0}),o.__metadata("design:type",r.ElementRef)],t.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:i.DropDownListComponent,static:!0}),o.__metadata("design:type",i.DropDownListComponent)],t.prototype,"dropDownList",void 0),t=o.__decorate([r.Component({selector:"kendo-editor-fontsize-dropdownlist",template:'\n <kendo-dropdownlist\n #element\n kendoEditorDropDownTool\n [defaultItem]="defaultItem"\n [textField]="\'text\'"\n [valueField]="\'size\'"\n [data]="data"\n [(value)]="value"\n [valuePrimitive]="true"\n [itemDisabled]="itemDisabled"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-dropdownlist>\n ',styles:["\n .k-dropdownlist {\n width: 13em;\n }\n "]})],t)}();e.FontSizeDropDownListComponent=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(17),s=n(2),l=n(9),c=n(3),d=n(7),u=n(30),p=n(16),f=function(t){function e(e,n,o,r){var i=t.call(this)||this;return i.editor=e,i.localization=n,i.dialogService=o,i.ngZone=r,i.tabindex=-1,i.disabled=!1,i.views=["palette"],i}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(t){this.views=[t]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get(this.editorCommand)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.disabled=n.disabled}))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},e.prototype.handleValueChange=function(t){this.editor.exec(this.editorCommand,t),this.editor.view.focus()},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.handleValueChange(t.color)},e.prototype.onOpen=function(t){this.valueCache=t.value,t.reset()},e.prototype.onClose=function(t){var e=this;t.value||(t.value=this.valueCache),this.editor.shouldEmitFocus=!0,this.ngZone.onStable.pipe(p.take(1)).subscribe((function(){return e.editor.view.focus()}))},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return l.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:u.ColorPickerDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,value:this.value,title:this.title,editorCommand:this.editorCommand,paletteSettings:this.paletteSettings,icon:this.icon,views:this.views})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.colorPickerButton.nativeElement.focus():this.colorPicker.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"value",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"icon",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"paletteSettings",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"editorCommand",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),o.__decorate([r.Input(),o.__metadata("design:type",Array)],e.prototype,"views",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String),o.__metadata("design:paramtypes",[String])],e.prototype,"view",null),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("colorpicker",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("colorpicker",{read:a.ColorPickerComponent,static:!1}),o.__metadata("design:type",a.ColorPickerComponent)],e.prototype,"colorPicker",void 0),o.__decorate([r.ViewChild("colorPickerButton",{read:r.ElementRef,static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"colorPickerButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-colorpicker",template:'\n <ng-template #toolbarTemplate>\n <kendo-colorpicker\n #colorpicker\n [attr.title]="title"\n [icon]="icon"\n [views]="views"\n [format]="\'hex\'"\n [value]="value"\n [paletteSettings]="paletteSettings"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="handleValueChange($event)"\n (activeColorClick)="handleActiveColorClick($event)"\n (open)="onOpen(colorpicker)"\n (close)="onClose(colorpicker)"\n >\n </kendo-colorpicker>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #colorPickerButton\n class="k-overflow-button"\n [icon]="icon"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[c.EditorComponent,s.EditorLocalizationService,d.DialogService,r.NgZone])],e)}(i.ToolBarToolComponent);e.EditorColorPickerComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.commandIcons={alignCenter:"align-center",alignJustify:"align-justify",alignLeft:"align-left",alignRight:"align-right",backColor:"background",blockquote:"blockquote",bold:"bold",cleanFormatting:"clear-css",createLink:"link-horizontal",foreColor:"foreground-color",indent:"indent-increase",insertFile:"file-add",insertImage:"image",insertOrderedList:"list-ordered",insertUnorderedList:"list-unordered",italic:"italic",outdent:"indent-decrease",print:"print",redo:"redo",selectAll:"select-all",strikethrough:"strikethrough",subscript:"sub-script",superscript:"sup-script",underline:"underline",undo:"undo",unlink:"unlink-horizontal",viewSource:"html",insertTable:"table-insert",addColumnBefore:"table-column-insert-left",addColumnAfter:"table-column-insert-right",addRowBefore:"table-row-insert-above",addRowAfter:"table-row-insert-below",deleteRow:"table-row-delete",deleteColumn:"table-column-delete",mergeCells:"cells-merge",splitCell:"cell-split-horizontally",deleteTable:"table-delete"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(39),r=n(8);e.Schema=r.Schema;var i=r.marks,a=Object.assign(r.nodes,o.semanticNodes);e.schema=new r.Schema({marks:i,nodes:a})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data="",o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.textarea.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.editor.exec("setHTML",this.getData()),this.dialog.close(),this.editor.view.focus()},e.prototype.getData=function(){return this.textarea.nativeElement.value},e.prototype.setData=function(){this.data=this.indent(this.editor.getSource())},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.indent=function(t){return t.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("textarea",{static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"textarea",void 0),e=o.__decorate([r.Component({styles:["\n >>> .k-editor-textarea {\n height: 100%;\n }\n "],template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'viewSource\') }}\n </kendo-dialog-titlebar>\n <textarea [value]="data" #textarea class="k-textarea k-editor-textarea"></textarea>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogUpdate\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.SourceDialogComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(7),s=n(8),l=n(9),c=n(2),d=n(10),u=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.src=new i.FormControl("",i.Validators.required),o.alt=new i.FormControl(""),o.width=new i.FormControl("",i.Validators.min(1)),o.height=new i.FormControl("",i.Validators.min(1)),o.data={alt:"",height:"",src:"",width:""},o.imageData=new i.FormGroup({alt:o.alt,height:o.height,src:o.src,width:o.width}),o}return o.__extends(e,t),e.prototype.ngOnInit=function(){this.srcInputId="k-"+d.guid(),this.altTextInputId="k-"+d.guid(),this.widthInputId="k-"+d.guid(),this.heightInputId="k-"+d.guid()},e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.srcInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.src.value&&(this.editor.exec("insertImage",this.getData()),this.dialog.close(),this.editor.view.focus())},e.prototype.setData=function(t){var e=s.getNodeFromSelection(t);e&&(this.src.patchValue(e.attrs.src),this.alt.patchValue(e.attrs.alt),this.width.patchValue(e.attrs.width),this.height.patchValue(e.attrs.height))},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.getData=function(){return{alt:this.alt.value,height:this.normalizeDimension(this.height.value),src:this.src.value,width:this.normalizeDimension(this.width.value)}},e.prototype.normalizeDimension=function(t){return Number.isNaN(parseInt(t,10))||parseInt(t,10)<=0?"":l.safeString(parseInt(t,10))},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("srcInput",{read:r.ElementRef,static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"srcInput",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertImage\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <div class="k-edit-label">\n <label [for]="srcInputId">{{ textFor(\'imageWebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="srcInputId" #srcInput [formControl]="src" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="altTextInputId">{{ textFor(\'imageAltText\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="altTextInputId" [formControl]="alt" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="widthInputId">{{ textFor(\'imageWidth\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="widthInputId" [formControl]="width" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <div class="k-edit-label">\n <label [for]="heightInputId">{{ textFor(\'imageHeight\') }}</label>\n </div>\n <div class="k-edit-field">\n <input [id]="heightInputId" [formControl]="height" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="imageData.invalid"\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogInsert\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[a.DialogRef,c.EditorLocalizationService])],e)}(a.DialogContentBase);e.ImageDialogComponent=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(12),a=n(7),s=n(8),l=n(9),c=n(2),d=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.linkForm=new i.FormGroup({href:new i.FormControl("",i.Validators.required),text:new i.FormControl({value:"",disabled:!0},i.Validators.required),title:new i.FormControl("")}),o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.hrefInput.nativeElement.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){var t=this.getData();this.editor.exec(this.command,t),this.dialog.close(),this.editor.view.focus()},Object.defineProperty(e.prototype,"titleText",{get:function(){return this.localization.get(this.command)},enumerable:!0,configurable:!0}),e.prototype.setData=function(t,e){"createLink"===this.command&&this.linkForm.addControl("target",new i.FormControl);var n=s.getMark(t,t.schema.marks.link);if(n)this.linkForm.reset({href:n.attrs.href,title:n.attrs.title,target:l.isPresent(n.attrs.target),text:this.setLinkText(t)});else if(t.selection.empty){var o=e.applyToWord?s.expandSelection(t,(function(){}),e).state:t;o.selection.empty||this.linkForm.patchValue({text:s.getSelectionText(o)})}else this.linkForm.patchValue({text:s.getSelectionText(t)})},e.prototype.textForWithPrefix=function(t){var e="createLink"===this.command?"link":"file";return this.textFor(e+t)},e.prototype.textFor=function(t){return this.localization.get(t)},e.prototype.setLinkText=function(t){var e=t.selection;if(e.empty&&e.$cursor){var n=e.$cursor,o=n.index();return n.parent.child(o).text}return s.getSelectionText(t)},e.prototype.getData=function(){var t=this.linkForm.value;return l.isPresent(this.linkForm.controls.target)&&(t.target=t.target?"_blank":null),t},o.__decorate([r.Input(),o.__metadata("design:type",Object)],e.prototype,"editor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"command",void 0),o.__decorate([r.ViewChild("hrefInput",{read:r.ElementRef,static:!0}),o.__metadata("design:type",r.ElementRef)],e.prototype,"hrefInput",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ titleText }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content">\n <form novalidate [formGroup]="linkForm">\n <div class="k-edit-label">\n <label (click)="hrefInput.focus()">{{ textForWithPrefix(\'WebAddress\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #hrefInput formControlName="href" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="textInput.focus()">{{ textForWithPrefix(\'Text\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #textInput formControlName="text" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n\n <div class="k-edit-label">\n <label (click)="titleInput.focus()">{{ textForWithPrefix(\'Title\') }}</label>\n </div>\n <div class="k-edit-field">\n <input #titleInput formControlName="title" type="text" class="k-textbox k-input k-rounded-md" />\n </div>\n <ng-container *ngIf="command === \'createLink\'">\n <div class="k-edit-label"></div>\n <div class="k-edit-field">\n <input type="checkbox" id="k-target-blank" kendoCheckBox formControlName="target" />\n <label class="k-checkbox-label" for="k-target-blank">{{ textForWithPrefix(\'OpenInNewWindow\') }}</label>\n </div>\n </ng-container>\n </form>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton [disabled]="linkForm.invalid" (click)="onConfirmAction()" [primary]="true">\n {{ textFor(\'dialogInsert\') }}\n </button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[a.DialogRef,c.EditorLocalizationService])],e)}(a.DialogContentBase);e.FileLinkDialogComponent=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EditorErrorMessages={schemaType:"Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",setSchemaOnce:"The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/",pluginsCallbackType:function(t){return"plugins must be a function, but received "+JSON.stringify(t)+"."},pastedContentCallbackType:function(t){return"pastedContent must be a function, but received "+JSON.stringify(t)+"."},setPluginsOnce:"The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/",setPlaceHolderOnce:"The placeholder cannot be changed dynamically. See https://www.telerik.com/kendo-angular-ui/components/editor/plugins/#toc-custom-plugins/",printTool:"The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=function(t){function e(e,n,o){var r=t.call(this)||this;return r.cleanedHtml=e,r.originalHtml=n,r.originalEvent=o,r}return o.__extends(e,t),e}(n(10).PreventableEvent);e.EditorPasteEvent=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(18),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.formatDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("format",{tag:this.value}),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("formatDropDownList",{read:l.FormatDropDownListComponent,static:!0}),o.__metadata("design:type",l.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'format\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-format-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FormatDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(17),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.colorPicker.focus()}))},e.prototype.handleActiveColorClick=function(t){t.preventOpen(),this.value=t.color},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec(this.editorCommand,this.value),this.dialog.close(),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor,this.value=t.value,this.editorCommand=t.editorCommand,this.paletteSettings=t.paletteSettings,this.icon=t.icon,this.views=t.view?[t.view]:t.views},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("colorpicker",{read:l.ColorPickerComponent,static:!0}),o.__metadata("design:type",l.ColorPickerComponent)],e.prototype,"colorPicker",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(editorCommand) }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-colorpicker\n #colorpicker\n [views]="views"\n [format]="\'hex\'"\n [attr.title]="title"\n [icon]="icon"\n [(value)]="value"\n [paletteSettings]="paletteSettings"\n (activeColorClick)="handleActiveColorClick($event)"\n >\n </kendo-colorpicker>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.ColorPickerDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(19),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontFamilyDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontFamily",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("fontFamilyDropDownList",{read:l.FontFamilyDropDownListComponent,static:!0}),o.__metadata("design:type",l.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontFamily\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontfamily-dropdownlist\n #fontFamilyDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontFamilyDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o}return o.__extends(e,t),e.prototype.onCancelAction=function(){this.dialog.close(),this.editor.view.focus()},e.prototype.onCellClick=function(t){this.dialog.close(),this.editor.exec("insertTable",t),this.editor.view.focus()},e.prototype.setData=function(t){this.editor=t.editor},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'insertTable\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-ct-popup k-window-content" style="text-align: center;">\n <kendo-popup-table-grid (cellClick)="onCellClick($event)"></kendo-popup-table-grid>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.InsertTableDialogComponent=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(7),a=n(2),s=n(3),l=n(20),c=function(t){function e(e,n){var o=t.call(this,e)||this;return o.dialog=e,o.localization=n,o.data=[],o}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){var t=this;Promise.resolve(null).then((function(){t.fontSizeDropDownList.dropDownList.focus()}))},e.prototype.onCancelAction=function(){this.dialog.close()},e.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontSize",this.value),this.dialog.close()},e.prototype.setData=function(t){this.editor=t.editor,this.data=t.data,this.defaultItem=t.defaultItem,this.value=t.value,this.itemDisabled=t.itemDisabled},e.prototype.textFor=function(t){return this.localization.get(t)},o.__decorate([r.Input(),o.__metadata("design:type",s.EditorComponent)],e.prototype,"editor",void 0),o.__decorate([r.ViewChild("fontSizeDropDownList",{read:l.FontSizeDropDownListComponent,static:!0}),o.__metadata("design:type",l.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),e=o.__decorate([r.Component({template:'\n <kendo-dialog-titlebar (close)="onCancelAction()">\n {{ textFor(\'fontSize\') }}\n </kendo-dialog-titlebar>\n <div class="k-editor-dialog">\n <div class="k-editor-dialog k-popup-edit-form k-window-content k-content">\n <div class="k-edit-form-container k-window-content" style="text-align: center;">\n <kendo-editor-fontsize-dropdownlist\n #fontSizeDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n >\n </kendo-editor-fontsize-dropdownlist>\n </div>\n </div>\n </div>\n <kendo-dialog-actions>\n <button kendoButton (click)="onCancelAction()">{{ textFor(\'dialogCancel\') }}</button>\n <button kendoButton\n (click)="onConfirmAction()" [primary]="true">{{ textFor(\'dialogApply\') }}</button>\n </kendo-dialog-actions>\n '}),o.__metadata("design:paramtypes",[i.DialogRef,a.EditorLocalizationService])],e)}(i.DialogContentBase);e.FontSizeDialogComponent=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(22),r=function(){function t(t,e,n,r,i){var a=this;this.command=t,this.button=e,this.editor=n,this.localization=r,this.toolsService=i,setTimeout((function(){var t=a.localization.get(a.command);t&&(a.button.showText="overflow",a.button.showIcon="both",a.button.text=t),a.button.toolbarOptions.icon||(a.button.icon=o.commandIcons[a.command]),a.button.title=t,a.toolsService.needsCheck.next()}))}return t.prototype.ngOnInit=function(){this.subs=this.editor.stateChange.subscribe(this.onStateChange.bind(this)),this.subs.add(this.button.click.subscribe(this.clickHandler.bind(this))),this.subs.add(this.button.pointerdown.subscribe(this.pointerdownHandler.bind(this)))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},t.prototype.clickHandler=function(){},t.prototype.pointerdownHandler=function(t){},t.prototype.onStateChange=function(t){},t}();e.EditorCommandBase=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignCenter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignJustify",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignLeft",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"alignRight",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"backColor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"blockquote",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"bold",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"cleanFormatting",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"createLink",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fontFamily",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fontSize",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"foreColor",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"format",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"indent",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertFile",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertImage",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertOrderedList",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertUnorderedList",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"italic",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"outdent",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"print",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"redo",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"selectAll",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"strikethrough",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"subscript",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"superscript",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"underline",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"undo",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"unlink",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"viewSource",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"insertTable",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addColumnBefore",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addColumnAfter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addRowBefore",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"addRowAfter",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteColumn",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteRow",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"deleteTable",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogApply",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogCancel",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogInsert",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"dialogUpdate",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileTitle",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"fileWebAddress",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageAltText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageHeight",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageWebAddress",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"imageWidth",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkOpenInNewWindow",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkText",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkTitle",void 0),o.__decorate([r.Input(),o.__metadata("design:type",String)],e.prototype,"linkWebAddress",void 0),e}(n(11).ComponentMessages);e.Messages=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(3);e.EditorComponent=o.EditorComponent;var r=n(45);e.EditorModule=r.EditorModule;var i=n(23);e.schema=i.schema,e.Schema=i.Schema;var a=n(8);e.EditorState=a.EditorState,e.Plugin=a.Plugin,e.PluginKey=a.PluginKey,e.Transaction=a.Transaction,e.EditorView=a.EditorView,e.Decoration=a.Decoration,e.DecorationSet=a.DecorationSet,e.NodeType=a.NodeType,e.Node=a.Node,e.MarkType=a.MarkType,e.Mark=a.Mark,e.InputRule=a.InputRule,e.inputRules=a.inputRules,e.wrappingInputRule=a.wrappingInputRule,e.textblockTypeInputRule=a.textblockTypeInputRule,e.keymap=a.keymap,e.baseKeymap=a.baseKeymap,e.history=a.history,e.dropCursor=a.dropCursor,e.gapCursor=a.gapCursor,e.tableNodes=a.tableNodes,e.getSelectionText=a.getSelectionText;var s=n(28);e.EditorPasteEvent=s.EditorPasteEvent},function(t,e){t.exports=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.packageMetadata={name:"@progress/kendo-angular-editor",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1646842151,version:"",licensingDocsUrl:"https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(40);e.semanticTagNames=["article","main","nav","header","footer","aside","section"],e.semanticNodes=e.semanticTagNames.reduce((function(t,e){var n,i;return Object.assign(t,((n={})[e]=(i=e,{content:"block*",group:"block",attrs:o.__assign({},r.commonAttributes()),parseDOM:[{tag:i,getAttrs:r.getAttributes}],toDOM:function(t){return r.hasAttrs(t.attrs)?[i,r.getAttrs(t.attrs),r.hole]:[i,r.hole]}}),n))}),{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0);e.hasAttrs=function(t,e){for(var n in t)if(n&&null!==t[n]&&n!==e)return!0;return!1},e.getAttrs=function(t,e){var n={};for(var o in t)o&&null!==t[o]&&o!==e&&(n[o]=t[o]);return n},e.getAttributes=function(t){for(var e,n={},o=t.attributes,r=0;r<o.length;r++)n[(e=o[r]).name]=e.value;return n},e.serializeDOMAttrs=function(t){return Array.from(t.attributes).reduce((function(t,e){var n;return Object.assign({},t,((n={})[e.name]=e.value,n))}),{})},e.commonAttributes=function(){return o.__assign({},e.createDefaultAttributes(["class","id","style"]))},e.createDefaultAttributes=function(t){return void 0===t&&(t=[]),o.__assign({},t.reduce((function(t,e){var n;return o.__assign({},t,((n={})[e]={default:null},n))}),{}))},e.hole=0,e.isSchemaNode=function(t){return function(e){return e.type.name===t}},e.isTable=e.isSchemaNode("table"),e.isTableBody=e.isSchemaNode("table_body"),e.isTableHead=e.isSchemaNode("table_head"),e.isTableFoot=e.isSchemaNode("table_foot"),e.isTableRow=e.isSchemaNode("table_row"),e.isTableCell=e.isSchemaNode("table_cell"),e.isTableHeaderCell=e.isSchemaNode("table_header")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(8),i=n(42),a=function(t,e){return r.alignBlocks(r.alignRemoveRules)(t,e)},s={bold:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.bold,{applyToWord:t}))},cleanFormatting:function(t){return r.cleanFormatting(t)},createLink:function(t){return r.expandToWordWrap(r.applyLink,{mark:"link",attrs:t.value,applyToWord:t.applyToWord})},fontFamily:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"font-family",value:t.value,applyToWord:t.applyToWord})},fontSize:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"font-size",value:t.value+"px",applyToWord:t.applyToWord})},insertFile:function(t){return r.expandToWordWrap(r.applyLink,{mark:"link",attrs:t,applyToWord:t.applyToWord})},insertText:function(t){return r.insertText(t)},italic:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.italic,{applyToWord:t}))},strikethrough:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.strikethrough,{applyToWord:t}))},subscript:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.subscript,{applyToWord:t}))},superscript:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.superscript,{applyToWord:t}))},underline:function(t){return r.expandToWordWrap(r.toggleInlineFormat,o.__assign({},r.underline,{applyToWord:t}))},unlink:function(){return r.removeLink(r.link)},foreColor:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"color",value:t.value,applyToWord:t.applyToWord})},backColor:function(t){return r.expandToWordWrap(r.applyInlineStyle,{style:"background-color",value:t.value,applyToWord:t.applyToWord})},selectAll:function(){return function(t,e){return r.selectAll(t,e)}}},l={alignCenter:function(){return function(t,e){return r.isAligned(t,r.alignCenterRules)?a(t,e):r.alignBlocks(r.alignCenterRules)(t,e)}},alignJustify:function(){return function(t,e){return r.isAligned(t,r.alignJustifyRules)?a(t,e):r.alignBlocks(r.alignJustifyRules)(t,e)}},alignLeft:function(){return function(t,e){return r.isAligned(t,r.alignLeftRules)?a(t,e):r.alignBlocks(r.alignLeftRules)(t,e)}},alignRight:function(){return function(t,e){return r.isAligned(t,r.alignRightRules)?a(t,e):r.alignBlocks(r.alignRightRules)(t,e)}},format:function(t){return r.formatBlockElements(t.tag)},getHTML:function(){return r.getHtml},indent:function(){return r.indent},insertImage:function(t){return r.insertImage(t)},insertOrderedList:function(){return r.toggleOrderedList},insertUnorderedList:function(){return r.toggleUnorderedList},outdent:function(){return r.outdent},redo:function(){return r.redo},setHTML:function(t){var e=t.content,n=t.parseOptions;return r.setHtml(e,"setHTML",n)},undo:function(){return r.undo},blockquote:function(){return r.blockquote}},c={insertTable:function(t){return i.insertTable(t)},addColumnBefore:function(){return r.addColumnBefore},addColumnAfter:function(){return r.addColumnAfter},addRowBefore:function(){return r.addRowBefore},addRowAfter:function(){return r.addRowAfter},deleteRow:function(){return r.deleteRow},deleteColumn:function(){return r.deleteColumn},mergeCells:function(){return r.mergeCells},splitCell:function(){return r.splitCell},deleteTable:function(){return r.deleteTable}};e.editorCommands=Object.assign({},s,l,c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8);e.insertTable=function(t){return function(e,n){var r=o.createTable(e.schema.nodes,t.rows,t.cols);r&&o.insertNode(r,!0)(e,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(8),r=n(8);e.getToolbarState=function(t,e){return{alignCenter:{selected:r.isAligned(t,r.alignCenterRules),disabled:!1},alignJustify:{selected:r.isAligned(t,r.alignJustifyRules),disabled:!1},alignLeft:{selected:r.isAligned(t,r.alignLeftRules),disabled:!1},alignRight:{selected:r.isAligned(t,r.alignRightRules),disabled:!1},bold:{selected:r.hasMark(t,r.bold),disabled:!1},cleanFormatting:{selected:!1,disabled:!o.cleanFormatting()(t)},format:{selected:r.activeNode(t),disabled:!1},blockquote:{selected:!1,disabled:!o.blockquote(t)},indent:{selected:!1,disabled:!(r.canIndentAsListItem(t,t.schema.nodes.list_item)||r.canBeIndented(t,r.indentRules))},insertOrderedList:{selected:r.hasNode(t,t.schema.nodes.ordered_list),disabled:!1},insertUnorderedList:{selected:r.hasNode(t,t.schema.nodes.bullet_list),disabled:!1},italic:{selected:r.hasMark(t,r.italic),disabled:!1},unlink:{selected:!1,disabled:!r.hasMark(t,r.link)},outdent:{selected:!1,get disabled(){return!(r.hasNode(t,t.schema.nodes.blockquote)||r.canOutdentAsListItem(t,r.outdentRules)||o.isIndented(t,r.outdentRules.nodes))}},redo:{selected:!1,disabled:!r.redo(t)},selectAll:{selected:!1,disabled:!1},strikethrough:{selected:r.hasMark(t,r.strikethrough),disabled:!1},style:{selected:r.getActiveMarks(t,t.schema.marks.style),disabled:!1},subscript:{selected:r.hasMark(t,r.subscript),disabled:!1},superscript:{selected:r.hasMark(t,r.superscript),disabled:!1},underline:{selected:r.hasMark(t,r.underline),disabled:!1},undo:{selected:!1,disabled:!r.undo(t)},createLink:{selected:!1,get disabled(){var n=t.selection.empty;return e&&e.applyToWord&&n?r.expandSelection(t,(function(){}),e).state.selection.empty:n}},insertFile:{selected:!1,disabled:t.selection.empty},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},print:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!r.addColumnBefore(t)},addColumnAfter:{selected:!1,disabled:!r.addColumnAfter(t)},addRowBefore:{selected:!1,disabled:!r.addRowBefore(t)},addRowAfter:{selected:!1,disabled:!r.addRowAfter(t)},deleteRow:{selected:!1,disabled:!r.deleteRow(t)},deleteColumn:{selected:!1,disabled:!r.deleteColumn(t)},mergeCells:{selected:!1,disabled:!r.mergeCells(t)},splitCell:{selected:!1,disabled:!r.splitCell(t)},deleteTable:{selected:!1,disabled:!r.deleteTable(t)}}},e.initialToolBarState={alignCenter:{selected:!1,disabled:!1},alignJustify:{selected:!1,disabled:!1},alignLeft:{selected:!1,disabled:!1},alignRight:{selected:!1,disabled:!1},bold:{selected:!1,disabled:!1},italic:{selected:!1,disabled:!1},underline:{selected:!1,disabled:!1},strikethrough:{selected:!1,disabled:!1},subscript:{selected:!1,disabled:!1},superscript:{selected:!1,disabled:!1},format:{selected:{text:"Format",tag:null},disabled:!1},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!1},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!1},indent:{selected:!1,disabled:!1},outdent:{selected:!1,disabled:!1},insertOrderedList:{selected:!1,disabled:!1},insertUnorderedList:{selected:!1,disabled:!1},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!1},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!1},viewSource:{selected:!1,disabled:!1},insertTable:{selected:!1,disabled:!1},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!1}},e.disabledToolBarState={alignCenter:{selected:!1,disabled:!0},alignJustify:{selected:!1,disabled:!0},alignLeft:{selected:!1,disabled:!0},alignRight:{selected:!1,disabled:!0},bold:{selected:!1,disabled:!0},italic:{selected:!1,disabled:!0},underline:{selected:!1,disabled:!0},strikethrough:{selected:!1,disabled:!0},subscript:{selected:!1,disabled:!0},superscript:{selected:!1,disabled:!0},format:{selected:{text:"Format",tag:null},disabled:!0},style:{selected:{marks:[],hasNodesWithoutMarks:!1},disabled:!0},cleanFormatting:{selected:!1,disabled:!0},blockquote:{selected:!1,disabled:!0},indent:{selected:!1,disabled:!0},outdent:{selected:!1,disabled:!0},insertOrderedList:{selected:!1,disabled:!0},insertUnorderedList:{selected:!1,disabled:!0},unlink:{selected:!1,disabled:!0},redo:{selected:!1,disabled:!0},undo:{selected:!1,disabled:!0},print:{selected:!1,disabled:!0},createLink:{selected:!1,disabled:!0},insertFile:{selected:!1,disabled:!0},insertImage:{selected:!1,disabled:!0},viewSource:{selected:!1,disabled:!0},insertTable:{selected:!1,disabled:!0},addColumnBefore:{selected:!1,disabled:!0},addColumnAfter:{selected:!1,disabled:!0},addRowBefore:{selected:!1,disabled:!0},addRowAfter:{selected:!1,disabled:!0},deleteRow:{selected:!1,disabled:!0},deleteColumn:{selected:!1,disabled:!0},mergeCells:{selected:!1,disabled:!0},splitCell:{selected:!1,disabled:!0},deleteTable:{selected:!1,disabled:!0},selectAll:{selected:!1,disabled:!0}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultStyle='\n html, body {\n margin: 0;\n height: 100%;\n padding: 0;\n }\n\n html {\n min-height: 100%;\n }\n\n body {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n }\n\n body > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n }\n\n div.ProseMirror {\n position: relative;\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n }\n\n .ProseMirror pre {\n white-space: pre-wrap;\n }\n\n .k-content > p {\n margin: 0 0 1em;\n }\n\n .k-content table {\n white-space: pre-wrap;\n }\n\n .k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n }\n\n .k-content .k-text-highlighted {\n background-color: #bbdefb;\n }\n\n .k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n }\n\n .ProseMirror-hideselection *::selection { background: transparent; }\n .ProseMirror-hideselection *::-moz-selection { background: transparent; }\n .ProseMirror-hideselection { caret-color: transparent; }\n\n .ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n }\n\n .ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n }\n\n @keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n }\n\n .ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n }\n\n .k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n }\n\n .k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n }\n\n .k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n }\n\n .k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n }\n\n .k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n }\n\n .k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n }\n\n .k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n }\n\n .k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n }\n\n .k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n }\n\n .k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n }\n\n .ProseMirror .k-placeholder::before {\n content: attr(data-placeholder);\n height: 0;\n color: #8a8a8a;\n float: left;\n opacity: 1;\n cursor: text;\n -webkit-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n\n .ProseMirror li {\n position: relative;\n }\n\n li.ProseMirror-selectednode {\n outline: none;\n }\n\n li.ProseMirror-selectednode:after {\n content: "";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n }\n',e.tablesStyles='\n.ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n}\n\n.ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n}\n\n.ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n}\n\n.ProseMirror th {\n font-weight: bold;\n text-align: left;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n/* Give selected cells a blue overlay */\n.ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: "";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n}\n',e.rtlStyles="body { direction: rtl }"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(46),a=n(12),s=n(4),l=n(13),c=n(7),d=n(47),u=n(17),p=n(3),f=n(25),h=n(24),m=n(26),v=n(29),g=n(30),y=n(31),b=n(32),w=n(48),k=n(49),_=n(50),C=n(21),x=n(51),S=n(53),E=n(54),T=n(55),M=n(56),D=n(57),O=n(58),A=n(59),I=n(60),B=n(61),N=n(62),z=n(63),R=n(64),P=n(65),L=n(66),F=n(67),$=n(68),V=n(69),j=n(70),W=n(71),H=n(72),q=n(73),J=n(74),K=n(75),U=n(76),G=n(77),X=n(78),Y=n(79),Z=n(80),Q=n(81),tt=n(82),et=n(83),nt=n(84),ot=n(85),rt=n(86),it=n(87),at=n(88),st=n(89),lt=n(18),ct=n(19),dt=n(20),ut=n(33),pt=n(90),ft=n(91),ht=n(92),mt=[E.EditorAlignLeftButtonDirective,T.EditorAlignCenterButtonDirective,M.EditorAlignRightButtonDirective,D.EditorAlignJustifyButtonDirective,K.EditorInsertFileButtonDirective,A.EditorRedoButtonDirective,I.EditorUndoButtonDirective,B.EditorInsertImageButtonDirective,N.EditorIndentButtonDirective,z.EditorOutdentButtonDirective,R.EditorCreateLinkButtonDirective,P.EditorUnlinkButtonDirective,L.EditorInsertOrderedListButtonDirective,F.EditorInsertUnorderedListButtonDirective,$.EditorViewSourceButtonDirective,V.EditorBoldButtonDirective,j.EditorItalicButtonDirective,W.EditorUnderlineButtonDirective,H.EditorStrikethroughButtonDirective,q.EditorSubscriptButtonDirective,J.EditorSuperscriptButtonDirective,U.EditorForeColorDirective,G.EditorBackColorDirective,X.EditorCleanFormattingButtonDirective,Y.EditorAddColumnBeforeButtonDirective,Z.EditorAddColumnAfterButtonDirective,Q.EditorAddRowBeforeButtonDirective,tt.EditorAddRowAfterButtonDirective,et.EditorDeleteColumnButtonDirective,nt.EditorDeleteRowButtonDirective,ot.EditorDeleteTableButtonDirective,rt.EditorMergeCellsButtonDirective,it.EditorSplitCellButtonDirective,st.CustomMessagesComponent,at.LocalizedMessagesDirective,pt.DropDownToolDirective,ft.EditorPrintDirective,ht.EditorSelectAllButtonDirective,O.EditorBlockquoteDirective],vt=[k.EditorFontSizeComponent,_.EditorFontFamilyComponent,w.EditorFormatComponent,C.EditorColorPickerComponent,x.EditorInsertTableButtonComponent],gt=[m.FileLinkDialogComponent,f.ImageDialogComponent,h.SourceDialogComponent,v.FormatDialogComponent,g.ColorPickerDialogComponent,y.FontFamilyDialogComponent,ut.FontSizeDialogComponent,b.InsertTableDialogComponent],yt=[S.PopupTableGridComponent,lt.FormatDropDownListComponent,ct.FontFamilyDropDownListComponent,dt.FontSizeDropDownListComponent],bt=function(){function t(){}return t=o.__decorate([r.NgModule({declarations:[p.EditorComponent,mt,vt,gt,yt],entryComponents:[gt],exports:[p.EditorComponent,mt,vt,s.ToolBarModule,d.ButtonModule,a.FormsModule,a.ReactiveFormsModule,yt],imports:[i.CommonModule,a.FormsModule,a.ReactiveFormsModule,d.ButtonModule,u.ColorPickerModule,c.DialogModule,l.DropDownsModule,u.NumericTextBoxModule,u.CheckBoxModule,s.ToolBarModule,u.TextBoxModule]})],t)}();e.EditorModule=bt},function(t,e){t.exports=u},function(t,e){t.exports=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(7),s=n(9),l=n(3),c=n(2),d=n(29),u=n(18),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"Paragraph",tag:"p"},{text:"Heading 1",tag:"h1"},{text:"Heading 2",tag:"h2"},{text:"Heading 3",tag:"h3"},{text:"Heading 4",tag:"h4"},{text:"Heading 5",tag:"h5"},{text:"Heading 6",tag:"h6"}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.formatDropDownList||t.formatDropDownList.dropDownList.isOpen)||null===e.dataItem.tag},setTimeout((function(){t.defaultItem={text:t.title,tag:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.format,o=t.data.findIndex((function(t){return t.tag===n.selected.tag}));t.value=-1!==o?n.selected.tag:null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){s.isPresent(t)&&(this.editor.exec("format",{tag:t}),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.tag===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){var t=this.formatDropDownList.element;if(t)return s.outerWidth(t.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("format")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:d.FormatDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.formatButton.nativeElement.focus():this.formatDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("formatDropDownList",{static:!1}),o.__metadata("design:type",u.FormatDropDownListComponent)],e.prototype,"formatDropDownList",void 0),o.__decorate([r.ViewChild("formatButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"formatButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFormat]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-format-dropdownlist\n #formatDropDownList\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-format-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #formatButton\n [tabindex]="tabindex"\n type="button"\n kendoButton\n class="k-overflow-button"\n [icon]="\'apply-format\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[l.EditorComponent,a.DialogService,c.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFormatComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(9),s=n(3),l=n(2),c=n(7),d=n(33),u=n(20),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"8px",size:8},{text:"10px",size:10},{text:"12px",size:12},{text:"14px",size:14},{text:"18px",size:18},{text:"24px",size:24},{text:"36px",size:36}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontSizeDropDownList||t.fontSizeDropDownList.dropDownList.isOpen)||null===e.dataItem.size},setTimeout((function(){t.defaultItem={text:t.title,size:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=(a.getUniqueStyleValues(n.selected,"font-size").match(/\d+/g)||[null])[0],t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("fontSize",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.size===parseInt(t,10)}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontSize")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:d.FontSizeDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontSizeButton.nativeElement.focus():this.fontSizeDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:u.FontSizeDropDownListComponent,static:!1}),o.__metadata("design:type",u.FontSizeDropDownListComponent)],e.prototype,"fontSizeDropDownList",void 0),o.__decorate([r.ViewChild("fontSizeButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"fontSizeButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontSize]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontsize-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontsize-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontSizeButton\n class="k-overflow-button"\n [icon]="\'font-size\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[s.EditorComponent,c.DialogService,l.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontSizeComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(9),s=n(3),l=n(2),c=n(7),d=n(31),u=n(19),p=n(5),f=function(t){function e(e,n,o,i){var a=t.call(this)||this;return a.editor=e,a.dialogService=n,a.localization=o,a.toolsService=i,a.disabled=!1,a.tabindex=-1,a.valueChange=new r.EventEmitter,a._data=[{text:"Arial",fontName:'Arial,"Helvetica Neue",Helvetica,sans-serif'},{text:"Courier New",fontName:'"Courier New",Courier,"Lucida Sans Typewriter","Lucida Typewriter",monospace'},{text:"Georgia",fontName:'Georgia,Times,"Times New Roman",serif'},{fontName:'Impact,Haettenschweiler,"Franklin Gothic Bold",Charcoal,"Helvetica Inserat","Bitstream Vera Sans Bold","Arial Black","sans serif"',text:"Impact"},{text:"Lucida Console",fontName:'"Lucida Console","Lucida Sans Typewriter",monaco,"Bitstream Vera Sans Mono",monospace'},{text:"Tahoma",fontName:"Tahoma,Verdana,Segoe,sans-serif"},{text:"Times New Roman",fontName:'TimesNewRoman,"Times New Roman",Times,Baskerville,Georgia,serif'},{text:"Trebuchet MS",fontName:'"Trebuchet MS","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Tahoma,sans-serif'},{text:"Verdana",fontName:"Verdana,Geneva,sans-serif"}],a}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(t){this._data=t||this._data},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var t=this;this.itemDisabled=function(e){return!(t.overflows||!t.fontFamilyDropDownList||t.fontFamilyDropDownList.dropDownList.isOpen)||null===e.dataItem.fontName},setTimeout((function(){t.defaultItem={text:t.title,fontName:null},t.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(e){var n=e.style;t.value=a.getUniqueStyleValues(n.selected,"font-family")||null,t.disabled=n.disabled}))},e.prototype.onValueChange=function(t){a.isPresent(t)&&(this.editor.exec("fontFamily",t),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(e){return e.fontName===t}))))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("fontFamily")},enumerable:!0,configurable:!0}),e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:d.FontFamilyDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontFamilyButton.nativeElement.focus():this.fontFamilyDropDownList.focus()},e.prototype.handleKey=function(){return this.tabindex=-1,!1},o.__decorate([r.Input(),o.__metadata("design:type",Array),o.__metadata("design:paramtypes",[Array])],e.prototype,"data",null),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],e.prototype,"valueChange",void 0),o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("element",{read:u.FontFamilyDropDownListComponent,static:!1}),o.__metadata("design:type",u.FontFamilyDropDownListComponent)],e.prototype,"fontFamilyDropDownList",void 0),o.__decorate([r.ViewChild("fontFamilyButton",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"fontFamilyButton",void 0),e=n=o.__decorate([r.Component({providers:[{provide:i.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-toolbar-dropdownlist[kendoEditorFontFamily]",template:'\n <ng-template #toolbarTemplate>\n <kendo-editor-fontfamily-dropdownlist\n #element\n [defaultItem]="defaultItem"\n [data]="data"\n [(value)]="value"\n [itemDisabled]="itemDisabled"\n [title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (valueChange)="onValueChange($event)"\n >\n </kendo-editor-fontfamily-dropdownlist>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n tabindex="-1"\n type="button"\n kendoButton\n #fontFamilyButton\n class="k-overflow-button"\n [icon]="\'font-family\'"\n [attr.title]="title"\n [disabled]="disabled"\n [tabindex]="tabindex"\n (click)="openDialog()"\n >\n {{ title }}\n </button>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[s.EditorComponent,c.DialogService,l.EditorLocalizationService,p.EditorToolsService])],e)}(i.ToolBarToolComponent);e.EditorFontFamilyComponent=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(15),a=n(16),s=n(4),l=n(52),c=n(9),d=n(3),u=n(2),p=n(7),f=n(32),h=n(10),m=function(t){function e(e,n,o,s){var l=t.call(this)||this;return l.editor=e,l.localization=n,l.popupService=o,l.dialogService=s,l.open=!1,l.buttonBlurred=new r.EventEmitter,l.cellClicked=new r.EventEmitter,l.subs=l.editor.stateChange.subscribe((function(t){var e=t.insertTable;l.disabled=e.disabled})),l.subs.add(l.buttonBlurred.pipe(a.concatMap((function(){return i.interval(200).pipe(a.take(1),a.takeUntil(l.cellClicked))}))).subscribe((function(){l.toggle(!1)}))),l}var n;return o.__extends(e,t),n=e,e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.subs&&this.subs.unsubscribe()},Object.defineProperty(e.prototype,"outerWidth",{get:function(){if(this.element)return c.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return this.localization.get("insertTable")},enumerable:!0,configurable:!0}),e.prototype.toggle=function(t){this.open=void 0===t?!this.open:t,this.destroyPopup(),this.open&&this.createPopup()},e.prototype.openDialog=function(){var t={appendTo:this.editor.dialogContainer,content:f.InsertTableDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(t).content.instance.setData({editor:this.editor})},e.prototype.onBlur=function(){this.tabIndex=-1,this.buttonBlurred.emit()},e.prototype.onCellClick=function(t){this.cellClicked.emit(),this.toggle(!1),this.editor.exec("insertTable",t)},e.prototype.canFocus=function(){return!this.disabled},e.prototype.focus=function(){this.tabIndex=0,this.getButton().focus()},e.prototype.handleKey=function(t){return t.keyCode===h.Keys.Space||t.keyCode===h.Keys.Enter||(this.tabIndex=-1,!1)},e.prototype.onTableWizardClick=function(){},e.prototype.createPopup=function(){var t="rtl"===this.editor.direction?"right":"left",e={horizontal:t,vertical:"bottom"},n={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.element,anchorAlign:e,animate:!0,content:this.popupGridTemplate,popupAlign:n,popupClass:"k-ct-popup k-group k-reset k-state-border-up",positionMode:"absolute"});var o=this.popupRef.popupElement;o.style.width="190px",o.style.height="164px",o.setAttribute("dir",this.editor.direction)},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},e.prototype.getButton=function(){return(this.overflows?this.overflowElement:this.element).nativeElement},o.__decorate([r.ViewChild("toolbarTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"toolbarTemplate",void 0),o.__decorate([r.ViewChild("popupTemplate",{static:!1}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupTemplate",void 0),o.__decorate([r.ViewChild("element",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"element",void 0),o.__decorate([r.ViewChild("overflowElement",{static:!1}),o.__metadata("design:type",r.ElementRef)],e.prototype,"overflowElement",void 0),o.__decorate([r.ViewChild("popupGridTemplate",{static:!0}),o.__metadata("design:type",r.TemplateRef)],e.prototype,"popupGridTemplate",void 0),e=n=o.__decorate([r.Component({providers:[{provide:s.ToolBarToolComponent,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-editor-insert-table-button",template:'\n <ng-template #toolbarTemplate>\n <button\n type="button"\n kendoButton\n #element\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="toggle()"\n (blur)="onBlur()"\n ></button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n kendoButton\n #overflowElement\n [attr.title]="title"\n [attr.tabindex]="tabIndex"\n [icon]="\'table-insert\'"\n [disabled]="disabled"\n (click)="openDialog()">\n {{ title }}\n </button>\n </ng-template>\n <ng-template #popupGridTemplate>\n <kendo-popup-table-grid (cellClick)="onCellClick($event)" (tableWizardClick)="onTableWizardClick()"></kendo-popup-table-grid>\n </ng-template>\n '}),o.__param(0,r.Host()),o.__metadata("design:paramtypes",[d.EditorComponent,u.EditorLocalizationService,l.PopupService,p.DialogService])],e)}(s.ToolBarToolComponent);e.EditorInsertTableButtonComponent=m},function(t,e){t.exports=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(){function t(){this.cellClick=new r.EventEmitter,this.tableWizardClick=new r.EventEmitter,this.state={rows:-1,cols:-1},this.rows=6,this.cols=8}return Object.defineProperty(t.prototype,"message",{get:function(){var t=this.state,e=t.rows,n=t.cols;return"Create a "+(e>-1?e+1:"")+" "+(n>-1?"x":"")+" "+(n>-1?n+1:"")+" table"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cells",{get:function(){return Array.from(Array(this.rows*this.cols).keys())},enumerable:!0,configurable:!0}),t.prototype.selected=function(t){var e=this.state,n=e.rows,o=e.cols,r=Math.floor(t/this.cols),i=t%this.cols;return r<=n&&i<=o},t.prototype.setState=function(t){var e=Math.floor(t/this.cols),n=t%this.cols;this.state={rows:e,cols:n}},t.prototype.resetState=function(){this.state={rows:-1,cols:-1}},t.prototype.insertTable=function(){this.cellClick.emit(this.state)},t.prototype.openTableWizard=function(){this.tableWizardClick.emit()},o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"cellClick",void 0),o.__decorate([r.Output(),o.__metadata("design:type",r.EventEmitter)],t.prototype,"tableWizardClick",void 0),t=o.__decorate([r.Component({selector:"kendo-popup-table-grid",template:'\n <div style="border-color: inherit;" (mouseleave)="resetState()" (click)="insertTable()">\n <span *ngFor="let i of cells"\n class="k-ct-cell"\n [class.k-state-selected]="selected(i)"\n [class.k-state-disabled]="!selected(i)"\n (mouseenter)="setState(i)">\n </span>\n </div>\n <div class="k-status" unselectable="on">{{ message }}</div>\n \x3c!-- uncomment when TableWizard is completed\n <div class="k-editor-toolbar" unselectable="on">\n <button type="button" kendoButton class="k-tool" [icon]="\'table-wizard\'" (click)="openTableWizard()" title="Table Wizard">Table Wizard</button>\n </div>\n --\x3e\n '})],t)}();e.PopupTableGridComponent=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"alignLeft",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignLeftButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignLeftButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"alignCenter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignCenterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignCenterButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"alignRight",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignRightButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignRightButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"alignJustify",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAlignJustifyButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAlignJustifyButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){var i=t.call(this,"blockquote",e,n,o,r)||this;return i.editor=n,i}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorBlockquoteButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorBlockquoteDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"redo",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorRedoButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorRedoButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"undo",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUndoButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUndoButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"insertImage",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertImageButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorInsertImageButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"indent",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorIndentButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorIndentButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"outdent",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorOutdentButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorOutdentButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"createLink",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorCreateLinkButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorCreateLinkButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"unlink",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUnlinkButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUnlinkButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"insertOrderedList",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertOrderedListButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorInsertOrderedListButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"insertUnorderedList",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertUnorderedListButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorInsertUnorderedListButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(14),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"viewSource",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorViewSourceButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandDialog);e.EditorViewSourceButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"bold",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorBoldButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorBoldButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"italic",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorItalicButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorItalicButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"underline",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorUnderlineButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorUnderlineButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"strikethrough",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorStrikethroughButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorStrikethroughButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"subscript",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSubscriptButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSubscriptButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"superscript",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSuperscriptButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSuperscriptButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(3),a=n(14),s=n(4),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"insertFile",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorInsertFileButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[s.ToolBarButtonComponent,i.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(a.EditorCommandDialog);e.EditorInsertFileButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(21),a=n(22),s=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=a.commandIcons.foreColor,this.colorPicker.editorCommand="foreColor"}return t=o.__decorate([r.Directive({selector:"[kendoEditorForeColor]"}),o.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorForeColorDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(21),a=n(22),s=function(){function t(t){this.colorPicker=t,this.colorPicker.icon=a.commandIcons.backColor,this.colorPicker.editorCommand="backColor"}return t=o.__decorate([r.Directive({selector:"[kendoEditorBackColor]"}),o.__metadata("design:paramtypes",[i.EditorColorPickerComponent])],t)}();e.EditorBackColorDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"cleanFormatting",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorCleanFormattingButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorCleanFormattingButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"addColumnBefore",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnBeforeButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddColumnBeforeButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"addColumnAfter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnAfterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddColumnAfterButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"addRowBefore",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowBeforeButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddRowBeforeButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"addRowAfter",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowAfterButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorAddRowAfterButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"deleteColumn",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteColumnButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteColumnButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"deleteRow",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteRowButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteRowButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"deleteTable",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteTableButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorDeleteTableButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"mergeCells",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorMergeCellsButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorMergeCellsButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"splitCell",e,n,o,r)||this}return o.__extends(e,t),e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSplitCellButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSplitCellButtonDirective=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=n(35),s=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return o.__extends(e,t),n=e,e=n=o.__decorate([r.Directive({providers:[{provide:a.Messages,useExisting:r.forwardRef((function(){return n}))}],selector:"[kendoEditorLocalizedMessages]"}),o.__metadata("design:paramtypes",[i.LocalizationService])],e)}(a.Messages);e.LocalizedMessagesDirective=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(11),a=n(35),s=function(t){function e(e){var n=t.call(this)||this;return n.service=e,n}var n;return o.__extends(e,t),n=e,Object.defineProperty(e.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),e=n=o.__decorate([r.Component({providers:[{provide:a.Messages,useExisting:r.forwardRef((function(){return n}))}],selector:"kendo-editor-messages",template:""}),o.__metadata("design:paramtypes",[i.LocalizationService])],e)}(a.Messages);e.CustomMessagesComponent=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=function(){function t(t,e){this.hostEl=t,this.zone=e,this.preventDefault=function(t){t.preventDefault()}}return Object.defineProperty(t.prototype,"hostElement",{get:function(){return this.hostEl.nativeElement},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.zone.runOutsideAngular((function(){t.hostElement.addEventListener("pointerdown",t.preventDefault)}))},t.prototype.ngOnDestroy=function(){this.hostElement.removeEventListener("pointerdown",this.preventDefault)},t=o.__decorate([r.Directive({selector:"[kendoEditorDropDownTool]"}),o.__metadata("design:paramtypes",[r.ElementRef,r.NgZone])],t)}();e.DropDownToolDirective=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(27),d=n(5),u=function(t){function e(e,n,o,r){var i=t.call(this,"print",e,n,o,r)||this;return i.editor=n,i}return o.__extends(e,t),e.prototype.ngAfterViewInit=function(){if(r.isDevMode&&!this.editor.iframe)throw new Error(c.EditorErrorMessages.printTool)},e.prototype.clickHandler=function(){if(this.editor.iframe){var t=this.editor.view,e=t&&t.dom,n=e&&e.ownerDocument,o=n&&n.defaultView;o&&o.print()}},e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorPrintButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,d.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorPrintDirective=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(1),i=n(4),a=n(3),s=n(6),l=n(2),c=n(5),d=function(t){function e(e,n,o,r){return t.call(this,"selectAll",e,n,o,r)||this}return o.__extends(e,t),e.prototype.clickHandler=function(){this.editor.shouldEmitFocus=!0,t.prototype.clickHandler.call(this)},e=o.__decorate([r.Directive({selector:"kendo-toolbar-button[kendoEditorSelectAllButton]"}),o.__param(1,r.Host()),o.__metadata("design:paramtypes",[i.ToolBarButtonComponent,a.EditorComponent,l.EditorLocalizationService,c.EditorToolsService])],e)}(s.EditorCommandButton);e.EditorSelectAllButtonDirective=d}])}));