@progress/kendo-angular-editor 3.1.1 → 3.1.3-dev.202203090959
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-angular-editor.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/package-metadata.js +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/fesm2015/index.js +1 -1
- package/dist/fesm5/index.js +1 -1
- package/dist/npm/package-metadata.js +1 -1
- package/dist/systemjs/kendo-angular-editor.js +1 -1
- package/package.json +2 -2
|
@@ -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(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,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}));
|
|
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 i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function o(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}function s(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}function c(e,t){return function(n,i){t(n,i,e)}}function d(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function p(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}function u(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}function h(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||(t[n]=e[n])}function f(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function b(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,o,r=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function m(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(b(arguments[t]));return e}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var i=Array(e),o=0;for(t=0;t<n;t++)for(var r=arguments[t],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i}function v(e){return this instanceof v?(this.v=e,this):new v(e)}function y(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i,o=n.apply(e,t||[]),r=[];return i={},a("next"),a("throw"),a("return"),i[Symbol.asyncIterator]=function(){return this},i;function a(e){o[e]&&(i[e]=function(t){return new Promise((function(n,i){r.push([e,t,n,i])>1||s(e,t)}))})}function s(e,t){try{(n=o[e](t)).value instanceof v?Promise.resolve(n.value.v).then(c,d):l(r[0][2],n)}catch(e){l(r[0][3],e)}var n}function c(e){s("next",e)}function d(e){s("throw",e)}function l(e,t){e(t),r.shift(),r.length&&s(r[0][0],r[0][1])}}function _(e){var t,n;return t={},i("next"),i("throw",(function(e){throw e})),i("return"),t[Symbol.iterator]=function(){return this},t;function i(i,o){t[i]=e[i]?function(t){return(n=!n)?{value:v(e[i](t)),done:"return"===i}:o?o(t):t}:o}}function O(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=f(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,o){(function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)})(i,o,(t=e[n](t)).done,t.value)}))}}}function j(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function C(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function k(e){return e&&e.__esModule?e:{default:e}}function w(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,n){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,n),n}},function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t),n.d(t,"ResizeService",(function(){return M})),n.d(t,"PreventableEvent",(function(){return U})),n.d(t,"DraggableDirective",(function(){return f})),n.d(t,"DraggableModule",(function(){return b})),n.d(t,"closestInScope",(function(){return m})),n.d(t,"closest",(function(){return g})),n.d(t,"contains",(function(){return v})),n.d(t,"findElement",(function(){return y})),n.d(t,"findFocusableChild",(function(){return k})),n.d(t,"findFocusable",(function(){return w})),n.d(t,"hasClasses",(function(){return x})),n.d(t,"isFocusableWithTabKey",(function(){return C})),n.d(t,"isFocusable",(function(){return O})),n.d(t,"isVisible",(function(){return j})),n.d(t,"matchesClasses",(function(){return E})),n.d(t,"matchesNodeName",(function(){return T})),n.d(t,"rtlScrollPosition",(function(){return D})),n.d(t,"EventsOutsideAngularDirective",(function(){return P})),n.d(t,"EventsModule",(function(){return A})),n.d(t,"ResizeSensorComponent",(function(){return H})),n.d(t,"ResizeBatchService",(function(){return V})),n.d(t,"ResizeCompatService",(function(){return F})),n.d(t,"ResizeObserverService",(function(){return L})),n.d(t,"ResizeSensorModule",(function(){return $})),n.d(t,"KendoInput",(function(){return W})),n.d(t,"isDocumentAvailable",(function(){return d})),n.d(t,"isChanged",(function(){return l})),n.d(t,"anyChanged",(function(){return p})),n.d(t,"hasObservers",(function(){return u})),n.d(t,"guid",(function(){return h})),n.d(t,"Keys",(function(){return B}));var i=n(0),o=n(1),r=n(26),a=n(12),s=n(4),c=n(5),d=function(){return"undefined"!=typeof document},l=function(e,t,n){return void 0===n&&(n=!0),!(void 0===t[e]||t[e].isFirstChange()&&n||t[e].previousValue===t[e].currentValue)},p=function(e,t,n){return void 0===n&&(n=!0),e.some((function(e){return l(e,t,n)}))},u=function(e){return e&&e.observers.length>0},h=function(){for(var e="",t=0;t<32;t++){var n=16*Math.random()|0;8!==t&&12!==t&&16!==t&&20!==t||(e+="-"),e+=(12===t?4:16===t?3&n|8:n).toString(16)}return e},f=function(){function e(e,t){this.element=e,this.ngZone=t,this.enableDrag=!0,this.kendoPress=new o.EventEmitter,this.kendoDrag=new o.EventEmitter,this.kendoRelease=new o.EventEmitter}return e.prototype.ngOnInit=function(){this.toggleDraggable()},e.prototype.ngOnChanges=function(e){l("enableDrag",e)&&this.toggleDraggable()},e.prototype.ngOnDestroy=function(){this.destroyDraggable()},e.prototype.toggleDraggable=function(){var e=this;d()&&(this.destroyDraggable(),this.enableDrag&&(this.draggable=new r.a({drag:function(t){return e.kendoDrag.next(t)},press:function(t){return e.kendoPress.next(t)},release:function(t){return e.kendoRelease.next(t)}}),this.ngZone.runOutsideAngular((function(){return e.draggable.bindTo(e.element.nativeElement)}))))},e.prototype.destroyDraggable=function(){this.draggable&&(this.draggable.destroy(),this.draggable=null)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"enableDrag",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"kendoPress",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"kendoDrag",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"kendoRelease",void 0),e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoDraggable]"}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.NgZone])],e)}(),b=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[f],exports:[f],imports:[a.CommonModule]})],e)}(),m=function(e,t,n){for(;e&&e!==n&&!t(e);)e=e.parentNode;if(e!==n)return e},g=function(e,t){for(;e&&!t(e);)e=e.parentNode;return e},v=function(e,t,n){if(void 0===n&&(n=!1),!g(t,(function(t){return t===e})))return!1;var i=g(t,(function(e){return e===t}));return i&&(n||i!==e)},y=function(e,t,n){if(void 0===n&&(n=!0),e){if(n&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){var i=y(e,t);if(i)return i}e=e.nextSibling}}},_=/^(?:a|input|select|option|textarea|button|object)$/i,O=function(e){if(!e.tagName)return!1;var t=e.tagName.toLowerCase(),n=Boolean(e.getAttribute("tabIndex"));return!e.disabled&&_.test(t)||n},j=function(e){var t=e.getBoundingClientRect(),n=t.width>0&&t.height>0,i=0!==t.x&&0!==t.y;return(n||i)&&"hidden"!==window.getComputedStyle(e).visibility},C=function(e,t){if(void 0===t&&(t=!0),!O(e))return!1;var n=e.getAttribute("tabIndex");return(!t||j(e))&&"-1"!==n},k=function(e,t){return void 0===t&&(t=!0),y(e,(function(e){return C(e,t)}),!1)},w=function(e,t){return void 0===t&&(t=!0),y(e,(function(e){return C(e,t)}))},S=function(e){return String(e).trim().split(" ")},x=function(e,t){var n=S(t);return Boolean(S(e.className).find((function(e){return n.indexOf(e)>=0})))},E=function(e){return function(t){return x(t,e)}},I={},T=function(e){return I[e]||(I[e]=function(t){return String(t.nodeName).toLowerCase()===e.toLowerCase()}),I[e]};function D(e,t,n){var i=e;return n<0?i=-e:n>0&&(i=t.scrollWidth-t.offsetWidth-e),i}var B,P=function(){function e(e,t,n){this.element=e,this.ngZone=t,this.renderer=n,this.events={}}return e.prototype.ngOnInit=function(){var e=this;if(this.element&&this.element.nativeElement){var t=this.events;this.subscriptions=[],this.ngZone.runOutsideAngular((function(){for(var n in t)t.hasOwnProperty(n)&&e.subscriptions.push(e.renderer.listen(e.element.nativeElement,n,e.scope?t[n].bind(e.scope):t[n]))}))}},e.prototype.ngOnDestroy=function(){if(this.subscriptions){for(var e=0;e<this.subscriptions.length;e++)this.subscriptions[e]();this.subscriptions=null}},Object(i.__decorate)([Object(o.Input)("kendoEventsOutsideAngular"),Object(i.__metadata)("design:type",Object)],e.prototype,"events",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"scope",void 0),e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoEventsOutsideAngular]"}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.NgZone,o.Renderer2])],e)}(),A=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[P],exports:[P]})],e)}(),M=function(){function e(e){this.resizeBatchService=e,this.resize=new o.EventEmitter,this.acceptedSize=!1,this.state=0}return e.prototype.acceptSize=function(e){void 0===e&&(e=this.measure()),this.lastWidth=e.width,this.lastHeight=e.height,this.acceptedSize=!0},e.prototype.checkChanges=function(){d()&&0===this.state&&(this.state=1,this.resizeBatchService.schedule(this,this.init))},e.prototype.destroy=function(){this.resizeBatchService.cancel(this)},e.prototype.checkSize=function(){if(this.parentElement){var e=this.measure(),t=e.width,n=e.height;if(!(t===this.lastWidth&&n===this.lastHeight))return this.lastWidth=t,this.lastHeight=n,this.acceptedSize=!1,this.resize.emit(),!0}},e.prototype.initSize=function(){var e=this.measure();this.lastWidth=e.width,this.lastHeight=e.height},e.prototype.measure=function(){var e=0,t=0;return this.parentElement&&(t=this.parentElement.offsetHeight,e=this.parentElement.offsetWidth),{height:t,width:e}},e}(),z=function(e){var t=document.createElement("div");return t.style.cssText=e,t},R="position: absolute; display: block; left: 0; top: 0; right: 0; bottom: 0; z-index: -1;overflow: hidden; visibility: hidden;",F=function(e){function t(t,n,i){var o=e.call(this,t)||this;return o.element=n,o.ngZone=i,o}return Object(i.__extends)(t,e),t.prototype.checkChanges=function(){2!==this.state?e.prototype.checkChanges.call(this):this.resizeBatchService.isScheduled(this)||this.resizeBatchService.schedule(this,this.checkSize)},t.prototype.destroy=function(){if(e.prototype.destroy.call(this),this.subscription&&this.subscription.unsubscribe(),this.expand){var t=this.element.nativeElement;t.removeChild(this.expand),t.removeChild(this.shrink),this.expand.removeChild(this.expandChild),this.expand=this.expandChild=this.shrink=this.element=null}},t.prototype.checkSize=function(){if(e.prototype.checkSize.call(this))return this.reset(),!0},t.prototype.init=function(){var e,t=this.parentElement=this.element.nativeElement.parentElement;"static"===(e="position",getComputedStyle(t,null).getPropertyValue(e))&&(t.style.position="relative"),this.state=2,this.render(),this.reset(),this.initSize(),this.subscribe()},t.prototype.render=function(){var e=this.element.nativeElement;e.style.cssText=R,e.setAttribute("dir","ltr"),this.expand=z(R),this.expandChild=z("position: absolute; left: 0; top: 0; transition: 0s;"),this.expand.appendChild(this.expandChild),e.appendChild(this.expand),this.shrink=z(R);var t=z("position: absolute; left: 0; top: 0; transition: 0s;width: 200%; height: 200%;");this.shrink.appendChild(t),e.appendChild(this.shrink)},t.prototype.reset=function(){var e=this.expandChild;e.style.width="100000px",e.style.height="100000px";var t=this.expand;t.scrollLeft=1e5,t.scrollTop=1e5;var n=this.shrink;n.scrollLeft=1e5,n.scrollTop=1e5},t.prototype.subscribe=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.subscription=Object(c.merge)(Object(c.fromEvent)(e.shrink,"scroll"),Object(c.fromEvent)(e.expand,"scroll")).subscribe((function(){e.checkSize()}))}))},t}(M),N="undefined"!=typeof ResizeObserver,L=function(e){function t(t,n,i){var o=e.call(this,t)||this;return o.element=n,o.ngZone=i,o}return Object(i.__extends)(t,e),t.supported=function(){return N},t.prototype.destroy=function(){e.prototype.destroy.call(this),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.parentElement=null},t.prototype.init=function(){var e=this;this.parentElement=this.element.nativeElement.parentElement,this.initSize(),this.state=2,this.ngZone.runOutsideAngular((function(){e.resizeObserver=new ResizeObserver((function(){e.checkSize()})),e.resizeObserver.observe(e.parentElement)}))},t}(M),V=function(){function e(e){this.ngZone=e,this.scheduled=[],this.resolvedPromise=Promise.resolve(null),this.flush=this.flush.bind(this)}return e.prototype.schedule=function(e,t){var n=this;this.scheduled.push({instance:e,method:t}),this.subscription||this.ngZone.runOutsideAngular((function(){n.subscription=Object(c.from)(n.resolvedPromise).subscribe(n.flush)}))},e.prototype.isScheduled=function(e){return Boolean(this.scheduled.find((function(t){return t.instance===e})))},e.prototype.cancel=function(e){for(var t=this.scheduled,n=t.length,i=0;i<n;i++)if(t[i].instance===e)return t.splice(i,1),void(t.length||this.unsubscribe())},e.prototype.ngOnDestroy=function(){this.unsubscribe()},e.prototype.unsubscribe=function(){this.subscription&&(this.subscription.unsubscribe(),this.subscription=null)},e.prototype.flush=function(){this.scheduled.forEach((function(e){e.method.call(e.instance)})),this.scheduled=[],this.unsubscribe()},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__metadata)("design:paramtypes",[o.NgZone])],e)}(),H=function(){function e(e,t,n){var i=this;this.rateLimit=10,this.resize=new o.EventEmitter;var r=L.supported()?L:F;this.resizeService=new r(e,t,n);var a=1e3/(this.rateLimit||10);this.subscription=this.resizeService.resize.pipe(Object(s.auditTime)(a)).subscribe((function(){i.resizeService.acceptedSize||i.resize.emit()}))}return e.prototype.ngAfterViewChecked=function(){this.resizeService.checkChanges()},e.prototype.ngOnDestroy=function(){this.subscription.unsubscribe(),this.resizeService.destroy()},e.prototype.acceptSize=function(e){this.resizeService.acceptSize(e)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"rateLimit",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"resize",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-resize-sensor",template:""}),Object(i.__metadata)("design:paramtypes",[V,o.ElementRef,o.NgZone])],e)}(),K=[H],$=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[K],exports:[K],providers:[V]})],e)}(),W=function(){};!function(e){e[e.Alt=18]="Alt",e[e.ArrowDown=40]="ArrowDown",e[e.ArrowLeft=37]="ArrowLeft",e[e.ArrowRight=39]="ArrowRight",e[e.ArrowUp=38]="ArrowUp",e[e.Backspace=8]="Backspace",e[e.Control=17]="Control",e[e.Delete=46]="Delete",e[e.Digit0=48]="Digit0",e[e.Digit1=49]="Digit1",e[e.Digit2=50]="Digit2",e[e.Digit3=51]="Digit3",e[e.Digit4=52]="Digit4",e[e.Digit5=53]="Digit5",e[e.Digit6=54]="Digit6",e[e.Digit7=55]="Digit7",e[e.Digit8=56]="Digit8",e[e.Digit9=57]="Digit9",e[e.End=35]="End",e[e.Enter=13]="Enter",e[e.Escape=27]="Escape",e[e.F1=112]="F1",e[e.F2=113]="F2",e[e.F10=121]="F10",e[e.Home=36]="Home",e[e.Insert=45]="Insert",e[e.KeyA=65]="KeyA",e[e.KeyB=66]="KeyB",e[e.KeyC=67]="KeyC",e[e.KeyD=68]="KeyD",e[e.KeyE=69]="KeyE",e[e.KeyF=70]="KeyF",e[e.KeyG=71]="KeyG",e[e.KeyH=72]="KeyH",e[e.KeyI=73]="KeyI",e[e.KeyJ=74]="KeyJ",e[e.KeyK=75]="KeyK",e[e.KeyL=76]="KeyL",e[e.KeyM=77]="KeyM",e[e.KeyN=78]="KeyN",e[e.KeyO=79]="KeyO",e[e.KeyP=80]="KeyP",e[e.KeyQ=81]="KeyQ",e[e.KeyR=82]="KeyR",e[e.KeyS=83]="KeyS",e[e.KeyT=84]="KeyT",e[e.KeyU=85]="KeyU",e[e.KeyV=86]="KeyV",e[e.KeyW=87]="KeyW",e[e.KeyX=88]="KeyX",e[e.KeyY=89]="KeyY",e[e.KeyZ=90]="KeyZ",e[e.NumpadDecimal=110]="NumpadDecimal",e[e.PageDown=34]="PageDown",e[e.PageUp=33]="PageUp",e[e.Shift=16]="Shift",e[e.Space=32]="Space",e[e.Tab=9]="Tab"}(B||(B={}));var U=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}()},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t){e.exports=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(3),a=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return i.__extends(t,e),t=i.__decorate([i.__param(0,o.Inject(r.L10N_PREFIX)),i.__param(1,o.Optional()),i.__param(2,o.Optional()),i.__param(2,o.Inject(r.RTL)),i.__metadata("design:paramtypes",[String,r.MessageService,Boolean])],t)}(r.LocalizationService);t.EditorLocalizationService=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(10),a=n(5),s=n(4),c=n(9),d=n(18),l=n(2),p=n(21),u=n(13),h=n(47),f=n(32),b=n(50),m=n(52),g=n(22),v=n(33),y=n(34),_=n(35),O=n(3),j=n(6),C=n(53),k=n(36),w=n(11),S=n(37),x={convertMsLists:!1,removeAttributes:[],removeHtmlComments:!1,removeInvalidHTML:!0,removeMsClasses:!1,removeMsStyles:!1,stripTags:[]},E=g.conditionallyExecute(p.removeComments),I=g.conditionallyExecute(p.sanitize),T=function(e){if("all"===e.removeAttributes)return{"*":p.removeAttribute};var t=g.removeEmptyEntries({style:e.removeMsStyles?p.sanitizeStyleAttr:void 0,class:e.removeMsClasses?p.sanitizeClassAttr:void 0});return e.removeAttributes.reduce((function(e,t){var n;return i.__assign({},e,((n={})[t]=p.removeAttribute,n))}),t)},D=function(){function e(e,t,n,r,s,c){var d=this;this.dialogService=e,this.localization=t,this.cdr=n,this.ngZone=r,this.element=s,this.toolsService=c,this.iframe=!0,this.applyToWord=!1,this.preserveWhitespace=!1,this.resizable=!1,this.valueChange=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.paste=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.hostClass=!0,this.stateChange=new a.BehaviorSubject(m.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(e){var t=e.docChanged;if(!(d.disabled||d.readonly&&t)){if(t){var n=e.doc,i=p.getHtml({doc:n});d.trOnChange=e,d.htmlOnChange=i,d.ngZone.run((function(){d.valueModified.next(i)}))}t&&!d.inForm||d.view.updateState(d.view.state.apply(e))}},this.transformPastedHTML=function(e){var t=i.__assign({},x,d.pasteCleanupSettings),n=g.pipe(I(t.removeInvalidHTML),E(t.removeHtmlComments))(e),o=p.pasteCleanup(n,{convertMsLists:t.convertMsLists,stripTags:t.stripTags.join("|"),attributes:T(t)});if(l.hasObservers(d.paste)){var r=new S.EditorPasteEvent(o,e,d._pasteEvent);return d.ngZone.run((function(){return d.paste.emit(r)})),r.isDefaultPrevented()?"":r.cleanedHtml}return o},this.changeValue=function(e){var t=d._value;if(d._value=e,d._view){if(d.htmlOnChange===e&&d.trOnChange)d.view.updateState(d.view.state.apply(d.trOnChange));else if((t||"")!==(e||"")){if(d.iframe&&!d.container.element.nativeElement.contentWindow)return;var n=d.view.state,i=p.parseContent(e||"",n.schema,{preserveWhitespace:d.preserveWhitespace}),o=n.tr.setSelection(new p.AllSelection(n.doc)).replaceSelectionWith(i);d.view.updateState(n.apply(o))}d.trOnChange=null,d.htmlOnChange=null}},this.onChangeCallback=function(e){d.changeValue(e)},this.onTouchedCallback=function(e){},this.onPaste=function(e,t){return d._pasteEvent=t,!1},u.validatePackage(h.packageMetadata),this.direction=t.rtl?"rtl":"ltr",this.subs=a.zip(this.afterViewInit.asObservable(),this.contentAreaLoaded.asObservable()).subscribe((function(){return d.initialize()}))}var t;return t=e,Object.defineProperty(e.prototype,"value",{get:function(){if(this.trOnChange)return this.htmlOnChange;var e=this._view?this.getSource():this._value;return"<p></p>"===e?this._value?"":this._value:e},set:function(e){this.changeValue(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=e||!1,this._view&&this._view.updateState(this._view.state),this._disabled&&(this.readonly=!1),this._disabled||this._readonly?this.stateChange.next(m.disabledToolBarState):this.stateChange.next(m.initialToolBarState)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readonly",{get:function(){return this._readonly},set:function(e){if(this._readonly=e||!1,this._view){var t=void 0,n=(t=this.iframe?this.container.element.nativeElement.contentWindow:window).getSelection().focusNode;this._view.dom.contains(n)&&t.getSelection().removeAllRanges();var i=this._view.state.doc,o=this._view.state.tr.setSelection(p.TextSelection.create(i,1));this._view.dispatch(o)}this._readonly?(this.toolbar&&(this.toolbar.tabindex=-1),this.stateChange.next(m.disabledToolBarState)):(this.toolbar&&(this.toolbar.tabindex=0),this.stateChange.next(m.initialToolBarState))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"schema",{get:function(){return this._schema},set:function(e){if(o.isDevMode){if(!(e instanceof p.Schema))throw new Error(k.EditorErrorMessages.schemaType);if(this._view)throw new Error(k.EditorErrorMessages.setSchemaOnce)}this._schema=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"plugins",{get:function(){return this._plugins},set:function(e){if(o.isDevMode){if("function"!=typeof e)throw new Error(k.EditorErrorMessages.pluginsCallbackType(e));if(this._view)throw new Error(k.EditorErrorMessages.setPluginsOnce)}this._plugins=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){if(o.isDevMode&&this._view)throw new Error(k.EditorErrorMessages.setPlaceHolderOnce);this._placeholder=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resizableClass",{get:function(){return!!this.resizable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isIE",{get:function(){return this.iframe&&g.detectIE()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minWidth",{get:function(){var e=this.resizable;return e.minWidth?e.minWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxWidth",{get:function(){var e=this.resizable;return e.maxWidth?e.maxWidth+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minHeight",{get:function(){var e=this.resizable;return e.minHeight?e.minHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxHeight",{get:function(){var e=this.resizable;return e.maxHeight?e.maxHeight+"px":void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"toolbar",{get:function(){return this.defaultToolbarComponent||this.userToolBarComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this._view},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){return this._view&&this._view.state?p.getSelectionText(this._view.state):""},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.subs.add(this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr"}))),this.subs.add(this.toolsService.needsCheck.subscribe((function(){return e.cdr.markForCheck()})))},e.prototype.ngAfterViewInit=function(){this.afterViewInit.next(),this.iframe||this.contentAreaLoaded.next(),this.resizable&&this.normalizeSize()},e.prototype.ngOnChanges=function(e){var t=this;e.value&&this.view&&this.changeValue(e.value.currentValue),e.iframe&&!e.iframe.isFirstChange()&&this.ngZone.onStable.pipe(s.take(1)).subscribe((function(){return t.initialize()})),e.resizable&&!e.resizable.isFirstChange()&&this.normalizeSize()},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.iframeOnLoad=function(){this.contentAreaLoaded.next()},e.prototype.exec=function(e,t){"setHTML"===e&&"string"==typeof t?t={content:t,parseOptions:{preserveWhitespace:this.preserveWhitespace}}:["fontFamily","fontSize","foreColor","backColor","createLink"].some((function(t){return t===e}))&&(t={value:t,applyToWord:this.applyToWord}),b.editorCommands[e](t)(this._view.state,this._view.dispatch,this._view)},e.prototype.openDialog=function(e){var t={createLink:{content:_.FileLinkDialogComponent},insertFile:{content:_.FileLinkDialogComponent},insertImage:{content:y.ImageDialogComponent},viewSource:{content:v.SourceDialogComponent,height:400,width:500}},n=Object.assign({appendTo:this.dialogContainer},t[e]);this.toolbar.toggle(!1);var i=this.dialogService.open(n).content.instance;"createLink"!==e&&"insertFile"!==e||(i.command=e),i.editor=this,i.setData(this._view.state,{applyToWord:this.applyToWord})},e.prototype.focus=function(){this.focusChangedProgrammatically=!0,this._view.focus(),this.focusChangedProgrammatically=!1},e.prototype.blur=function(){this.focusChangedProgrammatically=!0,this._view.dom.blur(),this.focusChangedProgrammatically=!1},e.prototype.getSource=function(){return p.getHtml(this._view.state)},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe(),this._styleObserver&&this._styleObserver.disconnect()},e.prototype.writeValue=function(e){this.inForm=!0,this.value=null===e?void 0:e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.isEmpty=function(){return!1},e.prototype.initialize=function(){var e=this;if(l.isDocumentAvailable()){var t=this.schema||f.schema,n=this.container.element.nativeElement,i=p.parseContent((this.value||"").trim(),t,{preserveWhitespace:this.preserveWhitespace});if(this.iframe){var o=n.contentDocument,r=o.createElement("meta");r.setAttribute("charset","utf-8"),o.head.appendChild(r),[C.defaultStyle,C.tablesStyles,"rtl"===this.dir?C.rtlStyles:void 0].forEach((function(e){if(e){var t=o.createElement("style");t.appendChild(o.createTextNode(e)),o.head.appendChild(t)}})),(c=o.createElement("div")).classList.add("k-content"),o.body.appendChild(c)}else{var c=document.createElement("div");n.appendChild(c)}var d=[new p.Plugin({key:new p.PluginKey("editor-tabindex"),props:{attributes:function(){return{tabIndex:e.readonly?"0":""}}}}),new p.Plugin({key:new p.PluginKey("toolbar-tools-update"),view:function(){return{update:function(t){e.disabled||e.stateChange.next(e.readonly?m.disabledToolBarState:m.getToolbarState(t.state,{applyToWord:e.applyToWord}))}}}}),p.history(),p.keymap(p.buildListKeymap(t)),p.keymap(p.buildKeymap(t,{applyToWord:this.applyToWord})),p.keymap(p.baseKeymap),p.gapCursor(),p.imageResizing(),p.tableEditing(),p.caretColor()];this.placeholder&&d.push(p.placeholder(this.placeholder));var u=p.EditorState.create({schema:t,doc:i,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(){e._view=new p.EditorView({mount:e.viewMountElement},{state:u,editable:function(){return!e.readonly},dispatchTransaction:e.dispatchTransaction,transformPastedHTML:e.transformPastedHTML,handleDOMEvents:{paste:e.onPaste}})})),this._view){var h=void 0,b=this.element.nativeElement.querySelector(".k-editor-content").classList;h=this.iframe?this.container.element.nativeElement.contentDocument:this.container.element.nativeElement,this.subs.add(a.fromEvent(h,"focusin").subscribe((function(t){if(e.readonly&&b.add("k-focus"),!e.focusChangedProgrammatically||e.shouldEmitFocus){var n=t.relatedTarget;n&&n.classList.contains("k-colorpicker")&&!e.shouldEmitFocus||e.ngZone.run((function(){return e.onFocus.emit()})),e.shouldEmitFocus=!1}}))),this.subs.add(a.fromEvent(h,"focusout").subscribe((function(t){if(e.readonly&&b.remove("k-focus"),!e.focusChangedProgrammatically){var n=t.relatedTarget;n&&n.classList.contains("k-colorpicker")||e.ngZone.run((function(){return e.onBlur.emit()}))}})))}this.subs.add(this.stateChange.subscribe((function(){e.userToolBarComponent?e.userToolBarComponent.cdr.detectChanges():e.cdr.detectChanges()}))),this.subs.add(this.valueModified.subscribe((function(t){e.onChangeCallback(t),e.valueChange.emit(t),e.cdr.markForCheck()}))),this.subs.add(a.fromEvent(this.viewMountElement,"keyup").pipe(s.map((function(e){return e.keyCode})),s.filter((function(e){return 121===e})),s.map((function(){return e.userToolBarElement||e.defaultToolbar}))).subscribe((function(e){return e.nativeElement.focus()}))),this.subs.add(a.fromEvent(this.viewMountElement,"blur").pipe(s.filter((function(t){return!e.viewMountElement.contains(t.relatedTarget)}))).subscribe((function(){return e.onTouchedCallback()})))}},e.prototype.normalizeSize=function(){var e=this;if("object"==typeof this.resizable&&!this._styleObserver){var t=this.element.nativeElement;this._styleObserver=new MutationObserver((function(){e.ngZone.runOutsideAngular((function(){return e.normalizeProperties(t)}))})),this._styleObserver.observe(t,{attributeFilter:["style"]})}},e.prototype.normalizeProperties=function(e){var t=Object.keys(this.resizable),n=parseInt(e.style.width,10),i=parseInt(e.style.height,10),o=this.resizable;t.forEach((function(t){var r=t.startsWith("min"),a=!r,s=t.endsWith("Width"),c=!s;r&&s?n<o.minWidth&&(e.style.width=o.minWidth+"px"):r&&c?i<o.minHeight&&(e.style.height=o.minHeight+"px"):a&&s?n>o.maxWidth&&(e.style.width=o.maxWidth+"px"):i>o.maxHeight&&(e.style.height=o.maxHeight+"px")}))},i.__decorate([o.Input(),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[String])],e.prototype,"value",null),i.__decorate([o.Input(),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[Boolean])],e.prototype,"disabled",null),i.__decorate([o.Input(),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[Boolean])],e.prototype,"readonly",null),i.__decorate([o.Input(),i.__metadata("design:type",Boolean)],e.prototype,"iframe",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"applyToWord",void 0),i.__decorate([o.Input(),i.__metadata("design:type",p.Schema),i.__metadata("design:paramtypes",[p.Schema])],e.prototype,"schema",null),i.__decorate([o.Input(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Function])],e.prototype,"plugins",null),i.__decorate([o.Input(),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[String])],e.prototype,"placeholder",null),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"preserveWhitespace",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"pasteCleanupSettings",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"resizable",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),i.__decorate([o.Output("focus"),i.__metadata("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"paste",void 0),i.__decorate([o.Output("blur"),i.__metadata("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),i.__decorate([o.HostBinding("class.k-editor"),i.__metadata("design:type",Boolean)],e.prototype,"hostClass",void 0),i.__decorate([o.HostBinding("class.k-editor-resizable"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],e.prototype,"resizableClass",null),i.__decorate([o.HostBinding("class.k-disabled"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],e.prototype,"isDisabled",null),i.__decorate([o.HostBinding("class.k-readonly"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],e.prototype,"isReadonly",null),i.__decorate([o.HostBinding("class.k-ie"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],e.prototype,"isIE",null),i.__decorate([o.HostBinding("attr.dir"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],e.prototype,"dir",null),i.__decorate([o.HostBinding("attr.ariaDisabled"),i.__metadata("design:type",Boolean),i.__metadata("design:paramtypes",[])],e.prototype,"ariaDisabled",null),i.__decorate([o.HostBinding("style.minWidth"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],e.prototype,"minWidth",null),i.__decorate([o.HostBinding("style.maxWidth"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],e.prototype,"maxWidth",null),i.__decorate([o.HostBinding("style.minHeight"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],e.prototype,"minHeight",null),i.__decorate([o.HostBinding("style.maxHeight"),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[])],e.prototype,"maxHeight",null),i.__decorate([o.ContentChild(c.ToolBarComponent,{static:!1}),i.__metadata("design:type",c.ToolBarComponent)],e.prototype,"userToolBarComponent",void 0),i.__decorate([o.ContentChild(c.ToolBarComponent,{read:o.ElementRef,static:!1}),i.__metadata("design:type",o.ElementRef)],e.prototype,"userToolBarElement",void 0),i.__decorate([o.ViewChild("dialogsContainer",{read:o.ViewContainerRef,static:!0}),i.__metadata("design:type",o.ViewContainerRef)],e.prototype,"dialogContainer",void 0),i.__decorate([o.ViewChild("content",{read:o.ViewContainerRef,static:!1}),i.__metadata("design:type",o.ViewContainerRef)],e.prototype,"container",void 0),i.__decorate([o.ViewChild("defaultToolbar",{read:o.ElementRef,static:!1}),i.__metadata("design:type",o.ElementRef)],e.prototype,"defaultToolbar",void 0),i.__decorate([o.ViewChild("defaultToolbar",{read:c.ToolBarComponent,static:!1}),i.__metadata("design:type",c.ToolBarComponent)],e.prototype,"defaultToolbarComponent",void 0),e=t=i.__decorate([o.Component({selector:"kendo-editor",providers:[j.EditorLocalizationService,w.EditorToolsService,{provide:O.LocalizationService,useExisting:j.EditorLocalizationService},{provide:O.L10N_PREFIX,useValue:"kendo.editor"},{provide:r.NG_VALUE_ACCESSOR,useExisting:o.forwardRef((function(){return t})),multi:!0},{provide:l.KendoInput,useExisting:o.forwardRef((function(){return t}))}],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 "]}),i.__metadata("design:paramtypes",[d.DialogService,O.LocalizationService,o.ChangeDetectorRef,o.NgZone,o.ElementRef,w.EditorToolsService])],e)}();t.EditorComponent=D},function(e,t){e.exports=o},function(e,t,n){"use strict";n.r(t),n.d(t,"ToolbarMessages",(function(){return V})),n.d(t,"NavigationService",(function(){return E})),n.d(t,"RefreshService",(function(){return f})),n.d(t,"ToolBarRendererComponent",(function(){return L})),n.d(t,"RendererService",(function(){return N})),n.d(t,"ToolBarButtonListComponent",(function(){return M})),n.d(t,"ToolBarComponent",(function(){return B})),n.d(t,"ToolBarToolComponent",(function(){return I})),n.d(t,"ToolBarButtonComponent",(function(){return P})),n.d(t,"ToolBarButtonGroupComponent",(function(){return A})),n.d(t,"ToolBarDropDownButtonComponent",(function(){return z})),n.d(t,"ToolBarSplitButtonComponent",(function(){return R})),n.d(t,"ToolBarSeparatorComponent",(function(){return F})),n.d(t,"ToolBarModule",(function(){return U})),n.d(t,"LocalizedToolbarMessagesDirective",(function(){return H})),n.d(t,"ToolbarCustomMessagesComponent",(function(){return K}));var i=n(0),o=n(1),r=n(16),a=n(2),s=n(3),c=n(13),d=n(4),l=n(5),p=n(19),u=n(12),h={name:"@progress/kendo-angular-toolbar",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1642585115,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"},f=function(){function e(){this.onRefresh=new o.EventEmitter}return e.prototype.refresh=function(e){this.onRefresh.emit(e)},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),b=/^(?:a|input|select|textarea|button|object)$/i;function m(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0}var g=function(e,t,n){if(void 0===n&&(n=!0),e){if(n&&t(e))return e;for(e=e.firstChild;e;){if(1===e.nodeType){var i=g(e,t);if(i)return i}e=e.nextSibling}}},v=function(e,t){if(void 0===t&&(t=!0),e.tagName){var n=e.tagName.toLowerCase(),i=null!==e.getAttribute("tabIndex");return b.test(n)&&(i=!e.disabled),i&&(!t||function(e){var t=e.getBoundingClientRect(),n=t.width>0&&t.height>0,i=0!==t.x&&0!==t.y;return(n||i)&&"hidden"!==window.getComputedStyle(e).visibility}(e))}return!1},y=function(e,t,n){void 0===t&&(t=!0);for(var i=n?e.prevSibling:e.nextSibling;i;){if(1===i.nodeType){var o=g(i,(function(e){return v(e,t)}));if(o)return o}i=n?i.prevSibling:i.nextSibling}},_=function(e){return null!=e},O=function(e){return function(t){return _(e[t])}},j=function(e,t,n){return function(i){switch(i.type){case"keydown":if(i.keyCode===e)return n.length-1;if(i.keyCode===t)return 0;break;case"click":return n.findIndex((function(e){return e===i.target||e.contains(i.target)}));case"focus":default:return 0}}},C=function(e,t,n){return function(i,o){switch(o.keyCode){case e:return n(i-1)?i-1:i;case t:return n(i+1)?i+1:i;default:return i}}},k=function(e){return function(t){return e===t}},w=function(e){return void 0===e&&(e=!1),function(t){return void 0===t&&(t=!0),t?a.Keys.ArrowDown:e?a.Keys.ArrowLeft:a.Keys.ArrowRight}},S=function(e){return void 0===e&&(e=!1),function(t){return void 0===t&&(t=!0),t?a.Keys.ArrowUp:e?a.Keys.ArrowRight:a.Keys.ArrowLeft}},x=function(e,t,n){switch(t){case"toolbar":return n?void 0:e;case"overflow":return n?e:void 0;default:return e}},E=function(){function e(e){this.zone=e,this.focused={renderedTool:null,index:-1},this.renderedTools=[],this.isPopupFocused=!1,this.isOverflowButtonFocused=!1}return e.prototype.setRenderedTools=function(e){this.renderedTools=e.slice()},e.prototype.click=function(e){var t=e.context,n=e.event;this.focused.renderedTool!==t&&n&&this.focus(t,n)},e.prototype.moveFocusToToolBar=function(){this.isPopupFocused=!1,this.focusOverflowButton()},e.prototype.moveFocusToPopup=function(){this.isPopupFocused=!0,this.blurOverflowButton(),this.focus()},e.prototype.focusNext=function(e){if(!this.isOverflowButtonFocused&&this.focused.renderedTool&&!this.focused.renderedTool.tool.handleKey(e)){var t=this.getFocusableTools().slice(this.focused.index+1)[0];t?this.focus(t,e):this.isOverflowButtonVisible()&&!this.isPopupFocused&&this.focusOverflowButton()}},e.prototype.focusPrev=function(e){if(this.isOverflowButtonFocused){var t=this.getFocusableTools().reverse()[0];this.focus(t,e)}else if(this.focused.renderedTool&&!this.focused.renderedTool.tool.handleKey(e)){var n=this.getFocusableTools().slice(0,this.focused.index).reverse()[0];n&&this.focus(n,e)}},e.prototype.resetNavigation=function(){this.blurOverflowButton(),this.focused.renderedTool=null,this.focused.index=-1},e.prototype.focusFirst=function(e){var t=this.getFocusableTools()[0],n=this.overflowButton;t?(this.focused.renderedTool=t,this.focused.index=this.getFocusableTools().findIndex((function(e){return e===t})),this.focus(t,e)):n&&n.nativeElement.focus()},e.prototype.getFocusableTools=function(){var e=this;return this.renderedTools.filter((function(t){return t.tool.overflows===e.isPopupFocused&&t.tool.canFocus()}))},e.prototype.focus=function(e,t){var n=this;this.zone.onStable.pipe(Object(d.take)(1)).subscribe((function(){if(e)e.tool.canFocus&&e.tool.canFocus()&&(n.focused.renderedTool=e,n.focused.index=n.getFocusableTools().findIndex((function(t){return t===e})),e.tool.focus(t),n.blurOverflowButton());else{var i=n.getFocusableTools(),o=i.find((function(e){return e===n.focused.renderedTool}))||i[0];o&&(n.focused.renderedTool=o,n.focused.index=n.getFocusableTools().findIndex((function(e){return e===o})),o.tool.focus(t))}}))},e.prototype.blurOverflowButton=function(){this.overflowButton&&(this.isOverflowButtonFocused=!1,this.overflowButton.nativeElement.tabIndex=-1)},e.prototype.focusOverflowButton=function(){this.isOverflowButtonFocused=!0,this.overflowButton.nativeElement.tabIndex=0,this.overflowButton.nativeElement.focus()},e.prototype.isOverflowButtonVisible=function(){return _(this.overflowButton)&&"visible"===window.getComputedStyle(this.overflowButton.nativeElement).getPropertyValue("visibility")},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__metadata)("design:paramtypes",[o.NgZone])],e)}(),I=function(){function e(){this.tabIndex=-1,this.overflows=!0,this.responsive=!0}return Object.defineProperty(e.prototype,"toolbarDisplay",{get:function(){return this.overflows?"none":"inline-block"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowDisplay",{get:function(){return this.overflows?"block":"none"},enumerable:!0,configurable:!0}),e.prototype.canFocus=function(){return!1},e.prototype.focus=function(e){},e.prototype.handleKey=function(e){return!1},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"responsive",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"toolbar-tool",template:""})],e)}(),T=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}(),D=function(e){return{animate:!0,anchorAlign:{horizontal:e?"left":"right",vertical:"bottom"},popupAlign:{horizontal:e?"left":"right",vertical:"top"}}},B=function(){function e(e,t,n,i,r,a,s,d){this.localization=e,this.popupService=t,this.refreshService=n,this.navigationService=i,this.element=r,this.cdr=a,this.zone=s,this.renderer=d,this.overflow=!1,this.tabindex=0,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.hostClasses=!0,this.cancelRenderedToolsSubscription$=new l.Subject,this.subscriptions=new l.Subscription,Object(c.validatePackage)(h),this.direction=e.rtl?"rtl":"ltr"}return Object.defineProperty(e.prototype,"resizable",{get:function(){return this.overflow},set:function(e){this.overflow=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings||D(this.localization.rtl)},set:function(e){this._popupSettings=Object.assign({},D(this.localization.rtl),e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupOpen",{get:function(){return this._open},set:function(e){if(this.popupOpen!==e){var t=new T;e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()||this.toggle(e)}},enumerable:!0,configurable:!0}),e.prototype.onFocus=function(e){this.navigationService.resetNavigation(),this.navigationService.focusFirst(e),this.element.nativeElement.setAttribute("tabindex","-1")},e.prototype.onFocusOut=function(e){var t=this;!function(e,t){for(;e&&!t(e);)e=e.parentNode;return e}(e.relatedTarget,(function(e){return e===t.element.nativeElement}))?this.element.nativeElement.setAttribute("tabindex",this.tabindex.toString()):this.element.nativeElement.setAttribute("tabindex","-1")},Object.defineProperty(e.prototype,"getRole",{get:function(){return"toolbar"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getDir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resizableClass",{get:function(){return this.overflow},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.element.nativeElement.getAttribute("tabindex")||this.element.nativeElement.setAttribute("tabindex","0"),this.zone.runOutsideAngular((function(){e.toolbarKeydownListener=e.renderer.listen(e.element.nativeElement,"keydown",(function(t){switch(t.keyCode){case a.Keys.ArrowLeft:e.zone.run((function(){t.preventDefault(),"ltr"===e.direction?e.navigationService.focusPrev(t):e.navigationService.focusNext(t),e.element.nativeElement.setAttribute("tabindex","-1")}));break;case a.Keys.ArrowRight:e.zone.run((function(){t.preventDefault(),"ltr"===e.direction?e.navigationService.focusNext(t):e.navigationService.focusPrev(t),e.element.nativeElement.setAttribute("tabindex","-1")}));break;case a.Keys.Tab:e.zone.run((function(){return e.navigationService.resetNavigation()}));break;case a.Keys.Escape:e.zone.run((function(){return e.toggle(!1)}))}}))})),this.overflow&&(this.subscriptions.add(Object(l.merge)(this.resizeSensor.resize.pipe(Object(d.filter)((function(){return e.overflow}))),this.renderedTools.changes).subscribe((function(){return e.onResize()}))),this.zone.runOutsideAngular((function(){return setTimeout((function(){return e.onResize()}))})),this.navigationService.overflowButton=this.overflowButton),this.navigationService.setRenderedTools(this.renderedTools.toArray()),this.subscriptions.add(this.renderedTools.changes.subscribe((function(t){return e.navigationService.setRenderedTools(t.toArray())})))},e.prototype.ngOnInit=function(){var e=this;this.subscriptions.add(this.localization.changes.subscribe((function(t){var n=t.rtl;return e.direction=n?"rtl":"ltr"}))),Object(a.isDocumentAvailable)()&&this.zone.runOutsideAngular((function(){return e.subscriptions.add(Object(l.fromEvent)(document,"click").pipe(Object(d.filter)((function(){return!!e.popupRef})),Object(d.filter)((function(t){return!e.popupRef.popup.instance.container.nativeElement.contains(t.target)})),Object(d.filter)((function(t){return!e.overflowButton.nativeElement.contains(t.target)}))).subscribe((function(){e.zone.run((function(){e.popupOpen=!1}))})))}))},e.prototype.ngOnChanges=function(e){e.tabindex&&this.element.nativeElement.setAttribute("tabindex",e.tabindex.currentValue.toString())},e.prototype.ngOnDestroy=function(){this.popupRef&&this.popupRef.close(),this.toolbarKeydownListener&&this.toolbarKeydownListener(),this.cancelRenderedToolsSubscription$.next(),this.subscriptions.unsubscribe()},Object.defineProperty(e.prototype,"moreToolsTitle",{get:function(){return this.localization.get("moreToolsTitle")},enumerable:!0,configurable:!0}),e.prototype.onRendererClick=function(e){this.navigationService.click(e),this.element.nativeElement.setAttribute("tabindex","-1")},e.prototype.showPopup=function(){this.popupOpen=!this.popupOpen,this.navigationService.click({context:void 0,event:void 0})},e.prototype.toggle=function(e){this._open=void 0!==e?e:!this.popupOpen,this.popupRef&&(this.popupRef.close(),this.popupRef=null),this.popupOpen&&(this.popupRef=this.popupService.open({anchor:this.overflowButton,anchorAlign:this.popupSettings.anchorAlign,popupAlign:this.popupSettings.popupAlign,content:this.popupTemplate,appendTo:this.appendTo,animate:this.popupSettings.animate,popupClass:this.popupSettings.popupClass,positionMode:"absolute"}),this.setPopupContentDimensions(),this.popupRef.popupOpen.subscribe(this.onPopupOpen.bind(this)),this.popupRef.popupClose.subscribe(this.onPopupClose.bind(this)))},e.prototype.onResize=function(){if(Object(a.isDocumentAvailable)()){var e=(t=this.element.nativeElement,n=t.offsetWidth,i=getComputedStyle(t),n-=parseFloat(i.paddingLeft)||0+parseFloat(i.borderLeftWidth)||0,(n-=parseFloat(i.paddingRight)||0+parseFloat(i.borderRightWidth)||0)-this.overflowAnchorWidth);this.shrink(e,this.childrenWidth),this.stretch(e,this.childrenWidth)}var t,n,i;this.cdr.detectChanges(),this.resizeSensor.acceptSize()},e.prototype.onPopupOpen=function(){var e=this;this.zone.runOutsideAngular((function(){e.overflowKeydownListener=e.renderer.listen(e.popupRef.popupElement,"keydown",(function(t){switch(t.keyCode){case a.Keys.ArrowUp:e.zone.run((function(){t.preventDefault(),e.navigationService.focusPrev(t)}));break;case a.Keys.ArrowDown:e.zone.run((function(){t.preventDefault(),e.navigationService.focusNext(t)}));break;case a.Keys.Escape:e.zone.run((function(){return e.toggle(!1)}));break;case a.Keys.Tab:e.zone.run((function(){e.toggle(!1),e.navigationService.resetNavigation()}))}}))})),this.cancelRenderedToolsSubscription$.next(),this.navigationService.moveFocusToPopup(),this.navigationService.setRenderedTools(this.overflowRenderedTools.toArray()),this.overflowRenderedTools.changes.pipe(Object(d.takeUntil)(this.cancelRenderedToolsSubscription$)).subscribe((function(t){return e.navigationService.setRenderedTools(t.toArray())}))},e.prototype.onPopupClose=function(){var e=this;this.cancelRenderedToolsSubscription$.next(),this.navigationService.setRenderedTools(this.renderedTools.toArray()),this.renderedTools.changes.pipe(Object(d.takeUntil)(this.cancelRenderedToolsSubscription$)).subscribe((function(t){return e.navigationService.setRenderedTools(t.toArray())})),this.navigationService.moveFocusToToolBar(),this.overflowKeydownListener&&this.overflowKeydownListener()},Object.defineProperty(e.prototype,"displayAnchor",{get:function(){return this.allTools.filter((function(e){return e.overflows&&e.responsive})).length>0?"visible":"hidden"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupWidth",{get:function(){return this.popupSettings&&this.popupSettings.width?isNaN(this.popupSettings.width)?this.popupSettings.width:this.popupSettings.width+"px":"150px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupHeight",{get:function(){if(this.popupSettings&&this.popupSettings.height)return isNaN(this.popupSettings.height)?this.popupSettings.height:this.popupSettings.height+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowAnchorWidth",{get:function(){return this.overflow?(this.cachedOverflowAnchorWidth||(this.cachedOverflowAnchorWidth=m(this.overflowButton.nativeElement)),this.cachedOverflowAnchorWidth):0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childrenWidth",{get:function(){var e=this.renderedTools.reduce((function(e,t){return t.width+e}),0);return Math.ceil(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"visibleTools",{get:function(){return this.allTools.filter((function(e){return!1===e.overflows}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowTools",{get:function(){return this.allTools.filter((function(e){return!0===e.overflows}))},enumerable:!0,configurable:!0}),e.prototype.shrink=function(e,t){if(e<t)for(var n=this.visibleTools.length-1;n>=0&&!(e>t);n--)t-=this.hideLastVisibleTool()},e.prototype.stretch=function(e,t){var n;if(e>t)for(var i=this.overflowTools.length-1;i>=0&&(n=this.showFirstHiddenTool(e,t));i--)t+=n},e.prototype.hideLastVisibleTool=function(){var e=this.visibleTools[this.visibleTools.length-1],t=this.renderedTools.find((function(t){return t.tool===e})).width;return e.overflows=!0,this.refreshService.refresh(e),t},e.prototype.showFirstHiddenTool=function(e,t){var n=this.overflowTools[0],i=this.renderedTools.find((function(e){return e.tool===n}));return n.overflows=!1,n.visibility="hidden",this.refreshService.refresh(n),e>t+i.width?(n.visibility="visible",this.refreshService.refresh(n)):(n.overflows=!0,this.refreshService.refresh(n)),i.width},e.prototype.setPopupContentDimensions=function(){var e=this.popupRef.popup.instance.contentContainer.nativeElement;e.style.width=this.popupWidth,e.style.height=this.popupHeight,e.style.overflow="auto"},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"overflow",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"resizable",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)("tabIndex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"close",void 0),Object(i.__decorate)([Object(o.ContentChildren)(I),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"allTools",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowButton",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"overflowButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("resizeSensor",{static:!1}),Object(i.__metadata)("design:type",a.ResizeSensorComponent)],e.prototype,"resizeSensor",void 0),Object(i.__decorate)([Object(o.ViewChild)("container",{read:o.ViewContainerRef,static:!0}),Object(i.__metadata)("design:type",o.ViewContainerRef)],e.prototype,"container",void 0),Object(i.__decorate)([Object(o.ViewChildren)("toolbarRenderer"),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"renderedTools",void 0),Object(i.__decorate)([Object(o.ViewChildren)("overflowRenderer"),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"overflowRenderedTools",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-widget"),Object(o.HostBinding)("class.k-toolbar"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostListener)("focus",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onFocus",null),Object(i.__decorate)([Object(o.HostListener)("focusout",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onFocusOut",null),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"getRole",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"getDir",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-toolbar-resizable"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"resizableClass",null),e=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBar",providers:[f,E,s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.toolbar"}],selector:"kendo-toolbar",template:'\n <ng-container kendoToolbarLocalizedMessages\n i18n-moreToolsTitle="kendo.toolbar.moreToolsTitle|The title of the **more tools** button in a responsive ToolBar"\n moreToolsTitle="More tools"\n >\n </ng-container>\n <ng-container *ngFor="let tool of allTools; let index = index">\n <kendo-toolbar-renderer\n #toolbarRenderer\n (rendererClick)="onRendererClick($event)"\n [location]="\'toolbar\'"\n [resizable]="overflow"\n [tool]="tool"\n ></kendo-toolbar-renderer>\n </ng-container>\n <button\n #overflowButton\n type="button"\n tabindex="-1"\n [title]="moreToolsTitle"\n [attr.aria-label]="moreToolsTitle"\n *ngIf="overflow"\n [style.visibility]="displayAnchor"\n class="k-overflow-anchor k-button"\n (click)="showPopup()"\n >\n <span class="k-icon k-i-more-vertical"></span>\n </button>\n <ng-template #popupTemplate>\n <ul class="k-overflow-container k-list-container k-reset">\n <ng-container *ngFor="let tool of allTools; let index = index">\n <li class="k-item">\n <kendo-toolbar-renderer\n #overflowRenderer\n (rendererClick)="onRendererClick($event)"\n [location]="\'overflow\'"\n [resizable]="overflow"\n [tool]="tool"\n ></kendo-toolbar-renderer>\n </li>\n </ng-container>\n </ul>\n </ng-template>\n <ng-container #container></ng-container>\n <kendo-resize-sensor *ngIf="overflow" [rateLimit]="1000" #resizeSensor></kendo-resize-sensor>\n '}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService,r.PopupService,f,E,o.ElementRef,o.ChangeDetectorRef,o.NgZone,o.Renderer2])],e)}(),P=function(e){function t(){var t=e.call(this)||this;return t.showText="both",t.showIcon="both",t.toggleable=!1,t.selected=!1,t.fillMode="solid",t.themeColor="base",t.click=new o.EventEmitter,t.pointerdown=new o.EventEmitter,t.selectedChange=new o.EventEmitter,t.toolbarOptions={text:"",icon:"",iconClass:"",imageUrl:""},t.overflowOptions={text:"",icon:"",iconClass:"",imageUrl:""},t}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"text",{set:function(e){this.toolbarOptions.text=x(e,this.showText,!1),this.overflowOptions.text=x(e,this.showText,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"look",{set:function(e){e&&(this.fillMode="default"===e?"solid":e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"togglable",{get:function(){return this.toggleable},set:function(e){this.toggleable=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{set:function(e){this.toolbarOptions.icon=x(e,this.showIcon,!1),this.overflowOptions.icon=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{set:function(e){this.toolbarOptions.iconClass=x(e,this.showIcon,!1),this.overflowOptions.iconClass=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{set:function(e){this.toolbarOptions.imageUrl=x(e,this.showIcon,!1),this.overflowOptions.imageUrl=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),t.prototype.onBlur=function(){this.getButton().tabIndex=-1},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(e){e&&"focus"!==e.type&&"keydown"!==e.type||this.getButton().focus(),this.getButton().tabIndex=0},t.prototype.handleKey=function(){return this.getButton().tabIndex=-1,!1},t.prototype.getButton=function(){return(this.overflows?this.overflowButtonElement:this.toolbarButtonElement).nativeElement},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showText",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"text",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"style",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"className",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"toggleable",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"look",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],t.prototype,"togglable",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"selected",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"fillMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"icon",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"iconClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"imageUrl",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"click",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"pointerdown",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"selectedChange",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarButton",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"toolbarButtonElement",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowButton",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"overflowButtonElement",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarButton",providers:[{provide:I,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-button",template:'\n <ng-template #toolbarTemplate>\n <button\n #toolbarButton\n [tabindex]="tabIndex"\n type="button"\n kendoButton\n [ngStyle]="style"\n [ngClass]="className"\n [attr.title]="title"\n [disabled]="disabled"\n [toggleable]="toggleable"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n [selected]="selected"\n [icon]="toolbarOptions.icon"\n [iconClass]="toolbarOptions.iconClass"\n [imageUrl]="toolbarOptions.imageUrl"\n (click)="click.emit($event)"\n (pointerdown)="pointerdown.emit($event)"\n (selectedChange)="selectedChange.emit($event)"\n (blur)="onBlur()"\n >\n {{ toolbarOptions.text }}\n </button>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #overflowButton\n tabindex="-1"\n type="button"\n kendoButton\n class="k-overflow-button"\n [ngStyle]="style"\n [ngClass]="className"\n [attr.title]="title"\n [disabled]="disabled"\n [toggleable]="toggleable"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n [selected]="selected"\n [icon]="overflowOptions.icon"\n [iconClass]="overflowOptions.iconClass"\n [imageUrl]="overflowOptions.imageUrl"\n (click)="click.emit($event)"\n (selectedChange)="selectedChange.emit($event)"\n >\n {{ overflowOptions.text }}\n </button>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[])],t)}(I),A=function(e){function t(t){var n=e.call(this)||this;return n.localization=t,n.selection="multiple",n.focusedIndex=-1,n.getNextKey=w(n.localization.rtl),n.getPrevKey=S(n.localization.rtl),n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"look",{set:function(e){e&&this.buttonComponents.forEach((function(t){return t.fillMode="default"===e?"solid":e}))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"buttonElements",{get:function(){return this.getButtonGroup().buttons.filter((function(e){return!e.isDisabled})).map((function(e){return e.element}))},enumerable:!0,configurable:!0}),t.prototype.onFocus=function(){this.focusedIndex=0},t.prototype.onNavigate=function(e){e.preventDefault()},t.prototype.selectedChangeHandler=function(e,t){t.selected=e,t.selectedChange.emit(e)},t.prototype.onButtonClick=function(e){this.focusedIndex=this.buttonElements.findIndex((function(t){return t===e.target||t.contains(e.target)})),this.focusButton(this.focusedIndex,e)},t.prototype.canFocus=function(){return!(this.disabled||0===this.buttonElements.length)},t.prototype.focus=function(e){void 0===e&&(e={});var t=this.getNextKey(this.overflows),n=this.getPrevKey(this.overflows);this.focusedIndex=j(n,t,this.buttonElements)(e),this.focusButton(this.focusedIndex,e)},t.prototype.handleKey=function(e){var t=this.getNextKey(this.overflows),n=this.getPrevKey(this.overflows),i=O(this.buttonElements),o=k(this.focusedIndex);return this.focusedIndex=C(n,t,i)(this.focusedIndex,e),this.focusButton(this.focusedIndex,e),!o(this.focusedIndex)},t.prototype.getButtonGroup=function(){return this.overflows?this.overflowButtonGroup:this.toolbarButtonGroup},t.prototype.focusButton=function(e,t){t.type&&"focus"!==t.type&&"keydown"!==t.type||this.buttonElements[e].focus()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"selection",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"width",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"look",null),Object(i.__decorate)([Object(o.ViewChild)("toolbarTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ContentChildren)(Object(o.forwardRef)((function(){return P}))),Object(i.__metadata)("design:type",o.QueryList)],t.prototype,"buttonComponents",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarButtonGroup",{static:!1}),Object(i.__metadata)("design:type",p.ButtonGroupComponent)],t.prototype,"toolbarButtonGroup",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowButtonGroup",{static:!1}),Object(i.__metadata)("design:type",p.ButtonGroupComponent)],t.prototype,"overflowButtonGroup",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarButtonGroup",providers:[s.LocalizationService,{provide:I,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-buttongroup",template:'\n <ng-template #toolbarTemplate>\n <kendo-buttongroup\n #toolbarButtonGroup\n [tabIndex]="-1"\n [selection]="selection"\n [disabled]="disabled"\n [width]="width"\n (navigate)="onNavigate($event)"\n (focus)="onFocus()"\n >\n <span\n kendoButton\n *ngFor="let button of buttonComponents"\n [ngStyle]="button.style"\n [ngClass]="button.className"\n [attr.title]="button.title"\n [disabled]="button.disabled"\n [togglable]="button.togglable"\n [selected]="button.selected"\n [fillMode]="button.fillMode"\n [themeColor]="button.fillMode ? button.themeColor : null"\n [icon]="button.toolbarOptions.icon"\n [iconClass]="button.toolbarOptions.iconClass"\n [imageUrl]="button.toolbarOptions.imageUrl"\n (click)="button.click.emit($event); onButtonClick($event)"\n (pointerdown)="button.pointerdown.emit($event)"\n (selectedChange)="selectedChangeHandler($event, button)"\n >\n {{ button.toolbarOptions.text }}\n </span>\n </kendo-buttongroup>\n </ng-template>\n <ng-template #popupTemplate>\n <kendo-buttongroup\n #overflowButtonGroup\n class="k-overflow-button"\n [tabIndex]="-1"\n [selection]="selection"\n [disabled]="disabled"\n [width]="width"\n >\n <span\n kendoButton\n class="k-overflow-button"\n *ngFor="let button of buttonComponents"\n [ngStyle]="button.style"\n [ngClass]="button.className"\n [attr.title]="button.title"\n [disabled]="button.disabled"\n [togglable]="button.togglable"\n [selected]="button.selected"\n [fillMode]="button.fillMode"\n [themeColor]="button.fillMode ? button.themeColor : null"\n [icon]="button.overflowOptions.icon"\n [iconClass]="button.overflowOptions.iconClass"\n [imageUrl]="button.overflowOptions.imageUrl"\n (click)="button.click.emit($event); onButtonClick($event)"\n (selectedChange)="selectedChangeHandler($event, button)"\n >\n {{ button.overflowOptions.text }}\n </span>\n </kendo-buttongroup>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService])],t)}(I),M=function(){function e(){this.disabled=!1,this.fillMode="solid",this.themeColor="base",this.itemClick=new o.EventEmitter}return e.prototype.getText=function(e){if(e)return this.textField?e[this.textField]:e.text||e},e.prototype.onClick=function(e,t){var n=this.data[t];e.click&&e.click(n),this.itemClick.emit(n)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"data",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"fillMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"itemClick",void 0),Object(i.__decorate)([Object(o.ViewChildren)("button"),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"buttons",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-toolbar-buttonlist",template:'\n <button\n #button\n type="button"\n tabindex="-1"\n kendoButton\n style="padding-left: 16px"\n class="k-overflow-button"\n *ngFor="let item of data; let i = index"\n [disabled]="disabled || item.disabled"\n [icon]="item.icon"\n [iconClass]="item.iconClass"\n [imageUrl]="item.imageUrl"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n (click)="onClick(item, i)"\n >\n {{ getText(item) }}\n </button>\n '})],e)}(),z=function(e){function t(){var t=e.call(this)||this;return t.showText="both",t.showIcon="both",t.fillMode="solid",t.themeColor="base",t.itemClick=new o.EventEmitter,t.open=new o.EventEmitter,t.close=new o.EventEmitter,t.toolbarOptions={text:"",icon:"",iconClass:"",imageUrl:""},t.overflowOptions={text:"",icon:"",iconClass:"",imageUrl:""},t._popupSettings={animate:!0,popupClass:""},t.focusedIndex=-1,t.getNextKey=w(),t.getPrevKey=S(),t}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"text",{set:function(e){this.toolbarOptions.text=x(e,this.showText,!1),this.overflowOptions.text=x(e,this.showText,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{set:function(e){this.toolbarOptions.icon=x(e,this.showIcon,!1),this.overflowOptions.icon=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{set:function(e){this.toolbarOptions.iconClass=x(e,this.showIcon,!1),this.overflowOptions.iconClass=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{set:function(e){this.toolbarOptions.imageUrl=x(e,this.showIcon,!1),this.overflowOptions.imageUrl=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0,popupClass:""},e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"look",{set:function(e){e&&(this.fillMode="default"===e?"solid":e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"primary",{set:function(e){this.themeColor=e?"primary":"base"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data||(this.data=[]),this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"overflowButtons",{get:function(){return this.overflowDropDownButtonButtonList.buttons.toArray().filter((function(e){return!e.nativeElement.disabled})).slice()},enumerable:!0,configurable:!0}),t.prototype.onButtonListClick=function(e){this.focusedIndex=this.overflowDropDownButtonButtonList.buttons.toArray().findIndex((function(t){return t.nativeElement.contains(e.target)}))},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(e){void 0===e&&(e={}),this.overflows?this.overflowButtons.length>0&&(this.focusedIndex=j(this.getPrevKey(),this.getNextKey(),this.overflowButtons.map((function(e){return e.nativeElement})))(e),this.focusButton(this.focusedIndex,e)):"focus"!==e.type&&"keydown"!==e.type||this.toolbarDropDownButton.focus()},t.prototype.handleKey=function(e){if(!this.overflows&&(e.keyCode===this.getPrevKey(this.overflows)||e.keyCode===this.getNextKey(this.overflows)))return!1;if(this.overflows){var t=O(this.overflowButtons),n=k(this.focusedIndex);return this.focusedIndex=C(this.getPrevKey(),this.getNextKey(),t)(this.focusedIndex,e),this.focusButton(this.focusedIndex,e),!n(this.focusedIndex)}},t.prototype.focusButton=function(e,t){t.type&&"focus"!==t.type&&"keydown"!==t.type||this.overflowButtons[e].nativeElement.focus()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showText",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"text",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"icon",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"iconClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"imageUrl",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"look",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],t.prototype,"primary",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"fillMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"buttonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array),Object(i.__metadata)("design:paramtypes",[Array])],t.prototype,"data",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"itemClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"close",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("dropdownButton",{read:o.ElementRef,static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"dropdownButton",void 0),Object(i.__decorate)([Object(o.ViewChild)(p.DropDownButtonComponent,{static:!1}),Object(i.__metadata)("design:type",p.DropDownButtonComponent)],t.prototype,"dropDownButtonComponent",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarDropDownButton",{static:!1}),Object(i.__metadata)("design:type",p.DropDownButtonComponent)],t.prototype,"toolbarDropDownButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowDropDownButtonButtonList",{static:!1}),Object(i.__metadata)("design:type",M)],t.prototype,"overflowDropDownButtonButtonList",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarDropDownButton",providers:[{provide:I,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-dropdownbutton",template:'\n <ng-template #toolbarTemplate>\n <kendo-dropdownbutton\n #toolbarDropDownButton\n [icon]="toolbarOptions.icon"\n [iconClass]="toolbarOptions.iconClass"\n [imageUrl]="toolbarOptions.imageUrl"\n [buttonClass]="buttonClass"\n [disabled]="disabled"\n [tabIndex]="-1"\n [data]="data"\n [textField]="textField"\n [popupSettings]="popupSettings"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n (open)="open.emit($event)"\n (close)="close.emit($event)"\n (itemClick)="itemClick.emit($event)"\n >\n {{ toolbarOptions.text }}\n </kendo-dropdownbutton>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n type="button"\n tabindex="-1"\n kendoButton\n class="k-overflow-button"\n [disabled]="true"\n [icon]="overflowOptions.icon"\n [iconClass]="overflowOptions.iconClass"\n [imageUrl]="overflowOptions.imageUrl"\n [ngClass]="buttonClass"\n (click)="itemClick.emit($event)"\n >\n {{ overflowOptions.text }}\n </button>\n <kendo-toolbar-buttonlist\n #overflowDropDownButtonButtonList\n [data]="data"\n [disabled]="disabled"\n [textField]="textField"\n (itemClick)="itemClick.emit($event)"\n (click)="onButtonListClick($event)"\n >\n </kendo-toolbar-buttonlist>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[])],t)}(I),R=function(e){function t(){var t=e.call(this)||this;return t.showText="both",t.showIcon="both",t.fillMode="solid",t.themeColor="base",t.arrowButtonIcon="arrow-s",t.textField="text",t.buttonClick=new o.EventEmitter,t.itemClick=new o.EventEmitter,t.open=new o.EventEmitter,t.close=new o.EventEmitter,t.toolbarOptions={text:"",icon:"",iconClass:"",imageUrl:""},t.overflowOptions={text:"",icon:"",iconClass:"",imageUrl:""},t._popupSettings={animate:!0,popupClass:""},t.focusedIndex=-1,t.getNextKey=w(),t.getPrevKey=S(),t}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"text",{set:function(e){this.toolbarOptions.text=x(e,this.showText,!1),this.overflowOptions.text=x(e,this.showText,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"icon",{set:function(e){this.toolbarOptions.icon=x(e,this.showIcon,!1),this.overflowOptions.icon=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"iconClass",{set:function(e){this.toolbarOptions.iconClass=x(e,this.showIcon,!1),this.overflowOptions.iconClass=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"imageUrl",{set:function(e){this.toolbarOptions.imageUrl=x(e,this.showIcon,!1),this.overflowOptions.imageUrl=x(e,this.showIcon,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupSettings",{get:function(){return this._popupSettings||(this._popupSettings={animate:!0,popupClass:""}),this._popupSettings},set:function(e){this._popupSettings=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"look",{set:function(e){e&&(this.fillMode="default"===e?"solid":e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data||(this.data=[]),this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"overflowButtons",{get:function(){return[this.overflowSplitButton].concat(this.overflowSplitButtonButtonList.buttons.toArray().filter((function(e){return!e.nativeElement.disabled})))},enumerable:!0,configurable:!0}),t.prototype.onButtonListClick=function(e){this.focusedIndex=this.overflowButtons.findIndex((function(t){return t.nativeElement.contains(e.target)}))},t.prototype.onMainButtonClick=function(e){this.buttonClick.emit(e),this.focusedIndex=0},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(e){void 0===e&&(e={}),this.overflows?this.overflowButtons.length>0&&(this.focusedIndex=j(this.getPrevKey(),this.getNextKey(),this.overflowButtons.map((function(e){return e.nativeElement})))(e),this.focusButton(this.focusedIndex,e)):"focus"!==e.type&&"keydown"!==e.type||this.toolbarSplitButton.focus()},t.prototype.handleKey=function(e){if(!this.overflows&&(e.keyCode===this.getPrevKey(this.overflows)||e.keyCode===this.getNextKey(this.overflows)))return!1;if(this.overflows){var t=O(this.overflowButtons),n=k(this.focusedIndex);return this.focusedIndex=C(this.getPrevKey(),this.getNextKey(),t)(this.focusedIndex,e),this.focusButton(this.focusedIndex,e),!n(this.focusedIndex)}},t.prototype.focusButton=function(e,t){t.type&&"focus"!==t.type&&"keydown"!==t.type&&"click"!==t.type||this.overflowButtons[e].nativeElement.focus()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showText",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"showIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"text",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"icon",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"iconClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"imageUrl",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"fillMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"look",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"buttonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"arrowButtonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"arrowButtonIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array),Object(i.__metadata)("design:paramtypes",[Array])],t.prototype,"data",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"buttonClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"itemClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"close",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("toolbarSplitButton",{static:!1}),Object(i.__metadata)("design:type",p.SplitButtonComponent)],t.prototype,"toolbarSplitButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowSplitButton",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"overflowSplitButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("overflowSplitButtonButtonList",{static:!1}),Object(i.__metadata)("design:type",M)],t.prototype,"overflowSplitButtonButtonList",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarSplitButton",providers:[{provide:I,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-splitbutton",template:'\n <ng-template #toolbarTemplate>\n <kendo-splitbutton\n #toolbarSplitButton\n [data]="data"\n [text]="toolbarOptions.text"\n [icon]="toolbarOptions.icon"\n [iconClass]="toolbarOptions.iconClass"\n [imageUrl]="toolbarOptions.imageUrl"\n [buttonClass]="buttonClass"\n [arrowButtonClass]="arrowButtonClass"\n [arrowButtonIcon]="arrowButtonIcon"\n [disabled]="disabled"\n [tabIndex]="-1"\n [textField]="textField"\n [popupSettings]="popupSettings"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n (buttonClick)="buttonClick.emit($event)"\n (open)="open.emit($event)"\n (close)="close.emit($event)"\n (itemClick)="itemClick.emit($event)"\n >\n </kendo-splitbutton>\n </ng-template>\n <ng-template #popupTemplate>\n <button\n #overflowSplitButton\n type="button"\n tabindex="-1"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n kendoButton\n class="k-overflow-button"\n [disabled]="disabled"\n [icon]="overflowOptions.icon"\n [iconClass]="overflowOptions.iconClass"\n [imageUrl]="overflowOptions.imageUrl"\n [ngClass]="buttonClass"\n (click)="buttonClick.emit($event)"\n (click)="onMainButtonClick($event)"\n >\n {{ overflowOptions.text }}\n </button>\n <kendo-toolbar-buttonlist\n #overflowSplitButtonButtonList\n [data]="data"\n [disabled]="disabled"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n [textField]="textField"\n (itemClick)="itemClick.emit($event)"\n (click)="onButtonListClick($event)"\n >\n </kendo-toolbar-buttonlist>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[])],t)}(I),F=function(e){function t(){return e.call(this)||this}var n;return Object(i.__extends)(t,e),n=t,t.prototype.canFocus=function(){return!1},t.prototype.focus=function(){},t.prototype.handleKey=function(){return!1},t.prototype.ngAfterViewInit=function(){this.popupTemplate||(this.popupTemplate=this.toolbarTemplate)},Object(i.__decorate)([Object(o.ViewChild)("toolbarTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("separator",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"separator",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarSeparator",providers:[{provide:I,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-separator",template:'\n <ng-template #toolbarTemplate>\n <div class="k-separator"></div>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[])],t)}(I),N=function(){function e(){}return e.prototype.getElement=function(){return this.element.nativeElement},e.prototype.querySelector=function(e){return this.element.nativeElement.querySelector(e)},e.prototype.querySelectorAll=function(e){return this.element.nativeElement.querySelectorAll(e)},e.prototype.findFocusable=function(){return e=this.element.nativeElement,void 0===(t=!1)&&(t=!0),g(e,(function(e){return v(e,t)}));var e,t},e.prototype.findFocusableChild=function(e){return e||(e=this.findFocusable()),function(e,t){return void 0===t&&(t=!0),g(e,(function(e){return v(e,t)}),!1)}(e,!1)},e.prototype.findNextFocusableSibling=function(e){return e||(e=this.findFocusable()),y(e,!1)},e.prototype.findPrevFocusableSibling=function(e){return e||(e=this.findFocusable()),y(e,!1,!0)},e.prototype.setAttribute=function(e,t,n){this.renderer.setAttribute(e,t,n)},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),L=function(){function e(e,t,n,i){var r=this;this.element=e,this.renderer=t,this.rendererService=n,this.refreshService=i,this.rendererClick=new o.EventEmitter,this.rendererService.element=e,this.rendererService.renderer=this,this.refreshSubscription=this.refreshService.onRefresh.subscribe((function(e){r.tool===e&&r.refresh()}))}return e.prototype.onClick=function(e){this.rendererClick.emit({context:this,event:e})},e.prototype.ngOnInit=function(){this.resizable?"toolbar"===this.location?(this.template=this.tool.toolbarTemplate,this.renderer.setStyle(this.element.nativeElement,"visibility","hidden"),this.renderer.setStyle(this.element.nativeElement,"display","none")):(this.template=this.tool.popupTemplate,this.renderer.setStyle(this.element.nativeElement,"display","none")):(this.tool.overflows=!1,this.template=this.tool.toolbarTemplate,this.renderer.setStyle(this.element.nativeElement,"visibility","display"),this.renderer.setStyle(this.element.nativeElement,"display","inline-block"))},e.prototype.ngOnDestroy=function(){this.refreshSubscription.unsubscribe()},e.prototype.ngAfterViewInit=function(){this.resizable&&this.refresh()},Object.defineProperty(e.prototype,"width",{get:function(){return this.tool.overflows?0:m(this.element.nativeElement)},enumerable:!0,configurable:!0}),e.prototype.isDisplayed=function(){return"none"!==this.element.nativeElement.style.display},e.prototype.refresh=function(){this.resizable&&("toolbar"===this.location?(this.renderer.setStyle(this.element.nativeElement,"visibility",this.tool.visibility),this.renderer.setStyle(this.element.nativeElement,"display",this.tool.toolbarDisplay)):this.renderer.setStyle(this.element.nativeElement,"display",this.tool.overflowDisplay))},e.prototype.setAttribute=function(e,t,n){this.renderer.setAttribute(e,t,n)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",I)],e.prototype,"tool",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"location",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"resizable",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"rendererClick",void 0),Object(i.__decorate)([Object(o.HostListener)("click",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onClick",null),e=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoToolBarRenderer",providers:[N],selector:"kendo-toolbar-renderer",template:'\n <ng-container *ngIf="location === \'toolbar\'">\n <ng-template [ngTemplateOutlet]="template"></ng-template>\n </ng-container>\n <ng-container *ngIf="location === \'overflow\' && tool.responsive">\n <ng-template [ngTemplateOutlet]="template"></ng-template>\n </ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.Renderer2,N,f])],e)}(),V=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"moreToolsTitle",void 0),t}(s.ComponentMessages),H=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:V,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoToolbarLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService])],t)}(V),K=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:V,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-toolbar-messages",template:""}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService])],t)}(V),$=[I,P,A,z,R,F],W=[L,M,K,H],U=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[B,$,W],exports:[B,$,K,H],imports:[u.CommonModule,p.ButtonsModule,r.PopupModule,a.ResizeSensorModule]})],e)}()},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(5),a=function(){function e(){this.needsCheck=new r.Subject}return e=i.__decorate([o.Injectable()],e)}();t.EditorToolsService=a},function(e,t){e.exports=a},function(e,t,n){"use strict";n.r(t),n.d(t,"setScriptKey",(function(){return d})),n.d(t,"validatePackage",(function(){return l}));var i,o,r=["AgfZ","turOExC=","zNvUy3rPB24=","z3jVDxa=","ChvIBgLZAerHDgu=","zgf0yq==","DgLTzxn0yw1W","vM5SC2O=","rejpz2u=","DfvPvvq=","D01gsvi=","u0Xdu2y=","C2nYAxb0s2v5","Dg9mB2nHBgvtDhjPBMC=","r3bNtu8=","C2v0","ChjVzhvJDe5HBwu=","BgLJzw5ZAw5Nrg9JC1vYBa==","vgHLihbYB2r1y3qGAxmGBM90igLUy2X1zgvKigLUihrOzsbSAwnLBNnLlGO=","DMvYC2LVBG==","C1DHyu0=","ChjVzhvJDhm=","CNfLrgK=","uKP0uwG=","CgfYC2u=","y3DYvhq=","zxHWAxj5rgf0zq==","uMLXufK=","tM8GBgLJzw5ZzsbMB3vUzc4k","tNz1Awe=","z3jVDxbfBMq=","sK1Vvey=","zMLUza==","D2fYBG==","tfDRtxq=","CgfJA2fNzu5HBwu=","Dw5KzwzPBMvK","C3niBfO=","BgLJzw5Zzuv4CgLYyxrPB25eyxrL","ChjVzhvJDenVzgvZ","tgLJzw5ZzsbHy3rPDMf0Aw9UigzHAwXLzcbMB3iG","uhjVz3jLC3mG","tfLwDLa=","BgvUz3rO","lcb0AguGCgfJA2fNzsb3yxmGChvIBgLZAgvKig9Uia==","uvPnu2m=","BMfTzq==","B2jQzwn0","igzVCIbTB3jLigLUzM9YBwf0Aw9UlGO=","zvn3tLG=","u2vLia==","s0PPBvO=","zxbwz0u=","zg9JC1vYBa==","z2v0","DhLWzq==","y29Kzq==","ww91CIbSAwnLBNnLigv4CgLYzwqGB24G"];i=r,o=391,function(e){for(;--e;)i.push(i.shift())}(++o);var a=function(e,t){var n=r[e-=0];if(void 0===a.IhMVZF){a.uAzrZg=function(e){for(var t=function(e){for(var t,n,i=String(e).replace(/=+$/,""),o="",r=0,a=0;n=i.charAt(a++);~n&&(t=r%4?64*t+n:n,r++%4)?o+=String.fromCharCode(255&t>>(-2*r&6)):0)n="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(n);return o}(e),n=[],i=0,o=t.length;i<o;i++)n+="%"+("00"+t.charCodeAt(i).toString(16)).slice(-2);return decodeURIComponent(n)},a.jhAfvh={},a.IhMVZF=!0}var i=a.jhAfvh[e];return void 0===i?(n=a.uAzrZg(n),a.jhAfvh[e]=n):n=i,n},s={data:' {"timestamp":1643626140,"products":[{"trial":false,"code":"KENDOUIREACT","licenseExpirationDate":1656874800},{"trial":false,"code":"KENDOUICOMPLETE","licenseExpirationDate":1656874800},{"trial":false,"code":"KENDOUIVUE","licenseExpirationDate":1656874800},{"trial":false,"code":"KENDOUIANGULAR","licenseExpirationDate":1656874800}],"integrity":"l37ZhWg17/MGXmBvfpw8DLk3814="} '},c=new Map;function d(e){}function l(e){if(c[a("0xf")](e[a("0x3")])){if(a("0x8")==a("0x8"))return c[a("0xb")](e[a("0x3")])}var t,n=e[a("0x22")]?" v"+e[a("0x22")]:"",i=e[a("0x3")]+n,o=JSON[a("0x27")](s[a("0x14")]),r=!o[a("0x1b")]&&!o[a("0x15")],d=o[a("0x1b")]&&typeof KendoLicensing===a("0x33"),l=function(e,t){var n=e[a("0x24")];if(!n||!n[a("0x0")]){if(a("0x26")!==a("0x23"))return null}var i=new Set(t);return n[a("0x2f")]((function(e){if(a("0x39")==a("0x39"))return i[a("0xf")](e[a("0xd")])}))}(o,e[a("0x36")]);if(r||d)if(a("0x1d")==a("0x1d"))t={type:0,packageName:i,docsUrl:e[a("0x20")]};else{}else if(a("0x25")===a("0x10")){}else if(l){if(a("0x6")===a("0x2")){}else if(l[a("0x35")]<e[a("0x13")])if(a("0x2e")==a("0x2e"))t={type:2,packageName:i,publishDate:p(e[a("0x13")]),expiryDate:p(l[a("0x35")]),docsUrl:e[a("0x20")]};else{}}else if(a("0x31")!=a("0x31")){}else t={type:1,packageName:i,docsUrl:e[a("0x20")]};if(t&&typeof console===a("0x4"))if(a("0x17")!==a("0x2c")){var u=a("0x38")+e[a("0x1f")],h=typeof console[a("0x12")]===a("0x11");if(h)if(a("0x18")==a("0x18"))console[a("0x12")](u);else{}else if(a("0x2a")==a("0x2a"))console[a("0x30")](u);else{}if(console[a("0x30")](function(e){var t=a("0x37")+e[a("0x32")]+"\n";if(2===e[a("0xc")])if(a("0x16")!=a("0x16")){}else t+=a("0xe")+e[a("0x29")][a("0x1c")]()+a("0x1")+e[a("0x13")][a("0x1c")]()+".\n";else if(0===e[a("0xc")])if(a("0x28")===a("0x34")){}else t+=a("0x2b");else if(1===e[a("0xc")])if(a("0x9")===a("0x1a")){}else t+=a("0x21");return t+=a("0x7")+e[a("0xa")]+a("0x5")}(t)),h)if(a("0x19")!=a("0x19")){}else console[a("0x2d")]()}else{}var f=!t;return c[a("0x1e")](e[a("0x3")],f),f}function p(e){return new Date(1e3*e)}},function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return u})),n.d(t,"e",(function(){return h})),n.d(t,"f",(function(){return m})),n.d(t,"h",(function(){return g})),n.d(t,"d",(function(){return O})),n.d(t,"g",(function(){return k}));var i=function(){return"undefined"!=typeof window},o={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)(\.(\d+(\.\d+)?))?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},r={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},a={edge:/(edge)[ \/]([\w.]+)/i,webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i},s={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,ie:/MSIE|Windows\sPhone/i,chrome:/chrome|crios/i,webkit:/webkit/i},c=function(e,t,n){for(var i in t)if(t.hasOwnProperty(i)&&t[i].test(e))return i;return void 0!==n?n:e},d=function(e){var t,n=[];for(var i in o)if(o.hasOwnProperty(i)){if(!(n=e.match(o[i])))continue;if("windows"===i&&"plugins"in window.navigator)return null;var a={};return a.device=i,a.browser=c(e,s,"default"),a.name=c(i,r),a[a.name]=!0,a.majorVersion=n[2],a.minorVersion=n[3]?n[3].replace("_","."):".0",t=a.minorVersion.replace(".","").substr(0,2),a.flatVersion=a.majorVersion+t+new Array(3-(t.length<3?t.length:2)).join("0"),a.cordova=void 0!==typeof window.PhoneGap||void 0!==typeof window.cordova,a.appMode=window.navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||a.cordova,a}return null},l=function(e){var t=null,n=[];for(var i in a)if(a.hasOwnProperty(i)&&(n=e.match(a[i]))){(t={})[i]=!0,t[n[1].toLowerCase().split(" ")[0].split("/")[0]]=!0,t.version=parseInt(document.documentMode||n[2],10);break}return t},p=i()&&window.navigator?window.navigator.userAgent:null,u=p?l(p):null,h=p?d(p):null,f=i()&&"ontouchstart"in window,b=u&&!u.chrome&&window.MSPointerEvent,m=u&&!u.chrome&&window.PointerEvent,g=h&&(f||b||m),v=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g;function y(e){var t=[];return e.replace(v,(function(e,n,i,o){t.push(void 0!==n?n:i||o)})),t}var _={};function O(e){if(_[e])return _[e];var t=y(e);return _[e]=function(e){for(var n=e,i=0;i<t.length&&n;i++)n=n[t[i]];return n},_[e]}_[void 0]=function(e){return e};var j={undefined:function(e){return e}},C=function(e,t){return t&&t.arrays&&!isNaN(Number(e))?[]:{}};function k(e){if(j[e])return j[e];var t=y(e);return j[e]=function(e,n,i){for(var o=e,r=t.length-1,a=0;a<r&&o;a++)o=o[t[a]]=o[t[a]]||C(t[a+1],i);o[t[r]]=n},j[e]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,i,o,r)||this;return a.command=t,a.button=n,a.editor=i,a.localization=o,a.toolsService=r,a}return i.__extends(t,e),t.prototype.clickHandler=function(){this.editor.exec(this.command,this.editor.applyToWord),this.editor.focus()},t.prototype.pointerdownHandler=function(e){e.preventDefault()},t.prototype.onStateChange=function(e){this.button.selected=e[this.command].selected,this.button.disabled=e[this.command].disabled},t}(n(43).EditorCommandBase);t.EditorCommandButton=o},function(e,t,n){"use strict";n.r(t),n.d(t,"AlignService",(function(){return k})),n.d(t,"AnimationService",(function(){return I})),n.d(t,"DOMService",(function(){return j})),n.d(t,"PositionService",(function(){return w})),n.d(t,"ResizeService",(function(){return S})),n.d(t,"ScrollableService",(function(){return x})),n.d(t,"PopupService",(function(){return A})),n.d(t,"POPUP_CONTAINER",(function(){return P})),n.d(t,"PopupComponent",(function(){return B})),n.d(t,"PopupModule",(function(){return z})),n.d(t,"SCALE",(function(){return C}));var i=n(0),o=n(1),r=n(17),a=n(2),s=n(5),c=n(4),d=n(8),l=n(13),p=n(12),u=function(e,t){return e||{height:0,left:t.left,top:t.top,width:0}},h=function(){return"undefined"!=typeof window},f=/auto|scroll/,b=function(e){return function(e){return""+e.style.overflow+e.style.overflowX+e.style.overflowY}(e)||function(e){var t=window.getComputedStyle(e);return""+t.overflow+t.overflowX+t.overflowY}(e)};var m,g,v,y=(m=function(){if(!Object(a.isDocumentAvailable)()&&null!==document.body)return!1;var e=document.createElement("div");e.style.transform="matrix(10, 0, 0, 10, 0, 0)",e.innerHTML='<div style="position: fixed; top: 10px;">child</div>',document.body.appendChild(e);var t=10!==e.children[0].getBoundingClientRect().top;return document.body.removeChild(e),t},v=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v||(g=m.apply(void 0,e),v=!0),g}),_=function(e,t){return e&&1!==t?{height:e.height/t,left:e.left/t,top:e.top/t,width:e.width/t}:e},O=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],j=function(){function e(){}return e.prototype.addOffset=function(e,t){return{left:e.left+t.left,top:e.top+t.top}},e.prototype.addScroll=function(e,t){return Object(r.a)(e,t)},e.prototype.align=function(e){return Object(r.b)(e)},e.prototype.boundingOffset=function(e){return Object(r.c)(this.nativeElement(e))},e.prototype.getFontStyles=function(e){var t=this.getWindow();if(!t||!e)return[];var n=t.getComputedStyle(this.nativeElement(e));return O.map((function(e){return{key:e,value:n[e]}}))},e.prototype.getWindow=function(){return h()?window:null},e.prototype.hasOffsetParent=function(e){return!!e&&!!this.nativeElement(e).offsetParent},e.prototype.offset=function(e){return e?Object(r.f)(this.nativeElement(e)):null},e.prototype.offsetAtPoint=function(e,t){if(!e)return null;var n=this.nativeElement(e),i=n.style,o=i.left,a=i.top,s=i.transition;n.style.transition="none",n.style.left=t.left+"px",n.style.top=t.top+"px";var c=Object(r.f)(n);return n.style.left=o,n.style.top=a,n.offsetHeight,n.style.transition=s,c},e.prototype.nativeElement=function(e){return e?e.nativeElement||e:null},e.prototype.position=function(e,t,n){return void 0===n&&(n=1),e&&t?Object(r.h)(this.nativeElement(e),this.nativeElement(t),n):null},e.prototype.removeScroll=function(e,t){return Object(r.i)(e,t)},e.prototype.restrictToView=function(e){return Object(r.j)(e)},e.prototype.scrollPosition=function(e){return Object(r.k)(this.nativeElement(e))},e.prototype.scrollableParents=function(e){return function(e){var t=[];if(!Object(a.isDocumentAvailable)()||!h())return t;for(var n=e.parentElement;n;)(f.test(b(n))||n.hasAttribute("data-scrollable"))&&t.push(n),n=n.parentElement;return t.push(window),t}(this.nativeElement(e))},e.prototype.stackingElementOffset=function(e){var t=this.getRelativeContextElement(e);return t?Object(r.f)(t):null},e.prototype.stackingElementScroll=function(e){var t=this.getRelativeContextElement(e);return t?{x:t.scrollLeft,y:t.scrollTop}:{x:0,y:0}},e.prototype.getRelativeContextElement=function(e){if(!e||!y())return null;for(var t=this.nativeElement(e).parentElement;t;){if("none"!==window.getComputedStyle(t).transform)return t;t=t.parentElement}return null},e.prototype.useRelativePosition=function(e){return!!this.getRelativeContextElement(e)},e.prototype.windowViewPort=function(e){return Object(r.e)(this.nativeElement(e))},e.prototype.zIndex=function(e,t){return function(e,t){if(!e||!Object(a.isDocumentAvailable)()||!h())return null;var n=Object(r.l)(e,t);if(!n)return null;var i=[e].concat(Object(r.g)(e,n)).reduce((function(e,t){var n=t.style.zIndex||window.getComputedStyle(t).zIndex,i=parseInt(n,10);return i>e?i:e}),0);return i?i+1:null}(this.nativeElement(e),this.nativeElement(t))},e.prototype.zoomLevel=function(){return Object(a.isDocumentAvailable)()&&h()&&parseFloat((document.documentElement.clientWidth/window.innerWidth).toFixed(2))||1},e.prototype.isZoomed=function(){return this.zoomLevel()>1},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),C=new o.InjectionToken("Popup Document Scale"),k=function(){function e(e,t){void 0===t&&(t=1),this._dom=e,this.scale=t}return e.prototype.alignElement=function(e){var t=e.anchor,n=e.element,i=e.anchorAlign,o=e.elementAlign,r=e.margin,a=e.offset,s=e.positionMode,c=this.scale||1,d="fixed"===s||!this._dom.hasOffsetParent(n)?this.absoluteRect(t,n,a,c):this.relativeRect(t,n,a,c),l=_(this._dom.offset(n),c);return this._dom.align({anchorAlign:i,anchorRect:d,elementAlign:o,elementRect:l,margin:r})},e.prototype.absoluteRect=function(e,t,n,i){var o=this.elementScrollPosition(e,t),r=u(this._dom.offset(e),n),a=2*i,s=this._dom.stackingElementScroll(t);1!==i&&s&&(s.x/=a,s.y/=a);var c=this._dom.stackingElementOffset(t);return 1!==i&&c&&(c.left/=a,c.top/=a),this._dom.removeScroll(this._dom.addScroll(function(e,t){return t?{height:e.height,left:e.left-t.left,top:e.top-t.top,width:e.width}:e}(_(r,i),c),s),o)},e.prototype.elementScrollPosition=function(e,t){return e?{x:0,y:0}:this._dom.scrollPosition(t)},e.prototype.relativeRect=function(e,t,n,i){var o=u(this._dom.position(e,t,i),n);return _(o,i)},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__param)(1,Object(o.Inject)(C)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[j,Number])],e)}(),w=function(){function e(e,t){void 0===t&&(t=1),this._dom=e,this.scale=t}return e.prototype.positionElement=function(e){var t=e.anchor,n=e.currentLocation,i=e.element,o=e.anchorAlign,r=e.elementAlign,a=e.collisions,s=e.margin,c=this._dom,d=this.scale||1,l=c.offsetAtPoint(i,n),p=_(l,d),h=_(c.offset(t),d),f=u(h,n),b=e.viewPort||c.windowViewPort(i);b.width=b.width/d,b.height=b.height/d;var m=c.restrictToView({anchorAlign:o,anchorRect:f,collisions:a,elementAlign:r,elementRect:p,margin:s,viewPort:b}),g=c.addOffset(n,m.offset);return{flip:m.flip,flipped:m.flipped,offset:g}},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__param)(1,Object(o.Inject)(C)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[j,Number])],e)}(),S=function(){function e(e,t){this._dom=e,this._zone=t}return e.prototype.subscribe=function(e){var t=this;Object(a.isDocumentAvailable)()&&this._zone.runOutsideAngular((function(){t.subscription=Object(s.fromEvent)(t._dom.getWindow(),"resize").pipe(Object(c.auditTime)(1e3/60)).subscribe((function(){return e()}))}))},e.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.isUnsubscribed=function(){return this.subscription&&this.subscription.closed},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__metadata)("design:paramtypes",[j,o.NgZone])],e)}(),x=function(){function e(e,t){this._dom=e,this._zone=t}return e.prototype.forElement=function(e){return this.unsubscribe(),this.element=e,this},e.prototype.subscribe=function(e){var t=this;if(e&&Object(a.isDocumentAvailable)()&&this.element){var n=this._dom.nativeElement(this.element),i=this._dom.scrollableParents(this.element);this._zone.runOutsideAngular((function(){var o=i.map((function(e){return Object(s.fromEvent)(e,"scroll").pipe(Object(c.auditTime)(1e3/60))}));t.subscription=s.merge.apply(void 0,o).subscribe((function(o){var r=o.target,a=i.filter((function(e){return e===r})).length>0,s=r===document,c=r===window;(a||s||c)&&e(t.isVisible(n,r))}))}))}},e.prototype.unsubscribe=function(){this.subscription&&this.subscription.unsubscribe()},e.prototype.isVisible=function(e,t){var n=this._dom.boundingOffset(e),i=this._dom.boundingOffset(t);return!(1<i.top-n.bottom)&&(!(1<n.top-i.bottom)&&(!(1<n.left-i.right)&&!(1<i.left-n.right)))},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__metadata)("design:paramtypes",[j,o.NgZone])],e)}(),E={expand:function(e){var t="up"===e||"down"===e?"scaleY":"scaleX";return{start:{transform:t+"(0)",transformOrigin:"down"===e?"top":"left"===e?"right":"right"===e?"left":"bottom"},end:{transform:t+"(1)"}}},slide:function(e){var t="left"===e||"right"===e?"translateX":"translateY";return{start:{transform:t+"("+("right"===e||"down"===e?-100:100)+"%)"},end:{transform:t+"(0%)"}}},fade:function(){return{start:{opacity:0},end:{opacity:1}}},zoom:function(){return{start:{transform:"scale(0)"},end:{transform:"scale(1)"}}}},I=function(){function e(e){this.animationBuilder=e,this.start=new o.EventEmitter,this.end=new o.EventEmitter}return e.prototype.play=function(e,t,n){if(!this.flip||this.flip.horizontal!==n.horizontal||this.flip.vertical!==n.vertical){this.flip=n;var i=t.type||"slide",r=E[i];if(r){var a=r(this.getDirection(n,t));this.playStates(e,a,t)}else if(Object(o.isDevMode)())throw new Error('Unsupported animation type: "'+i+'". The supported types are slide, expand, fade and zoom.')}},e.prototype.ngOnDestroy=function(){this.stopPlayer()},e.prototype.playStates=function(e,t,n){var i=this;this.stopPlayer();var o=n.duration||100,r=this.animationBuilder.build([Object(d.style)(t.start),Object(d.animate)(o+"ms ease-in",Object(d.style)(t.end))]),a=this.player=r.create(e);a.onDone((function(){i.end.emit(),i.stopPlayer()})),this.start.emit(),a.play()},e.prototype.getDirection=function(e,t){var n=t.direction||"down";return e.horizontal&&("left"===n?n="right":"right"===n&&(n="left")),e.vertical&&("down"===n?n="up":"up"===n&&(n="down")),n},e.prototype.stopPlayer=function(){this.player&&(this.player.destroy(),this.player=null)},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__metadata)("design:paramtypes",[d.AnimationBuilder])],e)}(),T={name:"@progress/kendo-angular-popup",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1642583997,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"},D={left:-1e4,top:0},B=function(){function e(e,t,n,i,r,a,s,c,d){this.container=e,this._alignService=t,this.domService=n,this._positionService=i,this._resizeService=r,this._scrollableService=a,this.animationService=s,this._renderer=c,this._zone=d,this.animate=!0,this.anchorAlign={horizontal:"left",vertical:"bottom"},this.collision={horizontal:"fit",vertical:"flip"},this.popupAlign={horizontal:"left",vertical:"top"},this.copyAnchorStyles=!1,this.positionMode="fixed",this.offset=D,this.anchorViewportLeave=new o.EventEmitter,this.close=new o.EventEmitter,this.open=new o.EventEmitter,this.positionChange=new o.EventEmitter,this.resolvedPromise=Promise.resolve(null),this.initialCheck=!0,Object(l.validatePackage)(T),this._renderer.addClass(e.nativeElement,"k-animation-container"),this.updateFixedClass()}return e.prototype.ngOnInit=function(){this.reposition=this.reposition.bind(this),this._resizeService.subscribe(this.reposition),this.animationSubscriptions=this.animationService.start.subscribe(this.onAnimationStart.bind(this)),this.animationSubscriptions.add(this.animationService.end.subscribe(this.onAnimationEnd.bind(this))),this._scrollableService.forElement(this.anchor||this.container).subscribe(this.onScroll.bind(this)),this.currentOffset=D,this.setZIndex(),this.copyFontStyles(),this.updateFixedClass(),this.reposition()},e.prototype.ngOnChanges=function(e){e.copyAnchorStyles&&this.copyFontStyles(),e.positionMode&&this.updateFixedClass()},e.prototype.ngAfterViewInit=function(){var e=this;this.animate||this.resolvedPromise.then((function(){e.onAnimationEnd()}))},e.prototype.ngAfterViewChecked=function(){var e=this;this.initialCheck?this.initialCheck=!1:this._zone.runOutsideAngular((function(){e.unsubscribeReposition(),e.repositionSubscription=Object(s.from)(e.resolvedPromise).subscribe(e.reposition)}))},e.prototype.ngOnDestroy=function(){this.anchorViewportLeave.complete(),this.positionChange.complete(),this.close.emit(),this.close.complete(),this._resizeService.unsubscribe(),this._scrollableService.unsubscribe(),this.animationSubscriptions.unsubscribe(),this.unsubscribeReposition()},e.prototype.onResize=function(){this.reposition()},e.prototype.onAnimationStart=function(){this._renderer.removeClass(this.container.nativeElement,"k-animation-container-shown")},e.prototype.onAnimationEnd=function(){this._renderer.addClass(this.container.nativeElement,"k-animation-container-shown"),this.open.emit(),this.open.complete()},Object.defineProperty(e.prototype,"currentOffset",{get:function(){return this._currentOffset},set:function(e){this.setContainerStyle("left",e.left+"px"),this.setContainerStyle("top",e.top+"px"),this._currentOffset=e},enumerable:!0,configurable:!0}),e.prototype.setZIndex=function(){this.anchor&&this.setContainerStyle("z-index",String(this.domService.zIndex(this.anchor,this.container)))},e.prototype.reposition=function(){var e=this;if(Object(a.isDocumentAvailable)()){var t,n,i,o,r,s,c=this.position(),d=c.flip,l=c.offset;(!this.currentOffset||(t=this.currentOffset,n=l,i=t.left,o=t.top,r=n.left,s=n.top,Math.abs(i-r)>=1||Math.abs(o-s)>=1))&&(this.currentOffset=l,Object(a.hasObservers)(this.positionChange)&&this._zone.run((function(){return e.positionChange.emit({offset:l,flip:d})}))),this.animate&&this.animationService.play(this.contentContainer.nativeElement,this.animate,d),this.resizeSensor.acceptSize()}},e.prototype.position=function(){var e=this._alignService.alignElement({anchor:this.anchor,anchorAlign:this.anchorAlign,element:this.container,elementAlign:this.popupAlign,margin:this.margin,offset:this.offset,positionMode:this.positionMode});return this._positionService.positionElement({anchor:this.anchor,anchorAlign:this.anchorAlign,collisions:this.collision,currentLocation:e,element:this.container,elementAlign:this.popupAlign,margin:this.margin})},e.prototype.onScroll=function(e){var t=this,n=Object(a.hasObservers)(this.anchorViewportLeave);e||!n?this.reposition():n&&this._zone.run((function(){t.anchorViewportLeave.emit()}))},e.prototype.copyFontStyles=function(){var e=this;this.anchor&&this.copyAnchorStyles&&this.domService.getFontStyles(this.anchor).forEach((function(t){return e.setContainerStyle(t.key,t.value)}))},e.prototype.updateFixedClass=function(){var e="fixed"===this.positionMode?"addClass":"removeClass";this._renderer[e](this.container.nativeElement,"k-animation-container-fixed")},e.prototype.setContainerStyle=function(e,t){this._renderer.setStyle(this.container.nativeElement,e,t)},e.prototype.unsubscribeReposition=function(){this.repositionSubscription&&this.repositionSubscription.unsubscribe()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"animate",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"anchor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"anchorAlign",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"collision",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"popupAlign",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"copyAnchorStyles",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"popupClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"positionMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"offset",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"margin",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"anchorViewportLeave",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"close",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"positionChange",void 0),Object(i.__decorate)([Object(o.ViewChild)("container",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"contentContainer",void 0),Object(i.__decorate)([Object(o.ViewChild)(a.ResizeSensorComponent,{static:!0}),Object(i.__metadata)("design:type",a.ResizeSensorComponent)],e.prototype,"resizeSensor",void 0),e=Object(i.__decorate)([Object(o.Component)({exportAs:"kendo-popup",providers:[k,I,j,w,S,x],selector:"kendo-popup",template:'\n <div class="k-popup" [ngClass]="popupClass" #container>\n <ng-content></ng-content>\n <ng-template [ngTemplateOutlet]="content" [ngIf]="content"></ng-template>\n <kendo-resize-sensor [rateLimit]="100" (resize)="onResize()">\n </kendo-resize-sensor>\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,k,j,w,S,x,I,o.Renderer2,o.NgZone])],e)}(),P=new o.InjectionToken("Popup Container"),A=function(){function e(e,t,n,i){this.applicationRef=e,this.componentFactoryResolver=t,this.injector=n,this.container=i}return Object.defineProperty(e.prototype,"rootViewContainer",{get:function(){var e=this.applicationRef.components||[];if(e[0])return e[0];throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rootViewContainerNode",{get:function(){return this.container?this.container.nativeElement:this.getComponentRootNode(this.rootViewContainer)},enumerable:!0,configurable:!0}),e.prototype.open=function(e){void 0===e&&(e={});var t=this.contentFrom(e.content),n=t.component,i=t.nodes,o=this.appendPopup(i,e.appendTo),r=o.instance;this.projectComponentInputs(o,e),o.changeDetectorRef.detectChanges(),n&&n.changeDetectorRef.detectChanges();var a=this.getComponentRootNode(o);return{close:function(){var e;n&&n.destroy(),o.destroy(),(e=a)&&e.parentNode&&e.parentNode.removeChild(e)},content:n,popup:o,popupAnchorViewportLeave:r.anchorViewportLeave,popupClose:r.close,popupElement:a,popupOpen:r.open,popupPositionChange:r.positionChange}},e.prototype.appendPopup=function(e,t){var n=this.createComponent(B,e,t);return t||this.rootViewContainerNode.appendChild(this.getComponentRootNode(n)),n},e.prototype.getComponentRootNode=function(e){return e.location.nativeElement},e.prototype.getComponentFactory=function(e){return this.componentFactoryResolver.resolveComponentFactory(e)},e.prototype.createComponent=function(e,t,n){var i=this.getComponentFactory(e);if(n)return n.createComponent(i,void 0,this.injector,t);var o=i.create(this.injector,t);return this.applicationRef.attachView(o.hostView),o},e.prototype.projectComponentInputs=function(e,t){return Object.getOwnPropertyNames(t).filter((function(e){return"content"!==e||t.content instanceof o.TemplateRef})).map((function(n){e.instance[n]=t[n]})),e},e.prototype.contentFrom=function(e){if(!e||e instanceof o.TemplateRef)return{component:null,nodes:[[]]};var t=this.createComponent(e);return{component:t,nodes:[t?[t.location.nativeElement]:[]]}},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__param)(3,Object(o.Inject)(P)),Object(i.__param)(3,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.ApplicationRef,o.ComponentFactoryResolver,o.Injector,o.ElementRef])],e)}(),M=[B],z=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[M],entryComponents:[M],exports:[M],imports:[p.CommonModule,a.ResizeSensorModule],providers:[A]})],e)}()},function(e,t,n){"use strict";n.d(t,"b",(function(){return d})),n.d(t,"a",(function(){return l})),n.d(t,"c",(function(){return g})),n.d(t,"f",(function(){return y})),n.d(t,"g",(function(){return _})),n.d(t,"h",(function(){return w})),n.d(t,"i",(function(){return S})),n.d(t,"j",(function(){return D})),n.d(t,"k",(function(){return O})),n.d(t,"l",(function(){return P})),n.d(t,"d",(function(){return h})),n.d(t,"e",(function(){return m}));var i="bottom",o="center",r="middle",a="left",s="right",c="top",d=function(e){var t=e.anchorRect,n=e.anchorAlign,a=e.elementRect,c=e.elementAlign,d=e.margin;void 0===d&&(d={});var l=n.horizontal,p=n.vertical,u=c.horizontal,h=c.vertical,f=d.horizontal||0,b=d.vertical||0,m=t.top,g=t.left;return p===i&&(m+=t.height),p!==o&&p!==r||(m+=Math.round(t.height/2)),h===i&&(m-=a.height,b*=-1),h!==o&&h!==r||(m-=Math.round(a.height/2),b*=-1),l===s&&(g+=t.width),l!==o&&l!==r||(g+=Math.round(t.width/2)),u===s&&(g-=a.width,f*=-1),u!==o&&u!==r||(g-=Math.round(a.width/2),f*=-1),{top:m+b,left:g+f}};function l(e,t){return{top:e.top+t.y,left:e.left+t.x,height:e.height,width:e.width}}function p(e){return e.ownerDocument||e.document||e}var u=function(e){return p(e).defaultView},h=function(e){return p(e).documentElement},f=0;function b(){if(!f&&"undefined"!=typeof document){var e=document.createElement("div");e.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",e.innerHTML=" ",document.body.appendChild(e),f=e.offsetWidth-e.scrollWidth,document.body.removeChild(e)}return f}function m(e){var t=u(e),n=h(e),i={height:t.innerHeight,width:t.innerWidth};return n.scrollHeight-n.clientHeight>0&&(i.width-=b()),i}var g=function(e){if(!e.getBoundingClientRect){var t=m(e);return{bottom:t.height,left:0,right:t.width,top:0}}var n=e.getBoundingClientRect();return{bottom:n.bottom,left:n.left,right:n.right,top:n.top}},v=function(e){for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||h(e)},y=function(e){var t=e.getBoundingClientRect(),n=t.left,i=t.top;return t.height||t.width||(t=function(e){var t=e.style,n=t.display,i=t.left,o=t.position;e.style.display="",e.style.left="-10000px",e.style.position="absolute";var r=e.getBoundingClientRect();return e.style.display=n,e.style.left=i,e.style.position=o,r}(e)),{top:i,left:n,height:t.height,width:t.width}},_=function(e,t){for(var n=[],i=e.parentNode;i&&(n.push(i),i!==t);)i=i.parentNode;return n};function O(e){var t=h(e),n=u(e);return{x:n.pageXOffset||t.scrollLeft||0,y:n.pageYOffset||t.scrollTop||0}}var j=function(e){return e===(e.ownerDocument||{}).body?O(e):{x:e.scrollLeft,y:e.scrollTop}};var C=function(e,t){var n=u(e),i=n.getComputedStyle(e),o=y(e),r=t||v(e),a=e.ownerDocument,s=r!==a.body&&r!==a.documentElement,c={top:0,left:0};if("fixed"!==i.position&&s){var d=n.getComputedStyle(r);(c=y(r)).top+=parseInt(d.borderTopWidth,10),c.left+=parseInt(d.borderLeftWidth,10)}return{top:o.top-c.top,left:o.left-c.left,height:o.height,width:o.width}},k=function(e,t){return e?j(e):function(e){var t=v(e);return t?j(t):{x:0,y:0}}(t)},w=function(e,t,n){void 0===n&&(n=1);var i=t?v(t):null,o=C(e,i),r=o.top,a=o.left,s=o.height,c=o.width,d=k(i,e),l=d.x,p=d.y,u=e.ownerDocument,h=i===u.body||i===u.documentElement?1:n;return{top:r+p*h,left:a+l*h,height:s,width:c}};function S(e,t){return{top:e.top-t.y,left:e.left-t.x,height:e.height,width:e.width}}var x="fit",E="flip",I=function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),e<0&&(i=-e),i},T=function(e){var t=e.offset,n=e.size,i=e.anchorSize,s=e.viewPortSize,d=e.anchorAlignPoint,l=e.elementAlignPoint,p=0,u=2*e.margin;if(l!==d&&!(l===o||l===r)&&!(d===o||d===r)){var h=d===c||d===a;t<0&&h?t+(p=n+i+u)+n>s&&(p=0):t>=0&&!h&&(t+n>s&&(p+=-(i+n+u)),t+p<0&&(p=0))}return p},D=function(e){var t=e.anchorRect,n=e.anchorAlign,i=e.elementRect,o=e.elementAlign,r=e.collisions,a=e.viewPort,s=e.margin;void 0===s&&(s={});var c=i.top,d=i.left,l=i.height,p=i.width,u=a.height,h=a.width,f=s.horizontal||0,b=s.vertical||0,m=0,g=0,v=r.vertical===x,y=r.horizontal===x,_=r.vertical===E,O=r.horizontal===E;v&&(g+=I(c,l,u)),y&&(m+=I(d,p,h)),_&&(g+=T({margin:b,offset:c,size:l,anchorSize:t.height,viewPortSize:u,anchorAlignPoint:n.vertical,elementAlignPoint:o.vertical})),O&&(m+=T({margin:f,offset:d,size:p,anchorSize:t.width,viewPortSize:h,anchorAlignPoint:n.horizontal,elementAlignPoint:o.horizontal}));var j=_&&0!==g,C=O&&0!==m,k=v&&0!==g,w=y&&0!==m;return{flipped:C||j,fitted:k||w,flip:{horizontal:C,vertical:j},fit:{horizontal:w,vertical:k},offset:{left:m,top:g}}},B=function(e){for(var t=[],n=e.parentNode.firstElementChild;n;)n!==e&&t.push(n),n=n.nextElementSibling;return t},P=function(e,t){for(var n,i,o=_(e),r=t;r&&(n=B(r),!(i=o.reduce((function(e,t){return e.concat(n.filter((function(e){return e===t})))}),[])[0]));)r=r.parentElement;return i};A=function(e){if(!R())return!1;var t=e?e.ownerDocument:document;if(!t||!t.body)return!1;var n=t.createElement("div");n.style.transform="matrix(10, 0, 0, 10, 0, 0)",n.innerHTML='<div style="position: fixed; top: 10px;">child</div>',t.body.appendChild(n);var i=10!==n.children[0].getBoundingClientRect().top;return t.body.removeChild(n),i},z=!1;var A,M,z,R=function(){return Boolean("undefined"!=typeof window&&window.document&&window.document.createElement)}},function(e,t,n){"use strict";n.r(t),n.d(t,"DIALOG_DIRECTIVES",(function(){return ve})),n.d(t,"DialogContainerDirective",(function(){return ue})),n.d(t,"DialogContainerService",(function(){return W})),n.d(t,"CustomMessagesComponent",(function(){return be})),n.d(t,"DIALOG_LOCALIZATION_SERVICE",(function(){return M})),n.d(t,"LocalizedMessagesDirective",(function(){return fe})),n.d(t,"Messages",(function(){return he})),n.d(t,"TitleBarLocalizationService",(function(){return z})),n.d(t,"SHARED_DIRECTIVES",(function(){return me})),n.d(t,"SharedModule",(function(){return ge})),n.d(t,"DragResizeService",(function(){return X})),n.d(t,"NavigationService",(function(){return ee})),n.d(t,"WindowContainerDirective",(function(){return _e})),n.d(t,"WindowContainerService",(function(){return de})),n.d(t,"ResizeHandleDirective",(function(){return Y})),n.d(t,"DialogComponent",(function(){return K})),n.d(t,"DialogTitleBarComponent",(function(){return R})),n.d(t,"DialogContentBase",(function(){return $})),n.d(t,"DialogActionsComponent",(function(){return P})),n.d(t,"DialogService",(function(){return G})),n.d(t,"DialogCloseResult",(function(){return L})),n.d(t,"DialogRef",(function(){return H})),n.d(t,"DialogSettings",(function(){return V})),n.d(t,"DialogAction",(function(){return N})),n.d(t,"WindowComponent",(function(){return te})),n.d(t,"WindowTitleBarComponent",(function(){return Q})),n.d(t,"WindowMaximizeActionDirective",(function(){return ne})),n.d(t,"WindowMinimizeActionDirective",(function(){return ie})),n.d(t,"WindowCloseActionDirective",(function(){return oe})),n.d(t,"WindowRestoreActionDirective",(function(){return re})),n.d(t,"WindowSettings",(function(){return ae})),n.d(t,"WindowRef",(function(){return ce})),n.d(t,"WindowCloseResult",(function(){return se})),n.d(t,"WindowService",(function(){return pe})),n.d(t,"DialogModule",(function(){return ye})),n.d(t,"WindowModule",(function(){return ke})),n.d(t,"DialogsModule",(function(){return we}));var i,o=n(0),r=n(1),a=n(8),s=n(5),c=n(4),d=n(3),l=n(13),p=n(2),u=n(17),h=n(19),f=n(12),b=function(e){return null!=e},m=function(e){return String(e).trim().split(" ")},g=/^(?:a|input|select|textarea|button|object)$/i;!function(e){e[e.esc=27]="esc",e[e.tab=9]="tab",e[e.enter=13]="enter",e[e.space=32]="space",e[e.ctrl=17]="ctrl",e[e.shift=16]="shift",e[e.left=37]="left",e[e.up=38]="up",e[e.right=39]="right",e[e.down=40]="down"}(i||(i={}));var v=function(e,t){var n=m(t);return Boolean(m(e.className).find((function(e){return n.indexOf(e)>=0})))},y=function(e,t){if(void 0===t&&(t=!0),e.tagName){var n=e.tagName.toLowerCase(),i=e.getAttribute("tabIndex"),o=null!==i&&!isNaN(i)&&i>-1;return(g.test(n)?!e.disabled:o)&&(!t||function(e){var t=e.getBoundingClientRect();return!(!t.width||!t.height)&&"hidden"!==window.getComputedStyle(e).visibility}(e))}return!1},_=function(e,t,n){for(var i in e)i&&t.setAttribute(n,i,e[i])},O=function(e){return T(e)?j(e):I(e)?C(e):Array.isArray(e)?k(e):void 0},j=function(e){var t=[];return Object.keys(e).forEach((function(n){var i=B(n);e[n]&&i[0]&&t.push.apply(t,i)})),t},C=function(e){var t=[];return B(e).forEach((function(e){t.push(e)})),t},k=function(e){var t=[];return e.forEach((function(e){var n=B(e);n[0]&&t.push.apply(t,n)})),t},w=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","iframe","object","embed","*[tabindex]","*[contenteditable]"].join(","),S=function(e){var t=e.originalEvent;t.stopPropagation(),t.preventDefault()},x=["n","e","s","w","se","sw","ne","nw"],E=["top","left","width","height"],I=function(e){return e instanceof String||"string"==typeof e},T=function(e){return b(e)&&!Array.isArray(e)&&"object"==typeof e},D=function(e){return e+(function(e){return"number"==typeof e&&isFinite(e)}(e)?"px":"")},B=function(e){return e.trim().replace(/\s+/g," ").split(" ")},P=function(){function e(e){this.el=e,this.layout="stretched",this.action=new r.EventEmitter,this.buttonGroupClassName=!0}return Object.defineProperty(e.prototype,"className",{get:function(){return"stretched"===this.layout},enumerable:!0,configurable:!0}),e.prototype.actionTemplate=function(){return this.actions instanceof r.TemplateRef},e.prototype.onButtonClick=function(e,t){this.action.emit(e)},e.prototype.buttonClass=function(e){var t=["k-button k-button-md k-rounded-md"],n=e.fillMode?e.fillMode:"solid",i=e.themeColor?e.themeColor:"base",o=e.cssClass?O(e.cssClass):[];return t.push("k-button-"+n+" k-button-"+n+"-"+i),o.length>0&&(t=t.concat(o)),t.join(" ")},Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"actions",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"layout",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"action",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-dialog-buttongroup"),Object(r.HostBinding)("class.k-actions"),Object(o.__metadata)("design:type",Boolean)],e.prototype,"buttonGroupClassName",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-actions-stretched"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"className",null),e=Object(o.__decorate)([Object(r.Component)({selector:"kendo-dialog-actions",template:'\n <ng-content *ngIf="!actions"></ng-content>\n <ng-container *ngIf="!actionTemplate()">\n <button\n type="button"\n [ngClass]="buttonClass(action)"\n (click)="onButtonClick(action, $event)"\n *ngFor="let action of actions"\n [attr.aria-label]="action.text"\n >\n {{ action.text }}\n </button>\n </ng-container>\n <ng-template [ngTemplateOutlet]="actions" *ngIf="actionTemplate()"></ng-template>\n '}),Object(o.__metadata)("design:paramtypes",[r.ElementRef])],e)}(),A=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}(),M=new r.InjectionToken("Dialog LocalizationService"),z=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r.dialogLocalization=o,r}return Object(o.__extends)(t,e),t.prototype.get=function(t){return this.dialogLocalization?this.dialogLocalization.get(t):e.prototype.get.call(this,t)},t=Object(o.__decorate)([Object(o.__param)(0,Object(r.Inject)(d.L10N_PREFIX)),Object(o.__param)(1,Object(r.Optional)()),Object(o.__param)(2,Object(r.Optional)()),Object(o.__param)(2,Object(r.Inject)(d.RTL)),Object(o.__param)(3,Object(r.Optional)()),Object(o.__param)(3,Object(r.Inject)(M)),Object(o.__metadata)("design:paramtypes",[String,d.MessageService,Boolean,d.LocalizationService])],t)}(d.LocalizationService),R=function(){function e(e,t,n){this.zone=e,this.hostElement=t,this.localizationService=n,this.close=new r.EventEmitter}return Object.defineProperty(e.prototype,"className",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closeButtonTitle",{get:function(){return this.closeTitle||this.localizationService.get("closeTitle")},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.zone.onStable.pipe(Object(c.take)(1)).subscribe((function(){e.hostElement.nativeElement.querySelector(".k-dialog-title").setAttribute("id",e.id)}))},e.prototype.onCloseClick=function(e){e.preventDefault();var t=new A;this.close.emit(t)},Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"close",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"closeTitle",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-window-titlebar"),Object(r.HostBinding)("class.k-dialog-titlebar"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"className",null),e=Object(o.__decorate)([Object(r.Component)({selector:"kendo-dialog-titlebar",providers:[z,{provide:d.LocalizationService,useExisting:z},{provide:d.L10N_PREFIX,useValue:"kendo.dialog"}],template:'\n <ng-container\n kendoDialogTitleBarLocalizedMessages\n i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"\n closeTitle="Close"\n >\n <div class="k-window-title k-dialog-title">\n <ng-content></ng-content>\n </div>\n\n <div class="k-window-actions k-dialog-actions">\n <button\n role="button"\n [attr.title]="closeButtonTitle"\n [attr.aria-label]="closeButtonTitle"\n class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-window-action k-dialog-action k-dialog-close"\n (click)="onCloseClick($event)"\n >\n <span class="k-button-icon k-icon k-i-x"></span>\n </button>\n </div>\n </ng-container>\n '}),Object(o.__param)(2,Object(r.Optional)()),Object(o.__metadata)("design:paramtypes",[r.NgZone,r.ElementRef,d.LocalizationService])],e)}(),F={name:"@progress/kendo-angular-dialog",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1643116783,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"},N=function(){},L=function(){},V=function(){},H=function(){},K=function(){function e(e,t,n,i,o){var a=this;this.wrapper=e,this.renderer=t,this.cdr=i,this.ngZone=o,this.actionsLayout="stretched",this.titleId=null,this.contentId=null,this.action=new r.EventEmitter,this.close=new r.EventEmitter,this.tabIndex=0,this.subscriptions=[],this.domSubs=new s.Subscription,Object(l.validatePackage)(F),this.direction=n.rtl?"rtl":"ltr",this.subscriptions.push(n.changes.subscribe((function(e){var t=e.rtl;return a.direction=t?"rtl":"ltr"}))),this.titleId=this.generateTitleId(),this.contentId=this.generateContentId()}return Object.defineProperty(e.prototype,"htmlAttributes",{get:function(){return this._htmlAttributes},set:function(e){_(e,this.renderer,this.wrapper.nativeElement);var t=this.wrapper.nativeElement,n=t.getAttribute("dir"),i=t.getAttribute("tabindex");this.direction!==n&&n&&(this.direction=n),this.tabIndex!==i&&i&&(this.tabIndex=i),this._htmlAttributes=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cssClass",{get:function(){return this._cssClass},set:function(e){this.setServiceClasses(this._cssClass,e),this._cssClass=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){var e=this;this.bubble("close",this.titlebarContent.first),this.renderer.setAttribute(this.wrapper.nativeElement.querySelector(".k-dialog"),"aria-describedby",this.contentId),this.titlebarContent.first?this.titlebarContent.first.id=this.titleId:this.subscriptions.push(this.titlebarContent.changes.subscribe((function(){b(e.titlebarContent.first)&&(e.titlebarContent.first.id=e.titleId,e.ngZone.onStable.pipe(Object(c.take)(1)).subscribe((function(){e.bubble("close",e.titlebarContent.first),e.renderer.setAttribute(e.wrapper.nativeElement.querySelector(".k-dialog"),"aria-labelledby",e.titleId)})))})))},e.prototype.ngAfterViewInit=function(){var e=this;this.handleInitialFocus(),this.bubble("close",this.titlebarView.first),this.bubble("action",this.actionsView),this.titlebarView.first||this.titlebarContent.first?this.renderer.setAttribute(this.wrapper.nativeElement.querySelector(".k-dialog"),"aria-labelledby",this.titleId):this.subscriptions.push(this.titlebarView.changes.subscribe((function(){b(e.titlebarView.first)&&(e.titlebarView.first.id=e.titleId,e.ngZone.onStable.pipe(Object(c.take)(1)).subscribe((function(){e.bubble("close",e.titlebarView.first),e.renderer.setAttribute(e.wrapper.nativeElement.querySelector(".k-dialog"),"aria-labelledby",e.titleId)})))}))),this.initDomEvents()},e.prototype.ngOnInit=function(){this.renderer.removeAttribute(this.wrapper.nativeElement,"title"),this.cdr.detectChanges()},e.prototype.ngOnDestroy=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions=[],this.domSubs&&this.domSubs.unsubscribe()},e.prototype.focus=function(){var e=this.wrapper.nativeElement;b(e)&&e.focus()},e.prototype.initDomEvents=function(){var e=this;this.wrapper&&this.ngZone.runOutsideAngular((function(){e.domSubs.add(e.renderer.listen(e.wrapper.nativeElement,"keydown",(function(t){e.onKeyDown(t)})))}))},e.prototype.onKeyDown=function(e){var t=this,n=e.target,o=n.parentElement;(v(n,"k-dialog-wrapper k-dialog-buttongroup k-dialog-action")||v(o,"k-dialog-wrapper k-dialog-buttongroup k-dialog-action"))&&e.keyCode===i.esc&&this.ngZone.run((function(){t.close.emit(new L)})),v(n,"k-button")&&v(o,"k-dialog-buttongroup")&&(e.keyCode===i.left||e.keyCode===i.right)&&this.ngZone.run((function(){t.handleActionButtonFocus(o,e.keyCode)})),e.keyCode===i.tab&&this.ngZone.run((function(){t.keepFocusWithinComponent(n,e)}))},e.prototype.setServiceClasses=function(e,t){var n=this,i=this.wrapper.nativeElement;e&&O(e).forEach((function(e){n.renderer.removeClass(i,e)})),t&&O(t).forEach((function(e){n.renderer.addClass(i,e)}))},e.prototype.handleInitialFocus=function(){var e=this.wrapper.nativeElement,t=this.findPrimary(e);if(this.autoFocusedElement){var n=e.querySelector(this.autoFocusedElement);n&&n.focus()}else this.shouldFocusPrimary(t)?t.focus():e.focus()},e.prototype.findPrimary=function(e){return function(e){for(var t=e.length-1;t>=0;t--)for(var n=e[t].classList,i=0;i<n.length;i++)if(n[i].endsWith("-primary"))return e[t]}(e.querySelectorAll(".k-actions .k-button"))},e.prototype.handleActionButtonFocus=function(e,t){for(var n=this.getAllFocusableChildren(e),o=0;o<n.length;o++){if(n[o]===document.activeElement){if(t===i.left&&o>0){n[o-1].focus();break}if(t===i.right&&o<n.length-1){n[o+1].focus();break}}}},e.prototype.keepFocusWithinComponent=function(e,t){var n=this.wrapper.nativeElement,i=this.getFirstAndLastFocusable(n),o=i[0],r=i[1],a=!t.shiftKey&&e===r,s=t.shiftKey&&e===o;a&&(t.preventDefault(),o.focus()),s&&(t.preventDefault(),r.focus())},e.prototype.shouldFocusPrimary=function(e){return b(e)&&y(e)},e.prototype.getAllFocusableChildren=function(e){return e.querySelectorAll(w)},e.prototype.getFirstAndLastFocusable=function(e){var t=this.getAllFocusableChildren(e);return[t.length>0?t[0]:e,t.length>0?t[t.length-1]:e]},e.prototype.generateTitleId=function(){return"kendo-dialog-title-"+Math.ceil(1e6*Math.random()).toString()},e.prototype.generateContentId=function(){return"kendo-dialog-content-"+Math.ceil(1e6*Math.random()).toString()},Object.defineProperty(e.prototype,"wrapperClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styles",{get:function(){var e={};return this.width&&(e.width=D(this.width)),this.height&&(e.height=D(this.height)),this.minWidth&&(e.minWidth=D(this.minWidth)),this.maxWidth&&(e.maxWidth=D(this.maxWidth)),this.minHeight&&(e.minHeight=D(this.minHeight)),this.maxHeight&&(e.maxHeight=D(this.maxHeight)),e},enumerable:!0,configurable:!0}),e.prototype.bubble=function(e,t){var n=this;if(t){var i=t[e].subscribe((function(t){return n[e].emit(t)}));this.subscriptions.push(i)}},Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Array)],e.prototype,"actions",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"actionsLayout",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"autoFocusedElement",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"width",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"minWidth",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"maxWidth",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"height",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"minHeight",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],e.prototype,"maxHeight",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"action",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"close",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.dir"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),Object(o.__decorate)([Object(r.HostBinding)("attr.tabIndex"),Object(o.__metadata)("design:type",Number)],e.prototype,"tabIndex",void 0),Object(o.__decorate)([Object(r.ContentChildren)(R,{descendants:!1}),Object(o.__metadata)("design:type",r.QueryList)],e.prototype,"titlebarContent",void 0),Object(o.__decorate)([Object(r.ViewChildren)(R),Object(o.__metadata)("design:type",r.QueryList)],e.prototype,"titlebarView",void 0),Object(o.__decorate)([Object(r.ViewChild)(P,{static:!1}),Object(o.__metadata)("design:type",P)],e.prototype,"actionsView",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-dialog-wrapper"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"wrapperClass",null),e=Object(o.__decorate)([Object(r.Component)({animations:[Object(a.trigger)("overlayAppear",[Object(a.state)("in",Object(a.style)({opacity:1})),Object(a.transition)("void => *",[Object(a.style)({opacity:.1}),Object(a.animate)(".3s cubic-bezier(.2, .6, .4, 1)")])]),Object(a.trigger)("dialogSlideInAppear",[Object(a.state)("in",Object(a.style)({transform:"translate(0, 0)"})),Object(a.transition)("void => *",[Object(a.style)({transform:"translate(0, -10%)"}),Object(a.animate)(".3s cubic-bezier(.2, 1, .2, 1)")])])],exportAs:"kendoDialog",providers:[d.LocalizationService,{provide:M,useExisting:d.LocalizationService},{provide:d.L10N_PREFIX,useValue:"kendo.dialog"}],selector:"kendo-dialog",template:'\n <ng-container\n kendoDialogLocalizedMessages\n i18n-closeTitle="kendo.dialog.closeTitle|The title of the close button"\n closeTitle="Close"\n >\n <div class="k-overlay" @overlayAppear></div>\n\n <div class="k-window k-dialog" role="dialog" aria-modal="true" [ngStyle]="styles" @dialogSlideInAppear>\n <kendo-dialog-titlebar *ngIf="title" [closeTitle]="closeTitle" [id]="titleId">{{ title }}</kendo-dialog-titlebar>\n <ng-content select="kendo-dialog-titlebar" *ngIf="!title"></ng-content>\n\n <div [id]="contentId" class="k-content k-window-content k-dialog-content">\n <ng-content *ngIf="!contentTemplate"></ng-content>\n <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>\n </div>\n\n <ng-content select="kendo-dialog-actions" *ngIf="!actions"></ng-content>\n <kendo-dialog-actions *ngIf="actions" [actions]="actions" [layout]="actionsLayout"> </kendo-dialog-actions>\n </div>\n </ng-container>\n '}),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,d.LocalizationService,r.ChangeDetectorRef,r.NgZone])],e)}(),$=function(){function e(e){this.dialog=e}return e.prototype.ngAfterViewInit=function(){var e=this;this.dialogTitleBar&&this.dialogTitleBar.close.pipe(Object(c.filter)((function(e){return!e.isDefaultPrevented()}))).subscribe((function(){e.dialog.close()})),this.dialogActions&&this.dialogActions.actions&&this.dialogActions.action.subscribe((function(t){return e.dialog.dialog.instance.action.emit(t)}))},Object(o.__decorate)([Object(r.ViewChild)(R,{static:!1}),Object(o.__metadata)("design:type",R)],e.prototype,"dialogTitleBar",void 0),Object(o.__decorate)([Object(r.ViewChild)(P,{static:!1}),Object(o.__metadata)("design:type",P)],e.prototype,"dialogActions",void 0),e}(),W=function(){function e(){}var t;return t=e,Object.defineProperty(e.prototype,"container",{get:function(){return t.container},set:function(e){t.container=e},enumerable:!0,configurable:!0}),e.container=null,e=t=Object(o.__decorate)([Object(r.Injectable)()],e)}(),U=function(){function e(e,t){this.getDialogRef=e,this.parentInjector=t}return e.prototype.get=function(e,t){return e===H?this.getDialogRef():this.parentInjector.get(e,t)},e}(),G=function(){function e(e,t){this.resolver=e,this.containerService=t}return e.prototype.open=function(e){var t=this.resolver.resolveComponentFactory(K),n=e.appendTo||this.containerService.container;if(!n)throw new Error("\nCannot attach dialog to the page.\nAdd an element that uses the kendoDialogContainer directive, or set the 'appendTo' property.\nSee https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/.\n ");return this.initializeDialog(e.content,t,n,{close:function(){},content:null,dialog:null,result:null},e)},e.prototype.initializeDialog=function(e,t,n,i,o){var a=this.contentFrom(e,n,i),d=n.createComponent(t,void 0,void 0,a.nodes);i.dialog=d,d.changeDetectorRef.markForCheck(),this.applyOptions(d.instance,o);var l=new s.Subject,p=function(e){e instanceof A&&(e=new L),l.next(e||new L),a.componentRef&&a.componentRef.destroy(),d.destroy()},u=Object(s.merge)(l,Object(s.merge)(d.instance.close,d.instance.action).pipe(Object(c.map)((function(e){return e instanceof A?new L:e})),Object(c.filter)((function(t){if(o.preventAction){var n=function(e){return I(e)||e instanceof r.TemplateRef}(e)?void 0:i;return!o.preventAction(t,n)}return!0})))).pipe(Object(c.take)(1),Object(c.share)());if(u.subscribe(p),i.close=p,i.result=u,e&&Object(r.isDevMode)()){var h=a.nodes[0]&&a.nodes[0].length>0,f=a.nodes[2]&&a.nodes[2].length>0,b=o.title&&h,m=o.actions&&f;e.prototype instanceof $?(b||m)&&console.warn("\n Multiple Title and/or Actions configurations detected.\n When using a component as content, provide the title and actions either in the component's markup\n or via the title and actions properties of the DialogSettings object, but not both.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'"):(h||f)&&console.warn("\n When Title and/or Actions markup is provided in content component's template,\n the component needs to inherit the DialogContentBase class to ensure that close and result events are properly hooked.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/dialog/service/#toc-passing-title-content-and-actions-as-a-single-component'")}return i},e.prototype.applyOptions=function(e,t){e.title=t.title,e.actions=t.actions,e.actionsLayout=t.actionsLayout||"stretched",e.width=t.width,e.minWidth=t.minWidth,e.maxWidth=t.maxWidth,e.height=t.height,e.minHeight=t.minHeight,e.maxHeight=t.maxHeight,e.autoFocusedElement=t.autoFocusedElement,e.closeTitle=t.closeTitle,e.cssClass=t.cssClass,e.htmlAttributes=t.htmlAttributes,t.content instanceof r.TemplateRef&&(e.contentTemplate=t.content)},e.prototype.contentFrom=function(e,t,n){var i=t.injector.get(r.Renderer2),o=[],a=[],s=[],c=null;if("string"==typeof e)o=[i.createText(e)];else if(e&&!(e instanceof r.TemplateRef)){var d=new U((function(){return n}),t.injector),l=this.resolver.resolveComponentFactory(e);c=t.createComponent(l,void 0,d),a=Array.from(c.location.nativeElement.querySelectorAll("kendo-dialog-titlebar")),o=[c.location.nativeElement],s=Array.from(c.location.nativeElement.querySelectorAll("kendo-dialog-actions")),n.content=c}return{componentRef:c,nodes:[a,o,s]}},e=Object(o.__decorate)([Object(r.Injectable)(),Object(o.__param)(1,Object(r.Inject)(W)),Object(o.__metadata)("design:paramtypes",[r.ComponentFactoryResolver,W])],e)}(),Z=10002,q={draggable:!0,height:null,left:null,minHeight:100,minWidth:120,position:"absolute",resizable:!0,state:"default",top:null,width:null},J=function(e,t){return function(n){return e.kendoDrag.pipe(Object(c.takeUntil)(e.kendoRelease.pipe(Object(c.tap)((function(){t.emit()})))),Object(c.map)((function(e){var t=e.pageX,i=e.pageY;return{originalX:n.pageX,originalY:n.pageY,pageX:t,pageY:i}})))}},X=function(){function e(e){this.ngZone=e,this.close=new r.EventEmitter,this.focus=new r.EventEmitter,this.change=new r.EventEmitter,this.stateChange=new r.EventEmitter,this.dragStart=new r.EventEmitter,this.dragEnd=new r.EventEmitter,this.resizeStart=new r.EventEmitter,this.resizeEnd=new r.EventEmitter,this.options=Object.assign({},q),this.lastAction=null,this.subscriptions=new s.Subscription,this.dragSubscription=new s.Subscription}return e.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe(),this.dragSubscription&&this.dragSubscription.unsubscribe()},e.prototype.init=function(e){var t=this.options.state,n=this.options;this.window=e,"default"!==t&&(this.restoreOptions=Object.assign({},n)),"minimized"===t&&(n.height=0,n.minHeight=0),"maximized"===t&&(n.position="fixed")},e.prototype.onDrag=function(e){var t=this;this.subscriptions.add(this.ngZone.runOutsideAngular((function(){var n,i;t.dragSubscription=e.kendoPress.pipe(Object(c.tap)((function(e){e.isTouch||S(e),t.focus.emit(),n=t.currentPosition(),i=!1})),Object(c.switchMap)(J(e,t.dragEnd))).subscribe((function(e){var o=e.pageX,r=e.pageY,a=e.originalX,s=e.originalY;i||(t.ensureWidth(),t.dragStart.emit(),i=!0),t.handleDrag({originalX:a,originalY:s,pageX:o,pageY:r,startPosition:n})}))})))},e.prototype.handleDrag=function(e){var t=e.originalX,n=e.originalY,i=e.pageX,o=e.pageY,r=e.startPosition;this.options.left=r.x+i-t,this.options.top=r.y+o-n,"minimized"===this.options.state&&b(this.restoreOptions)&&(this.restoreOptions.left=this.options.left,this.restoreOptions.top=this.options.top),this.change.emit({left:r.x+i-t,top:r.y+o-n})},e.prototype.onResize=function(e,t){var n=this;this.subscriptions.add(this.ngZone.runOutsideAngular((function(){var i,o=!1;e.kendoPress.pipe(Object(c.tap)((function(e){S(e),n.focus.emit(),i=n.currentOffsetAndPosition(),o=!1})),Object(c.switchMap)(J(e,n.resizeEnd))).subscribe((function(e){var r=e.pageX,a=e.pageY,s=e.originalX,c=e.originalY;o||(n.resizeStart.emit(t),o=!0);var d=r-s,l=a-c;n.handleResize(i,t,d,l)}))})))},e.prototype.handleResize=function(e,t,n,i){var o=this,r=this.options,a={};t.indexOf("e")>=0&&((d=e.width+n)!==r.width&&d>=r.minWidth&&(a.width=d));if(t.indexOf("n")>=0){var s=e.height-i,c=e.y+i;s!==r.height&&s>=r.minHeight&&c!==r.top&&(a.height=s,a.top=c)}t.indexOf("s")>=0&&((s=e.height+i)!==r.height&&s>=r.minHeight&&(a.height=s));if(t.indexOf("w")>=0){var d,l=e.x+n;(d=e.width-n)!==r.width&&d>=r.minWidth&&l!==r.left&&(a.width=d,a.left=l)}(b(a.width)||b(a.height))&&(E.forEach((function(e){b(a[e])&&(o.options[e]=a[e])})),this.change.emit(a))},e.prototype.restoreAction=function(){this.lastAction="restore",this.defaultState()},e.prototype.defaultState=function(){b(this.restoreOptions)&&(this.options=Object.assign({},this.restoreOptions)),this.options.state="default",this.stateChange.emit("default")},e.prototype.storeOptions=function(){this.restoreOptions=Object.assign({},this.options)},e.prototype.maximizeAction=function(){this.lastAction="maximize",this.maximizeState()},e.prototype.maximizeState=function(){this.storeOptions();var e=this.windowViewPort;this.options=Object.assign({},this.options,{height:e.height,left:0,position:"fixed",state:"maximized",top:0,width:e.width}),this.stateChange.emit("maximized")},e.prototype.minimizeAction=function(){this.lastAction="minimize",this.minimizeState()},e.prototype.minimizeState=function(){this.storeOptions(),this.options=Object.assign({},this.options,{height:null,minHeight:0,state:"minimized"}),this.stateChange.emit("minimized")},e.prototype.applyManualState=function(){switch(this.options.state){case"default":this.clearHeight(),this.defaultState();break;case"maximized":this.clearHeight(),this.maximizeState();break;case"minimized":this.minimizeState()}},e.prototype.closeAction=function(){this.close.emit()},e.prototype.ensureWidth=function(){var e=Object(u.f)(this.window.nativeElement);b(this.options.width)||(this.options.width=e.width,this.change.emit({width:e.width}))},e.prototype.clearHeight=function(){0===this.options.height&&delete this.options.height,0===this.options.minHeight&&delete this.options.minHeight},e.prototype.center=function(){if("maximized"!==this.options.state){var e=Object(u.k)(this.window.nativeElement),t=this.windowViewPort,n=Object(u.f)(this.window.nativeElement),i={};b(this.options.left)||(this.options.left=e.x+Math.max(0,(t.width-n.width)/2),i.left=this.options.left),b(this.options.top)||(this.options.top=e.y+Math.max(0,(t.height-n.height)/2),i.top=this.options.top),this.change.emit(i)}},e.prototype.currentOffsetAndPosition=function(){var e=this.options,t=Object(u.f)(this.window.nativeElement);return Object.assign({},this.currentPosition(),{height:e.height?e.height:t.height,width:e.width?e.width:t.width})},e.prototype.currentPosition=function(){var e=this.options;return e.top&&e.left||this.setPosition(),{x:this.options.left,y:this.options.top}},e.prototype.setPosition=function(){var e=Object(u.h)(this.window.nativeElement,Object(u.d)(this.window.nativeElement));this.options.left=e.left,this.options.top=e.top},e.prototype.setRestoreOption=function(e,t){b(this.restoreOptions)&&(this.restoreOptions[e]=t)},Object.defineProperty(e.prototype,"nextPossibleZIndex",{get:function(){return Z},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nextZIndex",{get:function(){return Z++},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"windowViewPort",{get:function(){return Object(u.e)(this.window.nativeElement)},enumerable:!0,configurable:!0}),e=Object(o.__decorate)([Object(r.Injectable)(),Object(o.__metadata)("design:paramtypes",[r.NgZone])],e)}(),Y=function(){function e(e,t,n,i){this.draggable=e,this.el=t,this.renderer=n,this.service=i,this.subscriptions=new s.Subscription}return Object.defineProperty(e.prototype,"hostClass",{get:function(){return!0},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.setDisplay(),this.renderer.addClass(this.el.nativeElement,"k-resize-"+this.direction),this.subscriptions.add(Object(s.of)(this.draggable).subscribe((function(t){e.service.onResize(t,e.direction)}))),this.subscriptions.add(this.service.resizeStart.subscribe((function(t){t!==e.direction&&e.setDisplay("none")}))),this.subscriptions.add(this.service.dragStart.subscribe((function(){e.setDisplay("none")}))),this.subscriptions.add(Object(s.merge)(this.service.resizeEnd,this.service.dragEnd).subscribe((function(){e.setDisplay("block")}))),this.subscriptions.add(this.service.stateChange.subscribe((function(t){e.setDisplay("default"===t?"block":"none")})))},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.setDisplay=function(e){void 0===e&&(e="block"),this.renderer.setStyle(this.el.nativeElement,"display","default"===this.service.options.state?e:"none")},Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-resize-handle"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"hostClass",null),e=Object(o.__decorate)([Object(r.Directive)({selector:"[kendoWindowResizeHandle]"}),Object(o.__param)(0,Object(r.Host)()),Object(o.__metadata)("design:paramtypes",[p.DraggableDirective,r.ElementRef,r.Renderer2,X])],e)}(),Q=function(){function e(e,t,n){this.el=e,this.ngZone=n,this.service=t}return e.prototype.ngOnInit=function(){this.dragDirective=new p.DraggableDirective(this.el,this.ngZone),this.dragDirective.ngOnInit(),this.isDraggable&&this.subscribeDrag(),this.subscribeStateChange()},e.prototype.ngOnDestroy=function(){this.dragDirective.ngOnDestroy(),this.unsubscribeDrag(),this.unsubscribeState()},e.prototype.subscribeDrag=function(){var e=this;this.unsubscribeDrag(),this.dragSubscription=Object(s.of)(this.dragDirective).subscribe((function(t){e.service.onDrag(t)}))},e.prototype.subscribeStateChange=function(){var e=this;this.stateSubscription=this.service.stateChange.subscribe((function(t){e.service.options.draggable&&("maximized"===t?e.unsubscribeDrag():e.subscribeDrag())}))},e.prototype.unsubscribeDrag=function(){this.dragSubscription&&(this.service.dragSubscription.unsubscribe(),this.dragSubscription.unsubscribe(),this.dragSubscription=null)},e.prototype.unsubscribeState=function(){this.stateSubscription&&(this.stateSubscription.unsubscribe(),this.stateSubscription=null)},Object.defineProperty(e.prototype,"className",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"touchAction",{get:function(){if(this.isDraggable)return"none"},enumerable:!0,configurable:!0}),e.prototype.handle=function(e){var t=e.target,n=this.service.options.state;v(t,"k-icon")||y(t,!1)||!this.service.options.resizable||("default"===n?this.service.maximizeAction():"maximized"===n&&this.service.restoreAction())},Object.defineProperty(e.prototype,"isDraggable",{get:function(){var e=this.service.options;return e.draggable&&"maximized"!==e.state},enumerable:!0,configurable:!0}),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",r.TemplateRef)],e.prototype,"template",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-window-titlebar"),Object(r.HostBinding)("class.k-dialog-titlebar"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"className",null),Object(o.__decorate)([Object(r.HostBinding)("style.touch-action"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"touchAction",null),Object(o.__decorate)([Object(r.HostListener)("dblclick",["$event"]),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[Object]),Object(o.__metadata)("design:returntype",void 0)],e.prototype,"handle",null),e=Object(o.__decorate)([Object(r.Component)({selector:"kendo-window-titlebar",template:'\n <ng-content *ngIf="!template"></ng-content>\n <ng-template\n [ngTemplateOutlet]="template"\n [ngTemplateOutletContext]="{\'$implicit\': service}" *ngIf="template">\n </ng-template>\n '}),Object(o.__metadata)("design:paramtypes",[r.ElementRef,X,r.NgZone])],e)}(),ee=function(){function e(e,t){this.window=e,this.ngZone=t}return e.prototype.process=function(e){var t=this,n=e.keyCode;switch(n){case i.up:case i.down:case i.left:case i.right:e.preventDefault(),this.ngZone.run((function(){t.handleArrow(n,e)}));break;case i.esc:this.ngZone.run((function(){t.handleEscape()}))}},e.prototype.handleArrow=function(e,t){var n=this.window.options;t.altKey?this.handleStateChange(e,n.state):(t.ctrlKey||t.metaKey)&&"default"===n.state?this.handleResize(e):this.handleDrag(e)},e.prototype.handleEscape=function(){this.window.closeAction()},e.prototype.handleDrag=function(e){var t=this.window.options;if(t.draggable){var n=this.window.currentOffsetAndPosition(),o=this.window.restoreOptions,r={},a=10;switch(e!==i.left&&e!==i.up||(a*=-1),e){case i.left:case i.right:r.left=n.x+a,t.left=r.left;break;case i.up:case i.down:r.top=n.y+a,t.top=r.top}"minimized"===t.state&&b(o)&&(o.left=t.left,o.top=t.top),this.window.change.emit(r)}},e.prototype.handleResize=function(e){var t=this,n=this.window.options;if(n.resizable){var o,r,a=this.window.currentOffsetAndPosition(),s={},c=10;switch(e!==i.left&&e!==i.up||(c*=-1),e){case i.left:case i.right:(o=a.width+c)!==n.width&&o>=n.minWidth&&(s.width=o);break;case i.up:case i.down:(r=a.height+c)!==n.height&&r>=n.minHeight&&(s.height=r)}(b(s.width)||b(s.height))&&(E.forEach((function(e){b(s[e])&&(t.window.options[e]=s[e])})),this.window.change.emit(s))}},e.prototype.handleStateChange=function(e,t){"minimized"===t&&e===i.up||"maximized"===t&&e===i.down?this.window.restoreAction():"default"===t&&(e===i.up?this.window.maximizeAction():e===i.down&&this.window.minimizeAction())},e=Object(o.__decorate)([Object(r.Injectable)(),Object(o.__metadata)("design:paramtypes",[X,r.NgZone])],e)}(),te=function(){function e(e,t,n,i,o,a){var c=this;this.el=e,this.renderer=t,this.service=n,this.navigation=i,this.ngZone=o,this.localization=a,this.keepContent=!1,this.dragStart=new r.EventEmitter,this.dragEnd=new r.EventEmitter,this.resizeStart=new r.EventEmitter,this.resizeEnd=new r.EventEmitter,this.close=new r.EventEmitter,this.widthChange=new r.EventEmitter,this.heightChange=new r.EventEmitter,this.topChange=new r.EventEmitter,this.leftChange=new r.EventEmitter,this.stateChange=new r.EventEmitter,this.messages={},this.tabIndex=0,this.draged=!1,this.resized=!1,this.windowSubscription=new s.Subscription,this.domSubs=new s.Subscription,Object(l.validatePackage)(F),this.direction=this.localization.rtl?"rtl":"ltr",this.localizationChangeSubscription=this.localization.changes.subscribe((function(e){var t=e.rtl;return c.direction=t?"rtl":"ltr"})),this.resizeDirections=x,this.subscribeEvents()}return Object.defineProperty(e.prototype,"draggable",{get:function(){return this.options.draggable},set:function(e){this.options.draggable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"resizable",{get:function(){return this.options.resizable},set:function(e){this.options.resizable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cssClass",{get:function(){return this._cssClass},set:function(e){this.setServiceClasses(this._cssClass,e),this._cssClass=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"htmlAttributes",{get:function(){return this._htmlAttributes},set:function(e){_(e,this.renderer,this.el.nativeElement);var t=this.el.nativeElement,n=t.getAttribute("dir"),i=t.getAttribute("tabindex");this.direction!==n&&(this.direction=n),this.tabIndex!==i&&(this.tabIndex=i),this._htmlAttributes=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this.options.state},set:function(e){this.options.state=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minWidth",{get:function(){return this.options.minWidth},set:function(e){this.setOption("minWidth",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minHeight",{get:function(){return this.options.minHeight},set:function(e){this.setOption("minHeight",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.options.width},set:function(e){this.setOption("width",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.options.height},set:function(e){this.setOption("height",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.options.top},set:function(e){this.setOption("top",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.options.left},set:function(e){this.setOption("left",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closeButtonTitle",{get:function(){return this.messages&&this.messages.closeTitle?this.messages.closeTitle:this.localization.get("closeTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"restoreButtonTitle",{get:function(){return this.messages&&this.messages.restoreTitle?this.messages.restoreTitle:this.localization.get("restoreTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maximizeButtonTitle",{get:function(){return this.messages&&this.messages.maximizeTitle?this.messages.maximizeTitle:this.localization.get("maximizeTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minimizeButtonTitle",{get:function(){return this.messages&&this.messages.minimizeTitle?this.messages.minimizeTitle:this.localization.get("minimizeTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostClasses",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.setNextZIndex(),this.handleInitialFocus(),this.ngZone.runOutsideAngular((function(){return Promise.resolve(null).then((function(){return e.setInitialOffset()}))})),this.initDomEvents()},e.prototype.ngOnInit=function(){this.renderer.removeAttribute(this.el.nativeElement,"title"),this.service.init(this.el)},e.prototype.ngOnChanges=function(e){var t=this;if(E.forEach((function(n){Object(p.isChanged)(n,e)&&t.setStyle(n,t.options[n])})),Object(p.isChanged)("draggable",e)){var n=b(this.titleBarContent)?this.titleBarContent:this.titleBarView;e.draggable.currentValue?n.subscribeDrag():n.unsubscribeDrag()}Object(p.isChanged)("state",e)&&(b(this.service.lastAction)?this.service.lastAction=null:(this.service.applyManualState(),this.updateAllOffset()))},e.prototype.ngOnDestroy=function(){this.windowSubscription&&this.windowSubscription.unsubscribe(),this.domSubs&&this.domSubs.unsubscribe(),this.localizationChangeSubscription.unsubscribe()},e.prototype.focus=function(){var e=this.el.nativeElement;b(e)&&e.focus()},e.prototype.bringToFront=function(){this.setNextZIndex()},e.prototype.setDimension=function(e,t){this.setOption(e,t),this.setStyle(e,t)},e.prototype.setOffset=function(e,t){this.setOption(e,t),this.setStyle(e,t)},Object.defineProperty(e.prototype,"showDefaultTitleBar",{get:function(){return!b(this.titleBarContent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styleMinWidth",{get:function(){return this.minWidth+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"styleMinHeight",{get:function(){return this.minHeight+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stylePosition",{get:function(){return this.options.position},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperMaximizedClass",{get:function(){return"maximized"===this.state},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperMinimizedClass",{get:function(){return"minimized"===this.state},enumerable:!0,configurable:!0}),e.prototype.onComponentFocus=function(){this.renderer.addClass(this.el.nativeElement,"k-focus"),this.setNextZIndex()},e.prototype.onComponentBlur=function(){this.renderer.removeClass(this.el.nativeElement,"k-focus")},e.prototype.subscribeEvents=function(){var e=this;Object(p.isDocumentAvailable)()&&(this.windowSubscription.add(this.service.focus.subscribe((function(){e.el.nativeElement.focus()}))),this.windowSubscription.add(this.service.dragStart.subscribe((function(){e.draged=!0,e.ngZone.run((function(){e.dragStart.emit()}))}))),this.windowSubscription.add(this.service.dragEnd.subscribe((function(){e.draged&&(e.draged=!1,e.ngZone.run((function(){e.dragEnd.emit()})))}))),this.windowSubscription.add(this.service.close.subscribe((function(){e.close.emit()}))),this.windowSubscription.add(this.service.resizeStart.subscribe((function(){e.resized=!0,e.ngZone.run((function(){e.resizeStart.emit()}))}))),this.windowSubscription.add(this.service.resizeEnd.subscribe((function(){e.resized&&(e.resized=!1,e.ngZone.run((function(){e.resizeEnd.emit()})))}))),this.windowSubscription.add(this.service.change.subscribe((function(t){E.forEach((function(n){if(b(t[n])&&(e.setStyle(n,t[n]),"maximized"!==e.state)){var i=e[n+"Change"];i.observers.length&&e.ngZone.run((function(){i.emit(t[n])}))}}))}))),this.windowSubscription.add(this.service.stateChange.subscribe((function(t){b(e.service.lastAction)&&(e.updateAllOffset(),e.stateChange.emit(t))}))))},e.prototype.initDomEvents=function(){var e=this;this.el&&this.ngZone.runOutsideAngular((function(){e.domSubs.add(e.renderer.listen(e.el.nativeElement,"keydown",(function(t){e.onKeyDown(t)})))}))},e.prototype.onKeyDown=function(e){v(e.target,"k-window")&&this.navigation.process(e)},e.prototype.setServiceClasses=function(e,t){var n=this,i=this.el.nativeElement;e&&O(e).forEach((function(e){n.renderer.removeClass(i,e)})),t&&O(t).forEach((function(e){n.renderer.addClass(i,e)}))},e.prototype.setNextZIndex=function(){var e=this.el.nativeElement.style["z-index"],t=this.service.nextPossibleZIndex;(!e||t-e>1)&&this.renderer.setStyle(this.el.nativeElement,"z-index",this.service.nextZIndex)},e.prototype.setInitialOffset=function(){if("maximized"!==this.state)this.updateAllOffset(),b(this.left)&&b(this.top)||this.service.center();else{var e=this.service.windowViewPort;this.setStyle("width",e.width),this.setStyle("height",e.height),this.setStyle("top",0),this.setStyle("left",0)}},e.prototype.updateAllOffset=function(){var e=this;E.forEach((function(t){b(e[t])?e.setStyle(t,e[t]):e.removeStyle(t)}))},e.prototype.setStyle=function(e,t){this.renderer.setStyle(this.el.nativeElement,e,t+"px")},e.prototype.removeStyle=function(e){this.renderer.removeStyle(this.el.nativeElement,e)},Object.defineProperty(e.prototype,"options",{get:function(){return this.service.options},enumerable:!0,configurable:!0}),e.prototype.setOption=function(e,t){if("number"==typeof t||"string"==typeof t){var n="number"==typeof t?t:parseInt(t,10);this.options[e]=n,this.service.setRestoreOption(e,n)}},e.prototype.handleInitialFocus=function(){var e=this.el.nativeElement;if(this.autoFocusedElement){var t=e.querySelector(this.autoFocusedElement);t&&t.focus()}else this.focus()},Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"autoFocusedElement",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[Boolean])],e.prototype,"draggable",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[Boolean])],e.prototype,"resizable",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Boolean)],e.prototype,"keepContent",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[String])],e.prototype,"state",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"minWidth",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"minHeight",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"width",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"height",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"top",null),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Number),Object(o.__metadata)("design:paramtypes",[Number])],e.prototype,"left",null),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"dragStart",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"dragEnd",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"resizeStart",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"resizeEnd",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"close",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"widthChange",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"heightChange",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"topChange",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"leftChange",void 0),Object(o.__decorate)([Object(r.Output)(),Object(o.__metadata)("design:type",r.EventEmitter)],e.prototype,"stateChange",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.tabIndex"),Object(o.__metadata)("design:type",Number)],e.prototype,"tabIndex",void 0),Object(o.__decorate)([Object(r.HostBinding)("class.k-window"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"hostClasses",null),Object(o.__decorate)([Object(r.HostBinding)("attr.dir"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),Object(o.__decorate)([Object(r.ViewChild)(Q,{static:!1}),Object(o.__metadata)("design:type",Q)],e.prototype,"titleBarView",void 0),Object(o.__decorate)([Object(r.ContentChild)(Q,{static:!1}),Object(o.__metadata)("design:type",Q)],e.prototype,"titleBarContent",void 0),Object(o.__decorate)([Object(r.ViewChildren)(Y),Object(o.__metadata)("design:type",r.QueryList)],e.prototype,"resizeHandles",void 0),Object(o.__decorate)([Object(r.HostBinding)("style.minWidth"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"styleMinWidth",null),Object(o.__decorate)([Object(r.HostBinding)("style.minHeight"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"styleMinHeight",null),Object(o.__decorate)([Object(r.HostBinding)("style.position"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"stylePosition",null),Object(o.__decorate)([Object(r.HostBinding)("class.k-window-maximized"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"wrapperMaximizedClass",null),Object(o.__decorate)([Object(r.HostBinding)("class.k-window-minimized"),Object(o.__metadata)("design:type",Boolean),Object(o.__metadata)("design:paramtypes",[])],e.prototype,"wrapperMinimizedClass",null),Object(o.__decorate)([Object(r.HostListener)("focus"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],e.prototype,"onComponentFocus",null),Object(o.__decorate)([Object(r.HostListener)("blur"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],e.prototype,"onComponentBlur",null),e=Object(o.__decorate)([Object(r.Component)({exportAs:"kendoWindow",providers:[X,ee,d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.window"}],selector:"kendo-window",template:'\n <ng-container kendoWindowLocalizedMessages\n i18n-closeTitle="kendo.window.closeTitle|The title of the close button"\n closeTitle="Close"\n\n i18n-restoreTitle="kendo.window.restoreTitle|The title of the restore button"\n restoreTitle="Restore"\n\n i18n-maximizeTitle="kendo.window.maximizeTitle|The title of the maximize button"\n maximizeTitle="Maximize"\n\n i18n-minimizeTitle="kendo.window.minimizeTitle|The title of the minimize button"\n minimizeTitle="Minimize"\n >\n <ng-container>\n\n <kendo-window-titlebar *ngIf="showDefaultTitleBar" [template]="titleBarTemplate">\n <div class="k-window-title">{{ title }}</div>\n <div class="k-window-actions">\n <button kendoWindowMinimizeAction [attr.title]="minimizeButtonTitle" [attr.aria-label]="minimizeButtonTitle"></button>\n <button kendoWindowMaximizeAction [attr.title]="maximizeButtonTitle" [attr.aria-label]="maximizeButtonTitle"></button>\n <button kendoWindowRestoreAction [attr.title]="restoreButtonTitle" [attr.aria-label]="restoreButtonTitle"></button>\n <button kendoWindowCloseAction [attr.title]="closeButtonTitle" [attr.aria-label]="closeButtonTitle"></button>\n </div>\n </kendo-window-titlebar>\n <ng-content select="kendo-window-titlebar" *ngIf="!showDefaultTitleBar"></ng-content>\n\n <div *ngIf="state !== \'minimized\' || keepContent"\n [hidden]="state === \'minimized\' && keepContent"\n class="k-content k-window-content"\n >\n <ng-content *ngIf="!contentTemplate"></ng-content>\n <ng-template [ngTemplateOutlet]="contentTemplate" *ngIf="contentTemplate"></ng-template>\n </div>\n\n <ng-template [ngIf]=\'resizable\'>\n <div *ngFor=\'let dir of resizeDirections\'\n [direction]="dir"\n kendoWindowResizeHandle\n kendoDraggable>\n </div>\n </ng-template>\n '}),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,X,ee,r.NgZone,d.LocalizationService])],e)}(),ne=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,null,o,r)||this;return a.buttonType="button",a.window=i,a.fillMode="flat",a.icon="window-maximize",a}return Object(o.__extends)(t,e),t.prototype.onClick=function(){this.isDisabled||this.window.maximizeAction()},Object.defineProperty(t.prototype,"visible",{get:function(){return"default"===this.window.options.state?"inline-flex":"none"},enumerable:!0,configurable:!0}),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],t.prototype,"window",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.type"),Object(o.__metadata)("design:type",String)],t.prototype,"buttonType",void 0),Object(o.__decorate)([Object(r.HostListener)("click"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],t.prototype,"onClick",null),Object(o.__decorate)([Object(r.HostBinding)("style.display"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],t.prototype,"visible",null),t=Object(o.__decorate)([Object(r.Directive)({exportAs:"kendoWindowMaximizeAction",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.button"}],selector:"button[kendoWindowMaximizeAction]"}),Object(o.__param)(2,Object(r.Optional)()),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,X,d.LocalizationService,r.NgZone])],t)}(h.Button),ie=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,null,o,r)||this;return a.buttonType="button",a.window=i,a.fillMode="flat",a.icon="window-minimize",a}return Object(o.__extends)(t,e),t.prototype.onClick=function(){this.isDisabled||this.window.minimizeAction()},Object.defineProperty(t.prototype,"visible",{get:function(){return"default"===this.window.options.state?"inline-flex":"none"},enumerable:!0,configurable:!0}),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],t.prototype,"window",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.type"),Object(o.__metadata)("design:type",String)],t.prototype,"buttonType",void 0),Object(o.__decorate)([Object(r.HostListener)("click"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],t.prototype,"onClick",null),Object(o.__decorate)([Object(r.HostBinding)("style.display"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],t.prototype,"visible",null),t=Object(o.__decorate)([Object(r.Directive)({exportAs:"kendoWindowMinimizeAction",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.button"}],selector:"button[kendoWindowMinimizeAction]"}),Object(o.__param)(2,Object(r.Optional)()),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,X,d.LocalizationService,r.NgZone])],t)}(h.Button),oe=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,null,o,r)||this;return a.buttonType="button",a.window=i,a.fillMode="flat",a.icon="close",a}return Object(o.__extends)(t,e),t.prototype.onClick=function(){this.isDisabled||this.window.closeAction()},Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],t.prototype,"window",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.type"),Object(o.__metadata)("design:type",String)],t.prototype,"buttonType",void 0),Object(o.__decorate)([Object(r.HostListener)("click"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],t.prototype,"onClick",null),t=Object(o.__decorate)([Object(r.Directive)({exportAs:"kendoWindowCloseAction",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.button"}],selector:"button[kendoWindowCloseAction]"}),Object(o.__param)(2,Object(r.Optional)()),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,X,d.LocalizationService,r.NgZone])],t)}(h.Button),re=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,null,o,r)||this;return a.buttonType="button",a.window=i,a.fillMode="flat",a.icon="window-restore",a}return Object(o.__extends)(t,e),t.prototype.onClick=function(){this.isDisabled||this.window.restoreAction()},Object.defineProperty(t.prototype,"visible",{get:function(){return"default"===this.window.options.state?"none":"inline-flex"},enumerable:!0,configurable:!0}),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",Object)],t.prototype,"window",void 0),Object(o.__decorate)([Object(r.HostBinding)("attr.type"),Object(o.__metadata)("design:type",String)],t.prototype,"buttonType",void 0),Object(o.__decorate)([Object(r.HostListener)("click"),Object(o.__metadata)("design:type",Function),Object(o.__metadata)("design:paramtypes",[]),Object(o.__metadata)("design:returntype",void 0)],t.prototype,"onClick",null),Object(o.__decorate)([Object(r.HostBinding)("style.display"),Object(o.__metadata)("design:type",String),Object(o.__metadata)("design:paramtypes",[])],t.prototype,"visible",null),t=Object(o.__decorate)([Object(r.Directive)({exportAs:"kendoWindowRestoreAction",providers:[d.LocalizationService,{provide:d.L10N_PREFIX,useValue:"kendo.button"}],selector:"button[kendoWindowRestoreAction]"}),Object(o.__param)(2,Object(r.Optional)()),Object(o.__metadata)("design:paramtypes",[r.ElementRef,r.Renderer2,X,d.LocalizationService,r.NgZone])],t)}(h.Button),ae=function(){},se=function(){},ce=function(){},de=function(){function e(){}var t;return t=e,Object.defineProperty(e.prototype,"container",{get:function(){return t.container},set:function(e){t.container=e},enumerable:!0,configurable:!0}),e.container=null,e=t=Object(o.__decorate)([Object(r.Injectable)()],e)}(),le=function(){function e(e,t){this.getWindowRef=e,this.parentInjector=t}return e.prototype.get=function(e,t){return e===ce?this.getWindowRef():this.parentInjector.get(e,t)},e}(),pe=function(){function e(e,t){this.resolver=e,this.containerService=t}return e.prototype.open=function(e){var t=this.resolver.resolveComponentFactory(te),n=e.appendTo||this.containerService.container;if(!n)throw new Error("Cannot attach window to the page.\n Add an element that uses the kendoWindowContainer directive, or set the 'appendTo' property.\n See https://www.telerik.com/kendo-angular-ui/components/dialogs/window/service/\n ");var i={close:function(){},content:null,result:null,window:null},o=this.contentFrom(e.content,n,i),a=n.createComponent(t,void 0,void 0,o.nodes);i.window=a,this.applyOptions(a.instance,e);var d=new s.Subject,l=function(e){d.next(e||new se),o.componentRef&&o.componentRef.destroy(),a.destroy()},p=Object(s.merge)(d,a.instance.close.pipe(Object(c.map)((function(e){return e||new se})),Object(c.filter)((function(t){if(e.preventClose){var n=(o=e.content,I(o)||o instanceof r.TemplateRef?void 0:i);return!e.preventClose(t,n)}var o;return!0})))).pipe(Object(c.take)(1),Object(c.share)());return p.subscribe(l),i.close=l,i.result=p,a.changeDetectorRef.markForCheck(),i},e.prototype.applyOptions=function(e,t){b(t.htmlAttributes)&&(e.htmlAttributes=t.htmlAttributes),b(t.cssClass)&&(e.cssClass=t.cssClass),b(t.title)&&(e.title=t.title),b(t.keepContent)&&(e.keepContent=t.keepContent),b(t.width)&&(e.width=t.width),b(t.minWidth)&&(e.minWidth=t.minWidth),b(t.height)&&(e.height=t.height),b(t.minHeight)&&(e.minHeight=t.minHeight),b(t.left)&&(e.left=t.left),b(t.top)&&(e.top=t.top),b(t.draggable)&&(e.draggable=t.draggable),b(t.resizable)&&(e.resizable=t.resizable),b(t.messages&&t.messages.closeTitle)&&(e.messages.closeTitle=t.messages.closeTitle),b(t.messages&&t.messages.restoreTitle)&&(e.messages.restoreTitle=t.messages.restoreTitle),b(t.messages&&t.messages.maximizeTitle)&&(e.messages.maximizeTitle=t.messages.maximizeTitle),b(t.messages&&t.messages.minimizeTitle)&&(e.messages.minimizeTitle=t.messages.minimizeTitle),b(t.autoFocusedElement)&&(e.autoFocusedElement=t.autoFocusedElement),b(t.state)&&(e.state=t.state,"minimized"===t.state&&(e.keepContent=!0)),t.content instanceof r.TemplateRef&&(e.contentTemplate=t.content),t.titleBarContent instanceof r.TemplateRef&&(e.titleBarTemplate=t.titleBarContent)},e.prototype.contentFrom=function(e,t,n){var i=t.injector.get(r.Renderer2),o=[],a=null;if("string"==typeof e)o=[i.createText(e)];else if(e&&!(e instanceof r.TemplateRef)){var s=new le((function(){return n}),t.injector),c=this.resolver.resolveComponentFactory(e);o=[(a=t.createComponent(c,void 0,s)).location.nativeElement],n.content=a}return{componentRef:a,nodes:[[],o]}},e=Object(o.__decorate)([Object(r.Injectable)(),Object(o.__param)(1,Object(r.Inject)(de)),Object(o.__metadata)("design:paramtypes",[r.ComponentFactoryResolver,de])],e)}(),ue=function(){function e(e,t){t.container=e}return e=Object(o.__decorate)([Object(r.Directive)({selector:"[kendoDialogContainer]"}),Object(o.__metadata)("design:paramtypes",[r.ViewContainerRef,W])],e)}(),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(o.__extends)(t,e),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],t.prototype,"closeTitle",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],t.prototype,"restoreTitle",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],t.prototype,"maximizeTitle",void 0),Object(o.__decorate)([Object(r.Input)(),Object(o.__metadata)("design:type",String)],t.prototype,"minimizeTitle",void 0),t}(d.ComponentMessages),fe=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(o.__extends)(t,e),n=t,t=n=Object(o.__decorate)([Object(r.Directive)({providers:[{provide:he,useExisting:Object(r.forwardRef)((function(){return n}))}],selector:"\n [kendoDialogLocalizedMessages],\n [kendoWindowLocalizedMessages],\n [kendoDialogTitleBarLocalizedMessages]\n "}),Object(o.__metadata)("design:paramtypes",[d.LocalizationService])],t)}(he),be=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(o.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(o.__decorate)([Object(r.Component)({providers:[{provide:he,useExisting:Object(r.forwardRef)((function(){return n}))}],selector:"kendo-dialog-messages, kendo-window-messages",template:""}),Object(o.__metadata)("design:paramtypes",[d.LocalizationService])],t)}(he),me=[P,be,fe],ge=function(){function e(){}return e=Object(o.__decorate)([Object(r.NgModule)({declarations:[me],exports:[me,f.CommonModule],imports:[f.CommonModule]})],e)}(),ve=[K,R],ye=function(){function e(){}return e=Object(o.__decorate)([Object(r.NgModule)({declarations:[ve,ue],entryComponents:[ve],exports:[ve,me,ue],imports:[ge],providers:[W,G]})],e)}(),_e=function(){function e(e,t){t.container=e}return e=Object(o.__decorate)([Object(r.Directive)({selector:"[kendoWindowContainer]"}),Object(o.__metadata)("design:paramtypes",[r.ViewContainerRef,de])],e)}(),Oe=[Y,te,Q,oe,ie,ne,re],je=[te,Q],Ce=[te,oe,ie,ne,re,Q],ke=function(){function e(){}return e=Object(o.__decorate)([Object(r.NgModule)({declarations:[Oe,_e],entryComponents:[je],exports:[Ce,me,_e],imports:[ge,p.DraggableModule],providers:[de,pe]})],e)}(),we=function(){function e(){}return e=Object(o.__decorate)([Object(r.NgModule)({exports:[ye,ke]})],e)}()},function(e,t,n){"use strict";n.r(t),n.d(t,"KendoButtonService",(function(){return h})),n.d(t,"DialItemComponent",(function(){return le})),n.d(t,"DialListComponent",(function(){return de})),n.d(t,"FocusService",(function(){return B})),n.d(t,"FocusableDirective",(function(){return P})),n.d(t,"ButtonItemTemplateDirective",(function(){return T})),n.d(t,"ListButton",(function(){return R})),n.d(t,"ListComponent",(function(){return D})),n.d(t,"ListModule",(function(){return z})),n.d(t,"TemplateContextDirective",(function(){return A})),n.d(t,"NAVIGATION_CONFIG",(function(){return F})),n.d(t,"NavigationService",(function(){return N})),n.d(t,"LocalizedSplitButtonMessagesDirective",(function(){return K})),n.d(t,"Messages",(function(){return H})),n.d(t,"ButtonDirective",(function(){return w})),n.d(t,"Button",(function(){return w})),n.d(t,"ButtonGroupComponent",(function(){return x})),n.d(t,"ButtonGroup",(function(){return x})),n.d(t,"ButtonGroupModule",(function(){return I})),n.d(t,"ButtonModule",(function(){return E})),n.d(t,"ButtonsModule",(function(){return fe})),n.d(t,"SplitButtonComponent",(function(){return V})),n.d(t,"SplitButton",(function(){return V})),n.d(t,"SplitButtonModule",(function(){return W})),n.d(t,"SplitButtonCustomMessagesComponent",(function(){return $})),n.d(t,"DropDownButtonComponent",(function(){return G})),n.d(t,"DropDownButton",(function(){return G})),n.d(t,"DropDownButtonModule",(function(){return Z})),n.d(t,"ChipComponent",(function(){return q})),n.d(t,"ChipListComponent",(function(){return J})),n.d(t,"ChipModule",(function(){return Q})),n.d(t,"FloatingActionButtonModule",(function(){return he})),n.d(t,"FloatingActionButtonComponent",(function(){return ce})),n.d(t,"FloatingActionButtonTemplateDirective",(function(){return ie})),n.d(t,"DialItemTemplateDirective",(function(){return ne}));var i=n(0),o=n(1),r=n(5),a=n(2),s=n(3),c=n(13),d=n(12),l=n(16),p=n(4),u=n(8),h=function(){function e(){this.buttonClicked=new r.Subject,this.buttonClicked$=this.buttonClicked.asObservable()}return e.prototype.click=function(e){this.buttonClicked.next(e)},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),f={name:"@progress/kendo-angular-buttons",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1642682315,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"},b=Promise.resolve(null),m=function(e){return null!=e},g=function(e){return b.then(e)};function v(e,t){if(e.closest)return e.closest(t);for(var n=Element.prototype.matches?function(e,t){return e.matches(t)}:function(e,t){return e.msMatchesSelector(t)},i=e;i&&9!==i.nodeType;){if(n(i,t))return i;i=i.parentNode}}var y,_,O={small:"sm",medium:"md",large:"lg"},j={small:"sm",medium:"md",large:"lg",full:"full"},C=function(e,t,n,i){switch(t){case"size":return{toRemove:"k-"+e+"-"+O[n],toAdd:i?"k-"+e+"-"+O[i]:null};case"rounded":return{toRemove:"k-rounded-"+j[n],toAdd:i?"k-rounded-"+j[i]:null};case"fillMode":case"shape":return{toRemove:"k-"+e+"-"+n,toAdd:i?"k-"+e+"-"+i:null}}},k=function(e,t,n,i,o){return{toRemove:"k-"+e+"-"+t+"-"+i,toAdd:o?"k-"+e+"-"+n+"-"+o:null}},w=function(){function e(e,t,n,i,r){var a=this;this.service=n,this.ngZone=r,this.toggleable=!1,this.role="button",this.selectedChange=new o.EventEmitter,this.click=new o.EventEmitter,this.isDisabled=!1,this.isIcon=!1,this.isIconClass=!1,this._size="medium",this._rounded="medium",this._shape="rectangle",this._fillMode="solid",this._themeColor="base",this._focused=!1,this.domEvents=[],Object(c.validatePackage)(f),this.direction=i.rtl?"rtl":"ltr",this.localizationChangeSubscription=i.changes.subscribe((function(e){var t=e.rtl;return a.direction=t?"rtl":"ltr"})),this.element=e.nativeElement,this.renderer=t}return Object.defineProperty(e.prototype,"togglable",{get:function(){return this.toggleable},set:function(e){this.toggleable=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selected",{get:function(){return this._selected||!1},set:function(e){this._selected=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.element.tabIndex},set:function(e){this.element.tabIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{set:function(e){var t=this;e?this.iconSetter(e,(function(){t.isIcon=!0;var n="k-button-icon k-icon k-i-"+e;t.addIcon(n)})):(this.isIcon=!1,this.updateIconNode())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{set:function(e){var t=this;e?this.iconSetter(e,(function(){t.isIconClass=!0;var n="k-button-icon k-icon "+e;t.addIcon(n)})):(this.isIconClass=!1,this.updateIconNode())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"imageUrl",{set:function(e){e?this.iconSetter(e,this.addImgIcon.bind(this)):this.removeImageNode()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.isDisabled},set:function(e){this.isDisabled=e,this.renderer.setProperty(this.element,"disabled",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"themeColor",{get:function(){return this._themeColor},set:function(e){this.handleThemeColor(e),this._themeColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){return this._shape},set:function(e){this.handleClasses(e,"shape"),this._shape=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._focused},set:function(e){this.toggleClass("k-focus",e),this._focused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classButton",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isToggleable",{get:function(){return this.toggleable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"roleSetter",{get:function(){return this.role},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classDisabled",{get:function(){return this.isDisabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"classActive",{get:function(){return this.selected},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getDirection",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.onFocus=function(){this.isFocused=!0},e.prototype.onBlur=function(){this.isFocused=!1},Object.defineProperty(e.prototype,"primary",{set:function(e){this.themeColor=e?"primary":"base"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"look",{set:function(e){switch(e){case"default":this.fillMode="solid";break;default:this.fillMode=e}},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this,t="SPAN"===this.element.tagName;this.addTextSpan(),!this.element.hasAttribute("role")&&this.togglable&&this.toggleAriaPressed(this.toggleable),this.role&&this.setAttribute("role",this.role),this.ngZone.runOutsideAngular((function(){e.domEvents.push(e.renderer.listen(e.element,"click",e._onButtonClick.bind(e))),e.domEvents.push(e.renderer.listen(e.element,"keydown",(function(n){var i=n.keyCode===a.Keys.Space||n.keyCode===a.Keys.Enter;t&&i&&(e.click.emit(n),e._onButtonClick())})))}))},e.prototype.ngOnChanges=function(e){(Object(a.isChanged)("togglable",e)||Object(a.isChanged)("toggleable",e))&&this.toggleAriaPressed(this.toggleable)},e.prototype.ngAfterViewInit=function(){var e=this;["size","rounded","shape","fillMode"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.ngAfterViewChecked=function(){this.setIconTextClasses()},e.prototype.ngOnDestroy=function(){this.imageNode=null,this.iconNode=null,this.iconSpanNode=null,this.renderer=null,this.localizationChangeSubscription.unsubscribe(),clearTimeout(this.deferTimeout),this.domEvents.forEach((function(e){return e()}))},e.prototype.focus=function(){Object(a.isDocumentAvailable)()&&(this.element.focus(),this.isFocused=!0)},e.prototype.blur=function(){Object(a.isDocumentAvailable)()&&(this.element.blur(),this.isFocused=!1)},e.prototype.setAttribute=function(e,t){this.renderer.setAttribute(this.element,e,t)},e.prototype.removeAttribute=function(e){this.renderer.removeAttribute(this.element,e)},e.prototype.setSelected=function(e){var t=this,n=this.selected!==e;this.selected=e,this.setAttribute("aria-pressed",this.selected.toString()),this.toggleClass("k-selected",this.selected),n&&Object(a.hasObservers)(this.selectedChange)&&this.ngZone.run((function(){t.selectedChange.emit(e)}))},e.prototype.toggleAriaPressed=function(e){Object(a.isDocumentAvailable)()&&(e?this.setAttribute("aria-pressed",this.selected.toString()):this.removeAttribute("aria-pressed"))},e.prototype.hasText=function(){return Object(a.isDocumentAvailable)()&&this.element.textContent.trim().length>0},e.prototype.addImgIcon=function(e){var t=this.renderer;this.iconSpanNode=t.createElement("span"),t.setProperty(this.iconSpanNode,"className","k-button-icon k-icon"),this.imageNode?t.setProperty(this.imageNode,"src",e):Object(a.isDocumentAvailable)()&&(this.imageNode=t.createElement("img"),t.setProperty(this.imageNode,"src",e),t.setProperty(this.imageNode,"className","k-image"),t.setAttribute(this.imageNode,"role","presentation")),this.iconSpanNode.appendChild(this.imageNode),this.prependChild(this.iconSpanNode)},e.prototype.addIcon=function(e){var t=this.renderer;this.iconNode?t.setProperty(this.iconNode,"className",e):Object(a.isDocumentAvailable)()&&(this.iconNode=t.createElement("span"),t.setProperty(this.iconNode,"className",e),t.setAttribute(this.iconNode,"role","presentation"),this.prependChild(this.iconNode))},e.prototype.addTextSpan=function(){var e=this;if(Object(a.isDocumentAvailable)()&&this.hasText()){var t=this.renderer.createElement("span");this.renderer.addClass(t,"k-button-text"),Array.from(this.element.childNodes).forEach((function(n){return e.renderer.appendChild(t,n)})),this.renderer.appendChild(this.element,t)}},e.prototype.prependChild=function(e){var t=this;this.defer((function(){t.renderer&&e!==t.element.firstChild&&t.renderer.insertBefore(t.element,e,t.element.firstChild)}))},e.prototype.defer=function(e){var t=this;this.ngZone.runOutsideAngular((function(){t.deferTimeout=setTimeout(e,0)}))},e.prototype.iconSetter=function(e,t){e&&t(e),this.setIconTextClasses()},e.prototype.removeImageNode=function(){this.imageNode&&this.renderer.parentNode(this.imageNode)&&(this.renderer.removeChild(this.element,this.imageNode),this.renderer.removeChild(this.element,this.iconSpanNode),this.imageNode=null,this.iconSpanNode=null)},e.prototype.removeIconNode=function(){this.iconNode&&this.renderer.parentNode(this.iconNode)&&(this.renderer.removeChild(this.element,this.iconNode),this.iconNode=null),this.iconSpanNode&&(this.renderer.removeChild(this.element,this.iconSpanNode),this.iconSpanNode=null)},e.prototype.updateIconNode=function(){this.isIcon||this.isIconClass||this.removeIconNode()},e.prototype.setIconTextClasses=function(){var e=this.isIcon||this.isIconClass||this.imageNode;this.toggleClass("k-icon-button",e&&!this.hasText())},e.prototype.toggleClass=function(e,t){t?this.renderer.addClass(this.element,e):this.renderer.removeClass(this.element,e)},e.prototype._onButtonClick=function(){var e=this;!this.disabled&&this.service&&this.ngZone.run((function(){e.service.click(e)})),this.togglable&&!this.service&&this.setSelected(!this.selected)},e.prototype.handleClasses=function(e,t){var n=this.element,i=C("button",t,this[t],e);"fillMode"===t&&this.handleThemeColor(this.themeColor,this[t],e),i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},e.prototype.handleThemeColor=function(e,t,n){var i=this.element,o=t||this.fillMode,r=n||this.fillMode,a=k("button",o,r,this.themeColor,e);this.renderer.removeClass(i,a.toRemove),null!==r&&null!==n&&a.toAdd&&this.renderer.addClass(i,a.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"toggleable",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"togglable",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"selected",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"icon",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"iconClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"imageUrl",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"disabled",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"themeColor",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"shape",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"selectedChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"click",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-button"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"classButton",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-toggle-button"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"isToggleable",null),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"roleSetter",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"classDisabled",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-selected"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"classActive",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"getDirection",null),Object(i.__decorate)([Object(o.HostListener)("focus"),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onFocus",null),Object(i.__decorate)([Object(o.HostListener)("blur"),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onBlur",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"primary",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"look",null),e=Object(i.__decorate)([Object(o.Directive)({exportAs:"kendoButton",providers:[s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.button"}],selector:"button[kendoButton], span[kendoButton]"}),Object(i.__param)(2,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.Renderer2,h,s.LocalizationService,o.NgZone])],e)}(),S=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}(),x=function(){function e(e,t,n){var i=this;this.service=e,this.element=n,this.selection="multiple",this.navigate=new o.EventEmitter,this._tabIndex=0,this.currentTabIndex=0,Object(c.validatePackage)(f),this.localizationChangeSubscription=t.changes.subscribe((function(e){var t=e.rtl;return i.direction=t?"rtl":"ltr"}))}return Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this._tabIndex},set:function(e){this._tabIndex=e,this.currentTabIndex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperClass",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stretchedClass",{get:function(){return!!this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getRole",{get:function(){return this.isSelectionSingle()?"radiogroup":"group"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperWidth",{get:function(){return this.width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapperTabIndex",{get:function(){return this.disabled?void 0:this.currentTabIndex},enumerable:!0,configurable:!0}),e.prototype.keydown=function(e){this.disabled||this.navigateFocus(e)},e.prototype.onFocus=function(){this.currentTabIndex=-1;var e=this.buttons.toArray().findIndex((function(e){return-1!==e.element.tabIndex})),t=-1===e?0:e;this.focus(this.buttons.filter((function(e,n){return n===t})))},e.prototype.focusout=function(e){e.relatedTarget&&e.relatedTarget.parentNode!==this.element.nativeElement&&(this.defocus(this.buttons.toArray()),this.currentTabIndex=this.tabIndex)},e.prototype.ngOnInit=function(){var e=this;this.subscription=this.service.buttonClicked$.subscribe((function(t){var n;e.isSelectionSingle()?(n=!0,e.deactivate(e.buttons.filter((function(e){return e!==t})))):(e.defocus(e.buttons.toArray()),n=!t.selected),t.togglable&&t.setSelected(n),t.setAttribute("tabindex","0")}))},e.prototype.ngOnChanges=function(e){var t=this;Object(a.isChanged)("disabled",e)&&this.buttons.forEach((function(e){m(t.disabled)&&(e.disabled=t.disabled)}))},e.prototype.ngAfterContentInit=function(){this.buttons.forEach((function(e){e.selected?e.setAttribute("tabindex","0"):e.setAttribute("tabindex","-1")}))},e.prototype.ngAfterViewChecked=function(){this.buttons.length&&(this.buttons.first.renderer.addClass(this.buttons.first.element,"k-group-start"),this.buttons.last.renderer.addClass(this.buttons.last.element,"k-group-end"))},e.prototype.ngOnDestroy=function(){this.subscription.unsubscribe(),this.localizationChangeSubscription.unsubscribe()},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.navigateFocus=function(e){var t=this.buttons.toArray().findIndex((function(e){return-1!==e.element.tabIndex})),n=this.buttons.length-1,i=new S;e.keyCode===a.Keys.ArrowRight&&t<n&&(this.navigate.emit(i),i.isDefaultPrevented()||(this.defocus(this.buttons.toArray()),this.focus(this.buttons.filter((function(e,n){return n===t+1}))))),e.keyCode===a.Keys.ArrowLeft&&t>0&&(this.navigate.emit(i),i.isDefaultPrevented()||(this.defocus(this.buttons.toArray()),this.focus(this.buttons.filter((function(e,n){return n===t-1})))))},e.prototype.deactivate=function(e){e.forEach((function(e){e.setSelected(!1),e.setAttribute("tabindex","-1")}))},e.prototype.activate=function(e){e.forEach((function(e){e.setSelected(!0),e.setAttribute("tabindex","0"),e.focus()}))},e.prototype.defocus=function(e){e.forEach((function(e){e.setAttribute("tabindex","-1")}))},e.prototype.focus=function(e){e.forEach((function(e){e.setAttribute("tabindex","0"),e.focus()}))},e.prototype.verifySettings=function(){if(Object(o.isDevMode)()&&this.isSelectionSingle()&&this.buttons.filter((function(e){return e.selected})).length>1)throw new Error("Having multiple selected buttons with single selection mode is not supported")},e.prototype.isSelectionSingle=function(){return"single"===this.selection},Object(i.__decorate)([Object(o.Input)("disabled"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)("selection"),Object(i.__metadata)("design:type",String)],e.prototype,"selection",void 0),Object(i.__decorate)([Object(o.Input)("width"),Object(i.__metadata)("design:type",String)],e.prototype,"width",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"navigate",void 0),Object(i.__decorate)([Object(o.ContentChildren)(w),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"buttons",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-button-group"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"wrapperClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-button-group-stretched"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"stretchedClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"getRole",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaDisabled",null),Object(i.__decorate)([Object(o.HostBinding)("style.width"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"wrapperWidth",null),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"wrapperTabIndex",null),Object(i.__decorate)([Object(o.HostListener)("keydown",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"keydown",null),Object(i.__decorate)([Object(o.HostListener)("focus"),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onFocus",null),Object(i.__decorate)([Object(o.HostListener)("focusout",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"focusout",null),e=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoButtonGroup",providers:[h,s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.buttongroup"}],selector:"kendo-buttongroup",template:'\n <ng-content select="[kendoButton]"></ng-content>\n '}),Object(i.__metadata)("design:paramtypes",[h,s.LocalizationService,o.ElementRef])],e)}(),E=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[w],exports:[w]})],e)}(),I=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[x],exports:[x],imports:[d.CommonModule,E]})],e)}(),T=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoDropDownButtonItemTemplate],[kendoSplitButtonItemTemplate]"}),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),D=function(){function e(){this.onItemClick=new o.EventEmitter,this.onItemBlur=new o.EventEmitter,this.sizeClass="",Object(c.validatePackage)(f)}return Object.defineProperty(e.prototype,"size",{set:function(e){this.sizeClass=e?"k-menu-group-"+O[e]:""},enumerable:!0,configurable:!0}),e.prototype.getText=function(e){if(e)return this.textField?e[this.textField]:e.text||e},e.prototype.getIconClasses=function(e){var t={};return t[(e.icon?"k-icon k-i-"+e.icon:void 0)||e.iconClass]=!0,t},e.prototype.onClick=function(e){this.onItemClick.emit(e)},e.prototype.onBlur=function(){this.onItemBlur.emit()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"data",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",T)],e.prototype,"itemTemplate",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onItemClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onItemBlur",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-button-list",template:'\n <ul class="k-group k-menu-group k-reset" [ngClass]="sizeClass" unselectable="on" role="menu">\n <li role="menuitem" unselectable="on"\n kendoButtonFocusable\n *ngFor="let dataItem of data; let index = index;"\n class="k-item k-menu-item"\n (click)="onClick(index)"\n (blur)="onBlur()"\n [attr.aria-disabled]="dataItem.disabled ? true : false">\n <ng-template [ngIf]="itemTemplate?.templateRef">\n <span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">\n <ng-template [templateContext]="{templateRef: itemTemplate?.templateRef, $implicit: dataItem}"></ng-template>\n </span>\n </ng-template>\n <ng-template [ngIf]="!itemTemplate?.templateRef">\n <span kendoButtonFocusable [index]="index" class="k-link k-menu-link" [class.k-disabled]="dataItem.disabled" tabindex="-1">\n <span\n *ngIf="dataItem.icon || dataItem.iconClass"\n [ngClass]="getIconClasses(dataItem)"\n ></span>\n <img\n *ngIf="dataItem.imageUrl"\n class="k-image"\n [src]="dataItem.imageUrl"\n alt=""\n >\n <span *ngIf="getText(dataItem)" class="k-menu-link-text">\n {{ getText(dataItem) }}\n </span>\n </span>\n </ng-template>\n </li>\n </ul>\n '}),Object(i.__metadata)("design:paramtypes",[])],e)}(),B=function(){function e(){this.onFocus=new o.EventEmitter}return e.prototype.isFocused=function(e){return e===this.focused},e.prototype.focus=function(e){this.isFocused(e)||(this.focused=e,this.onFocus.emit(e))},e.prototype.resetFocus=function(){this.focused=-1},Object.defineProperty(e.prototype,"focused",{get:function(){return this.focusedIndex},set:function(e){this.focusedIndex=e,this.onFocus.emit(e)},enumerable:!0,configurable:!0}),e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),P=function(){function e(e,t,n){this.focusService=e,this.renderer=n,this.element=t.nativeElement,this.subscribeEvents()}return e.prototype.ngOnInit=function(){this.index===this.focusService.focused?this.renderer.addClass(this.element,"k-focus"):this.renderer.removeClass(this.element,"k-focus")},e.prototype.ngOnDestroy=function(){this.unsubscribeEvents()},e.prototype.subscribeEvents=function(){var e=this;Object(a.isDocumentAvailable)()&&(this.focusSubscription=this.focusService.onFocus.subscribe((function(t){e.index===t?(e.renderer.addClass(e.element,"k-focus"),e.element.focus()):e.renderer.removeClass(e.element,"k-focus")})))},e.prototype.unsubscribeEvents=function(){Object(a.isDocumentAvailable)()&&this.focusSubscription&&this.focusSubscription.unsubscribe()},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"index",void 0),e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoButtonFocusable]"}),Object(i.__metadata)("design:paramtypes",[B,o.ElementRef,o.Renderer2])],e)}(),A=function(){function e(e){this.viewContainerRef=e}return Object.defineProperty(e.prototype,"templateContext",{set:function(e){this.insertedViewRef&&(this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef)),this.insertedViewRef=void 0),e.templateRef&&(this.insertedViewRef=this.viewContainerRef.createEmbeddedView(e.templateRef,e))},enumerable:!0,configurable:!0}),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"templateContext",null),e=Object(i.__decorate)([Object(o.Directive)({selector:"[templateContext]"}),Object(i.__metadata)("design:paramtypes",[o.ViewContainerRef])],e)}(),M=[D,P,T,A],z=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[M],exports:[M],imports:[d.CommonModule]})],e)}();!function(e){e[e.keydown=0]="keydown",e[e.keypress=1]="keypress",e[e.keyup=2]="keyup"}(y||(y={})),function(e){e[e.Undefined=0]="Undefined",e[e.Open=1]="Open",e[e.Close=2]="Close",e[e.Enter=3]="Enter",e[e.EnterPress=4]="EnterPress",e[e.EnterUp=5]="EnterUp",e[e.Tab=6]="Tab",e[e.Esc=7]="Esc",e[e.Navigate=8]="Navigate"}(_||(_={}));var R=function(){function e(e,t,n,i,o,r){var s=this;this.focusService=e,this.navigationService=t,this.wrapperRef=n,this._zone=i,this.cdr=r,this._open=!1,this._disabled=!1,this._active=!1,this._popupSettings={animate:!0,popupClass:""},this.listId=Object(a.guid)(),this._isFocused=!1,Object(c.validatePackage)(f),this.focusService=e,this.navigationService=t,this.wrapper=n.nativeElement,this.localizationChangeSubscription=o.changes.subscribe((function(e){var t=e.rtl;return s.direction=t?"rtl":"ltr"})),this.subscribeEvents()}return Object.defineProperty(e.prototype,"popupClasses",{get:function(){var e=["k-menu-popup"];return this._popupSettings.popupClass&&e.push(this._popupSettings.popupClass),e.join(" ")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"openState",{get:function(){return this._open},set:function(e){this._open=e},enumerable:!0,configurable:!0}),e.prototype.togglePopupVisibility=function(){this._disabled||(this.openState=!this.openState,this.openState||this.focusService.focus(-1))},e.prototype.onItemClick=function(e){var t=this;this.emitItemClickHandler(e),setTimeout((function(){return t.focusWrapper()}),1)},e.prototype.ngOnDestroy=function(){this.openState=!1,this.unsubscribeEvents(),clearTimeout(this.focusFirstTimeout),clearTimeout(this.blurTimeout),this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe()},e.prototype.subscribeEvents=function(){Object(a.isDocumentAvailable)()&&(this.subscribeListItemFocusEvent(),this.subscribeComponentBlurredEvent(),this.subscribeNavigationEvents())},e.prototype.subscribeListItemFocusEvent=function(){var e=this;this.focusSubscription=this.focusService.onFocus.subscribe((function(){e._isFocused=!0}))},e.prototype.subscribeComponentBlurredEvent=function(){var e=this;this._zone.runOutsideAngular((function(){e.tabSubscription=e.navigationService.tab.pipe(Object(p.filter)((function(){return e._isFocused}))).subscribe(e.handleTab.bind(e)),e.componentBlurredSubscription=Object(r.fromEvent)(document,"click").pipe(Object(p.filter)((function(t){return!e.wrapperContains(t.target)})),Object(p.filter)((function(){return e._isFocused}))).subscribe((function(){return e._zone.run((function(){return e.blurWrapper()}))}))}))},e.prototype.subscribeNavigationEvents=function(){var e=this;this.navigationSubscription=this.navigationService.navigate.subscribe(this.focusService.focus.bind(this.focusService)),this.enterUpSubscription=this.navigationService.enterup.subscribe((function(){e.enterHandler(),e.focusWrapper()})),this.openSubscription=this.navigationService.open.subscribe((function(){e._open?e.focusWrapper():(e.togglePopupVisibility(),e.focusFirstItem())})),this.closeSubscription=Object(r.merge)(this.navigationService.close,this.navigationService.esc).subscribe((function(){return e.focusWrapper()}))},e.prototype.enterHandler=function(){},e.prototype.unsubscribeEvents=function(){Object(a.isDocumentAvailable)()&&(this.unsubscribe(this.componentBlurredSubscription),this.unsubscribe(this.focusSubscription),this.unsubscribe(this.navigationSubscription),this.unsubscribe(this.enterPressSubscription),this.unsubscribe(this.enterUpSubscription),this.unsubscribe(this.openSubscription),this.unsubscribe(this.closeSubscription),this.unsubscribe(this.tabSubscription))},e.prototype.unsubscribe=function(e){e&&e.unsubscribe()},e.prototype.keyDownHandler=function(e){this.keyHandler(e)},e.prototype.keyPressHandler=function(e){this.keyHandler(e,y.keypress)},e.prototype.keyUpHandler=function(e){this.keyHandler(e,y.keyup)},e.prototype.keyHandler=function(e,t){if(!this._disabled){var n=this.focusService.focused||0,i=e,o=this.navigationService.process({altKey:i.altKey,current:n,keyCode:i.keyCode,keyEvent:t,max:this._data?this._data.length-1:0,min:0});o!==_.Undefined&&o!==_.Tab&&(o!==_.Enter||o===_.Enter&&this._open)&&(e.keyCode===a.Keys.Space&&o===_.EnterUp?this._open=!1:i.preventDefault())}},e.prototype.emitItemClickHandler=function(e){var t=this._data[e];this._itemClick&&this._itemClick.emit(t),t&&t.click&&!t.disabled&&t.click(t)},e.prototype.focusFirstItem=function(){var e=this;this._data&&m(this._data[0])&&(this.focusFirstTimeout=setTimeout((function(){return e.focusService.focus(0)}),1))},e.prototype.focusWrapper=function(){this._open&&(this.togglePopupVisibility(),this.focusButton())},e.prototype.wrapperContains=function(e){return this.wrapper===e||this.wrapper.contains(e)},e.prototype.blurWrapper=function(e){void 0===e&&(e=!0),this._open&&this.togglePopupVisibility(),this._isFocused=!1,e&&(this._blur.emit(),this.cdr.markForCheck())},e.prototype.focusButton=function(){this.button&&this.button.nativeElement.focus()},e.prototype.handleTab=function(){this.focusButton(),this.blurWrapper(!1)},e}(),F=new o.InjectionToken("navigation.config"),N=function(){function e(e){this.navigate=new o.EventEmitter,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.enter=new o.EventEmitter,this.enterpress=new o.EventEmitter,this.enterup=new o.EventEmitter,this.tab=new o.EventEmitter,this.esc=new o.EventEmitter,this.useLeftRightArrows=e.useLeftRightArrows}return e.prototype.process=function(e){var t,n=e.keyCode,i=e.keyEvent,o=_.Undefined;if(i===y.keypress)this.isEnter(n)&&(o=_.EnterPress);else if(i===y.keyup)this.isEnter(n)&&(o=_.EnterUp);else if(e.altKey&&n===a.Keys.ArrowDown)o=_.Open;else if(e.altKey&&n===a.Keys.ArrowUp)o=_.Close;else if(this.isEnter(n))o=_.Enter;else if(n===a.Keys.Escape)o=_.Esc;else if(n===a.Keys.Tab)o=_.Tab;else if(n===a.Keys.ArrowUp||this.useLeftRightArrows&&n===a.Keys.ArrowLeft){var r=e.flipNavigation?1:-1,s=e.flipNavigation?e.min:e.max,c=e.flipNavigation?e.max:e.min;t=this.next({current:e.current,start:s,end:c,step:r}),o=_.Navigate}else if(n===a.Keys.ArrowDown||this.useLeftRightArrows&&n===a.Keys.ArrowRight){r=e.flipNavigation?-1:1,s=e.flipNavigation?e.max:e.min,c=e.flipNavigation?e.min:e.max;t=this.next({current:e.current,start:s,end:c,step:r}),o=_.Navigate}else n===a.Keys.Home?(t=e.min,o=_.Navigate):n===a.Keys.End&&(t=e.max,o=_.Navigate);return o!==_.Undefined&&this[_[o].toLowerCase()].emit(t),o},e.prototype.isEnter=function(e){return e===a.Keys.Enter||e===a.Keys.Space},e.prototype.next=function(e){return m(e.current)?e.current!==e.end?e.current+e.step:e.end:e.start},e=Object(i.__decorate)([Object(o.Injectable)(),Object(i.__param)(0,Object(o.Inject)(F)),Object(i.__metadata)("design:paramtypes",[Object])],e)}(),L={provide:F,useValue:{useLeftRightArrows:!0}},V=function(e){function t(t,n,i,r,s,c,d,l,p){var u=e.call(this,t,n,i,r,d,l)||this;return u.popupService=s,u.elRef=c,u.localization=d,u.renderer=p,u.text="",u.icon="",u.iconClass="",u.type="button",u.imageUrl="",u.size="medium",u.themeColor="base",u.tabIndex=0,u.arrowButtonIcon="arrow-s",u.buttonClick=new o.EventEmitter,u.itemClick=new o.EventEmitter,u.onFocus=new o.EventEmitter,u.onBlur=new o.EventEmitter,u.open=new o.EventEmitter,u.close=new o.EventEmitter,u.activeArrow=!1,u.listId=Object(a.guid)(),u.buttonText="",u.lockFocus=!1,u._rounded="medium",u._fillMode="solid",u._itemClick=u.itemClick,u._blur=u.onBlur,u}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this._fillMode="clear"===e?"flat":e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this.isOpen&&this.toggle(!1),this._disabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0,popupClass:""},e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data||(this.data=[]),this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"openState",{get:function(){return this._open},set:function(e){if(!this.disabled){var t=new S;e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()||this._toggle(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentTabIndex",{get:function(){return this.disabled?-1:this.tabIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused&&!this._disabled},set:function(e){this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgetClasses",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ariaLabel",{get:function(){var e,t,n,i=this.localization.get("splitButtonLabel")||"";return e=i,t="buttonText",n=this.buttonText,e.replace(new RegExp("{\\s*"+t+"\\s*}","g"),n)},enumerable:!0,configurable:!0}),t.prototype.onButtonFocus=function(){this.isFocused||(this._isFocused=!0,this.onFocus.emit())},t.prototype.onArrowButtonClick=function(){this.lockFocus=!0,this.togglePopupVisibility()},t.prototype.toggleButtonActiveState=function(e){this._active=e},t.prototype.toggleArrowButtonActiveState=function(e){this.activeArrow=e},t.prototype.onButtonClick=function(){this.lockFocus=!0,this.buttonClick.emit()},t.prototype.onButtonBlur=function(){this.isOpen||this.lockFocus||this.blurWrapper(),this.lockFocus=!1},t.prototype.keydown=function(e){this.keyDownHandler(e),e.keyCode===a.Keys.Space&&(this._active=!0)},t.prototype.keypress=function(e){this.keyPressHandler(e)},t.prototype.keyup=function(e){this._active=!1,e.keyCode!==a.Keys.Space&&this.keyUpHandler(e)},t.prototype.ngAfterViewInit=function(){this.updateButtonText(),this.handleClasses(this.rounded,"rounded")},t.prototype.ngOnChanges=function(e){if(e.hasOwnProperty("text")&&this.updateButtonText(),Object(a.isChanged)("popupSettings",e)&&m(this.popupRef)){var t=this.popupRef.popup.instance,n=e.popupSettings.currentValue;t.popupClass=n.popupClass,t.animate=n.animate,t.popupAlign=this.popupAlign}},t.prototype.togglePopupVisibility=function(){e.prototype.togglePopupVisibility.call(this),Object(a.isDocumentAvailable)()&&this.lockFocus&&this.button.nativeElement.focus()},t.prototype.wrapperContains=function(e){return this.wrapper===e||this.wrapper.contains(e)||this.popupRef&&this.popupRef.popupElement.contains(e)},Object.defineProperty(t.prototype,"anchorAlign",{get:function(){var e={horizontal:this.popupSettings.align||"left",vertical:"bottom"};return"rtl"!==this.direction||m(this.popupSettings.align)||(e.horizontal="right"),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupAlign",{get:function(){var e={horizontal:this.popupSettings.align||"left",vertical:"top"};return"rtl"!==this.direction||m(this.popupSettings.align)||(e.horizontal="right"),e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){Object(a.isDocumentAvailable)()&&this.button.nativeElement.focus()},t.prototype.blur=function(){Object(a.isDocumentAvailable)()&&(this.button.nativeElement.blur(),this.blurWrapper())},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.destroyPopup()},t.prototype.toggle=function(e){var t=this;this.disabled||g((function(){return t._toggle(void 0===e?!t._open:e)}))},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.openState},enumerable:!0,configurable:!0}),t.prototype.enterHandler=function(){if(!this.disabled)if(this.openState){var e=this.focusService.focused;m(e)&&-1!==e&&this.emitItemClickHandler(e)}else this.buttonClick.emit()},t.prototype.updateButtonText=function(){var e=this;if(Object(a.isDocumentAvailable)()){var t=this.wrapper.innerText.split("\n").join("").trim();setTimeout((function(){return e.buttonText=t}),0)}},Object.defineProperty(t.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.containerRef:e},enumerable:!0,configurable:!0}),t.prototype._toggle=function(e){this._open=e,this.destroyPopup(),this._open&&this.createPopup()},t.prototype.createPopup=function(){var e=this;this.popupRef=this.popupService.open({anchor:this.elRef,anchorAlign:this.anchorAlign,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupAlign:this.popupAlign,popupClass:this.popupClasses}),this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.openState=!1})),this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this))},t.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},t.prototype.handleClasses=function(e,t){var n=this.wrapperRef.nativeElement,i=C("button",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"text",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"icon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"iconClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"type",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"imageUrl",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"size",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],t.prototype,"disabled",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"tabIndex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"data",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"buttonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"arrowButtonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"arrowButtonIcon",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"buttonClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"itemClick",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"close",void 0),Object(i.__decorate)([Object(o.ContentChild)(T,{static:!1}),Object(i.__metadata)("design:type",T)],t.prototype,"itemTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("button",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"button",void 0),Object(i.__decorate)([Object(o.ViewChild)("arrowButton",{static:!0,read:o.ElementRef}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"arrowButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("container",{read:o.ViewContainerRef,static:!0}),Object(i.__metadata)("design:type",o.ViewContainerRef)],t.prototype,"containerRef",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-focus"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],t.prototype,"isFocused",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-split-button"),Object(o.HostBinding)("class.k-button-group"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"widgetClasses",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"dir",null),Object(i.__decorate)([Object(o.HostListener)("keydown",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keydown",null),Object(i.__decorate)([Object(o.HostListener)("keypress",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keypress",null),Object(i.__decorate)([Object(o.HostListener)("keyup",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keyup",null),t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoSplitButton",providers:[B,N,L,s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.splitbutton"}],selector:"kendo-splitbutton",template:'\n <ng-container kendoSplitButtonLocalizedMessages\n i18n-splitButtonLabel="kendo.splitbutton.splitButtonLabel|The text for the SplitButton aria-label"\n splitButtonLabel="{{ \'{buttonText} splitbutton\' }}">\n </ng-container>\n <button\n kendoButton\n #button\n [type]="type"\n [tabindex]="componentTabIndex"\n [disabled]="disabled"\n [size]="size"\n [rounded]="rounded"\n [fillMode]="fillMode"\n [themeColor]="themeColor"\n [icon]="icon"\n [class.k-active]="active"\n [class.k-icon-button]="!text && icon"\n [iconClass]="iconClass"\n [imageUrl]="imageUrl"\n [ngClass]="buttonClass"\n (focus)="onButtonFocus()"\n (click)="onButtonClick()"\n (blur)="onButtonBlur()"\n (mousedown)="toggleButtonActiveState(true)"\n (mouseup)="toggleButtonActiveState(false)"\n [attr.aria-disabled]="disabled"\n [attr.aria-expanded]="openState"\n [attr.aria-haspopup]="true"\n [attr.aria-owns]="listId"\n [attr.aria-label]="ariaLabel"\n >\n <span *ngIf="text" class="k-button-text">\n {{ text }}\n </span><ng-content></ng-content>\n </button>\n <button\n kendoButton\n #arrowButton\n type="button"\n [class.k-active]="activeArrow"\n [disabled]="disabled"\n [icon]="arrowButtonIcon"\n [size]="size"\n [rounded]="rounded"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n [tabindex]="-1"\n [ngClass]="arrowButtonClass"\n (click)="onArrowButtonClick()"\n (mousedown)="toggleArrowButtonActiveState(true)"\n (mouseup)="toggleArrowButtonActiveState(false)"\n ></button>\n <ng-template #popupTemplate>\n <kendo-button-list\n [id]="listId"\n [data]="data"\n [textField]="textField"\n [itemTemplate]="itemTemplate"\n (onItemClick)="onItemClick($event)"\n (keydown)="keyDownHandler($event)"\n (keypress)="keyPressHandler($event)"\n (keyup)="keyUpHandler($event)"\n [attr.dir]="dir"\n [size]="size"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[B,N,o.ElementRef,o.NgZone,l.PopupService,o.ElementRef,s.LocalizationService,o.ChangeDetectorRef,o.Renderer2])],t)}(R),H=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"splitButtonLabel",void 0),t}(s.ComponentMessages),K=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:H,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoSplitButtonLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService])],t)}(H),$=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:H,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-splitbutton-messages",template:""}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService])],t)}(H),W=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[V,K,$],exports:[V,z,K,$],imports:[d.CommonModule,l.PopupModule,E,z]})],e)}(),U={provide:F,useValue:{useLeftRightArrows:!0}},G=function(e){function t(t,n,i,r,s,c,d,l){var p=e.call(this,t,n,i,r,d,l)||this;return p.popupService=s,p.elRef=c,p.icon="",p.iconClass="",p.imageUrl="",p.size="medium",p.shape="rectangle",p.rounded="medium",p.themeColor="base",p.tabIndex=0,p.itemClick=new o.EventEmitter,p.open=new o.EventEmitter,p.close=new o.EventEmitter,p.onFocus=new o.EventEmitter,p.onBlur=new o.EventEmitter,p.listId=Object(a.guid)(),p._fillMode="solid",p._itemClick=p.itemClick,p._blur=p.onBlur,p}return Object(i.__extends)(t,e),Object.defineProperty(t.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0,popupClass:""},e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(e){e&&this.openState&&(this.openState=!1),this._disabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this._fillMode="clear"===e?"flat":e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"openState",{get:function(){return this._open},set:function(e){if(!this.disabled){var t=new S;e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()||this._toggle(e)}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentTabIndex",{get:function(){return this.disabled?-1:this.tabIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focused",{get:function(){return this._isFocused&&!this._disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"widgetClasses",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},enumerable:!0,configurable:!0}),t.prototype.keydown=function(e){this.keyDownHandler(e),e.keyCode===a.Keys.Space&&(this._active=!0)},t.prototype.keypress=function(e){this.keyPressHandler(e)},t.prototype.keyup=function(e){this.keyUpHandler(e),this._active=!1},t.prototype.mousedown=function(e){this._disabled&&e.preventDefault(),this._active=!0},t.prototype.mouseup=function(e){this._disabled&&e.preventDefault(),this._active=!1},t.prototype.openPopup=function(){this.togglePopupVisibility()},t.prototype.onButtonBlur=function(){this.isOpen||this.blurWrapper()},Object.defineProperty(t.prototype,"anchorAlign",{get:function(){var e={horizontal:this.popupSettings.align||"left",vertical:"bottom"};return"rtl"!==this.direction||m(this.popupSettings.align)||(e.horizontal="right"),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupAlign",{get:function(){var e={horizontal:this.popupSettings.align||"left",vertical:"top"};return"rtl"!==this.direction||m(this.popupSettings.align)||(e.horizontal="right"),e},enumerable:!0,configurable:!0}),t.prototype.focus=function(){Object(a.isDocumentAvailable)()&&this.button.nativeElement.focus()},t.prototype.blur=function(){Object(a.isDocumentAvailable)()&&(this.button.nativeElement.blur(),this.blurWrapper())},t.prototype.ngOnChanges=function(e){if(Object(a.isChanged)("popupSettings",e)&&m(this.popupRef)){var t=this.popupRef.popup.instance,n=e.popupSettings.currentValue;t.popupClass=n.popupClass,t.animate=n.animate,t.popupAlign=this.popupAlign}},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.destroyPopup()},t.prototype.toggle=function(e){var t=this;this.disabled||g((function(){return t._toggle(void 0===e?!t._open:e)}))},Object.defineProperty(t.prototype,"isOpen",{get:function(){return this.openState},enumerable:!0,configurable:!0}),t.prototype.handleFocus=function(){this._disabled||this._isFocused||(this._isFocused=!0,this.onFocus.emit())},t.prototype.wrapperContains=function(e){return this.wrapper===e||this.wrapper.contains(e)||this.popupRef&&this.popupRef.popupElement.contains(e)},t.prototype.subscribeNavigationEvents=function(){this.navigationSubscription=this.navigationService.navigate.subscribe(this.onArrowKeyNavigate.bind(this)),this.enterUpSubscription=this.navigationService.enterup.subscribe(this.onNavigationEnterUp.bind(this)),this.openSubscription=this.navigationService.open.subscribe(this.onNavigationOpen.bind(this)),this.closeSubscription=Object(r.merge)(this.navigationService.close,this.navigationService.esc).subscribe(this.onNavigationClose.bind(this))},t.prototype.onNavigationEnterUp=function(){if(this._disabled||this.openState||(this._active=!1),this.openState){var e=this.focusService.focused;m(e)&&-1!==e&&this.emitItemClickHandler(e)}this.togglePopupVisibility(),!this.openState&&Object(a.isDocumentAvailable)()&&this.button.nativeElement.focus()},t.prototype.onNavigationOpen=function(){this._disabled||this.openState||this.togglePopupVisibility()},t.prototype.onNavigationClose=function(){this.openState&&(this.togglePopupVisibility(),Object(a.isDocumentAvailable)()&&this.button.nativeElement.focus())},t.prototype.onArrowKeyNavigate=function(e){this.focusService.focus(e)},t.prototype._toggle=function(e){this._open!==e&&(this._open=e,this.destroyPopup(),this._open&&this.createPopup())},t.prototype.createPopup=function(){var e=this;this.popupRef=this.popupService.open({anchor:this.elRef,anchorAlign:this.anchorAlign,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupAlign:this.popupAlign,popupClass:this.popupClasses}),this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.openState=!1})),this.popupRef.popupOpen.subscribe(this.focusFirstItem.bind(this))},t.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"icon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"iconClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"imageUrl",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"textField",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],t.prototype,"disabled",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],t.prototype,"data",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"size",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"shape",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"rounded",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"themeColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],t.prototype,"buttonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"tabIndex",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"itemClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"close",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-focus"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"focused",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-dropdown-button"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"widgetClasses",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"dir",null),Object(i.__decorate)([Object(o.ContentChild)(T,{static:!1}),Object(i.__metadata)("design:type",T)],t.prototype,"itemTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("button",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"button",void 0),Object(i.__decorate)([Object(o.ViewChild)("buttonList",{static:!1}),Object(i.__metadata)("design:type",D)],t.prototype,"buttonList",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("container",{read:o.ViewContainerRef,static:!0}),Object(i.__metadata)("design:type",o.ViewContainerRef)],t.prototype,"container",void 0),Object(i.__decorate)([Object(o.HostListener)("keydown",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keydown",null),Object(i.__decorate)([Object(o.HostListener)("keypress",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keypress",null),Object(i.__decorate)([Object(o.HostListener)("keyup",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"keyup",null),Object(i.__decorate)([Object(o.HostListener)("mousedown",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"mousedown",null),Object(i.__decorate)([Object(o.HostListener)("mouseup",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],t.prototype,"mouseup",null),t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoDropDownButton",providers:[B,N,U,s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.dropdownbutton"}],selector:"kendo-dropdownbutton",template:'\n <button kendoButton #button\n role="menu"\n type="button"\n [tabindex]="componentTabIndex"\n [class.k-active]="active"\n [disabled]="disabled"\n [icon]="icon"\n [iconClass]="iconClass"\n [imageUrl]="imageUrl"\n [ngClass]="buttonClass"\n [size]="size"\n [shape]="shape"\n [rounded]="rounded"\n [fillMode]="fillMode"\n [themeColor]="fillMode ? themeColor : null"\n (click)="openPopup()"\n (focus)="handleFocus()"\n (blur)="onButtonBlur()"\n [attr.aria-disabled]="disabled"\n [attr.aria-expanded]="openState"\n [attr.aria-haspopup]="true"\n [attr.aria-owns]="listId"\n >\n <ng-content></ng-content>\n </button>\n <ng-template #popupTemplate>\n <kendo-button-list\n #buttonList\n [id]="listId"\n [data]="data"\n [textField]="textField"\n [itemTemplate]="itemTemplate"\n (onItemClick)="onItemClick($event)"\n (keydown)="keyDownHandler($event)"\n (keypress)="keyPressHandler($event)"\n (keyup)="keyUpHandler($event)"\n [attr.dir]="dir"\n [size]="size"\n >\n </kendo-button-list>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[B,N,o.ElementRef,o.NgZone,l.PopupService,o.ElementRef,s.LocalizationService,o.ChangeDetectorRef])],t)}(R),Z=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[G],exports:[G,z],imports:[d.CommonModule,l.PopupModule,z,E]})],e)}(),q=function(){function e(e,t,n,i){this.element=e,this.renderer=t,this.ngZone=n,this.localizationService=i,this.selected=!1,this.removable=!1,this.disabled=!1,this.remove=new o.EventEmitter,this.contentClick=new o.EventEmitter,this.tabIndex=0,this.hostClass=!0,this._size="medium",this._rounded="medium",this._fillMode="solid",this._themeColor="base",this.focused=!1,Object(c.validatePackage)(f),this.direction=i.rtl?"rtl":"ltr"}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"themeColor",{get:function(){return this._themeColor},set:function(e){this.handleThemeColor(e),this._themeColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaChecked",{get:function(){return this.selected},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasIconClass",{get:function(){return!!(this.icon||this.iconClass||this.avatarClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedClass",{get:function(){return this.selected},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focusedClass",{get:function(){return this.focused},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.dynamicRTLSubscription=this.localizationService.changes.subscribe((function(t){var n=t.rtl;return e.direction=n?"rtl":"ltr"}))},e.prototype.ngOnDestroy=function(){this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.detachDomEvents&&this.detachDomEvents()},e.prototype.ngAfterViewInit=function(){var e=this,t=this.element.nativeElement;["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)})),this.attachElementEventHandlers(t)},Object.defineProperty(e.prototype,"kendoIconClass",{get:function(){return this.verifyIconSettings([this.iconClass,this.avatarClass]),"k-i-"+this.icon},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"customIconClass",{get:function(){return this.verifyIconSettings([this.icon,this.avatarClass]),""+this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"chipAvatarClass",{get:function(){return this.verifyIconSettings([this.icon,this.iconClass]),""+this.avatarClass},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"removeIconClass",{get:function(){return this.removeIcon?""+this.removeIcon:"k-i-close-circle"},enumerable:!0,configurable:!0}),e.prototype.focus=function(){Object(a.isDocumentAvailable)()&&this.element.nativeElement.focus()},e.prototype.blur=function(){Object(a.isDocumentAvailable)()&&this.element.nativeElement.blur()},e.prototype.onRemoveClick=function(e){this.removable&&this.remove.emit({sender:this,originalEvent:e})},e.prototype.attachElementEventHandlers=function(e){var t=this;this.ngZone.runOutsideAngular((function(){var n=t.renderer.listen(e,"focus",(function(){t.renderer.addClass(e,"k-focus")})),i=t.renderer.listen(e,"blur",(function(){t.renderer.removeClass(e,"k-focus")})),o=t.renderer.listen(e,"click",(function(e){v(e.target,".k-chip-remove-action")||t.ngZone.run((function(){t.contentClick.emit({sender:t,originalEvent:e})}))}));t.detachDomEvents=function(){n(),i(),o()}}))},e.prototype.verifyIconSettings=function(e){if(Object(o.isDevMode)()&&e.filter((function(e){return null!=e})).length>0)throw this.renderer.removeClass(this.element.nativeElement,"k-chip-has-icon"),new Error("Invalid configuration: Having multiple icons is not supported. Only a single icon on a chip can be displayed.")},e.prototype.handleClasses=function(e,t){var n=this.element.nativeElement,i=C("chip",t,this[t],e);"fillMode"===t&&this.handleThemeColor(this.themeColor,this[t],e),i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},e.prototype.handleThemeColor=function(e,t,n){var i=this.element.nativeElement,o=t||this.fillMode,r=n||this.fillMode,a=k("chip",o,r,this.themeColor,e);this.renderer.removeClass(i,a.toRemove),null!==r&&null!==n&&a.toAdd&&this.renderer.addClass(i,a.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"label",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"icon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"iconClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"avatarClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"selected",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"removable",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"removeIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"themeColor",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"remove",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"contentClick",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number)],e.prototype,"tabIndex",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-checked"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaChecked",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-chip"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-chip-has-icon"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hasIconClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-selected"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"selectedClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-focus"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"focusedClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-chip",template:'\n <span\n *ngIf="icon"\n class="k-chip-icon k-icon"\n [ngClass]="kendoIconClass"\n >\n </span>\n\n <span\n *ngIf="iconClass"\n class="k-chip-icon"\n [ngClass]="customIconClass"\n >\n </span>\n\n <span\n *ngIf="avatarClass"\n class="k-chip-avatar k-avatar k-rounded-full"\n >\n <span class="k-avatar-image" [ngClass]="chipAvatarClass"></span>\n </span>\n\n <span class="k-chip-content">\n <span class="k-chip-label" *ngIf="label">\n {{ label }}\n </span>\n <ng-content *ngIf="!label"></ng-content>\n </span>\n\n <span class="k-chip-actions">\n <span class="k-chip-action k-chip-remove-action"\n *ngIf="removable"\n (click)="onRemoveClick($event)"\n >\n <span\n class="k-icon"\n [ngClass]="removeIconClass"\n >\n </span>\n </span>\n </span>\n ',providers:[s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.chip"}]}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.Renderer2,o.NgZone,s.LocalizationService])],e)}(),J=function(){function e(e,t,n){this.localizationService=e,this.renderer=t,this.element=n,this.hostClass=!0,this.selection="none",this.selectedChange=new o.EventEmitter,this.remove=new o.EventEmitter,this.role="listbox",this._size="medium",Object(c.validatePackage)(f),this.direction=e.rtl?"rtl":"ltr"}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"single",{get:function(){return"single"===this.selection},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"multiple",{get:function(){return"multiple"===this.selection},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){var t=e.target,n=v(t,".k-chip-remove-action"),i=v(t,".k-chip"),o=this.chips.find((function(e){return i===e.element.nativeElement}));if(n&&i){var r={sender:this,originalEvent:e,removedChip:o};this.remove.emit(r)}"none"!==this.selection&&i&&!n&&this.setSelection(o)},e.prototype.ngOnInit=function(){var e=this;this.dynamicRTLSubscription=this.localizationService.changes.subscribe((function(t){var n=t.rtl;return e.direction=n?"rtl":"ltr"}))},e.prototype.ngAfterViewInit=function(){var e=this;["size"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.ngAfterContentInit=function(){var e=this;this.chips.forEach((function(t){e.renderer.setAttribute(t.element.nativeElement,"role","option")}))},e.prototype.ngOnDestroy=function(){this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe()},e.prototype.selectedChips=function(){return this.chips.reduce((function(e,t,n){return t.selected?e.concat(n):e}),[])},e.prototype.setSelection=function(e){"single"===this.selection&&this.clearSelection(e),e.selected=!e.selected,this.selectedChange.emit(this.selectedChips())},e.prototype.clearSelection=function(e){this.chips.forEach((function(t){e!==t&&(t.selected=!1)}))},e.prototype.handleClasses=function(e,t){var n=this.element.nativeElement,i=C("chip-list",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.HostBinding)("class.k-chip-list"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"selection",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"selectedChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"remove",void 0),Object(i.__decorate)([Object(o.ContentChildren)(q),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"chips",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-selection-single"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"single",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-selection-multiple"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"multiple",null),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(i.__decorate)([Object(o.HostListener)("click",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"onClick",null),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-chiplist, kendo-chip-list",template:"\n <ng-content></ng-content>\n ",providers:[s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.chiplist"}]}),Object(i.__metadata)("design:paramtypes",[s.LocalizationService,o.Renderer2,o.ElementRef])],e)}(),X=[q,J],Y=X.slice(),Q=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Y],exports:[X],imports:[d.CommonModule]})],e)}();function ee(e,t){var n={horizontal:t?"right":"left",vertical:"bottom"};return"end"===e.horizontal&&(n.horizontal=t?"left":"right"),"bottom"===e.vertical&&(n.vertical="top"),"bottom"===e.vertical&&"end"===e.horizontal&&(n.horizontal=t?"left":"right",n.vertical="top"),n}function te(e,t){var n={horizontal:t?"right":"left",vertical:"top"};return"end"===e.horizontal&&(n.horizontal=t?"left":"right"),"bottom"===e.vertical&&(n.vertical="bottom"),"bottom"===e.vertical&&"end"===e.horizontal&&(n.horizontal=t?"left":"right",n.vertical="bottom"),n}var ne=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoDialItemTemplate]"}),Object(i.__param)(0,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),ie=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoFloatingActionButtonTemplate]"}),Object(i.__param)(0,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),oe={provide:F,useValue:{useLeftRightArrows:!1}},re={small:"k-fab-sm",medium:"k-fab-md",large:"k-fab-lg"},ae={rectangle:"k-fab-rectangle",square:"k-fab-square"},se={small:"k-rounded-sm",medium:"k-rounded-md",large:"k-rounded-lg",full:"k-rounded-full"},ce=function(){function e(e,t,n,i,s,d,l,p){var u=this;this.renderer=e,this.element=t,this.focusService=n,this.navigationService=i,this.ngZone=s,this.popupService=d,this.builder=l,this.localizationService=p,this.positionMode="fixed",this.dialItemAnimation=!0,this.tabIndex=0,this.dialItems=[],this.onBlur=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.dialItemClick=new o.EventEmitter,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.id="k-"+Object(a.guid)(),this._themeColor="primary",this._size="medium",this._shape="rectangle",this._disabled=!1,this._align={horizontal:"end",vertical:"bottom"},this._offset={x:"16px",y:"16px"},this._rounded="full",this.subscriptions=new r.Subscription,this.rtl=!1,this.animationEnd=new o.EventEmitter,this.initialSetup=!0,Object(c.validatePackage)(f),this.subscribeNavigationEvents(),this.subscriptions.add(this.localizationService.changes.subscribe((function(e){var t=e.rtl;u.rtl=t,u.direction=u.rtl?"rtl":"ltr"})))}return Object.defineProperty(e.prototype,"fixedClass",{get:function(){return"fixed"===this.positionMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"absoluteClass",{get:function(){return"absolute"===this.positionMode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"themeColor",{get:function(){return this._themeColor},set:function(e){this.handleClasses(e,"themeColor"),this._themeColor=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){return this._shape},set:function(e){this.handleClasses(e,"shape"),this._shape=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this._disabled},set:function(e){this._disabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"align",{get:function(){return this._align},set:function(e){this._align=Object.assign(this._align,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this._offset},set:function(e){this._offset=Object.assign(this._offset,e),this.offsetStyles()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentTabIndex",{get:function(){return this.disabled?-1:this.tabIndex},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;["shape","size","rounded","themeColor"].forEach((function(t){return e.handleClasses(e[t],t)})),this.renderer.addClass(this.element.nativeElement,this.alignClass()),this.offsetStyles(),this.initialSetup=!1},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object.defineProperty(e.prototype,"isOpen",{get:function(){return m(this.popupRef)},enumerable:!0,configurable:!0}),e.prototype.focus=function(){Object(a.isDocumentAvailable)()&&this.button.nativeElement.focus()},e.prototype.blur=function(){Object(a.isDocumentAvailable)()&&this.button.nativeElement.blur()},e.prototype.toggleDial=function(e){var t=this;if(!this.disabled&&this.hasDialItems){var n=m(e)?e:!this.isOpen;this.disabled||n===this.isOpen||(n?setTimeout((function(){return t.openDial()})):this.closeDial())}},Object.defineProperty(e.prototype,"role",{get:function(){return this.dialItems&&this.dialItems.length?"menubutton":"button"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaExpanded",{get:function(){return m(this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaHasPopup",{get:function(){return m(this.isOpen)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClasses",{get:function(){var e=[];return this.iconClass&&e.push(""+this.iconClass),this.icon&&e.push("k-fab-icon k-icon k-i-"+this.icon),e},enumerable:!0,configurable:!0}),e.prototype.clickHandler=function(){var e=this;!this.disabled&&this.hasDialItems&&this.ngZone.run((function(){var t=!e.isOpen;e.toggleDialWithEvents(t)}))},e.prototype.keyDownHandler=function(e){this.keyHandler(e)},e.prototype.keyHandler=function(e,t){if(!this.disabled){var n=this.focusService.focused||0,i=e.keyCode,o=this.navigationService.process({altKey:e.altKey,current:n,keyCode:i,keyEvent:t,max:this.dialItems?this.dialItems.length-1:0,min:0,flipNavigation:"bottom"===this.align.vertical});o!==_.Undefined&&o!==_.Tab&&e.preventDefault()}},e.prototype.onItemClick=function(e){var t=v(e.target,".k-fab-item");if(t){var n=t.getAttribute("data-fab-item-index");this.emitItemClick(n)}},e.prototype.focusHandler=function(){this.disabled||this.onFocus.emit()},e.prototype.blurHandler=function(){this.onBlur.emit(),this.toggleDialWithEvents(!1)},e.prototype.handleClasses=function(e,t){if(m(this.button)&&(this[t]!==e||this.initialSetup)){var n=this.button.nativeElement,i={themeColor:"k-fab-solid-"+this.themeColor,size:re[this.size],shape:ae[this.shape],rounded:se[this.rounded]},o={themeColor:e?"k-fab-solid-"+e:null,size:re[e],shape:ae[e],rounded:se[e]};this.renderer.removeClass(n,i[t]),o[t]&&this.renderer.addClass(n,o[t])}},e.prototype.onEnterPressed=function(){var e=this.focusService.focused;this.emitItemClick(e)},e.prototype.emitItemClick=function(e){var t=this.dialItems[e];if(t&&!t.disabled){var n={item:t,index:e};this.dialItemClick.emit(n),this.toggleDialWithEvents(!1)}},e.prototype.subscribeNavigationEvents=function(){this.subscriptions.add(this.navigationService.navigate.subscribe(this.onArrowKeyNavigate.bind(this))),this.subscriptions.add(this.navigationService.enter.subscribe(this.onNavigationEnterPress.bind(this))),this.subscriptions.add(Object(r.merge)(this.navigationService.close,this.navigationService.esc).subscribe(this.onNavigationClose.bind(this)))},e.prototype.onArrowKeyNavigate=function(e){this.focusService.focus(e)},e.prototype.onNavigationEnterPress=function(){var e=this;this.ngZone.run((function(){if(e.isOpen){var t=e.focusService.focused,n=e.dialItems[t];if(n&&n.disabled)return;if(m(t)&&-1!==t)return void e.onEnterPressed()}!e.isOpen&&Object(a.isDocumentAvailable)()&&(e.toggleDialWithEvents(!0),e.button.nativeElement.focus())}))},e.prototype.onNavigationClose=function(){var e=this;this.isOpen&&this.ngZone.run((function(){e.toggleDialWithEvents(!1),Object(a.isDocumentAvailable)()&&e.button.nativeElement.focus()}))},e.prototype.alignClass=function(){return"k-pos-"+this.align.vertical+"-"+this.align.horizontal},e.prototype.toggleDialWithEvents=function(e){if(e!==this.isOpen){var t=new S;e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()||(e?this.openDial():this.closeDial())}},e.prototype.openPopup=function(){var e=this;if(!this.isOpen){var t=this.icon&&!this.text,n=this.rtl,i=this.align;this.popupRef=this.popupService.open({anchor:this.element.nativeElement,animate:!1,content:this.popupTemplate,anchorAlign:ee(i,n),popupAlign:te(i,n),popupClass:"k-fab-popup k-popup-transparent"});var o=this.popupRef.popupElement;this.renderer.setStyle(o,"box-shadow","none"),t&&this.subscriptions.add(this.popupRef.popupOpen.subscribe((function(){return e.positionPopup()}))),this.ngZone.runOutsideAngular((function(){e.popupMouseDownListener=e.renderer.listen(o,"mousedown",(function(e){e.preventDefault()}))})),this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.toggleDialWithEvents(!1)}))}},e.prototype.closePopup=function(){this.isOpen&&(this.popupMouseDownListener&&this.popupMouseDownListener(),this.popupRef.close(),this.popupRef=null)},e.prototype.openDial=function(){this.openPopup(),this.focusService.focus(0),this.dialItemAnimation&&this.isValidAnimation()&&this.playAnimation(!0)},e.prototype.closeDial=function(){var e=this;this.dialItemAnimation&&this.isValidAnimation()?(this.playAnimation(!1),this.animationEnd.pipe(Object(p.take)(1)).subscribe((function(){return e.closePopup()}))):this.closePopup()},e.prototype.isValidAnimation=function(){var e=this.dialItemAnimation;return"boolean"==typeof e||0!==e.duration},e.prototype.positionPopup=function(){if(!this.dialItemTemplate){var e=this.element.nativeElement.getBoundingClientRect().width,t=this.popupRef.popupElement,n=t.querySelector(".k-fab-item-icon");if(n){var i=e/2-n.getBoundingClientRect().width/2,o=t.getBoundingClientRect().left,r="end"===this.align.horizontal,a=r?o-i:i+o,s=r?i+o:o-i;t.style.left=this.rtl?s+"px":a+"px"}}},e.prototype.offsetStyles=function(){var e=this.element.nativeElement;this.renderer.setStyle(e,this.horizontalPosition,this.horizontalOffset),this.renderer.setStyle(e,this.verticalPosition,this.verticalOffset)},Object.defineProperty(e.prototype,"hasDialItems",{get:function(){return m(this.dialItems)&&0!==this.dialItems.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalPosition",{get:function(){return{top:"top",middle:"top",bottom:"bottom"}[this.align.vertical]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalOffset",{get:function(){return"middle"===this.align.vertical?"16px"===this.offset.y?"50%":"calc(50% + "+this.offset.y+")":this.offset.y},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalPosition",{get:function(){var e=this.align.horizontal;return{end:this.rtl?"left":"right",center:"left",start:this.rtl?"right":"left"}[e]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontalOffset",{get:function(){return"center"===this.align.horizontal?"16px"===this.offset.x?"50%":"calc(50% + "+this.offset.x+")":this.offset.x},enumerable:!0,configurable:!0}),e.prototype.playerFor=function(e,t){return this.builder.build(t).create(e)},e.prototype.playAnimation=function(e){var t=this,n=this.durationSettings(),i={duration:n.duration,gap:n.gap,align:this.align},o=e?function(e){var t="bottom"===e.align.vertical,n=e.duration,i=e.gap;return Object(u.sequence)([Object(u.query)(".k-fab-item",[Object(u.style)({opacity:0,transform:"translateY("+(t?"8px":"-8px")+")"}),Object(u.stagger)(i,[Object(u.animate)(n+"ms ease-in",Object(u.style)({opacity:"*",transform:"translateY(0)"}))])],{optional:!0})])}(i):function(e){var t="bottom"===e.align.vertical,n=e.duration,i=e.gap;return Object(u.sequence)([Object(u.query)(".k-fab-item",[Object(u.style)({opacity:"*",transform:"translateY(0)"}),Object(u.stagger)(-i,[Object(u.animate)(n+"ms ease-in",Object(u.style)({opacity:0,transform:"translateY("+(t?"8px":"-8px")+")"}))])],{optional:!0})])}(i),r=this.playerFor(this.popupRef.popupElement,o);r.play(),r.onDone((function(){r&&(t.animationEnd.emit(),r.destroy(),r=null)}))},e.prototype.durationSettings=function(){return{duration:this.animationDuration(),gap:this.animationGap()}},e.prototype.animationGap=function(){var e=this.dialItemAnimation;return"boolean"!=typeof e&&m(e.gap)?e.gap:90},e.prototype.animationDuration=function(){var e=this.dialItemAnimation;return"boolean"!=typeof e&&m(e.duration)?e.duration:180},Object(i.__decorate)([Object(o.HostBinding)("class.k-pos-fixed"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"fixedClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-pos-absolute"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"absoluteClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.ViewChild)("button",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"button",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ContentChild)(ne,{static:!0}),Object(i.__metadata)("design:type",ne)],e.prototype,"dialItemTemplate",void 0),Object(i.__decorate)([Object(o.ContentChild)(ie,{static:!0}),Object(i.__metadata)("design:type",ie)],e.prototype,"fabTemplate",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"themeColor",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"shape",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"disabled",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"align",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"offset",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"positionMode",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"icon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"iconClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"buttonClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"dialClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"text",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"dialItemAnimation",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabIndex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"dialItems",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("dialItemClick"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"dialItemClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"close",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-floatingactionbutton",providers:[B,N,oe,s.LocalizationService,{provide:s.L10N_PREFIX,useValue:"kendo.floatingactionbutton"}],template:'\n <button\n #button\n [attr.id]="id"\n [attr.role]="role"\n [tabIndex]="componentTabIndex"\n type="button"\n class="k-fab k-fab-solid"\n [class.k-disabled]="disabled"\n [ngClass]="buttonClass"\n [disabled]="disabled"\n [attr.aria-disabled]="disabled"\n [attr.aria-expanded]="ariaExpanded"\n [attr.aria-haspopup]="ariaHasPopup"\n (focus)="focusHandler()"\n (blur)="blurHandler()"\n [kendoEventsOutsideAngular]="{\n keydown: keyDownHandler,\n click: clickHandler\n }"\n [scope]="this"\n >\n <ng-template *ngIf="fabTemplate"\n [ngTemplateOutlet]="fabTemplate?.templateRef"\n >\n </ng-template>\n\n <ng-container *ngIf="!fabTemplate">\n <span *ngIf="icon || iconClass" [ngClass]="iconClasses"></span>\n <span *ngIf="text" class="k-fab-text">{{ text }}</span>\n </ng-container>\n </button>\n\n <ng-template #popupTemplate>\n <ul\n kendoDialList\n [ngClass]="dialClass"\n [dialItems]="dialItems"\n [dialItemTemplate]=\'dialItemTemplate?.templateRef\'\n [align]="align"\n [attr.aria-labelledby]="id"\n (click)="onItemClick($event)"\n >\n </ul>\n </ng-template>\n '}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef,B,N,o.NgZone,l.PopupService,u.AnimationBuilder,s.LocalizationService])],e)}(),de=function(){function e(e,t){var n=this;this.focusService=e,this.cdr=t,this.hostClass=!0,this.subscriptions=new r.Subscription,this.subscriptions.add(this.focusService.onFocus.subscribe((function(){return n.cdr.detectChanges()})))}return Object.defineProperty(e.prototype,"bottomClass",{get:function(){return"top"===this.align.vertical||"middle"===this.align.vertical},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"topClass",{get:function(){return"bottom"===this.align.vertical},enumerable:!0,configurable:!0}),e.prototype.isFocused=function(e){return this.focusService.isFocused(e)},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},Object(i.__decorate)([Object(o.HostBinding)("class.k-fab-items"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-fab-items-bottom"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"bottomClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-fab-items-top"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"topClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"dialItems",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"dialItemTemplate",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"align",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoDialList]",template:'\n <ng-container *ngFor=\'let item of dialItems; let idx = index\'>\n <li\n kendoButtonFocusable\n kendoDialItem\n [item]="dialItems[idx]"\n [index]="idx"\n [dialItemTemplate]="dialItemTemplate"\n [isFocused]="isFocused(idx)"\n [ngClass]=\'item.cssClass\'\n [ngStyle]=\'item.cssStyle\'\n [align]="align"\n >\n </li>\n </ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[B,o.ChangeDetectorRef])],e)}(),le=function(){function e(e,t,n){this.element=e,this.renderer=t,this.localisationService=n,this.hostClass=!0,this.role="menuitem"}return Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.item.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){var e=this.item.label;return e||this.itemTitle},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indexAttr",{get:function(){return this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClasses",{get:function(){var e=[];return this.item.iconClass&&e.push(""+this.item.iconClass),this.item.icon&&e.push("k-fab-item-icon k-icon k-i-"+this.item.icon),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemTitle",{get:function(){var e=this.item.icon,t=this.item.itemTitle;return e&&t?t:e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this.element.nativeElement,t=this.localisationService.rtl,n=this.align.horizontal;this.renderer.addClass(e,this.getTextDirectionClass(t,n))},e.prototype.getTextDirectionClass=function(e,t){return{rtl:{end:"k-text-left",start:"k-text-right"},ltr:{start:"k-text-left",end:"k-text-right"}}[e?"rtl":"ltr"]["end"===t?"end":"start"]},Object(i.__decorate)([Object(o.HostBinding)("class.k-fab-item"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.title"),Object(o.HostBinding)("attr.aria-label"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"title",null),Object(i.__decorate)([Object(o.HostBinding)("attr.data-fab-item-index"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"indexAttr",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"cssClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"cssStyle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"isFocused",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"index",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"item",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"dialItemTemplate",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"align",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoDialItem]",template:'\n <ng-template *ngIf="dialItemTemplate"\n [ngTemplateOutlet]="dialItemTemplate"\n [ngTemplateOutletContext]="{ $implicit: item, index: index, isFocused: isFocused }"\n >\n </ng-template>\n\n <ng-container *ngIf="!dialItemTemplate">\n <span *ngIf="item.label" class="k-fab-item-text">{{ item.label }}</span>\n <span *ngIf="item.icon || item.iconClass" [ngClass]="iconClasses"></span>\n </ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.Renderer2,s.LocalizationService])],e)}(),pe=[ce,ne,ie],ue=pe.concat([de,le]),he=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[ue],exports:[pe],imports:[d.CommonModule,l.PopupModule,z,a.EventsModule]})],e)}(),fe=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({exports:[I,E,W,Z,Q,he]})],e)}()},function(e,t){e.exports=s},function(e,t,n){"use strict";function i(e){this.content=e}n.r(t),n.d(t,"getHtml",(function(){return Bt})),n.d(t,"setHtml",(function(){return Pt})),n.d(t,"parseContent",(function(){return Dt})),n.d(t,"trimWhitespace",(function(){return xt})),n.d(t,"htmlToFragment",(function(){return Et})),n.d(t,"domToPmDoc",(function(){return Tt})),n.d(t,"pmDocToFragment",(function(){return It})),n.d(t,"applyInlineStyle",(function(){return ln})),n.d(t,"getInlineStyles",(function(){return sn})),n.d(t,"toggleInlineFormat",(function(){return dn})),n.d(t,"applyLink",(function(){return un})),n.d(t,"removeLink",(function(){return pn})),n.d(t,"insertText",(function(){return hn})),n.d(t,"insertImage",(function(){return fn})),n.d(t,"alignBlocks",(function(){return kn})),n.d(t,"isAligned",(function(){return wn})),n.d(t,"cleanFormatting",(function(){return Sn})),n.d(t,"hasNode",(function(){return On})),n.d(t,"activeNode",(function(){return Cn})),n.d(t,"formatBlockElements",(function(){return gn})),n.d(t,"getBlockFormats",(function(){return yn})),n.d(t,"parentBlockFormat",(function(){return jn})),n.d(t,"changeTextBlock",(function(){return bn})),n.d(t,"blockNodes",(function(){return mn})),n.d(t,"cleanTextBlockFormatting",(function(){return vn})),n.d(t,"hasMark",(function(){return Qt})),n.d(t,"getMark",(function(){return nn})),n.d(t,"getActiveMarks",(function(){return on})),n.d(t,"removeAllMarks",(function(){return Xt})),n.d(t,"cleanMarks",(function(){return Yt})),n.d(t,"selectionMarks",(function(){return tn})),n.d(t,"indent",(function(){return Bi})),n.d(t,"canIndentAsListItem",(function(){return Ii})),n.d(t,"outdent",(function(){return Pi})),n.d(t,"canOutdentAsListItem",(function(){return Ti})),n.d(t,"isIndented",(function(){return Ei})),n.d(t,"canBeIndented",(function(){return Di})),n.d(t,"indentBlocks",(function(){return xi})),n.d(t,"toggleOrderedList",(function(){return Hi})),n.d(t,"toggleUnorderedList",(function(){return Vi})),n.d(t,"toggleList",(function(){return Li})),n.d(t,"listStyle",(function(){return Ni})),n.d(t,"blockquote",(function(){return wi})),n.d(t,"liftBlockquote",(function(){return Si})),n.d(t,"hasSameMarkup",(function(){return Lt})),n.d(t,"getSelectionText",(function(){return Vt})),n.d(t,"getNodeFromSelection",(function(){return Ht})),n.d(t,"selectedLineTextOnly",(function(){return Kt})),n.d(t,"expandSelection",(function(){return Ut})),n.d(t,"expandToWordWrap",(function(){return Gt})),n.d(t,"canInsert",(function(){return zt})),n.d(t,"insertNode",(function(){return Nt})),n.d(t,"indentHtml",(function(){return $t})),n.d(t,"alignLeftRules",(function(){return $i})),n.d(t,"alignCenterRules",(function(){return Ui})),n.d(t,"alignRightRules",(function(){return Wi})),n.d(t,"alignJustifyRules",(function(){return Gi})),n.d(t,"alignRemoveRules",(function(){return Zi})),n.d(t,"indentRules",(function(){return Hn})),n.d(t,"outdentRules",(function(){return Kn})),n.d(t,"nodes",(function(){return Zc})),n.d(t,"marks",(function(){return Hc})),n.d(t,"buildKeymap",(function(){return Fd})),n.d(t,"buildListKeymap",(function(){return Nd})),n.d(t,"bold",(function(){return Td})),n.d(t,"italic",(function(){return Dd})),n.d(t,"underline",(function(){return Bd})),n.d(t,"strikethrough",(function(){return Pd})),n.d(t,"subscript",(function(){return Ad})),n.d(t,"superscript",(function(){return Md})),n.d(t,"link",(function(){return zd})),n.d(t,"sanitize",(function(){return qd})),n.d(t,"removeComments",(function(){return Jd})),n.d(t,"removeTag",(function(){return Xd})),n.d(t,"pasteCleanup",(function(){return il})),n.d(t,"sanitizeClassAttr",(function(){return Qd})),n.d(t,"sanitizeStyleAttr",(function(){return nl})),n.d(t,"removeAttribute",(function(){return Yd})),n.d(t,"replaceImageSourcesFromRtf",(function(){return pl})),n.d(t,"convertMsLists",(function(){return Zd})),n.d(t,"find",(function(){return hl})),n.d(t,"findAt",(function(){return ul})),n.d(t,"findAll",(function(){return fl})),n.d(t,"replace",(function(){return bl})),n.d(t,"replaceAll",(function(){return ml})),n.d(t,"placeholder",(function(){return _l})),n.d(t,"spacesFix",(function(){return Cl})),n.d(t,"textHighlight",(function(){return wl})),n.d(t,"textHighlightKey",(function(){return kl})),n.d(t,"imageResizing",(function(){return Al})),n.d(t,"imageResizeKey",(function(){return Sl})),n.d(t,"caretColor",(function(){return zl})),n.d(t,"caretColorKey",(function(){return Ml})),n.d(t,"autoJoin",(function(){return gi})),n.d(t,"baseKeymap",(function(){return ki})),n.d(t,"chainCommands",(function(){return vi})),n.d(t,"createParagraphNear",(function(){return oi})),n.d(t,"deleteSelection",(function(){return $n})),n.d(t,"exitCode",(function(){return ii})),n.d(t,"joinBackward",(function(){return Wn})),n.d(t,"joinDown",(function(){return Qn})),n.d(t,"joinForward",(function(){return qn})),n.d(t,"joinUp",(function(){return Yn})),n.d(t,"lift",(function(){return ei})),n.d(t,"liftEmptyBlock",(function(){return ri})),n.d(t,"macBaseKeymap",(function(){return ji})),n.d(t,"newlineInCode",(function(){return ti})),n.d(t,"pcBaseKeymap",(function(){return Oi})),n.d(t,"selectAll",(function(){return di})),n.d(t,"selectNodeBackward",(function(){return Gn})),n.d(t,"selectNodeForward",(function(){return Jn})),n.d(t,"selectParentNode",(function(){return ci})),n.d(t,"selectTextblockEnd",(function(){return hi})),n.d(t,"selectTextblockStart",(function(){return ui})),n.d(t,"setBlockType",(function(){return bi})),n.d(t,"splitBlock",(function(){return ai})),n.d(t,"splitBlockKeepMarks",(function(){return si})),n.d(t,"toggleMark",(function(){return mi})),n.d(t,"wrapIn",(function(){return fi})),n.d(t,"dropCursor",(function(){return Rl})),n.d(t,"GapCursor",(function(){return Nl})),n.d(t,"gapCursor",(function(){return Vl})),n.d(t,"HistoryState",(function(){return td})),n.d(t,"closeHistory",(function(){return dd})),n.d(t,"history",(function(){return ud})),n.d(t,"redo",(function(){return fd})),n.d(t,"redoDepth",(function(){return md})),n.d(t,"undo",(function(){return hd})),n.d(t,"undoDepth",(function(){return bd})),n.d(t,"InputRule",(function(){return gd})),n.d(t,"closeDoubleQuote",(function(){return kd})),n.d(t,"closeSingleQuote",(function(){return Sd})),n.d(t,"ellipsis",(function(){return jd})),n.d(t,"emDash",(function(){return Od})),n.d(t,"inputRules",(function(){return vd})),n.d(t,"openDoubleQuote",(function(){return Cd})),n.d(t,"openSingleQuote",(function(){return wd})),n.d(t,"smartQuotes",(function(){return xd})),n.d(t,"textblockTypeInputRule",(function(){return Id})),n.d(t,"undoInputRule",(function(){return _d})),n.d(t,"wrappingInputRule",(function(){return Ed})),n.d(t,"keydownHandler",(function(){return lo})),n.d(t,"keymap",(function(){return co})),n.d(t,"ContentMatch",(function(){return P})),n.d(t,"DOMParser",(function(){return ee})),n.d(t,"DOMSerializer",(function(){return pe})),n.d(t,"Fragment",(function(){return r})),n.d(t,"Mark",(function(){return l})),n.d(t,"MarkType",(function(){return X})),n.d(t,"Node",(function(){return I})),n.d(t,"NodeRange",(function(){return S})),n.d(t,"NodeType",(function(){return G})),n.d(t,"ReplaceError",(function(){return p})),n.d(t,"ResolvedPos",(function(){return O})),n.d(t,"Schema",(function(){return Y})),n.d(t,"Slice",(function(){return u})),n.d(t,"addListNodes",(function(){return An})),n.d(t,"bulletList",(function(){return Dn})),n.d(t,"liftListItem",(function(){return Rn})),n.d(t,"listItem",(function(){return Bn})),n.d(t,"orderedList",(function(){return Tn})),n.d(t,"sinkListItem",(function(){return Fn})),n.d(t,"splitListItem",(function(){return zn})),n.d(t,"wrapInList",(function(){return Mn})),n.d(t,"AllSelection",(function(){return st})),n.d(t,"EditorState",(function(){return mt})),n.d(t,"NodeSelection",(function(){return rt})),n.d(t,"Plugin",(function(){return yt})),n.d(t,"PluginKey",(function(){return jt})),n.d(t,"Selection",(function(){return et})),n.d(t,"SelectionRange",(function(){return nt})),n.d(t,"TextSelection",(function(){return it})),n.d(t,"Transaction",(function(){return pt})),n.d(t,"CellSelection",(function(){return Es})),n.d(t,"TableMap",(function(){return cs})),n.d(t,"TableView",(function(){return _c})),n.d(t,"__clipCells",(function(){return Ps})),n.d(t,"__insertCells",(function(){return zs})),n.d(t,"__pastedCells",(function(){return Ds})),n.d(t,"addColSpan",(function(){return Ss})),n.d(t,"addColumn",(function(){return Xs})),n.d(t,"addColumnAfter",(function(){return Qs})),n.d(t,"addColumnBefore",(function(){return Ys})),n.d(t,"addRow",(function(){return ic})),n.d(t,"cellAround",(function(){return bs})),n.d(t,"colCount",(function(){return js})),n.d(t,"columnIsHeader",(function(){return xs})),n.d(t,"columnResizing",(function(){return Cc})),n.d(t,"columnResizingPluginKey",(function(){return jc})),n.d(t,"deleteColumn",(function(){return tc})),n.d(t,"deleteRow",(function(){return sc})),n.d(t,"deleteTable",(function(){return yc})),n.d(t,"findCell",(function(){return Os})),n.d(t,"fixTables",(function(){return qs})),n.d(t,"fixTablesKey",(function(){return Zs})),n.d(t,"goToNextCell",(function(){return vc})),n.d(t,"handlePaste",(function(){return Ks})),n.d(t,"inSameTable",(function(){return _s})),n.d(t,"isInTable",(function(){return ms})),n.d(t,"mergeCells",(function(){return dc})),n.d(t,"moveCellForward",(function(){return ys})),n.d(t,"nextCell",(function(){return Cs})),n.d(t,"pointsAtCell",(function(){return vs})),n.d(t,"removeColSpan",(function(){return ws})),n.d(t,"removeColumn",(function(){return ec})),n.d(t,"removeRow",(function(){return ac})),n.d(t,"rowIsHeader",(function(){return nc})),n.d(t,"selectedRect",(function(){return Js})),n.d(t,"selectionCell",(function(){return gs})),n.d(t,"setAttr",(function(){return ks})),n.d(t,"setCellAttr",(function(){return uc})),n.d(t,"splitCell",(function(){return lc})),n.d(t,"splitCellWithType",(function(){return pc})),n.d(t,"tableEditing",(function(){return Ic})),n.d(t,"tableEditingKey",(function(){return fs})),n.d(t,"tableNodeTypes",(function(){return hs})),n.d(t,"tableNodes",(function(){return us})),n.d(t,"toggleHeader",(function(){return fc})),n.d(t,"toggleHeaderCell",(function(){return gc})),n.d(t,"toggleHeaderColumn",(function(){return mc})),n.d(t,"toggleHeaderRow",(function(){return bc})),n.d(t,"updateColumnsOnResize",(function(){return Oc})),n.d(t,"AddMarkStep",(function(){return Le})),n.d(t,"MapResult",(function(){return me})),n.d(t,"Mapping",(function(){return ve})),n.d(t,"RemoveMarkStep",(function(){return Ve})),n.d(t,"ReplaceAroundStep",(function(){return xe})),n.d(t,"ReplaceStep",(function(){return Se})),n.d(t,"Step",(function(){return ke})),n.d(t,"StepMap",(function(){return ge})),n.d(t,"StepResult",(function(){return we})),n.d(t,"Transform",(function(){return _e})),n.d(t,"TransformError",(function(){return ye})),n.d(t,"canJoin",(function(){return Ae})),n.d(t,"canSplit",(function(){return Pe})),n.d(t,"dropPoint",(function(){return Fe})),n.d(t,"findWrapping",(function(){return De})),n.d(t,"insertPoint",(function(){return Re})),n.d(t,"joinPoint",(function(){return ze})),n.d(t,"liftTarget",(function(){return Te})),n.d(t,"replaceStep",(function(){return He})),n.d(t,"Decoration",(function(){return Pa})),n.d(t,"DecorationSet",(function(){return Ra})),n.d(t,"EditorView",(function(){return Ja})),n.d(t,"__endComposition",(function(){return Ca})),n.d(t,"__parseFromClipboard",(function(){return Ur})),n.d(t,"__serializeForClipboard",(function(){return Wr})),n.d(t,"createTable",(function(){return Ul})),n.d(t,"addRowAfter",(function(){return ql})),n.d(t,"addRowBefore",(function(){return Zl})),n.d(t,"pmAddRowAfter",(function(){return rc})),n.d(t,"pmAddRowBefore",(function(){return oc})),i.prototype={constructor:i,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,r=o.find(e),a=o.content.slice();return-1==r?a.push(n||e,t):(a[r+1]=t,n&&(a[r]=n)),new i(a)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new i(n)},addToStart:function(e,t){return new i([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new i(n)},addBefore:function(e,t,n){var o=this.remove(t),r=o.content.slice(),a=o.find(e);return r.splice(-1==a?r.length:a,0,t,n),new i(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=i.from(e)).size?new i(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=i.from(e)).size?new i(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=i.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},get size(){return this.content.length>>1}},i.from=function(e){if(e instanceof i)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new i(t)};var o=i;var r=function(e,t){if(this.content=e,this.size=t||0,null==t)for(var n=0;n<e.length;n++)this.size+=e[n].nodeSize},a={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};r.prototype.nodesBetween=function(e,t,n,i,o){void 0===i&&(i=0);for(var r=0,a=0;a<t;r++){var s=this.content[r],c=a+s.nodeSize;if(c>e&&!1!==n(s,i+a,o,r)&&s.content.size){var d=a+1;s.nodesBetween(Math.max(0,e-d),Math.min(s.content.size,t-d),n,i+d)}a=c}},r.prototype.descendants=function(e){this.nodesBetween(0,this.size,e)},r.prototype.textBetween=function(e,t,n,i){var o="",r=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),r=!n):a.isLeaf&&i?(o+="function"==typeof i?i(a):i,r=!n):!r&&a.isBlock&&(o+=n,r=!0)}),0),o},r.prototype.append=function(e){if(!e.size)return this;if(!this.size)return e;var t=this.lastChild,n=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new r(i,this.size+e.size)},r.prototype.cut=function(e,t){if(null==t&&(t=this.size),0==e&&t==this.size)return this;var n=[],i=0;if(t>e)for(var o=0,a=0;a<t;o++){var s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),n.push(s),i+=s.nodeSize),a=c}return new r(n,i)},r.prototype.cutByIndex=function(e,t){return e==t?r.empty:0==e&&t==this.content.length?this:new r(this.content.slice(e,t))},r.prototype.replaceChild=function(e,t){var n=this.content[e];if(n==t)return this;var i=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new r(i,o)},r.prototype.addToStart=function(e){return new r([e].concat(this.content),this.size+e.nodeSize)},r.prototype.addToEnd=function(e){return new r(this.content.concat(e),this.size+e.nodeSize)},r.prototype.eq=function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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},r.prototype.child=function(e){var t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t},r.prototype.maybeChild=function(e){return this.content[e]},r.prototype.forEach=function(e){for(var t=0,n=0;t<this.content.length;t++){var i=this.content[t];e(i,n,t),n+=i.nodeSize}},r.prototype.findDiffStart=function(e,t){return void 0===t&&(t=0),function e(t,n,i){for(var o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:i;var r=t.child(o),a=n.child(o);if(r!=a){if(!r.sameMarkup(a))return i;if(r.isText&&r.text!=a.text){for(var s=0;r.text[s]==a.text[s];s++)i++;return i}if(r.content.size||a.content.size){var c=e(r.content,a.content,i+1);if(null!=c)return c}i+=r.nodeSize}else i+=r.nodeSize}}(this,e,t)},r.prototype.findDiffEnd=function(e,t,n){return void 0===t&&(t=this.size),void 0===n&&(n=e.size),function e(t,n,i,o){for(var r=t.childCount,a=n.childCount;;){if(0==r||0==a)return r==a?null:{a:i,b:o};var s=t.child(--r),c=n.child(--a),d=s.nodeSize;if(s!=c){if(!s.sameMarkup(c))return{a:i,b:o};if(s.isText&&s.text!=c.text){for(var l=0,p=Math.min(s.text.length,c.text.length);l<p&&s.text[s.text.length-l-1]==c.text[c.text.length-l-1];)l++,i--,o--;return{a:i,b:o}}if(s.content.size||c.content.size){var u=e(s.content,c.content,i-1,o-1);if(u)return u}i-=d,o-=d}else i-=d,o-=d}}(this,e,t,n)},r.prototype.findIndex=function(e,t){if(void 0===t&&(t=-1),0==e)return c(0,e);if(e==this.size)return c(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position "+e+" outside of fragment ("+this+")");for(var n=0,i=0;;n++){var o=i+this.child(n).nodeSize;if(o>=e)return o==e||t>0?c(n+1,o):c(n,i);i=o}},r.prototype.toString=function(){return"<"+this.toStringInner()+">"},r.prototype.toStringInner=function(){return this.content.join(", ")},r.prototype.toJSON=function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null},r.fromJSON=function(e,t){if(!t)return r.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new r(t.map(e.nodeFromJSON))},r.fromArray=function(e){if(!e.length)return r.empty;for(var t,n=0,i=0;i<e.length;i++){var o=e[i];n+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new r(t||e,n)},r.from=function(e){if(!e)return r.empty;if(e instanceof r)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new r([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(r.prototype,a);var s={index:0,offset:0};function c(e,t){return s.index=e,s.offset=t,s}function d(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;var n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(!d(e[i],t[i]))return!1}else{for(var o in e)if(!(o in t)||!d(e[o],t[o]))return!1;for(var r in t)if(!(r in e))return!1}return!0}r.empty=new r([],0);var l=function(e,t){this.type=e,this.attrs=t};function p(e){var t=Error.call(this,e);return t.__proto__=p.prototype,t}l.prototype.addToSet=function(e){for(var t,n=!1,i=0;i<e.length;i++){var o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t},l.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e},l.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1},l.prototype.eq=function(e){return this==e||this.type==e.type&&d(this.attrs,e.attrs)},l.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return e},l.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");var n=e.marks[t.type];if(!n)throw new RangeError("There is no mark type "+t.type+" in this schema");return n.create(t.attrs)},l.sameSet=function(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0},l.setFrom=function(e){if(!e||0==e.length)return l.none;if(e instanceof l)return[e];var t=e.slice();return t.sort((function(e,t){return e.type.rank-t.type.rank})),t},l.none=[],p.prototype=Object.create(Error.prototype),p.prototype.constructor=p,p.prototype.name="ReplaceError";var u=function(e,t,n){this.content=e,this.openStart=t,this.openEnd=n},h={size:{configurable:!0}};function f(e,t,n){if(n.openStart>e.depth)throw new p("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new p("Inconsistent open depths");return function e(t,n,i,o){var a=t.index(o),s=t.node(o);if(a==n.index(o)&&o<t.depth-i.openStart){var c=e(t,n,i,o+1);return s.copy(s.content.replaceChild(a,c))}if(i.content.size){if(i.openStart||i.openEnd||t.depth!=o||n.depth!=o){var d=function(e,t){for(var n=t.depth-e.openStart,i=t.node(n).copy(e.content),o=n-1;o>=0;o--)i=t.node(o).copy(r.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}(i,t),l=d.start,p=d.end;return y(s,function e(t,n,i,o,a){var s=t.depth>a&&m(t,n,a+1),c=o.depth>a&&m(i,o,a+1),d=[];v(null,t,a,d),s&&c&&n.index(a)==i.index(a)?(b(s,c),g(y(s,e(t,n,i,o,a+1)),d)):(s&&g(y(s,_(t,n,a+1)),d),v(n,i,a,d),c&&g(y(c,_(i,o,a+1)),d));return v(o,null,a,d),new r(d)}(t,l,p,n,o))}var u=t.parent,h=u.content;return y(u,h.cut(0,t.parentOffset).append(i.content).append(h.cut(n.parentOffset)))}return y(s,_(t,n,o))}(e,t,n,0)}function b(e,t){if(!t.type.compatibleContent(e.type))throw new p("Cannot join "+t.type.name+" onto "+e.type.name)}function m(e,t,n){var i=e.node(n);return b(i,t.node(n)),i}function g(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function v(e,t,n,i){var o=(t||e).node(n),r=0,a=t?t.index(n):o.childCount;e&&(r=e.index(n),e.depth>n?r++:e.textOffset&&(g(e.nodeAfter,i),r++));for(var s=r;s<a;s++)g(o.child(s),i);t&&t.depth==n&&t.textOffset&&g(t.nodeBefore,i)}function y(e,t){if(!e.type.validContent(t))throw new p("Invalid content for node "+e.type.name);return e.copy(t)}function _(e,t,n){var i=[];(v(null,e,n,i),e.depth>n)&&g(y(m(e,t,n+1),_(e,t,n+1)),i);return v(t,null,n,i),new r(i)}h.size.get=function(){return this.content.size-this.openStart-this.openEnd},u.prototype.insertAt=function(e,t){var n=function e(t,n,i,o){var r=t.findIndex(n),a=r.index,s=r.offset,c=t.maybeChild(a);if(s==n||c.isText)return o&&!o.canReplace(a,a,i)?null:t.cut(0,n).append(i).append(t.cut(n));var d=e(c.content,n-s-1,i);return d&&t.replaceChild(a,c.copy(d))}(this.content,e+this.openStart,t,null);return n&&new u(n,this.openStart,this.openEnd)},u.prototype.removeBetween=function(e,t){return new u(function e(t,n,i){var o=t.findIndex(n),r=o.index,a=o.offset,s=t.maybeChild(r),c=t.findIndex(i),d=c.index,l=c.offset;if(a==n||s.isText){if(l!=i&&!t.child(d).isText)throw new RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(i))}if(r!=d)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(e(s.content,n-a-1,i-a-1)))}(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)},u.prototype.eq=function(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd},u.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},u.prototype.toJSON=function(){if(!this.content.size)return null;var e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e},u.fromJSON=function(e,t){if(!t)return u.empty;var n=t.openStart||0,i=t.openEnd||0;if("number"!=typeof n||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new u(r.fromJSON(e,t.content),n,i)},u.maxOpen=function(e,t){void 0===t&&(t=!0);for(var n=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)n++;for(var r=e.lastChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.lastChild)i++;return new u(e,n,i)},Object.defineProperties(u.prototype,h),u.empty=new u(r.empty,0,0);var O=function(e,t,n){this.pos=e,this.path=t,this.depth=t.length/3-1,this.parentOffset=n},j={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};O.prototype.resolveDepth=function(e){return null==e?this.depth:e<0?this.depth+e:e},j.parent.get=function(){return this.node(this.depth)},j.doc.get=function(){return this.node(0)},O.prototype.node=function(e){return this.path[3*this.resolveDepth(e)]},O.prototype.index=function(e){return this.path[3*this.resolveDepth(e)+1]},O.prototype.indexAfter=function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)},O.prototype.start=function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1},O.prototype.end=function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size},O.prototype.before=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]},O.prototype.after=function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize},j.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},j.nodeAfter.get=function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i},j.nodeBefore.get=function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)},O.prototype.posAtIndex=function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],i=0==t?0:this.path[3*t-1]+1,o=0;o<e;o++)i+=n.child(o).nodeSize;return i},O.prototype.marks=function(){var e=this.parent,t=this.index();if(0==e.content.size)return l.none;if(this.textOffset)return e.child(t).marks;var n=e.maybeChild(t-1),i=e.maybeChild(t);if(!n){var o=n;n=i,i=o}for(var r=n.marks,a=0;a<r.length;a++)!1!==r[a].type.spec.inclusive||i&&r[a].isInSet(i.marks)||(r=r[a--].removeFromSet(r));return r},O.prototype.marksAcross=function(e){var t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;for(var n=t.marks,i=e.parent.maybeChild(e.index()),o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||i&&n[o].isInSet(i.marks)||(n=n[o--].removeFromSet(n));return n},O.prototype.sharedDepth=function(e){for(var t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0},O.prototype.blockRange=function(e,t){if(void 0===e&&(e=this),e.pos<this.pos)return e.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new S(this,e,n)},O.prototype.sameParent=function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset},O.prototype.max=function(e){return e.pos>this.pos?e:this},O.prototype.min=function(e){return e.pos<this.pos?e:this},O.prototype.toString=function(){for(var e="",t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset},O.resolve=function(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");for(var n=[],i=0,o=t,r=e;;){var a=r.content.findIndex(o),s=a.index,c=a.offset,d=o-c;if(n.push(r,s,i+c),!d)break;if((r=r.child(s)).isText)break;o=d-1,i+=c+1}return new O(t,n,o)},O.resolveCached=function(e,t){for(var n=0;n<C.length;n++){var i=C[n];if(i.pos==t&&i.doc==e)return i}var o=C[k]=O.resolve(e,t);return k=(k+1)%w,o},Object.defineProperties(O.prototype,j);var C=[],k=0,w=12,S=function(e,t,n){this.$from=e,this.$to=t,this.depth=n},x={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};x.start.get=function(){return this.$from.before(this.depth+1)},x.end.get=function(){return this.$to.after(this.depth+1)},x.parent.get=function(){return this.$from.node(this.depth)},x.startIndex.get=function(){return this.$from.index(this.depth)},x.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(S.prototype,x);var E=Object.create(null),I=function(e,t,n,i){this.type=e,this.attrs=t,this.content=n||r.empty,this.marks=i||l.none},T={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}};T.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},T.childCount.get=function(){return this.content.childCount},I.prototype.child=function(e){return this.content.child(e)},I.prototype.maybeChild=function(e){return this.content.maybeChild(e)},I.prototype.forEach=function(e){this.content.forEach(e)},I.prototype.nodesBetween=function(e,t,n,i){void 0===i&&(i=0),this.content.nodesBetween(e,t,n,i,this)},I.prototype.descendants=function(e){this.nodesBetween(0,this.content.size,e)},T.textContent.get=function(){return this.textBetween(0,this.content.size,"")},I.prototype.textBetween=function(e,t,n,i){return this.content.textBetween(e,t,n,i)},T.firstChild.get=function(){return this.content.firstChild},T.lastChild.get=function(){return this.content.lastChild},I.prototype.eq=function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)},I.prototype.sameMarkup=function(e){return this.hasMarkup(e.type,e.attrs,e.marks)},I.prototype.hasMarkup=function(e,t,n){return this.type==e&&d(this.attrs,t||e.defaultAttrs||E)&&l.sameSet(this.marks,n||l.none)},I.prototype.copy=function(e){return void 0===e&&(e=null),e==this.content?this:new this.constructor(this.type,this.attrs,e,this.marks)},I.prototype.mark=function(e){return e==this.marks?this:new this.constructor(this.type,this.attrs,this.content,e)},I.prototype.cut=function(e,t){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))},I.prototype.slice=function(e,t,n){if(void 0===t&&(t=this.content.size),void 0===n&&(n=!1),e==t)return u.empty;var i=this.resolve(e),o=this.resolve(t),r=n?0:i.sharedDepth(t),a=i.start(r),s=i.node(r).content.cut(i.pos-a,o.pos-a);return new u(s,i.depth-r,o.depth-r)},I.prototype.replace=function(e,t,n){return f(this.resolve(e),this.resolve(t),n)},I.prototype.nodeAt=function(e){for(var t=this;;){var n=t.content.findIndex(e),i=n.index,o=n.offset;if(!(t=t.maybeChild(i)))return null;if(o==e||t.isText)return t;e-=o+1}},I.prototype.childAfter=function(e){var t=this.content.findIndex(e),n=t.index,i=t.offset;return{node:this.content.maybeChild(n),index:n,offset:i}},I.prototype.childBefore=function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,i=t.offset;if(i<e)return{node:this.content.child(n),index:n,offset:i};var o=this.content.child(n-1);return{node:o,index:n-1,offset:i-o.nodeSize}},I.prototype.resolve=function(e){return O.resolveCached(this,e)},I.prototype.resolveNoCache=function(e){return O.resolve(this,e)},I.prototype.rangeHasMark=function(e,t,n){var i=!1;return t>e&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(i=!0),!i})),i},T.isBlock.get=function(){return this.type.isBlock},T.isTextblock.get=function(){return this.type.isTextblock},T.inlineContent.get=function(){return this.type.inlineContent},T.isInline.get=function(){return this.type.isInline},T.isText.get=function(){return this.type.isText},T.isLeaf.get=function(){return this.type.isLeaf},T.isAtom.get=function(){return this.type.isAtom},I.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),B(this.marks,e)},I.prototype.contentMatchAt=function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t},I.prototype.canReplace=function(e,t,n,i,o){void 0===n&&(n=r.empty),void 0===i&&(i=0),void 0===o&&(o=n.childCount);var a=this.contentMatchAt(e).matchFragment(n,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(var c=i;c<o;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0},I.prototype.canReplaceWith=function(e,t,n,i){if(i&&!this.type.allowsMarks(i))return!1;var o=this.contentMatchAt(e).matchType(n),r=o&&o.matchFragment(this.content,t);return!!r&&r.validEnd},I.prototype.canAppend=function(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)},I.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 e=l.none,t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!l.sameSet(e,this.marks))throw new RangeError("Invalid collection of marks for node "+this.type.name+": "+this.marks.map((function(e){return e.type.name})));this.content.forEach((function(e){return e.check()}))},I.prototype.toJSON=function(){var e={type:this.type.name};for(var t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((function(e){return e.toJSON()}))),e},I.fromJSON=function(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}var i=r.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,n)},Object.defineProperties(I.prototype,T);var D=function(e){function t(t,n,i,o){if(e.call(this,t,n,null,o),!i)throw new RangeError("Empty text nodes are not allowed");this.text=i}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return t.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):B(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},t.prototype.textBetween=function(e,t){return this.text.slice(e,t)},n.nodeSize.get=function(){return this.text.length},t.prototype.mark=function(e){return e==this.marks?this:new t(this.type,this.attrs,this.text,e)},t.prototype.withText=function(e){return e==this.text?this:new t(this.type,this.attrs,e,this.marks)},t.prototype.cut=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.text.length),0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))},t.prototype.eq=function(e){return this.sameMarkup(e)&&this.text==e.text},t.prototype.toJSON=function(){var t=e.prototype.toJSON.call(this);return t.text=this.text,t},Object.defineProperties(t.prototype,n),t}(I);function B(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var P=function(e){this.validEnd=e,this.next=[],this.wrapCache=[]},A={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};P.parse=function(e,t){var n=new M(e,t);if(null==n.next)return P.empty;var i=R(n);n.next&&n.err("Unexpected trailing text");var o=function(e){var t=Object.create(null);return function n(i){var o=[];i.forEach((function(t){e[t].forEach((function(t){var n=t.term,i=t.to;if(n){var r=o.indexOf(n),a=r>-1&&o[r+1];K(e,i).forEach((function(e){a||o.push(n,a=[]),-1==a.indexOf(e)&&a.push(e)}))}}))}));for(var r=t[i.join(",")]=new P(i.indexOf(e.length-1)>-1),a=0;a<o.length;a+=2){var s=o[a+1].sort(H);r.next.push(o[a],t[s.join(",")]||n(s))}return r}(K(e,0))}(function(e){var t=[[]];return o(function e(t,r){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(e(n,r))}),[]);if("seq"==t.type)for(var a=0;;a++){var s=e(t.exprs[a],r);if(a==t.exprs.length-1)return s;o(s,r=n())}else{if("star"==t.type){var c=n();return i(r,c),o(e(t.expr,c),c),[i(c)]}if("plus"==t.type){var d=n();return o(e(t.expr,r),d),o(e(t.expr,d),d),[i(d)]}if("opt"==t.type)return[i(r)].concat(e(t.expr,r));if("range"==t.type){for(var l=r,p=0;p<t.min;p++){var u=n();o(e(t.expr,l),u),l=u}if(-1==t.max)o(e(t.expr,l),l);else for(var h=t.min;h<t.max;h++){var f=n();i(l,f),o(e(t.expr,l),f),l=f}return[i(l)]}if("name"==t.type)return[i(r,null,t.value)]}}(e,0),n()),t;function n(){return t.push([])-1}function i(e,n,i){var o={term:i,to:n};return t[e].push(o),o}function o(e,t){e.forEach((function(e){return e.to=t}))}}(i));return function(e,t){for(var n=0,i=[e];n<i.length;n++){for(var o=i[n],r=!o.validEnd,a=[],s=0;s<o.next.length;s+=2){var c=o.next[s],d=o.next[s+1];a.push(c.name),!r||c.isText||c.hasRequiredAttrs()||(r=!1),-1==i.indexOf(d)&&i.push(d)}r&&t.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,n),o},P.prototype.matchType=function(e){for(var t=0;t<this.next.length;t+=2)if(this.next[t]==e)return this.next[t+1];return null},P.prototype.matchFragment=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=e.childCount);for(var i=this,o=t;i&&o<n;o++)i=i.matchType(e.child(o).type);return i},A.inlineContent.get=function(){var e=this.next[0];return!!e&&e.isInline},A.defaultType.get=function(){for(var e=0;e<this.next.length;e+=2){var t=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}},P.prototype.compatible=function(e){for(var t=0;t<this.next.length;t+=2)for(var n=0;n<e.next.length;n+=2)if(this.next[t]==e.next[n])return!0;return!1},P.prototype.fillBefore=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=0);var i=[this];return function o(a,s){var c=a.matchFragment(e,n);if(c&&(!t||c.validEnd))return r.from(s.map((function(e){return e.createAndFill()})));for(var d=0;d<a.next.length;d+=2){var l=a.next[d],p=a.next[d+1];if(!l.isText&&!l.hasRequiredAttrs()&&-1==i.indexOf(p)){i.push(p);var u=o(p,s.concat(l));if(u)return u}}}(this,[])},P.prototype.findWrapping=function(e){for(var t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];var n=this.computeWrapping(e);return this.wrapCache.push(e,n),n},P.prototype.computeWrapping=function(e){for(var t=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var i=n.shift(),o=i.match;if(o.matchType(e)){for(var r=[],a=i;a.type;a=a.via)r.push(a.type);return r.reverse()}for(var s=0;s<o.next.length;s+=2){var c=o.next[s];c.isLeaf||c.hasRequiredAttrs()||c.name in t||i.type&&!o.next[s+1].validEnd||(n.push({match:c.contentMatch,type:c,via:i}),t[c.name]=!0)}}},A.edgeCount.get=function(){return this.next.length>>1},P.prototype.edge=function(e){var t=e<<1;if(t>=this.next.length)throw new RangeError("There's no "+e+"th edge in this content match");return{type:this.next[t],next:this.next[t+1]}},P.prototype.toString=function(){var e=[];return function t(n){e.push(n);for(var i=1;i<n.next.length;i+=2)-1==e.indexOf(n.next[i])&&t(n.next[i])}(this),e.map((function(t,n){for(var i=n+(t.validEnd?"*":" ")+" ",o=0;o<t.next.length;o+=2)i+=(o?", ":"")+t.next[o].name+"->"+e.indexOf(t.next[o+1]);return i})).join("\n")},Object.defineProperties(P.prototype,A),P.empty=new P(!0);var M=function(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},z={next:{configurable:!0}};function R(e){var t=[];do{t.push(F(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function F(e){var t=[];do{t.push(N(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function N(e){for(var t=function(e){if(e.eat("(")){var t=R(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){var n=function(e,t){var n=e.nodeTypes,i=n[t];if(i)return[i];var o=[];for(var r in n){var a=n[r];a.groups.indexOf(t)>-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=V(e,t)}return t}function L(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function V(e,t){var n=L(e),i=n;return e.eat(",")&&(i="}"!=e.next?L(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:i,expr:t}}function H(e,t){return t-e}function K(e,t){var n=[];return function t(i){var o=e[i];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(i);for(var r=0;r<o.length;r++){var a=o[r],s=a.term,c=a.to;s||-1!=n.indexOf(c)||t(c)}}(t),n.sort(H)}function $(e){var t=Object.create(null);for(var n in e){var i=e[n];if(!i.hasDefault)return null;t[n]=i.default}return t}function W(e,t){var n=Object.create(null);for(var i in e){var o=t&&t[i];if(void 0===o){var r=e[i];if(!r.hasDefault)throw new RangeError("No value supplied for attribute "+i);o=r.default}n[i]=o}return n}function U(e){var t=Object.create(null);if(e)for(var n in e)t[n]=new q(e[n]);return t}z.next.get=function(){return this.tokens[this.pos]},M.prototype.eat=function(e){return this.next==e&&(this.pos++||!0)},M.prototype.err=function(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")},Object.defineProperties(M.prototype,z);var G=function(e,t,n){this.name=e,this.schema=t,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=U(n.attrs),this.defaultAttrs=$(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e},Z={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0},whitespace:{configurable:!0}};Z.isInline.get=function(){return!this.isBlock},Z.isTextblock.get=function(){return this.isBlock&&this.inlineContent},Z.isLeaf.get=function(){return this.contentMatch==P.empty},Z.isAtom.get=function(){return this.isLeaf||this.spec.atom},Z.whitespace.get=function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")},G.prototype.hasRequiredAttrs=function(){for(var e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1},G.prototype.compatibleContent=function(e){return this==e||this.contentMatch.compatible(e.contentMatch)},G.prototype.computeAttrs=function(e){return!e&&this.defaultAttrs?this.defaultAttrs:W(this.attrs,e)},G.prototype.create=function(e,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new I(this,this.computeAttrs(e),r.from(t),l.setFrom(n))},G.prototype.createChecked=function(e,t,n){if(t=r.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new I(this,this.computeAttrs(e),t,l.setFrom(n))},G.prototype.createAndFill=function(e,t,n){if(e=this.computeAttrs(e),(t=r.from(t)).size){var i=this.contentMatch.fillBefore(t);if(!i)return null;t=i.append(t)}var o=this.contentMatch.matchFragment(t).fillBefore(r.empty,!0);return o?new I(this,e,t.append(o),l.setFrom(n)):null},G.prototype.validContent=function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0},G.prototype.allowsMarkType=function(e){return null==this.markSet||this.markSet.indexOf(e)>-1},G.prototype.allowsMarks=function(e){if(null==this.markSet)return!0;for(var t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0},G.prototype.allowedMarks=function(e){if(null==this.markSet)return e;for(var t,n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:l.empty:e},G.compile=function(e,t){var n=Object.create(null);e.forEach((function(e,i){return n[e]=new G(e,t,i)}));var i=t.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var o in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(G.prototype,Z);var q=function(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default},J={isRequired:{configurable:!0}};J.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(q.prototype,J);var X=function(e,t,n,i){this.name=e,this.schema=n,this.spec=i,this.attrs=U(i.attrs),this.rank=t,this.excluded=null;var o=$(this.attrs);this.instance=o&&new l(this,o)};X.prototype.create=function(e){return!e&&this.instance?this.instance:new l(this,W(this.attrs,e))},X.compile=function(e,t){var n=Object.create(null),i=0;return e.forEach((function(e,o){return n[e]=new X(e,i++,t,o)})),n},X.prototype.removeFromSet=function(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e},X.prototype.isInSet=function(e){for(var t=0;t<e.length;t++)if(e[t].type==this)return e[t]},X.prototype.excludes=function(e){return this.excluded.indexOf(e)>-1};var Y=function(e){for(var t in this.spec={},e)this.spec[t]=e[t];this.spec.nodes=o.from(e.nodes),this.spec.marks=o.from(e.marks),this.nodes=G.compile(this.spec.nodes,this),this.marks=X.compile(this.spec.marks,this);var n=Object.create(null);for(var i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");var r=this.nodes[i],a=r.spec.content||"",s=r.spec.marks;r.contentMatch=n[a]||(n[a]=P.parse(a,this.nodes)),r.inlineContent=r.contentMatch.inlineContent,r.markSet="_"==s?null:s?Q(this,s.split(" ")):""!=s&&r.inlineContent?null:[]}for(var c in this.marks){var d=this.marks[c],l=d.spec.excludes;d.excluded=null==l?[d]:""==l?[]:Q(this,l.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(e,t){for(var n=[],i=0;i<t.length;i++){var o=t[i],r=e.marks[o],a=r;if(r)n.push(r);else for(var s in e.marks){var c=e.marks[s];("_"==o||c.spec.group&&c.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}Y.prototype.node=function(e,t,n,i){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof G))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,i)},Y.prototype.text=function(e,t){var n=this.nodes.text;return new D(n,n.defaultAttrs,e,l.setFrom(t))},Y.prototype.mark=function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)},Y.prototype.nodeFromJSON=function(e){return I.fromJSON(this,e)},Y.prototype.markFromJSON=function(e){return l.fromJSON(this,e)},Y.prototype.nodeType=function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t};var ee=function(e,t){var n=this;this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((function(e){e.tag?n.tags.push(e):e.style&&n.styles.push(e)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))};ee.prototype.parse=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!1);return n.addAll(e,null,t.from,t.to),n.finish()},ee.prototype.parseSlice=function(e,t){void 0===t&&(t={});var n=new ae(this,t,!0);return n.addAll(e,null,t.from,t.to),u.maxOpen(n.finish())},ee.prototype.matchTag=function(e,t,n){for(var i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var o=this.tags[i];if(ce(e,o.tag)&&(void 0===o.namespace||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){var r=o.getAttrs(e);if(!1===r)continue;o.attrs=r}return o}}},ee.prototype.matchStyle=function(e,t,n,i){for(var o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){var r=this.styles[o];if(!(0!=r.style.indexOf(e)||r.context&&!n.matchesContext(r.context)||r.style.length>e.length&&(61!=r.style.charCodeAt(e.length)||r.style.slice(e.length+1)!=t))){if(r.getAttrs){var a=r.getAttrs(t);if(!1===a)continue;r.attrs=a}return r}}},ee.schemaRules=function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,i=0;i<t.length;i++){var o=t[i];if((null==o.priority?50:o.priority)<n)break}t.splice(i,0,e)}var i=function(t){var i=e.marks[t].spec.parseDOM;i&&i.forEach((function(e){n(e=de(e)),e.mark=t}))};for(var o in e.marks)i(o);var r;for(var a in e.nodes)r=void 0,(r=e.nodes[a].spec.parseDOM)&&r.forEach((function(e){n(e=de(e)),e.node=a}));return t},ee.fromSchema=function(e){return e.cached.domParser||(e.cached.domParser=new ee(e,ee.schemaRules(e)))};var te={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},ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ie={ol:!0,ul:!0};function oe(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}var re=function(e,t,n,i,o,r,a){this.type=e,this.attrs=t,this.solid=o,this.match=r||(4&a?null:e.contentMatch),this.options=a,this.content=[],this.marks=n,this.activeMarks=l.none,this.pendingMarks=i,this.stashMarks=[]};re.prototype.findWrapping=function(e){if(!this.match){if(!this.type)return[];var t=this.type.contentMatch.fillBefore(r.from(e));if(!t){var n,i=this.type.contentMatch;return(n=i.findWrapping(e.type))?(this.match=i,n):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)},re.prototype.finish=function(e){if(!(1&this.options)){var t,n=this.content[this.content.length-1];n&&n.isText&&(t=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length)))}var i=r.from(this.content);return!e&&this.match&&(i=i.append(this.match.fillBefore(r.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i},re.prototype.popFromStashMark=function(e){for(var t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]},re.prototype.applyPending=function(e){for(var t=0,n=this.pendingMarks;t<n.length;t++){var i=n[t];(this.type?this.type.allowsMarkType(i.type):le(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}},re.prototype.inlineContext=function(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!te.hasOwnProperty(e.parentNode.nodeName.toLowerCase())};var ae=function(e,t,n){this.parser=e,this.options=t,this.isOpen=n;var i,o=t.topNode,r=oe(null,t.preserveWhitespace,0)|(n?4:0);i=o?new re(o.type,o.attrs,l.none,l.none,!0,t.topMatch||o.type.contentMatch,r):new re(n?null:e.schema.topNodeType,null,l.none,l.none,!0,null,r),this.nodes=[i],this.open=0,this.find=t.findPositions,this.needsBlock=!1},se={top:{configurable:!0},currentPos:{configurable:!0}};function ce(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function de(e){var t={};for(var n in e)t[n]=e[n];return t}function le(e,t){var n=t.schema.nodes,i=function(i){var o=n[i];if(o.allowsMarkType(e)){var r=[],a=function(e){r.push(e);for(var n=0;n<e.edgeCount;n++){var i=e.edge(n),o=i.type,s=i.next;if(o==t)return!0;if(r.indexOf(s)<0&&a(s))return!0}};return a(o.contentMatch)?{v:!0}:void 0}};for(var o in n){var r=i(o);if(r)return r.v}}se.top.get=function(){return this.nodes[this.open]},ae.prototype.addDOM=function(e){if(3==e.nodeType)this.addTextNode(e);else if(1==e.nodeType){var t=e.getAttribute("style"),n=t?this.readStyles(function(e){var t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,i=[];for(;t=n.exec(e);)i.push(t[1],t[2].trim());return i}(t)):null,i=this.top;if(null!=n)for(var o=0;o<n.length;o++)this.addPendingMark(n[o]);if(this.addElement(e),null!=n)for(var r=0;r<n.length;r++)this.removePendingMark(n[r],i)}},ae.prototype.addTextNode=function(e){var t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){var i=n.content[n.content.length-1],o=e.previousSibling;(!i||o&&"BR"==o.nodeName||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)},ae.prototype.addElement=function(e,t){var n,i=e.nodeName.toLowerCase();ie.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(var t=e.firstChild,n=null;t;t=t.nextSibling){var i=1==t.nodeType?t.nodeName.toLowerCase():null;i&&ie.hasOwnProperty(i)&&n?(n.appendChild(t),t=n):"li"==i?n=t:i&&(n=null)}}(e);var o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(o?o.ignore:ne.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);var r,a=this.top,s=this.needsBlock;if(te.hasOwnProperty(i))r=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);this.addAll(e),r&&this.sync(a),this.needsBlock=s}else this.addElementByRule(e,o,!1===o.consuming?n:null)},ae.prototype.leafFallback=function(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))},ae.prototype.ignoreFallback=function(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))},ae.prototype.readStyles=function(e){var t=l.none;e:for(var n=0;n<e.length;n+=2)for(var i=null;;){var o=this.parser.matchStyle(e[n],e[n+1],this,i);if(!o)continue e;if(o.ignore)return null;if(t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return t},ae.prototype.addElementByRule=function(e,t,n){var i,o,r,a=this;t.node?(o=this.parser.schema.nodes[t.node]).isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs,t.preserveWhitespace):(r=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(r));var s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((function(e){return a.insertNode(e)}));else{var c=t.contentElement;"string"==typeof c?c=e.querySelector(c):"function"==typeof c&&(c=c(e)),c||(c=e),this.findAround(e,c,!0),this.addAll(c,i)}i&&(this.sync(s),this.open--),r&&this.removePendingMark(r,s)},ae.prototype.addAll=function(e,t,n,i){for(var o=n||0,r=n?e.childNodes[n]:e.firstChild,a=null==i?null:e.childNodes[i];r!=a;r=r.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(r),t&&te.hasOwnProperty(r.nodeName.toLowerCase())&&this.sync(t);this.findAtPoint(e,o)},ae.prototype.findPlace=function(e){for(var t,n,i=this.open;i>=0;i--){var o=this.nodes[i],r=o.findWrapping(e);if(r&&(!t||t.length>r.length)&&(t=r,n=o,!r.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a<t.length;a++)this.enterInner(t[a],null,!1);return!0},ae.prototype.insertNode=function(e){if(e.isInline&&this.needsBlock&&!this.top.type){var t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();var n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));for(var i=n.activeMarks,o=0;o<e.marks.length;o++)n.type&&!n.type.allowsMarkType(e.marks[o].type)||(i=e.marks[o].addToSet(i));return n.content.push(e.mark(i)),!0}return!1},ae.prototype.enter=function(e,t,n){var i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,n),i},ae.prototype.enterInner=function(e,t,n,i){this.closeExtra();var o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e,t);var r=oe(e,i,o.options);4&o.options&&0==o.content.length&&(r|=4),this.nodes.push(new re(e,t,o.activeMarks,o.pendingMarks,n,null,r)),this.open++},ae.prototype.closeExtra=function(e){var t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}},ae.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},ae.prototype.sync=function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return void(this.open=t)},se.currentPos.get=function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e},ae.prototype.findAtPoint=function(e,t){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)},ae.prototype.findInside=function(e){if(this.find)for(var t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)},ae.prototype.findAround=function(e,t,n){if(e!=t&&this.find)for(var i=0;i<this.find.length;i++){if(null==this.find[i].pos&&1==e.nodeType&&e.contains(this.find[i].node))t.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}},ae.prototype.findInText=function(e){if(this.find)for(var t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))},ae.prototype.matchesContext=function(e){var t=this;if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),i=this.options.context,o=!(this.isOpen||i&&i.parent.type!=this.nodes[0].type),r=-(i?i.depth+1:0)+(o?0:1),a=function(e,s){for(;e>=0;e--){var c=n[e];if(""==c){if(e==n.length-1||0==e)continue;for(;s>=r;s--)if(a(e-1,s))return!0;return!1}var d=s>0||0==s&&o?t.nodes[s].type:i&&s>=r?i.node(s-r).type:null;if(!d||d.name!=c&&-1==d.groups.indexOf(c))return!1;s--}return!0};return a(n.length-1,this.open)},ae.prototype.textblockFromContext=function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var i in this.parser.schema.nodes){var o=this.parser.schema.nodes[i];if(o.isTextblock&&o.defaultAttrs)return o}},ae.prototype.addPendingMark=function(e){var t=function(e,t){for(var n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)},ae.prototype.removePendingMark=function(e,t){for(var n=this.open;n>=0;n--){var i=this.nodes[n];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);var o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}},Object.defineProperties(ae.prototype,se);var pe=function(e,t){this.nodes=e||{},this.marks=t||{}};function ue(e){var t={};for(var n in e){var i=e[n].spec.toDOM;i&&(t[n]=i)}return t}function he(e){return e.document||window.document}pe.prototype.serializeFragment=function(e,t,n){var i=this;void 0===t&&(t={}),n||(n=he(t).createDocumentFragment());var o=n,r=null;return e.forEach((function(e){if(r||e.marks.length){r||(r=[]);for(var n=0,a=0;n<r.length&&a<e.marks.length;){var s=e.marks[a];if(i.marks[s.type.name]){if(!s.eq(r[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<r.length;)o=r.pop(),r.pop();for(;a<e.marks.length;){var c=e.marks[a++],d=i.serializeMark(c,e.isInline,t);d&&(r.push(c,o),o.appendChild(d.dom),o=d.contentDOM||d.dom)}}o.appendChild(i.serializeNodeInner(e,t))})),n},pe.prototype.serializeNodeInner=function(e,t){void 0===t&&(t={});var n=pe.renderSpec(he(t),this.nodes[e.type.name](e)),i=n.dom,o=n.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");t.onContent?t.onContent(e,o,t):this.serializeFragment(e.content,t,o)}return i},pe.prototype.serializeNode=function(e,t){void 0===t&&(t={});for(var n=this.serializeNodeInner(e,t),i=e.marks.length-1;i>=0;i--){var o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n},pe.prototype.serializeMark=function(e,t,n){void 0===n&&(n={});var i=this.marks[e.type.name];return i&&pe.renderSpec(he(n),i(e,t))},pe.renderSpec=function(e,t,n){if(void 0===n&&(n=null),"string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;var i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));var r=null,a=n?e.createElementNS(n,i):e.createElement(i),s=t[1],c=1;if(s&&"object"==typeof s&&null==s.nodeType&&!Array.isArray(s))for(var d in c=2,s)if(null!=s[d]){var l=d.indexOf(" ");l>0?a.setAttributeNS(d.slice(0,l),d.slice(l+1),s[d]):a.setAttribute(d,s[d])}for(var p=c;p<t.length;p++){var u=t[p];if(0===u){if(p<t.length-1||p>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var h=pe.renderSpec(e,u,n),f=h.dom,b=h.contentDOM;if(a.appendChild(f),b){if(r)throw new RangeError("Multiple content holes");r=b}}return{dom:a,contentDOM:r}},pe.fromSchema=function(e){return e.cached.domSerializer||(e.cached.domSerializer=new pe(this.nodesFromSchema(e),this.marksFromSchema(e)))},pe.nodesFromSchema=function(e){var t=ue(e.nodes);return t.text||(t.text=function(e){return e.text}),t},pe.marksFromSchema=function(e){return ue(e.marks)};var fe=Math.pow(2,16);function be(e){return 65535&e}var me=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=null),this.pos=e,this.deleted=t,this.recover=n},ge=function e(t,n){if(void 0===n&&(n=!1),!t.length&&e.empty)return e.empty;this.ranges=t,this.inverted=n};ge.prototype.recover=function(e){var t=0,n=be(e);if(!this.inverted)for(var i=0;i<n;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/fe}(e)},ge.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},ge.prototype.map=function(e,t){return void 0===t&&(t=1),this._map(e,t,!0)},ge.prototype._map=function(e,t,n){for(var i=0,o=this.inverted?2:1,r=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?i:0);if(s>e)break;var c=this.ranges[a+o],d=this.ranges[a+r],l=s+c;if(e<=l){var p=s+i+((c?e==s?-1:e==l?1:t:t)<0?0:d);if(n)return p;var u=e==(t<0?s:l)?null:a/3+(e-s)*fe;return new me(p,t<0?e!=s:e!=l,u)}i+=d-c}return n?e+i:new me(e+i)},ge.prototype.touches=function(e,t){for(var n=0,i=be(t),o=this.inverted?2:1,r=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>e)break;var c=this.ranges[a+o];if(e<=s+c&&a==3*i)return!0;n+=this.ranges[a+r]-c}return!1},ge.prototype.forEach=function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,i=0,o=0;i<this.ranges.length;i+=3){var r=this.ranges[i],a=r-(this.inverted?o:0),s=r+(this.inverted?0:o),c=this.ranges[i+t],d=this.ranges[i+n];e(a,a+c,s,s+d),o+=d-c}},ge.prototype.invert=function(){return new ge(this.ranges,!this.inverted)},ge.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},ge.offset=function(e){return 0==e?ge.empty:new ge(e<0?[0,-e,0]:[0,0,e])},ge.empty=new ge([]);var ve=function(e,t,n,i){this.maps=e||[],this.from=n||0,this.to=null==i?this.maps.length:i,this.mirror=t};function ye(e){var t=Error.call(this,e);return t.__proto__=ye.prototype,t}ve.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.maps.length),new ve(this.maps,this.mirror,e,t)},ve.prototype.copy=function(){return new ve(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},ve.prototype.appendMap=function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)},ve.prototype.appendMapping=function(e){for(var t=0,n=this.maps.length;t<e.maps.length;t++){var i=e.getMirror(t);this.appendMap(e.maps[t],null!=i&&i<t?n+i:null)}},ve.prototype.getMirror=function(e){if(this.mirror)for(var t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]},ve.prototype.setMirror=function(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)},ve.prototype.appendMappingInverted=function(e){for(var t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){var i=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=i&&i>t?n-i-1:null)}},ve.prototype.invert=function(){var e=new ve;return e.appendMappingInverted(this),e},ve.prototype.map=function(e,t){if(void 0===t&&(t=1),this.mirror)return this._map(e,t,!0);for(var n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e},ve.prototype.mapResult=function(e,t){return void 0===t&&(t=1),this._map(e,t,!1)},ve.prototype._map=function(e,t,n){for(var i=!1,o=this.from;o<this.to;o++){var r=this.maps[o].mapResult(e,t);if(null!=r.recover){var a=this.getMirror(o);if(null!=a&&a>o&&a<this.to){o=a,e=this.maps[a].recover(r.recover);continue}}r.deleted&&(i=!0),e=r.pos}return n?e:new me(e,i)},ye.prototype=Object.create(Error.prototype),ye.prototype.constructor=ye,ye.prototype.name="TransformError";var _e=function(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ve},Oe={before:{configurable:!0},docChanged:{configurable:!0}};function je(){throw new Error("Override me")}Oe.before.get=function(){return this.docs.length?this.docs[0]:this.doc},_e.prototype.step=function(e){var t=this.maybeStep(e);if(t.failed)throw new ye(t.failed);return this},_e.prototype.maybeStep=function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t},Oe.docChanged.get=function(){return this.steps.length>0},_e.prototype.addStep=function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t},Object.defineProperties(_e.prototype,Oe);var Ce=Object.create(null),ke=function(){};ke.prototype.apply=function(e){return je()},ke.prototype.getMap=function(){return ge.empty},ke.prototype.invert=function(e){return je()},ke.prototype.map=function(e){return je()},ke.prototype.merge=function(e){return null},ke.prototype.toJSON=function(){return je()},ke.fromJSON=function(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ce[t.stepType];if(!n)throw new RangeError("No step type "+t.stepType+" defined");return n.fromJSON(e,t)},ke.jsonID=function(e,t){if(e in Ce)throw new RangeError("Duplicate use of step JSON ID "+e);return Ce[e]=t,t.prototype.jsonID=e,t};var we=function(e,t){this.doc=e,this.failed=t};we.ok=function(e){return new we(e,null)},we.fail=function(e){return new we(null,e)},we.fromReplace=function(e,t,n,i){try{return we.ok(e.replace(t,n,i))}catch(e){if(e instanceof p)return we.fail(e.message);throw e}};var Se=function(e){function t(t,n,i,o){e.call(this),this.from=t,this.to=n,this.slice=i,this.structure=!!o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){return this.structure&&Ee(e,this.from,this.to)?we.fail("Structure replace would overwrite content"):we.fromReplace(e,this.from,this.to,this.slice)},t.prototype.getMap=function(){return new ge([this.from,this.to-this.from,this.slice.size])},t.prototype.invert=function(e){return new t(this.from,this.from+this.slice.size,e.slice(this.from,this.to))},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted?null:new t(n.pos,Math.max(n.pos,i.pos),this.slice)},t.prototype.merge=function(e){if(!(e instanceof t)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var n=this.slice.size+e.slice.size==0?u.empty:new u(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new t(e.from,this.to,n,this.structure)}var i=this.slice.size+e.slice.size==0?u.empty:new u(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new t(this.from,this.to+(e.to-e.from),i,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new t(n.from,n.to,u.fromJSON(e,n.slice),!!n.structure)},t}(ke);ke.jsonID("replace",Se);var xe=function(e){function t(t,n,i,o,r,a,s){e.call(this),this.from=t,this.to=n,this.gapFrom=i,this.gapTo=o,this.slice=r,this.insert=a,this.structure=!!s}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){if(this.structure&&(Ee(e,this.from,this.gapFrom)||Ee(e,this.gapTo,this.to)))return we.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return we.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?we.fromReplace(e,this.from,this.to,n):we.fail("Content does not fit in gap")},t.prototype.getMap=function(){return new ge([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},t.prototype.invert=function(e){var n=this.gapTo-this.gapFrom;return new t(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),r=e.map(this.gapTo,1);return n.deleted&&i.deleted||o<n.pos||r>i.pos?null:new t(n.pos,i.pos,o,r,this.slice,this.insert,this.structure)},t.prototype.toJSON=function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e},t.fromJSON=function(e,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 t(n.from,n.to,n.gapFrom,n.gapTo,u.fromJSON(e,n.slice),n.insert,!!n.structure)},t}(ke);function Ee(e,t,n){for(var i=e.resolve(t),o=n-t,r=i.depth;o>0&&r>0&&i.indexAfter(r)==i.node(r).childCount;)r--,o--;if(o>0)for(var a=i.node(r).maybeChild(i.indexAfter(r));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function Ie(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Te(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var i=e.$from.node(n),o=e.$from.index(n),r=e.$to.indexAfter(n);if(n<e.depth&&i.canReplace(o,r,t))return n;if(0==n||i.type.spec.isolating||!Ie(i,o,r))break}}function De(e,t,n,i){void 0===i&&(i=e);var o=function(e,t){var n=e.parent,i=e.startIndex,o=e.endIndex,r=n.contentMatchAt(i).findWrapping(t);if(!r)return null;var a=r.length?r[0]:t;return n.canReplaceWith(i,o,a)?r:null}(e,t),r=o&&function(e,t){var n=e.parent,i=e.startIndex,o=e.endIndex,r=n.child(i),a=t.contentMatch.findWrapping(r.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,c=i;s&&c<o;c++)s=s.matchType(n.child(c).type);if(!s||!s.validEnd)return null;return a}(i,t);return r?o.map(Be).concat({type:t,attrs:n}).concat(r.map(Be)):null}function Be(e){return{type:e,attrs:null}}function Pe(e,t,n,i){void 0===n&&(n=1);var o=e.resolve(t),r=o.depth-n,a=i&&i[i.length-1]||o.parent;if(r<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,c=n-2;s>r;s--,c--){var d=o.node(s),l=o.index(s);if(d.type.spec.isolating)return!1;var p=d.content.cutByIndex(l,d.childCount),u=i&&i[c]||d;if(u!=d&&(p=p.replaceChild(0,u.type.create(u.attrs))),!d.canReplace(l+1,d.childCount)||!u.type.validContent(p))return!1}var h=o.indexAfter(r),f=i&&i[0];return o.node(r).canReplaceWith(h,h,f?f.type:o.node(r+1).type)}function Ae(e,t){var n=e.resolve(t),i=n.index();return Me(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(i,i+1)}function Me(e,t){return e&&t&&!e.isLeaf&&e.canAppend(t)}function ze(e,t,n){void 0===n&&(n=-1);for(var i=e.resolve(t),o=i.depth;;o--){var r=void 0,a=void 0,s=i.index(o);if(o==i.depth?(r=i.nodeBefore,a=i.nodeAfter):n>0?(r=i.node(o+1),s++,a=i.node(o).maybeChild(s)):(r=i.node(o).maybeChild(s-1),a=i.node(o+1)),r&&!r.isTextblock&&Me(r,a)&&i.node(o).canReplace(s,s+1))return t;if(0==o)break;t=n<0?i.before(o):i.after(o)}}function Re(e,t,n){var i=e.resolve(t);if(i.parent.canReplaceWith(i.index(),i.index(),n))return t;if(0==i.parentOffset)for(var o=i.depth-1;o>=0;o--){var r=i.index(o);if(i.node(o).canReplaceWith(r,r,n))return i.before(o+1);if(r>0)return null}if(i.parentOffset==i.parent.content.size)for(var a=i.depth-1;a>=0;a--){var s=i.indexAfter(a);if(i.node(a).canReplaceWith(s,s,n))return i.after(a+1);if(s<i.node(a).childCount)return null}}function Fe(e,t,n){var i=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,r=0;r<n.openStart;r++)o=o.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=i.depth;s>=0;s--){var c=s==i.depth?0:i.pos<=(i.start(s+1)+i.end(s+1))/2?-1:1,d=i.index(s)+(c>0?1:0),l=i.node(s),p=!1;if(1==a)p=l.canReplace(d,d,o);else{var u=l.contentMatchAt(d).findWrapping(o.firstChild.type);p=u&&l.canReplaceWith(d,d,u[0])}if(p)return 0==c?i.pos:c<0?i.before(s+1):i.after(s+1)}return null}function Ne(e,t,n){for(var i=[],o=0;o<e.childCount;o++){var a=e.child(o);a.content.size&&(a=a.copy(Ne(a.content,t,a))),a.isInline&&(a=t(a,n,o)),i.push(a)}return r.fromArray(i)}ke.jsonID("replaceAround",xe),_e.prototype.lift=function(e,t){for(var n=e.$from,i=e.$to,o=e.depth,a=n.before(o+1),s=i.after(o+1),c=a,d=s,l=r.empty,p=0,h=o,f=!1;h>t;h--)f||n.index(h)>0?(f=!0,l=r.from(n.node(h).copy(l)),p++):c--;for(var b=r.empty,m=0,g=o,v=!1;g>t;g--)v||i.after(g+1)<i.end(g)?(v=!0,b=r.from(i.node(g).copy(b)),m++):d++;return this.step(new xe(c,d,a,s,new u(l.append(b),p,m),l.size-p,!0))},_e.prototype.wrap=function(e,t){for(var n=r.empty,i=t.length-1;i>=0;i--){if(n.size){var o=t[i].type.contentMatch.matchFragment(n);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=r.from(t[i].type.create(t[i].attrs,n))}var a=e.start,s=e.end;return this.step(new xe(a,s,a,s,new u(n,0,0),t.length,!0))},_e.prototype.setBlockType=function(e,t,n,i){var o=this;if(void 0===t&&(t=e),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var a=this.steps.length;return this.doc.nodesBetween(e,t,(function(e,t){if(e.isTextblock&&!e.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}(o.doc,o.mapping.slice(a).map(t),n)){o.clearIncompatible(o.mapping.slice(a).map(t,1),n);var s=o.mapping.slice(a),c=s.map(t,1),d=s.map(t+e.nodeSize,1);return o.step(new xe(c,d,c+1,d-1,new u(r.from(n.create(i,null,e.marks)),0,0),1,!0)),!1}})),this},_e.prototype.setNodeMarkup=function(e,t,n,i){var o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);var a=t.create(n,null,i||o.marks);if(o.isLeaf)return this.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);return this.step(new xe(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new u(r.from(a),0,0),1,!0))},_e.prototype.split=function(e,t,n){void 0===t&&(t=1);for(var i=this.doc.resolve(e),o=r.empty,a=r.empty,s=i.depth,c=i.depth-t,d=t-1;s>c;s--,d--){o=r.from(i.node(s).copy(o));var l=n&&n[d];a=r.from(l?l.type.create(l.attrs,a):i.node(s).copy(a))}return this.step(new Se(e,e,new u(o.append(a),t,t),!0))},_e.prototype.join=function(e,t){void 0===t&&(t=1);var n=new Se(e-t,e+t,u.empty,!0);return this.step(n)};var Le=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=e.resolve(this.from),o=i.node(i.sharedDepth(this.to)),r=new u(Ne(n.content,(function(e,n){return e.isAtom&&n.type.allowsMarkType(t.mark.type)?e.mark(t.mark.addToSet(e.marks)):e}),o),n.openStart,n.openEnd);return we.fromReplace(e,this.from,this.to,r)},t.prototype.invert=function(){return new Ve(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(ke);ke.jsonID("addMark",Le);var Ve=function(e){function t(t,n,i){e.call(this),this.from=t,this.to=n,this.mark=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.apply=function(e){var t=this,n=e.slice(this.from,this.to),i=new u(Ne(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))})),n.openStart,n.openEnd);return we.fromReplace(e,this.from,this.to,i)},t.prototype.invert=function(){return new Le(this.from,this.to,this.mark)},t.prototype.map=function(e){var n=e.mapResult(this.from,1),i=e.mapResult(this.to,-1);return n.deleted&&i.deleted||n.pos>=i.pos?null:new t(n.pos,i.pos,this.mark)},t.prototype.merge=function(e){if(e instanceof t&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from)return new t(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark)},t.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},t.fromJSON=function(e,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new t(n.from,n.to,e.markFromJSON(n.mark))},t}(ke);function He(e,t,n,i){if(void 0===n&&(n=t),void 0===i&&(i=u.empty),t==n&&!i.size)return null;var o=e.resolve(t),r=e.resolve(n);return Ke(o,r,i)?new Se(t,n,i):new $e(o,r,i).fit()}function Ke(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}ke.jsonID("removeMark",Ve),_e.prototype.addMark=function(e,t,n){var i=this,o=[],r=[],a=null,s=null;return this.doc.nodesBetween(e,t,(function(i,c,d){if(i.isInline){var l=i.marks;if(!n.isInSet(l)&&d.type.allowsMarkType(n.type)){for(var p=Math.max(c,e),u=Math.min(c+i.nodeSize,t),h=n.addToSet(l),f=0;f<l.length;f++)l[f].isInSet(h)||(a&&a.to==p&&a.mark.eq(l[f])?a.to=u:o.push(a=new Ve(p,u,l[f])));s&&s.to==p?s.to=u:r.push(s=new Le(p,u,n))}}})),o.forEach((function(e){return i.step(e)})),r.forEach((function(e){return i.step(e)})),this},_e.prototype.removeMark=function(e,t,n){var i=this;void 0===n&&(n=null);var o=[],r=0;return this.doc.nodesBetween(e,t,(function(i,a){if(i.isInline){r++;var s=null;if(n instanceof X)for(var c,d=i.marks;c=n.isInSet(d);)(s||(s=[])).push(c),d=c.removeFromSet(d);else n?n.isInSet(i.marks)&&(s=[n]):s=i.marks;if(s&&s.length)for(var l=Math.min(a+i.nodeSize,t),p=0;p<s.length;p++){for(var u=s[p],h=void 0,f=0;f<o.length;f++){var b=o[f];b.step==r-1&&u.eq(o[f].style)&&(h=b)}h?(h.to=l,h.step=r):o.push({style:u,from:Math.max(a,e),to:l,step:r})}}})),o.forEach((function(e){return i.step(new Ve(e.from,e.to,e.style))})),this},_e.prototype.clearIncompatible=function(e,t,n){void 0===n&&(n=t.contentMatch);for(var i=this.doc.nodeAt(e),o=[],a=e+1,s=0;s<i.childCount;s++){var c=i.child(s),d=a+c.nodeSize,l=n.matchType(c.type,c.attrs);if(l){n=l;for(var p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||this.step(new Ve(a,d,c.marks[p]))}else o.push(new Se(a,d,u.empty));a=d}if(!n.validEnd){var h=n.fillBefore(r.empty,!0);this.replace(a,a,new u(h,0,0))}for(var f=o.length-1;f>=0;f--)this.step(o[f]);return this},_e.prototype.replace=function(e,t,n){void 0===t&&(t=e),void 0===n&&(n=u.empty);var i=He(this.doc,e,t,n);return i&&this.step(i),this},_e.prototype.replaceWith=function(e,t,n){return this.replace(e,t,new u(r.from(n),0,0))},_e.prototype.delete=function(e,t){return this.replace(e,t,u.empty)},_e.prototype.insert=function(e,t){return this.replaceWith(e,e,t)};var $e=function(e,t,n){this.$to=t,this.$from=e,this.unplaced=n,this.frontier=[];for(var i=0;i<=e.depth;i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}this.placed=r.empty;for(var a=e.depth;a>0;a--)this.placed=r.from(e.node(a).copy(this.placed))},We={depth:{configurable:!0}};function Ue(e,t,n){return 0==t?e.cutByIndex(n):e.replaceChild(0,e.firstChild.copy(Ue(e.firstChild.content,t-1,n)))}function Ge(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ge(e.lastChild.content,t-1,n)))}function Ze(e,t){for(var n=0;n<t;n++)e=e.firstChild.content;return e}function qe(e,t,n){if(t<=0)return e;var i=e.content;return t>1&&(i=i.replaceChild(0,qe(i.firstChild,t-1,1==i.childCount?n-1:0))),t>0&&(i=e.type.contentMatch.fillBefore(i).append(i),n<=0&&(i=i.append(e.type.contentMatch.matchFragment(i).fillBefore(r.empty,!0)))),e.copy(i)}function Je(e,t,n,i,o){var r=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==r.childCount&&!n.compatibleContent(r.type))return null;var s=i.fillBefore(r.content,!0,a);return s&&!function(e,t,n){for(var i=n;i<t.childCount;i++)if(!e.allowsMarks(t.child(i).marks))return!0;return!1}(n,r.content,a)?s:null}function Xe(e,t,n,i,o){if(t<n){var a=e.firstChild;e=e.replaceChild(0,a.copy(Xe(a.content,t+1,n,i,a)))}if(t>i){var s=o.contentMatchAt(0),c=s.fillBefore(e).append(e);e=c.append(s.matchFragment(c).fillBefore(r.empty,!0))}return e}function Ye(e,t){for(var n=[],i=Math.min(e.depth,t.depth);i>=0;i--){var o=e.start(i);if(o<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(o==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==o-1)&&n.push(i)}return n}We.depth.get=function(){return this.frontier.length-1},$e.prototype.fit=function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,i=this.$from,o=this.close(t<0?this.$to:i.doc.resolve(t));if(!o)return null;for(var r=this.placed,a=i.depth,s=o.depth;a&&s&&1==r.childCount;)r=r.firstChild.content,a--,s--;var c=new u(r,a,s);return t>-1?new xe(i.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||i.pos!=this.$to.pos?new Se(i.pos,o.pos,c):void 0},$e.prototype.findFittable=function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=void 0,i=(t?(n=Ze(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var a=this.frontier[o],s=a.type,c=a.match,d=void 0,l=void 0;if(1==e&&(i?c.matchType(i.type)||(l=c.fillBefore(r.from(i),!1)):s.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:l};if(2==e&&i&&(d=c.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:d};if(n&&c.matchType(n.type))break}},$e.prototype.openMore=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=Ze(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new u(t,n+1,Math.max(i,o.size+n>=t.size-i?n+1:0)),!0)},$e.prototype.dropNode=function(){var e=this.unplaced,t=e.content,n=e.openStart,i=e.openEnd,o=Ze(t,n);if(o.childCount<=1&&n>0){var r=t.size-n<=n+o.size;this.unplaced=new u(Ue(t,n-1,1),n-1,r?n-1:i)}else this.unplaced=new u(Ue(t,n,1),n,i)},$e.prototype.placeNodes=function(e){for(var t=e.sliceDepth,n=e.frontierDepth,i=e.parent,o=e.inject,a=e.wrap;this.depth>n;)this.closeFrontierNode();if(a)for(var s=0;s<a.length;s++)this.openFrontierNode(a[s]);var c=this.unplaced,d=i?i.content:c.content,l=c.openStart-t,p=0,h=[],f=this.frontier[n],b=f.match,m=f.type;if(o){for(var g=0;g<o.childCount;g++)h.push(o.child(g));b=b.matchFragment(o)}for(var v=d.size+t-(c.content.size-c.openEnd);p<d.childCount;){var y=d.child(p),_=b.matchType(y.type);if(!_)break;(++p>1||0==l||y.content.size)&&(b=_,h.push(qe(y.mark(m.allowedMarks(y.marks)),1==p?l:0,p==d.childCount?v:-1)))}var O=p==d.childCount;O||(v=-1),this.placed=Ge(this.placed,n,r.from(h)),this.frontier[n].match=b,O&&v<0&&i&&i.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var j=0,C=d;j<v;j++){var k=C.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),C=k.content}this.unplaced=O?0==t?u.empty:new u(Ue(c.content,t-1,1),t-1,v<0?c.openEnd:t-1):new u(Ue(c.content,t,p),c.openStart,c.openEnd)},$e.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Je(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;for(var n=this.$to.depth,i=this.$to.after(n);n>1&&i==this.$to.end(--n);)++i;return i},$e.prototype.findCloseLevel=function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],i=n.match,o=n.type,r=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Je(e,t,o,i,r);if(a){for(var s=t-1;s>=0;s--){var c=this.frontier[s],d=c.match,l=Je(e,s,c.type,d,!0);if(!l||l.childCount)continue e}return{depth:t,fit:a,move:r?e.doc.resolve(e.after(t+1)):e}}}},$e.prototype.close=function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ge(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var i=e.node(n),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,o)}return e},$e.prototype.openFrontierNode=function(e,t,n){var i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ge(this.placed,this.depth,r.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})},$e.prototype.closeFrontierNode=function(){var e=this.frontier.pop().match.fillBefore(r.empty,!0);e.childCount&&(this.placed=Ge(this.placed,this.frontier.length,e))},Object.defineProperties($e.prototype,We),_e.prototype.replaceRange=function(e,t,n){if(!n.size)return this.deleteRange(e,t);var i=this.doc.resolve(e),o=this.doc.resolve(t);if(Ke(i,o,n))return this.step(new Se(e,t,n));var r=Ye(i,this.doc.resolve(t));0==r[r.length-1]&&r.pop();var a=-(i.depth+1);r.unshift(a);for(var s=i.depth,c=i.pos-1;s>0;s--,c--){var d=i.node(s).type.spec;if(d.defining||d.isolating)break;r.indexOf(s)>-1?a=s:i.before(s)==c&&r.splice(1,0,-s)}for(var l=r.indexOf(a),p=[],h=n.openStart,f=n.content,b=0;;b++){var m=f.firstChild;if(p.push(m),b==n.openStart)break;f=m.content}h>0&&p[h-1].type.spec.defining&&i.node(l).type!=p[h-1].type?h-=1:h>=2&&p[h-1].isTextblock&&p[h-2].type.spec.defining&&i.node(l).type!=p[h-2].type&&(h-=2);for(var g=n.openStart;g>=0;g--){var v=(g+h+1)%(n.openStart+1),y=p[v];if(y)for(var _=0;_<r.length;_++){var O=r[(_+l)%r.length],j=!0;O<0&&(j=!1,O=-O);var C=i.node(O-1),k=i.index(O-1);if(C.canReplaceWith(k,k,y.type,y.marks))return this.replace(i.before(O),j?o.after(O):t,new u(Xe(n.content,0,n.openStart,v),v,n.openEnd))}}for(var w=this.steps.length,S=r.length-1;S>=0&&(this.replace(e,t,n),!(this.steps.length>w));S--){var x=r[S];x<0||(e=i.before(x),t=o.after(x))}return this},_e.prototype.replaceRangeWith=function(e,t,n){if(!n.isInline&&e==t&&this.doc.resolve(e).parent.content.size){var i=Re(this.doc,e,n.type);null!=i&&(e=t=i)}return this.replaceRange(e,t,new u(r.from(n),0,0))},_e.prototype.deleteRange=function(e,t){for(var n=this.doc.resolve(e),i=this.doc.resolve(t),o=Ye(n,i),r=0;r<o.length;r++){var a=o[r],s=r==o.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),i.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),i.indexAfter(a-1))))return this.delete(n.before(a),i.after(a))}for(var c=1;c<=n.depth&&c<=i.depth;c++)if(e-n.start(c)==n.depth-c&&t>n.end(c)&&i.end(c)-t!=i.depth-c)return this.delete(n.before(c),t);return this.delete(e,t)};var Qe=Object.create(null),et=function(e,t,n){this.ranges=n||[new nt(e.min(t),e.max(t))],this.$anchor=e,this.$head=t},tt={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};tt.anchor.get=function(){return this.$anchor.pos},tt.head.get=function(){return this.$head.pos},tt.from.get=function(){return this.$from.pos},tt.to.get=function(){return this.$to.pos},tt.$from.get=function(){return this.ranges[0].$from},tt.$to.get=function(){return this.ranges[0].$to},tt.empty.get=function(){for(var e=this.ranges,t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0},et.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},et.prototype.replace=function(e,t){void 0===t&&(t=u.empty);for(var n=t.content.lastChild,i=null,o=0;o<t.openEnd;o++)i=n,n=n.lastChild;for(var r=e.steps.length,a=this.ranges,s=0;s<a.length;s++){var c=a[s],d=c.$from,l=c.$to,p=e.mapping.slice(r);e.replaceRange(p.map(d.pos),p.map(l.pos),s?u.empty:t),0==s&<(e,r,(n?n.isInline:i&&i.isTextblock)?-1:1)}},et.prototype.replaceWith=function(e,t){for(var n=e.steps.length,i=this.ranges,o=0;o<i.length;o++){var r=i[o],a=r.$from,s=r.$to,c=e.mapping.slice(n),d=c.map(a.pos),l=c.map(s.pos);o?e.deleteRange(d,l):(e.replaceRangeWith(d,l,t),lt(e,n,t.isInline?-1:1))}},et.findFrom=function(e,t,n){var i=e.parent.inlineContent?new it(e):dt(e.node(0),e.parent,e.pos,e.index(),t,n);if(i)return i;for(var o=e.depth-1;o>=0;o--){var r=t<0?dt(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):dt(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(r)return r}},et.near=function(e,t){return void 0===t&&(t=1),this.findFrom(e,t)||this.findFrom(e,-t)||new st(e.node(0))},et.atStart=function(e){return dt(e,e,0,0,1)||new st(e)},et.atEnd=function(e){return dt(e,e,e.content.size,e.childCount,-1)||new st(e)},et.fromJSON=function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=Qe[t.type];if(!n)throw new RangeError("No selection type "+t.type+" defined");return n.fromJSON(e,t)},et.jsonID=function(e,t){if(e in Qe)throw new RangeError("Duplicate use of selection JSON ID "+e);return Qe[e]=t,t.prototype.jsonID=e,t},et.prototype.getBookmark=function(){return it.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(et.prototype,tt),et.prototype.visible=!0;var nt=function(e,t){this.$from=e,this.$to=t},it=function(e){function t(t,n){void 0===n&&(n=t),e.call(this,t,n)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},t.prototype.map=function(n,i){var o=n.resolve(i.map(this.head));if(!o.parent.inlineContent)return e.near(o);var r=n.resolve(i.map(this.anchor));return new t(r.parent.inlineContent?r:o,o)},t.prototype.replace=function(t,n){if(void 0===n&&(n=u.empty),e.prototype.replace.call(this,t,n),n==u.empty){var i=this.$from.marksAcross(this.$to);i&&t.ensureMarks(i)}},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor&&e.head==this.head},t.prototype.getBookmark=function(){return new ot(this.anchor,this.head)},t.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,t,n){void 0===n&&(n=t);var i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))},t.between=function(n,i,o){var r=n.pos-i.pos;if(o&&!r||(o=r>=0?1:-1),!i.parent.inlineContent){var a=e.findFrom(i,o,!0)||e.findFrom(i,-o,!0);if(!a)return e.near(i,o);i=a.$head}return n.parent.inlineContent||(0==r||(n=(e.findFrom(n,-o,!0)||e.findFrom(n,o,!0)).$anchor).pos<i.pos!=r<0)&&(n=i),new t(n,i)},Object.defineProperties(t.prototype,n),t}(et);et.jsonID("text",it);var ot=function(e,t){this.anchor=e,this.head=t};ot.prototype.map=function(e){return new ot(e.map(this.anchor),e.map(this.head))},ot.prototype.resolve=function(e){return it.between(e.resolve(this.anchor),e.resolve(this.head))};var rt=function(e){function t(t){var n=t.nodeAfter,i=t.node(0).resolve(t.pos+n.nodeSize);e.call(this,t,i),this.node=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var o=i.mapResult(this.anchor),r=o.deleted,a=o.pos,s=n.resolve(a);return r?e.near(s):new t(s)},t.prototype.content=function(){return new u(r.from(this.node),0,0)},t.prototype.eq=function(e){return e instanceof t&&e.anchor==this.anchor},t.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},t.prototype.getBookmark=function(){return new at(this.anchor)},t.fromJSON=function(e,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new t(e.resolve(n.anchor))},t.create=function(e,t){return new this(e.resolve(t))},t.isSelectable=function(e){return!e.isText&&!1!==e.type.spec.selectable},t}(et);rt.prototype.visible=!1,et.jsonID("node",rt);var at=function(e){this.anchor=e};at.prototype.map=function(e){var t=e.mapResult(this.anchor),n=t.deleted,i=t.pos;return n?new ot(i,i):new at(i)},at.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=t.nodeAfter;return n&&rt.isSelectable(n)?new rt(t):et.near(t)};var st=function(e){function t(t){e.call(this,t.resolve(0),t.resolve(t.content.size))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.replace=function(t,n){if(void 0===n&&(n=u.empty),n==u.empty){t.delete(0,t.doc.content.size);var i=e.atStart(t.doc);i.eq(t.selection)||t.setSelection(i)}else e.prototype.replace.call(this,t,n)},t.prototype.toJSON=function(){return{type:"all"}},t.fromJSON=function(e){return new t(e)},t.prototype.map=function(e){return new t(e)},t.prototype.eq=function(e){return e instanceof t},t.prototype.getBookmark=function(){return ct},t}(et);et.jsonID("all",st);var ct={map:function(){return this},resolve:function(e){return new st(e)}};function dt(e,t,n,i,o,r){if(t.inlineContent)return it.create(e,n);for(var a=i-(o>0?0:1);o>0?a<t.childCount:a>=0;a+=o){var s=t.child(a);if(s.isAtom){if(!r&&rt.isSelectable(s))return rt.create(e,n-(o<0?s.nodeSize:0))}else{var c=dt(e,s,n+o,o<0?s.childCount:0,o,r);if(c)return c}n+=s.nodeSize*o}}function lt(e,t,n){var i=e.steps.length-1;if(!(i<t)){var o,r=e.steps[i];if(r instanceof Se||r instanceof xe)e.mapping.maps[i].forEach((function(e,t,n,i){null==o&&(o=i)})),e.setSelection(et.near(e.doc.resolve(o),n))}}var pt=function(e){function t(t){e.call(this,t.doc),this.time=Date.now(),this.curSelection=t.selection,this.curSelectionFor=0,this.storedMarks=t.storedMarks,this.updated=0,this.meta=Object.create(null)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;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},t.prototype.setSelection=function(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},t.prototype.setStoredMarks=function(e){return this.storedMarks=e,this.updated|=2,this},t.prototype.ensureMarks=function(e){return l.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this},t.prototype.addStoredMark=function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))},t.prototype.removeStoredMark=function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},t.prototype.addStep=function(t,n){e.prototype.addStep.call(this,t,n),this.updated=-3&this.updated,this.storedMarks=null},t.prototype.setTime=function(e){return this.time=e,this},t.prototype.replaceSelection=function(e){return this.selection.replace(this,e),this},t.prototype.replaceSelectionWith=function(e,t){var n=this.selection;return!1!==t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||l.none))),n.replaceWith(this,e),this},t.prototype.deleteSelection=function(){return this.selection.replace(this),this},t.prototype.insertText=function(e,t,n){void 0===n&&(n=t);var i=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();if(!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var r=this.doc.resolve(t);o=n==t?r.marks():r.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,i.text(e,o)),this.selection.empty||this.setSelection(et.near(this.selection.$to)),this},t.prototype.setMeta=function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this},t.prototype.getMeta=function(e){return this.meta["string"==typeof e?e:e.key]},n.isGeneric.get=function(){for(var e in this.meta)return!1;return!0},t.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(t.prototype,n),t}(_e);function ut(e,t){return t&&e?e.bind(t):e}var ht=function(e,t,n){this.name=e,this.init=ut(t.init,n),this.apply=ut(t.apply,n)},ft=[new ht("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new ht("selection",{init:function(e,t){return e.selection||et.atStart(t.doc)},apply:function(e){return e.selection}}),new ht("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,i){return i.selection.$cursor?e.storedMarks:null}}),new ht("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],bt=function(e,t){var n=this;this.schema=e,this.fields=ft.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),t&&t.forEach((function(e){if(n.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");n.plugins.push(e),n.pluginsByKey[e.key]=e,e.spec.state&&n.fields.push(new ht(e.key,e.spec.state,e))}))},mt=function(e){this.config=e},gt={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};gt.schema.get=function(){return this.config.schema},gt.plugins.get=function(){return this.config.plugins},mt.prototype.apply=function(e){return this.applyTransaction(e).state},mt.prototype.filterTransaction=function(e,t){void 0===t&&(t=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=t){var i=this.config.plugins[n];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0},mt.prototype.applyTransaction=function(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};for(var t=[e],n=this.applyInner(e),i=null;;){for(var o=!1,r=0;r<this.config.plugins.length;r++){var a=this.config.plugins[r];if(a.spec.appendTransaction){var s=i?i[r].n:0,c=i?i[r].state:this,d=s<t.length&&a.spec.appendTransaction.call(a,s?t.slice(s):t,c,n);if(d&&n.filterTransaction(d,r)){if(d.setMeta("appendedTransaction",e),!i){i=[];for(var l=0;l<this.config.plugins.length;l++)i.push(l<r?{state:n,n:t.length}:{state:this,n:0})}t.push(d),n=n.applyInner(d),o=!0}i&&(i[r]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}},mt.prototype.applyInner=function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var t=new mt(this.config),n=this.config.fields,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.apply(e,this[o.name],this,t)}for(var r=0;r<vt.length;r++)vt[r](this,e,t);return t},gt.tr.get=function(){return new pt(this)},mt.create=function(e){for(var t=new bt(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new mt(t),i=0;i<t.fields.length;i++)n[t.fields[i].name]=t.fields[i].init(e,n);return n},mt.prototype.reconfigure=function(e){for(var t=new bt(this.schema,e.plugins),n=t.fields,i=new mt(t),o=0;o<n.length;o++){var r=n[o].name;i[r]=this.hasOwnProperty(r)?this[r]:n[o].init(e,i)}return i},mt.prototype.toJSON=function(e){var t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((function(e){return e.toJSON()}))),e&&"object"==typeof e)for(var n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var i=e[n],o=i.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(i,this[i.key]))}return t},mt.fromJSON=function(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new bt(e.schema,e.plugins),o=new mt(i);return i.fields.forEach((function(i){if("doc"==i.name)o.doc=I.fromJSON(e.schema,t.doc);else if("selection"==i.name)o.selection=et.fromJSON(o.doc,t.selection);else if("storedMarks"==i.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(var r in n){var a=n[r],s=a.spec.state;if(a.key==i.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(o[i.name]=s.fromJSON.call(a,e,t[r],o))}o[i.name]=i.init(e,o)}})),o},mt.addApplyListener=function(e){vt.push(e)},mt.removeApplyListener=function(e){var t=vt.indexOf(e);t>-1&&vt.splice(t,1)},Object.defineProperties(mt.prototype,gt);var vt=[];var yt=function(e){this.props={},e.props&&function e(t,n,i){for(var o in t){var r=t[o];r instanceof Function?r=r.bind(n):"handleDOMEvents"==o&&(r=e(r,n,{})),i[o]=r}return i}(e.props,this,this.props),this.spec=e,this.key=e.key?e.key.key:Ot("plugin")};yt.prototype.getState=function(e){return e[this.key]};var _t=Object.create(null);function Ot(e){return e in _t?e+"$"+ ++_t[e]:(_t[e]=0,e+"$")}var jt=function(e){void 0===e&&(e="key"),this.key=Ot(e)};jt.prototype.get=function(e){return e.config.pluginsByKey[this.key]},jt.prototype.getState=function(e){return e[this.key]};var Ct="k-parent-node",kt=["div","ol","ul","li","table","tbody","thead","tfoot","td","th","p","tr","col","colgroup","article","main","nav","header","footer","aside","section"],wt=function(e,t){var n=(e.ownerDocument||document).createElement(t);Array.from(e.rows).filter((function(e){return e.getAttribute(Ct)===t})).forEach((function(e){e.removeAttribute(Ct),n.appendChild(e)})),n.children.length&&e.appendChild(n)},St=function(e,t){var n=t.toUpperCase();e.filter((function(e){return e.nodeName===n})).forEach((function(e){Array.from(e.children).forEach((function(n){n.setAttribute(Ct,t),e.parentNode&&e.parentNode.insertBefore(n,e)})),e.remove()}))},xt=function(e,t){void 0===t&&(t=kt);var n=t.join("|");return e.replace(new RegExp("\\s*(<(?:"+n+")(?:\\s[^>]*?)?>)","g"),"$1").replace(new RegExp("(<\\/(?:"+n+")(?:\\s[^>]*?)?>)\\s*","g"),"$1")},Et=function(e){var t,n=document.createElement("template");if("content"in n)n.innerHTML=e,t=n.content;else{var i=(new DOMParser).parseFromString(e,"text/html");t=document.createDocumentFragment();for(var o=i.body;o&&o.firstChild;)t.appendChild(o.firstChild)}return t},It=function(e){var t=pe.fromSchema(e.type.schema).serializeFragment(e.content);return function(e){Array.from(e.querySelectorAll("table")).forEach((function(e){wt(e,"thead"),wt(e,"tbody"),wt(e,"tfoot");var t=Array.from(e.children).find((function(e){return 0===e.children.length}));t&&t.remove()}))}(t),t},Tt=function(e,t,n){return ee.fromSchema(t).parse(e,n)},Dt=function(e,t,n){var i,o=Et(e);return i=o,Array.from(i.querySelectorAll("table")).forEach((function(e){var t=Array.from(e.children);t.some((function(e){return"THEAD"===e.nodeName||"TFOOT"===e.nodeName}))&&(St(t,"thead"),St(t,"tbody"),St(t,"tfoot"));var n=t.find((function(e){return"COLGROUP"===e.nodeName}));n&&(e.setAttribute("k-colgroup-data",n.outerHTML),n.remove())})),Tt(o,t,n)},Bt=function(e){var t=It(e.doc),n=document.createElement("div");return n.appendChild(t),n.innerHTML},Pt=function(e,t,n){return void 0===t&&(t="setHTML"),void 0===n&&(n={preserveWhitespace:"full"}),function(i,o){return o(i.tr.setSelection(new st(i.doc)).replaceSelectionWith(Dt(e,i.schema,n)).setMeta("commandName",t))}},At=n(0),Mt=function(e,t){var n=t.style,i=t.value,o=t.newValue;if(!e)return{changed:!1,style:null};var r=e.split(/\s*;\s*/).filter((function(e){return Boolean(e)})),a=r.filter((function(e){var t=e.split(/\s*:\s*/);return!(t[0].toLowerCase()===n&&i.test(t[1]))}));return o&&a.push(n+": "+o),{style:a.join("; ")+(a.length?";":""),changed:Boolean(o)||a.length!==r.length}},zt=function(e,t){for(var n=e.selection.$from,i=n.depth;i>=0;i--){var o=n.index(i);if(n.node(i).canReplaceWith(o,o,t))return!0}return!1},Rt=function(e){return e instanceof I?e.type.name:e.name},Ft=function(e,t){return void 0===t&&(t=1),function(n){return function(e,t){return void 0===t&&(t=1),function(n){for(var i=n.$from,o=i.depth;o>0;o--){var r=i.node(o);if(e(r)&&0===(t-=1))return{depth:o,node:r}}}}((function(t){return Rt(t)===Rt(e)}),t)(n)}},Nt=function(e,t){return function(n,i){var o=n.tr.replaceSelectionWith(e);t&&o.scrollIntoView(),i(o)}},Lt=function(e,t,n,i){var o=r.from(Dt(e,n,i)),a=r.from(Dt(t,n,i));return o.eq(a)},Vt=function(e){var t=e.selection;if(t instanceof it||t instanceof st){var n=t.content().content;return n.textBetween(0,n.size)}return""},Ht=function(e){if(e.selection instanceof rt)return e.selection.node},Kt=function(e){var t="",n=!1,i=e.selection,o=e.doc,r=i.$from,a=i.$to,s=i.from,c=i.to;return r.sameParent(a)&&(o.nodesBetween(s,c,(function(e){n=n||e.isLeaf&&!e.isText})),n||(t=Vt(e))),t},$t=function(e){return e.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$/,"")},Wt={before:/[^ !,?.\[\]{}()]+$/i,after:/^[^ !,?.\[\]{}()]+/i},Ut=function(e,t,n){if(!n.applyToWord||!e.selection.empty)return{state:e,dispatch:t};var i=!0===n.applyToWord?Wt:n.applyToWord,o=null,r=e.tr,a=e.selection,s=a.$head.nodeBefore,c=a.$head.nodeAfter;if(s&&"text"===s.type.name&&s.text&&c&&"text"===c.type.name&&c.text){var d=[];a.$head.parent.descendants((function(e,t){return d.push({node:e,pos:t}),!1}));for(var l=a.$head.parentOffset,p=d.findIndex((function(e){var t=e.node,n=e.pos;return n<=l&&n+t.nodeSize>=l})),u=d[p].node.text,h=!1,f=p-1;f>=0;f--){var b=d[f];!h&&b&&"text"===b.node.type.name?u=b.node.text+u:(h=!0,l-=b.node.nodeSize)}for(f=p+1;f<d.length;f++){if(!(b=d[f])||"text"!==b.node.type.name)break;u+=b.node.text}var m=u.substring(0,l),g=u.substring(l),v=i.before.exec(m),y=i.after.exec(g);if(v&&y){var _=v[0].length,O=y[0].length,j=o=a.from;r.setSelection(it.create(e.doc,j-_,j+O));return{state:{tr:r,selection:r.selection,doc:r.doc,storedMarks:null,schema:r.doc.type.schema},dispatch:function(e){e.setSelection(it.create(e.doc,o)),t(e)}}}}return{state:e,dispatch:t}},Gt=function(e,t){return function(n,i,o){var r=Ut(n,i,t),a=r.state,s=r.dispatch;return e(t)(a,s)}},Zt=function(e,t,n){for(var i=function(i){var o=t[i],r=o.$from,a=o.$to,s=0===r.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(r.pos,a.pos,(function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return{v:!0}},o=0;o<t.length;o++){var r=i(o);if(r)return r.v}return!1},qt=function(e,t,n){return function(i,o){var r=i.selection,a=r.empty,s=r.$cursor,c=r.ranges;if(a&&!s||!Zt(i.doc,c,e))return!1;if(o)if(s)e.isInSet(i.storedMarks||s.marks())?o(n.removeStoredMark(e)):o(n.addStoredMark(e.create(t)));else{for(var d=!1,l=0;!d&&l<c.length;l++){var p=c[l],u=p.$from,h=p.$to;d=i.doc.rangeHasMark(u.pos,h.pos,e)}for(l=0;l<c.length;l++){var f=c[l];u=f.$from,h=f.$to;d?n.removeMark(u.pos,h.pos,e):n.addMark(u.pos,h.pos,e.create(t))}o(n.scrollIntoView())}return!0}},Jt=function(e,t,n,i){void 0===i&&(i=null);var o=[],r=0;return e.doc.nodesBetween(t,n,(function(e,a){if(e.isInline){r++;var s=null;if(i instanceof X){var c=i.isInSet(e.marks);c&&(s=[c])}else i?i.isInSet(e.marks)&&(s=[i]):s=e.marks;if(s&&s.length)for(var d=Math.min(a+e.nodeSize,n),l=0;l<s.length;l++){for(var p=s[l],u=void 0,h=0;h<o.length;h++){var f=o[h];f.step===r-1&&p.eq(f.style)&&(u=f)}u?(u.to=d,u.step=r):o.push({style:p,from:Math.max(a,t),to:d,step:r})}}})),o.forEach((function(t){return e.step(new Ve(t.from,t.to,t.style))})),e},Xt=function(e){var t=(void 0===e?{}:e).except,n=void 0===t?[]:t;return function(e,t){var i,o=e.tr;Yt(o,{except:(i=n,i instanceof Array?i:[i])}),o.docChanged&&t(o)}},Yt=function(e,t){var n=t.except,i=e.doc,o=e.selection,r=i.type.schema,a=o.empty,s=o.ranges,c=(n||[]).map((function(e){return e.name}));if(!a){var d=Object.keys(r.marks).map((function(e){return r.marks[e]})).filter((function(e){return-1===c.indexOf(e.name)}));s.forEach((function(t){var n=t.$from,i=t.$to;d.forEach((function(t){return e.removeMark(n.pos,i.pos,t)}))}))}},Qt=function(e,t){var n,i=e.schema.marks,o=(t.altMarks||[]).filter((function(e){return i[e]})),r=t.altStyle,a=e.selection,s=a.from,c=a.$from,d=a.to,l=a.empty,p=i[t.mark],u=e.doc,h=!1;return l?(n=e.storedMarks||c.marks(),h=p&&p.isInSet(n)||o.some((function(e){return i[e].isInSet(n)}))):h=p&&u.rangeHasMark(s,d,p)||o.some((function(e){return u.rangeHasMark(s,d,i[e])})),!h&&r&&i.style?tn(e,i.style).some((function(e){return null!==en(e,r)})):Boolean(h)},en=function(e,t){for(var n=(e&&e.attrs.style||"").split(/\s*;\s*/).filter((function(e){return Boolean(e)})),i=0;i<n.length;i++){var o=n[i].split(/\s*:\s*/);if(o[0].toLowerCase()===t.name&&t.value.test(o[1]))return o[1]}return null},tn=function(e,t){var n=e.selection,i=n.from,o=n.$from,r=n.to,a=n.empty,s=[];return a?s.push(t.isInSet(e.storedMarks||o.marks())):e.doc.nodesBetween(i,r,(function(e){e.isInline&&s.push(t.isInSet(e.marks))})),s},nn=function(e,t){var n=tn(e,t),i=n.filter((function(e){return Boolean(e)}));return n.length===i.length?n[0]:void 0},on=function(e,t){var n=tn(e,t),i=n.filter((function(e){return Boolean(e)}));return{hasNodesWithoutMarks:n.length!==i.length,marks:i}},rn=function(e,t){var n=e.find((function(e){return"style"===e.type.name})),i=n&&n.attrs.style;return Mt(i,t)},an=function(e,t,n,i,o){var r=o.create({style:i.style}),a=[],s=[],c=null,d=null;return e.doc.nodesBetween(t,n,(function(e,l,p){if(e.isInline){var u=e.marks;if(!r.isInSet(u)&&p.type.allowsMarkType(r.type)){var h=Math.max(l,t),f=Math.min(l+e.nodeSize,n),b=rn(u,i);if(b.changed||i.newValue){for(var m=b.changed?{style:b.style||null}:{style:[i.style]+": "+i.newValue+";"},g=o.isInSet(u)?u.find((function(e){return"style"===e.type.name})):null,v=g?At.__assign({},g.attrs,m):m,y=o.create(v),_=y.addToSet(u),O=0;O<u.length;O++)u[O].isInSet(_)||(c&&c.to===h&&c.mark.eq(u[O])?c.to=f:(c=new Ve(h,f,u[O]),a.push(c)));var j=d&&d.to===h,C=j&&y.attrs.style===d.mark.attrs.style;j&&C?d.to=f:Object.keys(v).some((function(e){return null!==v[e]}))&&(d=new Le(h,f,y),s.push(d))}}}})),a.forEach((function(t){return e.step(t)})),s.forEach((function(t){return e.step(t)})),a.length+s.length>0},sn=function(e,t){var n=e.schema.marks.style;return(n?tn(e,n):[]).map((function(e){return en(e,t)})).filter((function(e){return null!==e}))},cn=function(e,t){return function(n,i,o){var r=n.selection,a=r.empty,s=r.$cursor,c=r.ranges;if(a&&!s||!Zt(n.doc,c,e))return!1;var d,l,p,u,h=!1;if(i){var f=o||n.tr;if(s){var b=n.storedMarks||s.marks();if(e.isInSet(b)){var m=rn(b,t),g=b.find((function(e){return"style"===e.type.name})),v=At.__assign({},g?g.attrs:{},{style:m.style||null});if(d=g.attrs,l=v,p=Object.keys(d),u=Object.keys(l),p.length===u.length&&p.every((function(e){return d[e]===l[e]})))return!1;i(f.removeStoredMark(e)),Object.keys(v).some((function(e){return null!==v[e]}))&&i(f.addStoredMark(e.create(v))),h=!0}}else{for(var y=0;y<c.length;y++){var _=c[y],O=_.$from,j=_.$to;h=an(f,O.pos,j.pos,t,e)}h&&(f.scrollIntoView(),i(f))}}return h}},dn=function(e,t,n){return function(i,o){var r=i.schema.marks,a=e.altStyle,s=e.altMarks,c=void 0===s?[]:s,d=e.mark,l=t||i.tr,p=!1,u=!1,h=function(){return u=!0};a&&r.style&&(p=cn(r.style,{style:a.name,value:a.value})(i,h,l));var f=[d].concat(c).filter((function(e){return r[e]})).map((function(e){return Qt(i,{mark:e})&&r[e]})).filter((function(e){return e}));return f.length?function(e,t,n,i){var o=t.selection,r=o.$cursor,a=o.ranges;if(i=i||t.tr,r)e.forEach((function(e){e.isInSet(t.storedMarks||r.marks())&&n(i.removeStoredMark(e))}));else{for(var s=function(t){var n=a[t],o=n.$from,r=n.$to;e.forEach((function(e){Jt(i,o.pos,r.pos,e)}))},c=0;c<a.length;c++)s(c);n(i.scrollIntoView())}}(f,i,h,l):p||qt(r[d],n,l)(i,h),u&&o(l),u}},ln=function(e,t){return function(n,i){var o=n.schema.marks.style,r={style:e.style,value:/^.+$/,newValue:e.value},a=n.tr;t&&a.setMeta("commandName",t),a.setMeta("args",e);var s=n.selection,c=s.empty,d=s.$cursor,l=s.ranges;if(c&&!d||!o||!Zt(n.doc,l,o))return!1;if(d){var p=n.storedMarks||d.marks(),u=o.isInSet(p)?p.find((function(e){return"style"===e.type.name})):null,h={style:null};if(u&&u.attrs.style){var f=Mt(u.attrs.style,r);f.changed&&f.style&&(h.style=f.style)}else r.newValue&&(h.style=[r.style]+": "+r.newValue+";");var b=u?At.__assign({},u.attrs,h):h;return Object.keys(b).some((function(e){return null!==b[e]}))?i(a.addStoredMark(o.create(b))):i(a.removeStoredMark(o)),!0}return cn(o,r)(n,i,a)}},pn=function(e,t){return function(n,i){var o=n.selection.$cursor;if(o){var r=o.parent,a=o.index(),s=n.schema.marks[e.mark],c=r.child(a).marks.find((function(e){return e.type===s})),d=r.childCount,l=o.pos-o.textOffset,p=r.child(a).nodeSize,u=void 0,h=void 0;for(u=a-1;u>=0&&c.isInSet(r.child(u).marks);)p+=h=r.child(u).nodeSize,l-=h,u-=1;for(u=a+1;u<d&&c.isInSet(r.child(u).marks);)p+=r.child(u).nodeSize,u+=1;i(Jt(t||n.tr,l,l+p,c))}else dn(e,t)(n,i)}},un=function(e,t){var n=e.mark,i=e.attrs;return void 0===t&&(t="link"),function(e,o){var r=e.schema.marks,a=e.tr;t&&(a.setMeta("commandName",t),a.setMeta("args",i));var s=!1,c=function(){return s=!0};if(function(e,t){var n=tn(e,t);return 1===n.length&&n[0]?n[0]:null}(e,r[n]))!function(e,t){return function(n,i){var o=n.selection,r=o.$cursor,a=o.from,s=o.to,c=n.schema.marks[e.mark];if(r){var d=r.parent,l=r.index(),p=d.child(l).marks.find((function(e){return e.type===c})),u=d.childCount,h=r.pos-r.textOffset,f=d.child(l).nodeSize,b=void 0,m=void 0;for(b=l-1;b>=0&&p.isInSet(d.child(b).marks);)f+=m=d.child(b).nodeSize,h-=m,b-=1;for(b=l+1;b<u&&p.isInSet(d.child(b).marks);)f+=d.child(b).nodeSize,b+=1;t.removeMark(h,h+f,c),t.addMark(h,h+f,c.create(e.attrs)),i(t)}else t.doc.nodesBetween(a,s,(function(n,o){n.isInline&&c.isInSet(n.marks)&&(t.removeMark(o,o+n.nodeSize,c),t.addMark(o,o+n.nodeSize,c.create(e.attrs)),i(t))}))}}({mark:n,attrs:i},a)(e,c);else{var d=e;Qt(e,{mark:n})&&(pn({mark:n,attrs:i},a)(e,c),d=mt.create({doc:a.doc,selection:a.selection})),s?qt(r[n],i,a)(d,c):dn({mark:n},a,i)(d,c)}return s&&o(a),s}},hn=function(e){return function(t,n){n(t.tr.insertText(e.text,e.from,e.to))}},fn=function(e){return function(t,n){var i=t.schema.nodes.image,o=i.createAndFill(e);Nt(o)(t,(function(t){return n(t.setMeta("commandName","insertImage").setMeta("args",e))}))}},bn=function(e,t,n,i){if(!n.isTextblock)return!1;e.selection.ranges.forEach((function(o){var a=e.steps.length,s=o.$from.pos,c=o.$to.pos;e.doc.nodesBetween(s,c,(function(o,s){if(o.eq(t)&&o.isTextblock&&!o.hasMarkup(n,i)&&function(e,t,n){var i=e.resolve(t),o=i.index();return i.parent.canReplaceWith(o,o+1,n)}(e.doc,e.mapping.slice(a).map(s),n)){e.clearIncompatible(e.mapping.slice(a).map(s,1),n);var c=e.mapping.slice(a),d=c.map(s,1),l=c.map(s+o.nodeSize,1),p=new u(r.from(n.create(i,null,o.marks)),0,0);return e.step(new xe(d,l,d+1,l-1,p,1,!0)),!1}}))}))},mn=function(e,t){void 0===t&&(t={blocksInSelection:!1});var n=e.doc,i=e.selection,o=i.$from,r=i.ranges,a=t.blocksInSelection,s=[],c=i instanceof rt?i.node:void 0;return c?c.isBlock?(s.push(c),c.nodesBetween(0,c.content.size,(function(e){e.isBlock&&s.push(e)}))):!a&&o.parent&&o.parent.isBlock&&s.push(o.parent):r.forEach((function(e){var t=e.$from.pos,i=e.$to.pos;n.nodesBetween(t,i,(function(e,n,o,r){e.isBlock&&(!a||n>=t&&n+e.content.size+2<=i)&&s.push(e)}))})),s},gn=function(e,t){return function(n,i){var o=mn(n),r=n.schema.nodes,a=n.tr;a.setMeta("commandName",t),a.setMeta("args",{value:e}),o.forEach((function(t){if(t.type.isTextblock)if("p"===e){var n=t.attrs,i=n.level,o=At.__rest(n,["level"]);bn(a,t,r.paragraph,o)}else if(/^h[1-6]$/i.test(e)){i=parseInt(e.substr(1),10);bn(a,t,r.heading,At.__assign({},t.attrs,{level:i}))}else if("blockquote"===e){var s=t.attrs;i=s.level,o=At.__rest(s,["level"]);bn(a,t,r.blockquote,o)}}));var s=a.docChanged;return s&&i(a.scrollIntoView()),s}},vn=function(e,t){void 0===t&&(t={blocksInSelection:!0});var n=e.doc,i=e.selection,o=t.blocksInSelection,r=t.blockNodeType;mn({doc:n,selection:i},{blocksInSelection:o}).filter((function(e){return e.isTextblock})).forEach((function(t){var n=t.attrs||{},i=n.style,o=void 0===i?"":i,a=n.class,s=void 0===a?"":a,c=At.__rest(n,["style","class"]),d=r||t.type;(o||s||d!==t.type)&&bn(e,t,d,c)}))},yn=function(e){var t=mn(e),n=e.schema.nodes,i=[];return t.forEach((function(e){e.type===n.paragraph?i.push("p"):e.type===n.heading?i.push("h"+e.attrs.level):e.type===n.blockquote&&n.blockquote.isTextblock&&i.push("blockquote")})),i},_n=function(e,t){var n,i,o=e.attrs.style;o&&t.forEach((function(e){i={style:e.name,value:/^.+$/,newValue:e.value},n=Mt(o,i),o=n.changed?n.style:o}));return o=o||t.reduce((function(e,t){return(e&&t.value?e+" ":"")+t.value?t.name+": "+t.value+";":""}),""),Object.assign({},e.attrs,{style:o||null})},On=function(e,t){var n=e.selection,i=n.from,o=n.to,r=!1;return e.doc.nodesBetween(i,o,(function(e){return!(r=r||e.type===t)})),r},jn=function(e){var t=yn(e);return 1===new Set(t).size?t[0]:null},Cn=function(e){return{tag:jn(e)||""}},kn=function(e,t){return function(n,i){var o=mn(n),r=n.tr;r.setMeta("commandName",t),o.forEach((function(t){if(t.type.isTextblock){var n={},i=e.find((function(e){return e.node===t.type.name}));i&&(n=_n(t,i.style)),bn(r,t,t.type,n)}}));var a=r.docChanged;return a&&i(r.scrollIntoView()),a}},wn=function(e,t){var n=mn(e),i=!1;return n.forEach((function(e){if(!i&&e.type.isTextblock&&e.attrs.style){var n=t.find((function(t){return t.node===e.type.name}));n&&(i=n.style.every((function(t){return!!t.value&&new RegExp(t.name+":\\s?"+t.value,"i").test(e.attrs.style)})))}})),i},Sn=function(e){return void 0===e&&(e={blocksInSelection:!0}),function(t,n){var i=t.tr,o=e.blocksInSelection,r=e.blockNodeType,a=(e.exceptMarks||[t.schema.marks.link]).filter(Boolean);Yt(i,{except:a}),vn(i,{blocksInSelection:o,blockNodeType:r});var s=i.docChanged;return s&&n&&n(i),s}},xn=["ol",0],En=["ul",0],In=["li",0],Tn={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:function(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1}}}],toDOM:function(e){return 1==e.attrs.order?xn:["ol",{start:e.attrs.order},0]}},Dn={parseDOM:[{tag:"ul"}],toDOM:function(){return En}},Bn={parseDOM:[{tag:"li"}],toDOM:function(){return In},defining:!0};function Pn(e,t){var n={};for(var i in e)n[i]=e[i];for(var o in t)n[o]=t[o];return n}function An(e,t,n){return e.append({ordered_list:Pn(Tn,{content:"list_item+",group:n}),bullet_list:Pn(Dn,{content:"list_item+",group:n}),list_item:Pn(Bn,{content:t})})}function Mn(e,t){return function(n,i){var o=n.selection,a=o.$from,s=o.$to,c=a.blockRange(s),d=!1,l=c;if(!c)return!1;if(c.depth>=2&&a.node(c.depth-1).type.compatibleContent(e)&&0==c.startIndex){if(0==a.index(c.depth-1))return!1;var p=n.doc.resolve(c.start-2);l=new S(p,p,c.depth),c.endIndex<c.parent.childCount&&(c=new S(a,n.doc.resolve(s.end(c.depth)),c.depth)),d=!0}var h=De(l,e,t,c);return!!h&&(i&&i(function(e,t,n,i,o){for(var a=r.empty,s=n.length-1;s>=0;s--)a=r.from(n[s].type.create(n[s].attrs,a));e.step(new xe(t.start-(i?2:0),t.end,t.start,t.end,new u(a,0,0),n.length,!0));for(var c=0,d=0;d<n.length;d++)n[d].type==o&&(c=d+1);for(var l=n.length-c,p=t.start+n.length-(i?2:0),h=t.parent,f=t.startIndex,b=t.endIndex,m=!0;f<b;f++,m=!1)!m&&Pe(e.doc,p,l)&&(e.split(p,l),p+=2*l),p+=h.child(f).nodeSize;return e}(n.tr,c,h,d,e).scrollIntoView()),!0)}}function zn(e){return function(t,n){var i=t.selection,o=i.$from,a=i.$to,s=i.node;if(s&&s.isBlock||o.depth<2||!o.sameParent(a))return!1;var c=o.node(-1);if(c.type!=e)return!1;if(0==o.parent.content.size&&o.node(-1).childCount==o.indexAfter(-1)){if(2==o.depth||o.node(-3).type!=e||o.index(-2)!=o.node(-2).childCount-1)return!1;if(n){for(var d=r.empty,l=o.index(-1)?1:o.index(-2)?2:3,p=o.depth-l;p>=o.depth-3;p--)d=r.from(o.node(p).copy(d));var h=o.indexAfter(-1)<o.node(-2).childCount?1:o.indexAfter(-2)<o.node(-3).childCount?2:3;d=d.append(r.from(e.createAndFill()));var f=o.before(o.depth-(l-1)),b=t.tr.replace(f,o.after(-h),new u(d,4-l,0)),m=-1;b.doc.nodesBetween(f,b.doc.content.size,(function(e,t){if(m>-1)return!1;e.isTextblock&&0==e.content.size&&(m=t+1)})),m>-1&&b.setSelection(t.selection.constructor.near(b.doc.resolve(m))),n(b.scrollIntoView())}return!0}var g=a.pos==o.end()?c.contentMatchAt(0).defaultType:null,v=t.tr.delete(o.pos,a.pos),y=g&&[null,{type:g}];return!!Pe(v.doc,o.pos,2,y)&&(n&&n(v.split(o.pos,2,y).scrollIntoView()),!0)}}function Rn(e){return function(t,n){var i=t.selection,o=i.$from,a=i.$to,s=o.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));return!!s&&(!n||(o.node(s.depth-1).type==e?function(e,t,n,i){var o=e.tr,a=i.end,s=i.$to.end(i.depth);a<s&&(o.step(new xe(a-1,s,a,s,new u(r.from(n.create(null,i.parent.copy())),1,0),1,!0)),i=new S(o.doc.resolve(i.$from.pos),o.doc.resolve(s),i.depth));return t(o.lift(i,Te(i)).scrollIntoView()),!0}(t,n,e,s):function(e,t,n){for(var i=e.tr,o=n.parent,a=n.end,s=n.endIndex-1,c=n.startIndex;s>c;s--)a-=o.child(s).nodeSize,i.delete(a-1,a+1);var d=i.doc.resolve(n.start),l=d.nodeAfter;if(i.mapping.map(n.end)!=n.start+d.nodeAfter.nodeSize)return!1;var p=0==n.startIndex,h=n.endIndex==o.childCount,f=d.node(-1),b=d.index(-1);if(!f.canReplace(b+(p?0:1),b+1,l.content.append(h?r.empty:r.from(o))))return!1;var m=d.pos,g=m+l.nodeSize;return i.step(new xe(m-(p?1:0),g+(h?1:0),m+1,g-1,new u((p?r.empty:r.from(o.copy(r.empty))).append(h?r.empty:r.from(o.copy(r.empty))),p?0:1,h?0:1),p?0:1)),t(i.scrollIntoView()),!0}(t,n,s)))}}function Fn(e){return function(t,n){var i=t.selection,o=i.$from,a=i.$to,s=o.blockRange(a,(function(t){return t.childCount&&t.firstChild.type==e}));if(!s)return!1;var c=s.startIndex;if(0==c)return!1;var d=s.parent,l=d.child(c-1);if(l.type!=e)return!1;if(n){var p=l.lastChild&&l.lastChild.type==d.type,h=r.from(p?e.create():null),f=new u(r.from(e.create(null,r.from(d.type.create(null,h)))),p?3:1,0),b=s.start,m=s.end;n(t.tr.step(new xe(b-(p?3:1),m,b,m,f,1,!0)).scrollIntoView())}return!0}}var Nn={orderedList:"ordered_list",bulletList:"bullet_list",listItem:"list_item"},Ln={listType:Nn.orderedList,types:At.__assign({},Nn)},Vn={listType:Nn.bulletList,types:At.__assign({},Nn)},Hn={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:At.__assign({},Nn)},Kn={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:At.__assign({},Nn)};function $n(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)}function Wn(e,t,n){var i=e.selection.$cursor;if(!i||(n?!n.endOfTextblock("backward",e):i.parentOffset>0))return!1;var o=Zn(i);if(!o){var r=i.blockRange(),a=r&&Te(r);return null!=a&&(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&li(e,o,t))return!0;if(0==i.parent.content.size&&(Un(s,"end")||rt.isSelectable(s))){var c=He(e.doc,i.before(),i.after(),u.empty);if(c.slice.size<c.to-c.from){if(t){var d=e.tr.step(c);d.setSelection(Un(s,"end")?et.findFrom(d.doc.resolve(d.mapping.map(o.pos,-1)),-1):rt.create(d.doc,o.pos-s.nodeSize)),t(d.scrollIntoView())}return!0}}return!(!s.isAtom||o.depth!=i.depth-1)&&(t&&t(e.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0)}function Un(e,t,n){for(;e;e="start"==t?e.firstChild:e.lastChild){if(e.isTextblock)return!0;if(n&&1!=e.childCount)return!1}return!1}function Gn(e,t,n){var i=e.selection,o=i.$head,r=o;if(!i.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;r=Zn(o)}var a=r&&r.nodeBefore;return!(!a||!rt.isSelectable(a))&&(t&&t(e.tr.setSelection(rt.create(e.doc,r.pos-a.nodeSize)).scrollIntoView()),!0)}function Zn(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function qn(e,t,n){var i=e.selection.$cursor;if(!i||(n?!n.endOfTextblock("forward",e):i.parentOffset<i.parent.content.size))return!1;var o=Xn(i);if(!o)return!1;var r=o.nodeAfter;if(li(e,o,t))return!0;if(0==i.parent.content.size&&(Un(r,"start")||rt.isSelectable(r))){var a=He(e.doc,i.before(),i.after(),u.empty);if(a.slice.size<a.to-a.from){if(t){var s=e.tr.step(a);s.setSelection(Un(r,"start")?et.findFrom(s.doc.resolve(s.mapping.map(o.pos)),1):rt.create(s.doc,s.mapping.map(o.pos))),t(s.scrollIntoView())}return!0}}return!(!r.isAtom||o.depth!=i.depth-1)&&(t&&t(e.tr.delete(o.pos,o.pos+r.nodeSize).scrollIntoView()),!0)}function Jn(e,t,n){var i=e.selection,o=i.$head,r=o;if(!i.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;r=Xn(o)}var a=r&&r.nodeAfter;return!(!a||!rt.isSelectable(a))&&(t&&t(e.tr.setSelection(rt.create(e.doc,r.pos)).scrollIntoView()),!0)}function Xn(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){var n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function Yn(e,t){var n,i=e.selection,o=i instanceof rt;if(o){if(i.node.isTextblock||!Ae(e.doc,i.from))return!1;n=i.from}else if(null==(n=ze(e.doc,i.from,-1)))return!1;if(t){var r=e.tr.join(n);o&&r.setSelection(rt.create(r.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(r.scrollIntoView())}return!0}function Qn(e,t){var n,i=e.selection;if(i instanceof rt){if(i.node.isTextblock||!Ae(e.doc,i.to))return!1;n=i.to}else if(null==(n=ze(e.doc,i.to,1)))return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0}function ei(e,t){var n=e.selection,i=n.$from,o=n.$to,r=i.blockRange(o),a=r&&Te(r);return null!=a&&(t&&t(e.tr.lift(r,a).scrollIntoView()),!0)}function ti(e,t){var n=e.selection,i=n.$head,o=n.$anchor;return!(!i.parent.type.spec.code||!i.sameParent(o))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}function ni(e){for(var t=0;t<e.edgeCount;t++){var n=e.edge(t).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function ii(e,t){var n=e.selection,i=n.$head,o=n.$anchor;if(!i.parent.type.spec.code||!i.sameParent(o))return!1;var r=i.node(-1),a=i.indexAfter(-1),s=ni(r.contentMatchAt(a));if(!r.canReplaceWith(a,a,s))return!1;if(t){var c=i.after(),d=e.tr.replaceWith(c,c,s.createAndFill());d.setSelection(et.near(d.doc.resolve(c),1)),t(d.scrollIntoView())}return!0}function oi(e,t){var n=e.selection,i=n.$from,o=n.$to;if(n instanceof st||i.parent.inlineContent||o.parent.inlineContent)return!1;var r=ni(o.parent.contentMatchAt(o.indexAfter()));if(!r||!r.isTextblock)return!1;if(t){var a=(!i.parentOffset&&o.index()<o.parent.childCount?i:o).pos,s=e.tr.insert(a,r.createAndFill());s.setSelection(it.create(s.doc,a+1)),t(s.scrollIntoView())}return!0}function ri(e,t){var n=e.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var i=n.before();if(Pe(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}var o=n.blockRange(),r=o&&Te(o);return null!=r&&(t&&t(e.tr.lift(o,r).scrollIntoView()),!0)}function ai(e,t){var n=e.selection,i=n.$from,o=n.$to;if(e.selection instanceof rt&&e.selection.node.isBlock)return!(!i.parentOffset||!Pe(e.doc,i.pos))&&(t&&t(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.parent.isBlock)return!1;if(t){var r=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof it||e.selection instanceof st)&&a.deleteSelection();var s=0==i.depth?null:ni(i.node(-1).contentMatchAt(i.indexAfter(-1))),c=r&&s?[{type:s}]:null,d=Pe(a.doc,a.mapping.map(i.pos),1,c);if(c||d||!Pe(a.doc,a.mapping.map(i.pos),1,s&&[{type:s}])||(c=[{type:s}],d=!0),d&&(a.split(a.mapping.map(i.pos),1,c),!r&&!i.parentOffset&&i.parent.type!=s)){var l=a.mapping.map(i.before()),p=a.doc.resolve(l);i.node(-1).canReplaceWith(p.index(),p.index()+1,s)&&a.setNodeMarkup(a.mapping.map(i.before()),s)}t(a.scrollIntoView())}return!0}function si(e,t){return ai(e,t&&function(n){var i=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();i&&n.ensureMarks(i),t(n)})}function ci(e,t){var n,i=e.selection,o=i.$from,r=i.to,a=o.sharedDepth(r);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(rt.create(e.doc,n))),!0)}function di(e,t){return t&&t(e.tr.setSelection(new st(e.doc))),!0}function li(e,t,n){var i,o,a=t.nodeBefore,s=t.nodeAfter;if(a.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){var i=t.nodeBefore,o=t.nodeAfter,r=t.index();return!!(i&&o&&i.type.compatibleContent(o.type))&&(!i.content.size&&t.parent.canReplace(r-1,r)?(n&&n(e.tr.delete(t.pos-i.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(r,r+1)||!o.isTextblock&&!Ae(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,i.type,i.contentMatchAt(i.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var c=t.parent.canReplace(t.index(),t.index()+1);if(c&&(i=(o=a.contentMatchAt(a.childCount)).findWrapping(s.type))&&o.matchType(i[0]||s.type).validEnd){if(n){for(var d=t.pos+s.nodeSize,l=r.empty,p=i.length-1;p>=0;p--)l=r.from(i[p].create(null,l));l=r.from(a.copy(l));var h=e.tr.step(new xe(t.pos-1,d,t.pos,d,new u(l,1,0),i.length,!0)),f=d+2*i.length;Ae(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var b=et.findFrom(t,1),m=b&&b.$from.blockRange(b.$to),g=m&&Te(m);if(null!=g&&g>=t.depth)return n&&n(e.tr.lift(m,g).scrollIntoView()),!0;if(c&&Un(s,"start",!0)&&Un(a,"end")){for(var v=a,y=[];y.push(v),!v.isTextblock;)v=v.lastChild;for(var _=s,O=1;!_.isTextblock;_=_.firstChild)O++;if(v.canReplace(v.childCount,v.childCount,_.content)){if(n){for(var j=r.empty,C=y.length-1;C>=0;C--)j=r.from(y[C].copy(j));n(e.tr.step(new xe(t.pos-y.length,t.pos+s.nodeSize,t.pos+O,t.pos+s.nodeSize-O,new u(j,y.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pi(e){return function(t,n){for(var i=t.selection,o=e<0?i.$from:i.$to,r=o.depth;o.node(r).isInline;){if(!r)return!1;r--}return!!o.node(r).isTextblock&&(n&&n(t.tr.setSelection(it.create(t.doc,e<0?o.start(r):o.end(r)))),!0)}}var ui=pi(-1),hi=pi(1);function fi(e,t){return function(n,i){var o=n.selection,r=o.$from,a=o.$to,s=r.blockRange(a),c=s&&De(s,e,t);return!!c&&(i&&i(n.tr.wrap(s,c).scrollIntoView()),!0)}}function bi(e,t){return function(n,i){var o=n.selection,r=o.from,a=o.to,s=!1;return n.doc.nodesBetween(r,a,(function(i,o){if(s)return!1;if(i.isTextblock&&!i.hasMarkup(e,t))if(i.type==e)s=!0;else{var r=n.doc.resolve(o),a=r.index();s=r.parent.canReplaceWith(a,a+1,e)}})),!!s&&(i&&i(n.tr.setBlockType(r,a,e,t).scrollIntoView()),!0)}}function mi(e,t){return function(n,i){var o=n.selection,r=o.empty,a=o.$cursor,s=o.ranges;if(r&&!a||!function(e,t,n){for(var i=function(i){var o=t[i],r=o.$from,a=o.$to,s=0==r.depth&&e.type.allowsMarkType(n);if(e.nodesBetween(r.pos,a.pos,(function(e){if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return{v:!0}},o=0;o<t.length;o++){var r=i(o);if(r)return r.v}return!1}(n.doc,s,e))return!1;if(i)if(a)e.isInSet(n.storedMarks||a.marks())?i(n.tr.removeStoredMark(e)):i(n.tr.addStoredMark(e.create(t)));else{for(var c=!1,d=n.tr,l=0;!c&&l<s.length;l++){var p=s[l],u=p.$from,h=p.$to;c=n.doc.rangeHasMark(u.pos,h.pos,e)}for(var f=0;f<s.length;f++){var b=s[f],m=b.$from,g=b.$to;if(c)d.removeMark(m.pos,g.pos,e);else{var v=m.pos,y=g.pos,_=m.nodeAfter,O=g.nodeBefore,j=_&&_.isText?/^\s*/.exec(_.text)[0].length:0,C=O&&O.isText?/\s*$/.exec(O.text)[0].length:0;v+j<y&&(v+=j,y-=C),d.addMark(v,y,e.create(t))}}i(d.scrollIntoView())}return!0}}function gi(e,t){if(Array.isArray(t)){var n=t;t=function(e){return n.indexOf(e.type.name)>-1}}return function(n,i,o){return e(n,i&&function(e,t){return function(n){if(!n.isGeneric)return e(n);for(var i=[],o=0;o<n.mapping.maps.length;o++){for(var r=n.mapping.maps[o],a=0;a<i.length;a++)i[a]=r.map(i[a]);r.forEach((function(e,t,n,o){return i.push(n,o)}))}for(var s=[],c=0;c<i.length;c+=2)for(var d=i[c],l=i[c+1],p=n.doc.resolve(d),u=p.sharedDepth(l),h=p.node(u),f=p.indexAfter(u),b=p.after(u+1);b<=l;++f){var m=h.maybeChild(f);if(!m)break;if(f&&-1==s.indexOf(b)){var g=h.child(f-1);g.type==m.type&&t(g,m)&&s.push(b)}b+=m.nodeSize}s.sort((function(e,t){return e-t}));for(var v=s.length-1;v>=0;v--)Ae(n.doc,s[v])&&n.join(s[v]);e(n)}}(i,t),o)}}function vi(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(t,n,i){for(var o=0;o<e.length;o++)if(e[o](t,n,i))return!0;return!1}}var yi=vi($n,Wn,Gn),_i=vi($n,qn,Jn),Oi={Enter:vi(ti,oi,ri,ai),"Mod-Enter":ii,Backspace:yi,"Mod-Backspace":yi,"Shift-Backspace":yi,Delete:_i,"Mod-Delete":_i,"Mod-a":di},ji={"Ctrl-h":Oi.Backspace,"Alt-Backspace":Oi["Mod-Backspace"],"Ctrl-d":Oi.Delete,"Ctrl-Alt-Backspace":Oi["Mod-Delete"],"Alt-Delete":Oi["Mod-Delete"],"Alt-d":Oi["Mod-Delete"],"Ctrl-a":ui,"Ctrl-e":hi};for(var Ci in Oi)ji[Ci]=Oi[Ci];Oi.Home=ui,Oi.End=hi;var ki=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?ji:Oi,wi=function(e,t){return fi(e.schema.nodes.blockquote)(e,t)},Si=function(e,t){var n=e.selection,i=n.$from,o=n.$to,r=e.schema.nodes.blockquote,a=e.doc,s=-1,c=i.blockRange(o);c&&a.nodesBetween(c.start,c.end,(function(e,t,n,i){e.type===r&&(s=t)}));var d=-1!==s;return t&&d&&t(e.tr.lift(c,a.resolve(s).depth)),d},xi=function(e,t,n){return function(i,o){var r=mn(i),a=i.tr;a.setMeta("commandName",t),r.forEach((function(t){if(t.type.isTextblock){var i=void 0,o=e.find((function(e){return e.node===t.type.name}));if(o){var r="rtl"===n?o.rtlStyle:o.style,s={name:r,value:o.step>0?""+o.step+o.unit:""};if(t.attrs.style){var c=new RegExp(r+":\\s?(\\d+)"+o.unit,"i"),d=t.attrs.style.match(c);if(d){var l=parseFloat(d[1])+o.step;l=l<=0?"":l,s.value=""+l+(l?o.unit:"")}}i=_n(t,[s])}i&&bn(a,t,t.type,i)}}));var s=a.docChanged;return s&&o(a.scrollIntoView()),s}},Ei=function(e,t,n){var i=mn(e),o=!1;return i.forEach((function(e){if(!o&&e.type.isTextblock&&e.attrs.style){var i=t.find((function(t){return t.node===e.type.name}));if(i){var r="rtl"===n?i.rtlStyle:i.style,a=new RegExp(r+":\\s?\\d+"+i.unit,"i");o=a.test(e.attrs.style)}}})),o},Ii=function(e,t){return Fn(t)(e)},Ti=function(e,t){var n=e.schema.nodes[t.listsTypes.listItem],i=e.schema.nodes[t.listsTypes.orderedList],o=e.schema.nodes[t.listsTypes.bulletList],r=!!Ft(i,2)(e.selection),a=!!Ft(o,2)(e.selection);return(r||a)&&Rn(n)(e)},Di=function(e,t){var n=e.schema.nodes,i=n[Hn.listsTypes.listItem];return(Ei(e,t.nodes)||Hn.nodes.some((function(t){return n[t.node]&&On(e,n[t.node])})))&&!On(e,i)},Bi=function(e,t){var n=e.schema.nodes[Hn.listsTypes.listItem],i=Di(e,Hn);Ii(e,n)?Fn(n)(e,t):i&&xi(Hn.nodes)(e,t)},Pi=function(e,t){var n=e.schema.nodes,i=n[Kn.listsTypes.listItem],o=Di(e,Kn);On(e,n.blockquote)?Si(e,t):Ti(e,Kn)?Rn(i)(e,t):o&&xi(Kn.nodes)(e,t)},Ai=function(e,t,n){for(var i=t.depth,o=e.nodes[n.bulletList],r=e.nodes[n.orderedList],a=e.nodes[n.listItem],s=t.depth;s>0;s--){var c=t.node(s);if(c.type!==o&&c.type!==r||(i=s),c.type!==o&&c.type!==r&&c.type!==a)break}return i-1};function Mi(e){return function(t,n,i){if(!i)return!1;var o=(t=i.state).schema.nodes[e.listType],r=t.selection,a=r.$from,s=r.$to,c=a.node(-2),d=a.node(-3),l=function(e,t,n,i){return 0===function(e,t,n){var i=Array(),o=function(e,t){var n=["blockquote","bulletList","orderedList"];if(1===t.depth)return t;var i=t.node(t.depth),o=t;for(;t.depth>=1;)t=e.resolve(t.before(t.depth)),(i=t.node(t.depth))&&-1!==n.indexOf(i.type.name)&&(o=t);return o}(e,t).depth,r=e.resolve(t.start(o));for(;r.pos<=n.start(n.depth);){var a=Math.min(r.depth,o),s=r.node(a);if(s&&i.push(s),0===a)break;var c=e.resolve(r.after(a));if(c.start(a)>=e.nodeSize-2)break;c.depth!==r.depth&&(c=e.resolve(c.pos+2)),r=c.depth?e.resolve(c.start(c.depth)):e.resolve(c.end(c.depth))}return i}(e,t,n).filter((function(e){return e.type!==i})).length}(t.doc,a,s,o);return(c&&c.type===o||d&&d.type===o)&&l?Ri(e)(t,n):(l||(Ri(e)(t,n),t=i.state),function(e,t){void 0===t&&(t={});return gi(Mn(e,t),(function(t,n){return t.type===n.type&&t.type===e}))}(o,e.listAttrs)(t,n))}}function zi(e,t,n,i){var o=i||e.schema.nodes.listItem,a=t.$from,s=t.$to,c=a.blockRange(s,(function(e){return e.childCount&&e.firstChild.type===o}));if(!c||c.depth<2||a.node(c.depth-1).type!==o)return n;var d=c.end,l=s.end(c.depth);return d<l&&(n.step(new xe(d-1,l,d,l,new u(r.from(o.create(void 0,c.parent.copy())),1,0),1,!0)),c=new S(n.doc.resolve(a.pos),n.doc.resolve(l),c.depth)),n.lift(c,Te(c)).scrollIntoView()}function Ri(e){return function(t,n){var i=t.tr,o=t.selection,r=o.$from,a=o.$to;return i.doc.nodesBetween(r.pos,a.pos,(function(n,o){if(n.isTextblock||"blockquote"===n.type.name||"div"===n.type.name){var r=new rt(i.doc.resolve(i.mapping.map(o))),a=r.$from.blockRange(r.$to);if(!a||r.$from.parent.type!==t.schema.nodes[e.listItem])return!1;var s=a&&Te(a);if(null==s)return!1;i.lift(a,s)}})),n&&n(i),!0}}var Fi=/list\-style\-type:\s?([\w-]+)/,Ni=function(e){var t=e.style||"",n=Fi.exec(t);return n&&n[1]||""},Li=function(e,t,n,i,o){var r=i.listType,a=i.listAttrs,s=void 0===a?{style:null}:a,c=e.selection,d=c.$from.node(c.$from.depth-2),l=c.$to.node(c.$to.depth-2);if(d&&d.type.name===r&&Ni(d.attrs)===Ni(s)&&l&&l.type.name===r&&Ni(l.attrs)===Ni(s)){var p=n.state.schema.nodes,u={bulletList:p[i.bulletList],orderedList:p[i.orderedList],listItem:p[i.listItem]},h=function(e,t){for(var n,i=t.bulletList,o=t.orderedList,r=t.listItem,a=e.depth-1;a>0;a--){var s=e.node(a);if(s.type!==i&&s.type!==o||(n=a),s.type!==i&&s.type!==o&&s.type!==r)break}return n}(c.$to,u),f=function(e,t,n,i,o,r){r||(r=e.schema.nodes.listItem);var a=!1;return o.doc.nodesBetween(t,n,(function(n,s){if(!a&&n.type===r&&s>t){a=!0;for(var c=i+3;c>i+2;){var d=o.doc.resolve(o.mapping.map(s));c=d.depth;var l=o.doc.resolve(o.mapping.map(s+n.textContent.length)),p=new it(d,l);o=zi(e,p,o,r)}}})),o}(e,c.$to.pos,c.$to.end(h),h,n.state.tr,u.listItem);return(f=function(e,t,n){var i=e.selection,o=i.from,r=i.to,a=e.schema.nodes,s=a.paragraph,c=a.heading,d=[];t.doc.nodesBetween(o,r,(function(e,t){e.type!==s&&e.type!==c||d.push({node:e,pos:t})}));for(var l=d.length-1;l>=0;l--){var p=d[l],u=t.doc.resolve(t.mapping.map(p.pos));if(u.depth>0){var h=void 0;h=p.node.textContent&&p.node.textContent.length>0?t.doc.resolve(t.mapping.map(p.pos+p.node.textContent.length)):t.doc.resolve(t.mapping.map(p.pos+1));var f=u.blockRange(h);f&&t.lift(f,Ai(e.schema,u,n))}}return t}(e,f,i)).setMeta("commandName",o),t(f),!0}return Mi(i)(e,t,n)};function Vi(e,t,n){return Li(e,t,n,At.__assign({listType:Vn.listType},Vn.types))}function Hi(e,t,n){return Li(e,t,n,At.__assign({listType:Ln.listType},Ln.types))}for(var Ki=function(e,t){return{name:e,value:t}},$i=[{node:"paragraph",style:[Ki("text-align","left")]},{node:"heading",style:[Ki("text-align","left")]}],Wi=[{node:"paragraph",style:[Ki("text-align","right")]},{node:"heading",style:[Ki("text-align","right")]}],Ui=[{node:"paragraph",style:[Ki("text-align","center")]},{node:"heading",style:[Ki("text-align","center")]}],Gi=[{node:"paragraph",style:[Ki("text-align","justify")]},{node:"heading",style:[Ki("text-align","justify")]}],Zi=[{node:"paragraph",style:[Ki("text-align","")]},{node:"heading",style:[Ki("text-align","")]}],qi={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"},Ji={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"},Xi="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Yi="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Qi="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),eo="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),to="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),no=Xi&&(eo||+Xi[1]<57)||Qi&&eo,io=0;io<10;io++)qi[48+io]=qi[96+io]=String(io);for(io=1;io<=24;io++)qi[io+111]="F"+io;for(io=65;io<=90;io++)qi[io]=String.fromCharCode(io+32),Ji[io]=String.fromCharCode(io);for(var oo in qi)Ji.hasOwnProperty(oo)||(Ji[oo]=qi[oo]);var ro="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function ao(e){var t,n,i,o,r=e.split(/-(?!$)/),a=r[r.length-1];"Space"==a&&(a=" ");for(var s=0;s<r.length-1;s++){var c=r[s];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))t=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))i=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);ro?o=!0:n=!0}}return t&&(a="Alt-"+a),n&&(a="Ctrl-"+a),o&&(a="Meta-"+a),i&&(a="Shift-"+a),a}function so(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}function co(e){return new yt({props:{handleKeyDown:lo(e)}})}function lo(e){var t=function(e){var t=Object.create(null);for(var n in e)t[ao(n)]=e[n];return t}(e);return function(e,n){var i,o=function(e){var t=!(no&&(e.ctrlKey||e.altKey||e.metaKey)||(Yi||to)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Ji:qi)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),r=1==o.length&&" "!=o,a=t[so(o,n,!r)];if(a&&a(e.state,e.dispatch,e))return!0;if(r&&(n.shiftKey||n.altKey||n.metaKey||o.charCodeAt(0)>127)&&(i=qi[n.keyCode])&&i!=o){var s=t[so(i,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(r&&n.shiftKey){var c=t[so(o,n,!0)];if(c&&c(e.state,e.dispatch,e))return!0}return!1}}var po={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var uo=/Edge\/(\d+)/.exec(navigator.userAgent),ho=/MSIE \d/.test(navigator.userAgent),fo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),bo=po.ie=!!(ho||fo||uo);po.ie_version=ho?document.documentMode||6:fo?+fo[1]:uo?+uo[1]:null,po.gecko=!bo&&/gecko\/(\d+)/i.test(navigator.userAgent),po.gecko_version=po.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var mo=!bo&&/Chrome\/(\d+)/.exec(navigator.userAgent);po.chrome=!!mo,po.chrome_version=mo&&+mo[1],po.safari=!bo&&/Apple Computer/.test(navigator.vendor),po.ios=po.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),po.mac=po.ios||/Mac/.test(navigator.platform),po.android=/Android \d/.test(navigator.userAgent),po.webkit="webkitFontSmoothing"in document.documentElement.style,po.webkit_version=po.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var go=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},vo=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},yo=null,_o=function(e,t,n){var i=yo||(yo=document.createRange());return i.setEnd(e,null==n?e.nodeValue.length:n),i.setStart(e,t||0),i},Oo=function(e,t,n,i){return n&&(Co(e,t,n,i,-1)||Co(e,t,n,i,1))},jo=/^(img|br|input|textarea|hr)$/i;function Co(e,t,n,i,o){for(;;){if(e==n&&t==i)return!0;if(t==(o<0?0:ko(e))){var r=e.parentNode;if(1!=r.nodeType||wo(e)||jo.test(e.nodeName)||"false"==e.contentEditable)return!1;t=go(e)+(o<0?0:1),e=r}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?ko(e):0}}}function ko(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function wo(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var So=function(e){var t=e.isCollapsed;return t&&po.chrome&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function xo(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Eo(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Io(e,t){return"number"==typeof e?e:e[t]}function To(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,i=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*i}}function Do(e,t,n){for(var i=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,r=e.dom.ownerDocument,a=n||e.dom;a;a=vo(a))if(1==a.nodeType){var s=a==r.body||1!=a.nodeType,c=s?Eo(r):To(a),d=0,l=0;if(t.top<c.top+Io(i,"top")?l=-(c.top-t.top+Io(o,"top")):t.bottom>c.bottom-Io(i,"bottom")&&(l=t.bottom-c.bottom+Io(o,"bottom")),t.left<c.left+Io(i,"left")?d=-(c.left-t.left+Io(o,"left")):t.right>c.right-Io(i,"right")&&(d=t.right-c.right+Io(o,"right")),d||l)if(s)r.defaultView.scrollBy(d,l);else{var p=a.scrollLeft,u=a.scrollTop;l&&(a.scrollTop+=l),d&&(a.scrollLeft+=d);var h=a.scrollLeft-p,f=a.scrollTop-u;t={left:t.left-h,top:t.top-f,right:t.right-h,bottom:t.bottom-f}}if(s)break}}function Bo(e){for(var t=[],n=e.ownerDocument;e&&(t.push({dom:e,top:e.scrollTop,left:e.scrollLeft}),e!=n);e=vo(e));return t}function Po(e,t){for(var n=0;n<e.length;n++){var i=e[n],o=i.dom,r=i.top,a=i.left;o.scrollTop!=r+t&&(o.scrollTop=r+t),o.scrollLeft!=a&&(o.scrollLeft=a)}}var Ao=null;function Mo(e,t){for(var n,i,o=2e8,r=0,a=t.top,s=t.top,c=e.firstChild,d=0;c;c=c.nextSibling,d++){var l=void 0;if(1==c.nodeType)l=c.getClientRects();else{if(3!=c.nodeType)continue;l=_o(c).getClientRects()}for(var p=0;p<l.length;p++){var u=l[p];if(u.top<=a&&u.bottom>=s){a=Math.max(u.bottom,a),s=Math.min(u.top,s);var h=u.left>t.left?u.left-t.left:u.right<t.left?t.left-u.right:0;if(h<o){n=c,o=h,i=h&&3==n.nodeType?{left:u.right<t.left?u.right:u.left,top:t.top}:t,1==c.nodeType&&h&&(r=d+(t.left>=(u.left+u.right)/2?1:0));continue}}!n&&(t.left>=u.right&&t.top>=u.top||t.left>=u.left&&t.top>=u.bottom)&&(r=d+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,i=document.createRange(),o=0;o<n;o++){i.setEnd(e,o+1),i.setStart(e,o);var r=Fo(i,1);if(r.top!=r.bottom&&zo(t,r))return{node:e,offset:o+(t.left>=(r.left+r.right)/2?1:0)}}return{node:e,offset:0}}(n,i):!n||o&&1==n.nodeType?{node:e,offset:r}:Mo(n,i)}function zo(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Ro(e,t){var n,i,o,r,a=e.dom.ownerDocument;if(a.caretPositionFromPoint)try{var s=a.caretPositionFromPoint(t.left,t.top);s&&(o=(n=s).offsetNode,r=n.offset)}catch(e){}if(!o&&a.caretRangeFromPoint){var c=a.caretRangeFromPoint(t.left,t.top);c&&(o=(i=c).startContainer,r=i.startOffset)}var d,l=(e.root.elementFromPoint?e.root:a).elementFromPoint(t.left,t.top+1);if(!l||!e.dom.contains(1!=l.nodeType?l.parentNode:l)){var p=e.dom.getBoundingClientRect();if(!zo(t,p))return null;if(!(l=function e(t,n,i){var o=t.childNodes.length;if(o&&i.top<i.bottom)for(var r=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-i.top)/(i.bottom-i.top))-2)),a=r;;){var s=t.childNodes[a];if(1==s.nodeType)for(var c=s.getClientRects(),d=0;d<c.length;d++){var l=c[d];if(zo(n,l))return e(s,n,l)}if((a=(a+1)%o)==r)break}return t}(e.dom,t,p)))return null}if(po.safari)for(var u=l;o&&u;u=vo(u))u.draggable&&(o=r=null);if(l=function(e,t){var n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(l,t),o){if(po.gecko&&1==o.nodeType&&(r=Math.min(r,o.childNodes.length))<o.childNodes.length){var h,f=o.childNodes[r];"IMG"==f.nodeName&&(h=f.getBoundingClientRect()).right<=t.left&&h.bottom>t.top&&r++}o==e.dom&&r==o.childNodes.length-1&&1==o.lastChild.nodeType&&t.top>o.lastChild.getBoundingClientRect().bottom?d=e.state.doc.content.size:0!=r&&1==o.nodeType&&"BR"==o.childNodes[r-1].nodeName||(d=function(e,t,n,i){for(var o=-1,r=t;r!=e.dom;){var a=e.docView.nearestDesc(r,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>i.left||s.top>i.top)o=a.posBefore;else{if(!(s.right<i.left||s.bottom<i.top))break;o=a.posAfter}}r=a.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n)}(e,o,r,t))}null==d&&(d=function(e,t,n){var i=Mo(t,n),o=i.node,r=i.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,r,a)}(e,l,t));var b=e.docView.nearestDesc(l,!0);return{pos:d,inside:b?b.posAtStart-b.border:-1}}function Fo(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var No=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Lo(e,t,n){var i=e.docView.domFromPos(t,n<0?-1:1),o=i.node,r=i.offset,a=po.webkit||po.gecko;if(3==o.nodeType){if(!a||!No.test(o.nodeValue)&&(n<0?r:r!=o.nodeValue.length)){var s=r,c=r,d=n<0?1:-1;return n<0&&!r?(c++,d=-1):n>=0&&r==o.nodeValue.length?(s--,d=1):n<0?s--:c++,Vo(Fo(_o(o,s,c),d),d<0)}var l=Fo(_o(o,r,r),n);if(po.gecko&&r&&/\s/.test(o.nodeValue[r-1])&&r<o.nodeValue.length){var p=Fo(_o(o,r-1,r-1),-1);if(p.top==l.top){var u=Fo(_o(o,r,r+1),-1);if(u.top!=l.top)return Vo(u,u.left<p.left)}}return l}if(!e.state.doc.resolve(t).parent.inlineContent){if(r&&(n<0||r==ko(o))){var h=o.childNodes[r-1];if(1==h.nodeType)return Ho(h.getBoundingClientRect(),!1)}if(r<ko(o)){var f=o.childNodes[r];if(1==f.nodeType)return Ho(f.getBoundingClientRect(),!0)}return Ho(o.getBoundingClientRect(),n>=0)}if(r&&(n<0||r==ko(o))){var b=o.childNodes[r-1],m=3==b.nodeType?_o(b,ko(b)-(a?0:1)):1!=b.nodeType||"BR"==b.nodeName&&b.nextSibling?null:b;if(m)return Vo(Fo(m,1),!1)}if(r<ko(o)){for(var g=o.childNodes[r];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var v=g?3==g.nodeType?_o(g,0,a?0:1):1==g.nodeType?g:null:null;if(v)return Vo(Fo(v,-1),!0)}return Vo(Fo(3==o.nodeType?_o(o):o,-n),n>=0)}function Vo(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ho(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Ko(e,t,n){var i=e.state,o=e.root.activeElement;i!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{i!=t&&e.updateState(i),o!=e.dom&&o&&o.focus()}}var $o=/[\u0590-\u08ac]/;var Wo=null,Uo=null,Go=!1;function Zo(e,t,n){return Wo==t&&Uo==n?Go:(Wo=t,Uo=n,Go="up"==n||"down"==n?function(e,t,n){var i=t.selection,o="up"==n?i.$from:i.$to;return Ko(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var i=e.docView.nearestDesc(t,!0);if(!i)break;if(i.node.isBlock){t=i.dom;break}t=i.dom.parentNode}for(var r=Lo(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=_o(a,0,a.nodeValue.length).getClientRects()}for(var c=0;c<s.length;c++){var d=s[c];if(d.bottom>d.top+1&&("up"==n?r.top-d.top>2*(d.bottom-r.top):d.bottom-r.bottom>2*(r.bottom-d.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var i=t.selection.$head;if(!i.parent.isTextblock)return!1;var o=i.parentOffset,r=!o,a=o==i.parent.content.size,s=e.root.getSelection();return $o.test(i.parent.textContent)&&s.modify?Ko(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,r=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var c=!(i.depth?e.docView.domAfterPos(i.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&r==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),c})):"left"==n||"backward"==n?r:a}(e,t,n))}var qo=function(e,t,n,i){this.parent=e,this.children=t,this.dom=n,n.pmViewDesc=this,this.contentDOM=i,this.dirty=0},Jo={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}};qo.prototype.matchesWidget=function(){return!1},qo.prototype.matchesMark=function(){return!1},qo.prototype.matchesNode=function(){return!1},qo.prototype.matchesHack=function(e){return!1},qo.prototype.parseRule=function(){return null},qo.prototype.stopEvent=function(){return!1},Jo.size.get=function(){for(var e=0,t=0;t<this.children.length;t++)e+=this.children[t].size;return e},Jo.border.get=function(){return 0},qo.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var e=0;e<this.children.length;e++)this.children[e].destroy()},qo.prototype.posBeforeChild=function(e){for(var t=0,n=this.posAtStart;t<this.children.length;t++){var i=this.children[t];if(i==e)return n;n+=i.size}},Jo.posBefore.get=function(){return this.parent.posBeforeChild(this)},Jo.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Jo.posAfter.get=function(){return this.posBefore+this.size},Jo.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},qo.prototype.localPosFromDOM=function(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){var i,o;if(e==this.contentDOM)i=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&(!(o=i.pmViewDesc)||o.parent!=this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}var r,a;if(e==this.contentDOM)r=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;r=e.nextSibling}for(;r&&(!(a=r.pmViewDesc)||a.parent!=this);)r=r.nextSibling;return r?this.posBeforeChild(a):this.posAtEnd}var s;if(e==this.dom&&this.contentDOM)s=t>go(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var c=e;;c=c.parentNode){if(c==this.dom){s=!1;break}if(c.parentNode.firstChild!=c)break}if(null==s&&t==e.childNodes.length)for(var d=e;;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},qo.prototype.nearestDesc=function(e,t){for(var n=!0,i=e;i;i=i.parentNode){var o=this.getDesc(i);if(o&&(!t||o.node)){if(!n||!o.nodeDOM||(1==o.nodeDOM.nodeType?o.nodeDOM.contains(1==e.nodeType?e:e.parentNode):o.nodeDOM==e))return o;n=!1}}},qo.prototype.getDesc=function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t},qo.prototype.posFromDOM=function(e,t,n){for(var i=e;i;i=i.parentNode){var o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,n)}return-1},qo.prototype.descAt=function(e){for(var t=0,n=0;t<this.children.length;t++){var i=this.children[t],o=n+i.size;if(n==e&&o!=n){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-n-i.border);n=o}},qo.prototype.domFromPos=function(e,t){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,i=0,o=0;n<this.children.length;n++){var r=this.children[n],a=o+r.size;if(a>e||r instanceof or){i=e-o;break}o=a}if(i)return this.children[n].domFromPos(i-this.children[n].border,t);for(var s=void 0;n&&!(s=this.children[n-1]).size&&s instanceof Yo&&s.widget.type.side>=0;n--);if(t<=0){for(var c,d=!0;(c=n?this.children[n-1]:null)&&c.dom.parentNode!=this.contentDOM;n--,d=!1);return c&&t&&d&&!c.border&&!c.domAtom?c.domFromPos(c.size,t):{node:this.contentDOM,offset:c?go(c.dom)+1:0}}for(var l,p=!0;(l=n<this.children.length?this.children[n]:null)&&l.dom.parentNode!=this.contentDOM;n++,p=!1);return l&&p&&!l.border&&!l.domAtom?l.domFromPos(0,t):{node:this.contentDOM,offset:l?go(l.dom):this.contentDOM.childNodes.length}},qo.prototype.parseRange=function(e,t,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var i=-1,o=-1,r=n,a=0;;a++){var s=this.children[a],c=r+s.size;if(-1==i&&e<=c){var d=r+s.border;if(e>=d&&t<=c-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,d);e=r;for(var l=a;l>0;l--){var p=this.children[l-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=go(p.dom)+1;break}e-=p.size}-1==i&&(i=0)}if(i>-1&&(c>t||a==this.children.length-1)){t=c;for(var u=a+1;u<this.children.length;u++){var h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){o=go(h.dom);break}t+=h.size}-1==o&&(o=this.contentDOM.childNodes.length);break}r=c}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}},qo.prototype.emptyChildAt=function(e){if(this.border||!this.contentDOM||!this.children.length)return!1;var t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)},qo.prototype.domAfterPos=function(e){var t=this.domFromPos(e,0),n=t.node,i=t.offset;if(1!=n.nodeType||i==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[i]},qo.prototype.setSelection=function(e,t,n,i){for(var o=Math.min(e,t),r=Math.max(e,t),a=0,s=0;a<this.children.length;a++){var c=this.children[a],d=s+c.size;if(o>s&&r<d)return c.setSelection(e-s-c.border,t-s-c.border,n,i);s=d}var l=this.domFromPos(e,e?-1:1),p=t==e?l:this.domFromPos(t,t?-1:1),u=n.getSelection(),h=!1;if((po.gecko||po.safari)&&e==t){var f=l.node,b=l.offset;if(3==f.nodeType){if((h=b&&"\n"==f.nodeValue[b-1])&&b==f.nodeValue.length)for(var m=f,g=void 0;m;m=m.parentNode){if(g=m.nextSibling){"BR"==g.nodeName&&(l=p={node:g.parentNode,offset:go(g)+1});break}var v=m.pmViewDesc;if(v&&v.node&&v.node.isBlock)break}}else{var y=f.childNodes[b-1];h=y&&("BR"==y.nodeName||"false"==y.contentEditable)}}if(po.gecko&&u.focusNode&&u.focusNode!=p.node&&1==u.focusNode.nodeType){var _=u.focusNode.childNodes[u.focusOffset];_&&"false"==_.contentEditable&&(i=!0)}if(i||h&&po.safari||!Oo(l.node,l.offset,u.anchorNode,u.anchorOffset)||!Oo(p.node,p.offset,u.focusNode,u.focusOffset)){var O=!1;if((u.extend||e==t)&&!h){u.collapse(l.node,l.offset);try{e!=t&&u.extend(p.node,p.offset),O=!0}catch(e){if(!(e instanceof DOMException))throw e}}if(!O){if(e>t){var j=l;l=p,p=j}var C=document.createRange();C.setEnd(p.node,p.offset),C.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(C)}}},qo.prototype.ignoreMutation=function(e){return!this.contentDOM&&"selection"!=e.type},Jo.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},qo.prototype.markDirty=function(e,t){for(var n=0,i=0;i<this.children.length;i++){var o=this.children[i],r=n+o.size;if(n==r?e<=r&&t>=n:e<r&&t>n){var a=n+o.border,s=r-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==r?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=r}this.dirty=2},qo.prototype.markParentsDirty=function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty<n&&(t.dirty=n)}},Jo.domAtom.get=function(){return!1},Jo.ignoreForCoords.get=function(){return!1},Object.defineProperties(qo.prototype,Jo);var Xo=[],Yo=function(e){function t(t,n,i,o){var r,a=n.type.toDOM;if("function"==typeof a&&(a=a(i,(function(){return r?r.parent?r.parent.posBeforeChild(r):void 0:o}))),!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")}e.call(this,t,Xo,a,null),this.widget=n,r=this}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.matchesWidget=function(e){return 0==this.dirty&&e.type.eq(this.widget.type)},t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.stopEvent=function(e){var t=this.widget.spec.stopEvent;return!!t&&t(e)},t.prototype.ignoreMutation=function(e){return"selection"!=e.type||this.widget.spec.ignoreSelection},t.prototype.destroy=function(){this.widget.type.destroy(this.dom),e.prototype.destroy.call(this)},n.domAtom.get=function(){return!0},Object.defineProperties(t.prototype,n),t}(qo),Qo=function(e){function t(t,n,i,o){e.call(this,t,Xo,n,null),this.textDOM=i,this.text=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},t.prototype.localPosFromDOM=function(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t},t.prototype.domFromPos=function(e){return{node:this.textDOM,offset:e}},t.prototype.ignoreMutation=function(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue},Object.defineProperties(t.prototype,n),t}(qo),er=function(e){function t(t,n,i,o){e.call(this,t,[],i,o),this.mark=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.create=function(e,n,i,o){var r=o.nodeViews[n.type.name],a=r&&r(n,o,i);return a&&a.dom||(a=pe.renderSpec(document,n.type.spec.toDOM(n,i))),new t(e,n,a.dom,a.contentDOM||a.dom)},t.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}},t.prototype.matchesMark=function(e){return 3!=this.dirty&&this.mark.eq(e)},t.prototype.markDirty=function(t,n){if(e.prototype.markDirty.call(this,t,n),0!=this.dirty){for(var i=this.parent;!i.node;)i=i.parent;i.dirty<this.dirty&&(i.dirty=this.dirty),this.dirty=0}},t.prototype.slice=function(e,n,i){var o=t.create(this.parent,this.mark,!0,i),r=this.children,a=this.size;n<a&&(r=mr(r,n,a,i)),e>0&&(r=mr(r,0,e,i));for(var s=0;s<r.length;s++)r[s].parent=o;return o.children=r,o},t}(qo),tr=function(e){function t(t,n,i,o,r,a,s,c,d){e.call(this,t,n.isLeaf?Xo:[],r,a),this.nodeDOM=s,this.node=n,this.outerDeco=i,this.innerDeco=o,a&&this.updateChildren(c,d)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return t.create=function(e,n,i,o,r,a){var s,c,d=r.nodeViews[n.type.name],l=d&&d(n,r,(function(){return c?c.parent?c.parent.posBeforeChild(c):void 0:a}),i,o),p=l&&l.dom,u=l&&l.contentDOM;if(n.isText)if(p){if(3!=p.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else p=document.createTextNode(n.text);else p||(p=(s=pe.renderSpec(document,n.type.spec.toDOM(n))).dom,u=s.contentDOM);u||n.isText||"BR"==p.nodeName||(p.hasAttribute("contenteditable")||(p.contentEditable=!1),n.type.spec.draggable&&(p.draggable=!0));var h=p;return p=pr(p,i,n),l?c=new rr(e,n,i,o,p,u,h,l,r,a+1):n.isText?new ir(e,n,i,o,p,h,r):new t(e,n,i,o,p,u,h,r,a+1)},t.prototype.parseRule=function(){var e=this;if(this.node.type.spec.reparseInView)return null;var t={node:this.node.type.name,attrs:this.node.attrs};return"pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?t.contentElement=this.contentDOM:t.getContent=function(){return e.contentDOM?r.empty:e.node.content},t},t.prototype.matchesNode=function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ur(t,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},t.prototype.updateChildren=function(e,t){var n=this,i=this.node.inlineContent,o=t,r=e.composing&&this.localCompositionInfo(e,t),a=r&&r.pos>-1?r:null,s=r&&r.pos<0,c=new fr(this,a&&a.node);!function(e,t,n,i){var o=t.locals(e),r=0;if(0==o.length){for(var a=0;a<e.childCount;a++){var s=e.child(a);i(s,o,t.forChild(r,s),a),r+=s.nodeSize}return}for(var c=0,d=[],l=null,p=0;;){if(c<o.length&&o[c].to==r){for(var u=o[c++],h=void 0;c<o.length&&o[c].to==r;)(h||(h=[u])).push(o[c++]);if(h){h.sort(br);for(var f=0;f<h.length;f++)n(h[f],p,!!l)}else n(u,p,!!l)}var b=void 0,m=void 0;if(l)m=-1,b=l,l=null;else{if(!(p<e.childCount))break;m=p,b=e.child(p++)}for(var g=0;g<d.length;g++)d[g].to<=r&&d.splice(g--,1);for(;c<o.length&&o[c].from<=r&&o[c].to>r;)d.push(o[c++]);var v=r+b.nodeSize;if(b.isText){var y=v;c<o.length&&o[c].from<y&&(y=o[c].from);for(var _=0;_<d.length;_++)d[_].to<y&&(y=d[_].to);y<v&&(l=b.cut(y-r),b=b.cut(0,y-r),v=y,m=-1)}var O=d.length?b.isInline&&!b.isLeaf?d.filter((function(e){return!e.inline})):d.slice():Xo;i(b,O,t.forChild(r,b),m),r=v}}(this.node,this.innerDeco,(function(t,r,a){t.spec.marks?c.syncToMarks(t.spec.marks,i,e):t.type.side>=0&&!a&&c.syncToMarks(r==n.node.childCount?l.none:n.node.child(r).marks,i,e),c.placeWidget(t,e,o)}),(function(t,n,a,d){var l;c.syncToMarks(t.marks,i,e),c.findNodeMatch(t,n,a,d)||s&&e.state.selection.from>o&&e.state.selection.to<o+t.nodeSize&&(l=c.findIndexWithChild(r.node))>-1&&c.updateNodeAt(t,n,a,l,e)||c.updateNextNode(t,n,a,e,d)||c.addNode(t,n,a,e,o),o+=t.nodeSize})),c.syncToMarks(Xo,i,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),function e(t,n,i){for(var o=t.firstChild,r=!1,a=0;a<n.length;a++){var s=n[a],c=s.dom;if(c.parentNode==t){for(;c!=o;)o=hr(o),r=!0;o=o.nextSibling}else r=!0,t.insertBefore(c,o);if(s instanceof er){var d=o?o.previousSibling:t.lastChild;e(s.contentDOM,s.children,i),o=d?d.nextSibling:t.firstChild}}for(;o;)o=hr(o),r=!0;r&&i.trackWrites==t&&(i.trackWrites=null)}(this.contentDOM,this.children,e),po.ios&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))},t.prototype.localCompositionInfo=function(e,t){var n=e.state.selection,i=n.from,o=n.to;if(!(!(e.state.selection instanceof it)||i<t||o>t+this.node.content.size)){var r=e.root.getSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];e=e.childNodes[t-1],t=ko(e)}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(r.focusNode,r.focusOffset);if(a&&this.dom.contains(a.parentNode)){if(this.node.inlineContent){var s=a.nodeValue,c=function(e,t,n,i){for(var o=0,r=0;o<e.childCount&&r<=i;){var a=e.child(o++),s=r;if(r+=a.nodeSize,a.isText){for(var c=a.text;o<e.childCount;){var d=e.child(o++);if(r+=d.nodeSize,!d.isText)break;c+=d.text}if(r>=n&&s<i){var l=c.lastIndexOf(t,i-s-1);if(l>=0&&l+t.length+s>=n)return s+l}}}return-1}(this.node.content,s,i-t,o-t);return c<0?null:{node:a,pos:c,text:s}}return{node:a,pos:-1}}}},t.prototype.protectLocalComposition=function(e,t){var n=t.node,i=t.pos,o=t.text;if(!this.getDesc(n)){for(var r=n;r.parentNode!=this.contentDOM;r=r.parentNode){for(;r.previousSibling;)r.parentNode.removeChild(r.previousSibling);for(;r.nextSibling;)r.parentNode.removeChild(r.nextSibling);r.pmViewDesc&&(r.pmViewDesc=null)}var a=new Qo(this,r,n,o);e.compositionNodes.push(a),this.children=mr(this.children,i,i+o.length,e,a)}},t.prototype.update=function(e,t,n,i){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,i),!0)},t.prototype.updateInner=function(e,t,n,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0},t.prototype.updateOuterDeco=function(e){if(!ur(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=dr(this.dom,this.nodeDOM,cr(this.outerDeco,this.node,t),cr(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=e}},t.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},t.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(t.prototype,n),t}(qo);function nr(e,t,n,i,o){return pr(i,t,e),new tr(null,e,t,n,i,i,i,o,0)}var ir=function(e){function t(t,n,i,o,r,a,s){e.call(this,t,n,i,o,r,null,a,s)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0}};return t.prototype.parseRule=function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}},t.prototype.update=function(e,t,n,i){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,!0)},t.prototype.inParent=function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1},t.prototype.domFromPos=function(e){return{node:this.nodeDOM,offset:e}},t.prototype.localPosFromDOM=function(t,n,i){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):e.prototype.localPosFromDOM.call(this,t,n,i)},t.prototype.ignoreMutation=function(e){return"characterData"!=e.type&&"selection"!=e.type},t.prototype.slice=function(e,n,i){var o=this.node.cut(e,n),r=document.createTextNode(o.text);return new t(this.parent,o,this.outerDeco,this.innerDeco,r,r,i)},t.prototype.markDirty=function(t,n){e.prototype.markDirty.call(this,t,n),this.dom==this.nodeDOM||0!=t&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)},n.domAtom.get=function(){return!1},Object.defineProperties(t.prototype,n),t}(tr),or=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={domAtom:{configurable:!0},ignoreForCoords:{configurable:!0}};return t.prototype.parseRule=function(){return{ignore:!0}},t.prototype.matchesHack=function(e){return 0==this.dirty&&this.dom.nodeName==e},n.domAtom.get=function(){return!0},n.ignoreForCoords.get=function(){return"IMG"==this.dom.nodeName},Object.defineProperties(t.prototype,n),t}(qo),rr=function(e){function t(t,n,i,o,r,a,s,c,d,l){e.call(this,t,n,i,o,r,a,s,d,l),this.spec=c}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.update=function(t,n,i,o){if(3==this.dirty)return!1;if(this.spec.update){var r=this.spec.update(t,n,i);return r&&this.updateInner(t,n,i,o),r}return!(!this.contentDOM&&!t.isLeaf)&&e.prototype.update.call(this,t,n,i,o)},t.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():e.prototype.selectNode.call(this)},t.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():e.prototype.deselectNode.call(this)},t.prototype.setSelection=function(t,n,i,o){this.spec.setSelection?this.spec.setSelection(t,n,i):e.prototype.setSelection.call(this,t,n,i,o)},t.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),e.prototype.destroy.call(this)},t.prototype.stopEvent=function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)},t.prototype.ignoreMutation=function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):e.prototype.ignoreMutation.call(this,t)},t}(tr);function ar(e){e&&(this.nodeName=e)}ar.prototype=Object.create(null);var sr=[new ar];function cr(e,t,n){if(0==e.length)return sr;for(var i=n?sr[0]:new ar,o=[i],r=0;r<e.length;r++){var a=e[r].type.attrs;if(a)for(var s in a.nodeName&&o.push(i=new ar(a.nodeName)),a){var c=a[s];null!=c&&(n&&1==o.length&&o.push(i=new ar(t.isInline?"span":"div")),"class"==s?i.class=(i.class?i.class+" ":"")+c:"style"==s?i.style=(i.style?i.style+";":"")+c:"nodeName"!=s&&(i[s]=c))}}return o}function dr(e,t,n,i){if(n==sr&&i==sr)return t;for(var o=t,r=0;r<i.length;r++){var a=i[r],s=n[r];if(r){var c=void 0;s&&s.nodeName==a.nodeName&&o!=e&&(c=o.parentNode)&&c.tagName.toLowerCase()==a.nodeName||((c=document.createElement(a.nodeName)).pmIsDeco=!0,c.appendChild(o),s=sr[0]),o=c}lr(o,s||sr[0],a)}return o}function lr(e,t,n){for(var i in t)"class"==i||"style"==i||"nodeName"==i||i in n||e.removeAttribute(i);for(var o in n)"class"!=o&&"style"!=o&&"nodeName"!=o&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){for(var r=t.class?t.class.split(" ").filter(Boolean):Xo,a=n.class?n.class.split(" ").filter(Boolean):Xo,s=0;s<r.length;s++)-1==a.indexOf(r[s])&&e.classList.remove(r[s]);for(var c=0;c<a.length;c++)-1==r.indexOf(a[c])&&e.classList.add(a[c]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style)for(var d,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;d=l.exec(t.style);)e.style.removeProperty(d[1]);n.style&&(e.style.cssText+=n.style)}}function pr(e,t,n){return dr(e,e,sr,cr(t,n,1!=e.nodeType))}function ur(e,t){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function hr(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}var fr=function(e,t){this.top=e,this.lock=t,this.index=0,this.stack=[],this.changed=!1,this.preMatch=function(e,t){var n=t,i=n.children.length,o=e.childCount,r=new Map,a=[];e:for(;o>0;){for(var s=void 0;;)if(i){var c=n.children[i-1];if(!(c instanceof er)){s=c,i--;break}n=c,i=c.children.length}else{if(n==t)break e;i=n.parent.children.indexOf(n),n=n.parent}var d=s.node;if(d){if(d!=e.child(o-1))break;--o,r.set(s,o),a.push(s)}}return{index:o,matched:r,matches:a.reverse()}}(e.node.content,e)};function br(e,t){return e.type.side-t.type.side}function mr(e,t,n,i,o){for(var r=[],a=0,s=0;a<e.length;a++){var c=e[a],d=s,l=s+=c.size;d>=n||l<=t?r.push(c):(d<t&&r.push(c.slice(0,t-d,i)),o&&(r.push(o),o=null),l>n&&r.push(c.slice(n-d,c.size,i)))}return r}function gr(e,t){var n=e.root.getSelection(),i=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),r=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var s,c,d=i.resolve(a);if(So(n)){for(s=d;o&&!o.node;)o=o.parent;if(o&&o.node.isAtom&&rt.isSelectable(o.node)&&o.parent&&(!o.node.isInline||!function(e,t,n){for(var i=0==t,o=t==ko(e);i||o;){if(e==n)return!0;var r=go(e);if(!(e=e.parentNode))return!1;i=i&&0==r,o=o&&r==ko(e)}}(n.focusNode,n.focusOffset,o.dom))){var l=o.posBefore;c=new rt(a==l?d:i.resolve(l))}}else{var p=e.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(p<0)return null;s=i.resolve(p)}c||(c=Sr(e,s,d,"pointer"==t||e.state.selection.head<d.pos&&!r?1:-1));return c}function vr(e){return e.editable?e.hasFocus():xr(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function yr(e,t){var n=e.state.selection;if(kr(e,n),vr(e)){if(!t&&e.mouseDown&&e.mouseDown.allowDefault&&po.chrome){var i=e.root.getSelection(),o=e.domObserver.currentSelection;if(i.anchorNode&&Oo(i.anchorNode,i.anchorOffset,o.anchorNode,o.anchorOffset))return e.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){var t=e.root.getSelection(),n=document.createRange(),i=e.cursorWrapper.dom,o="IMG"==i.nodeName;o?n.setEnd(i.parentNode,go(i)+1):n.setEnd(i,0);n.collapse(!1),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&po.ie&&po.ie_version<=11&&(i.disabled=!0,i.disabled=!1)}(e);else{var r,a,s=n.anchor,c=n.head;!_r||n instanceof it||(n.$from.parent.inlineContent||(r=Or(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Or(e,n.to))),e.docView.setSelection(s,c,e.root,t),_r&&(r&&Cr(r),a&&Cr(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){var t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.hideSelectionGuard);var n=e.root.getSelection(),i=n.anchorNode,o=n.anchorOffset;t.addEventListener("selectionchange",e.hideSelectionGuard=function(){n.anchorNode==i&&n.anchorOffset==o||(t.removeEventListener("selectionchange",e.hideSelectionGuard),setTimeout((function(){vr(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}fr.prototype.destroyBetween=function(e,t){if(e!=t){for(var n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}},fr.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},fr.prototype.syncToMarks=function(e,t,n){for(var i=0,o=this.stack.length>>1,r=Math.min(o,e.length);i<r&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&!1!==e[i].type.spec.spanning;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.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(e[o])){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 c=er.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}},fr.prototype.findNodeMatch=function(e,t,n,i){var o,r=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))r=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var c=this.top.children[a];if(c.matchesNode(e,t,n)&&!this.preMatch.matched.has(c)){r=a;break}}return!(r<0)&&(this.destroyBetween(this.index,r),this.index++,!0)},fr.prototype.updateNodeAt=function(e,t,n,i,o){return!!this.top.children[i].update(e,t,n,o)&&(this.destroyBetween(this.index,i),this.index=i+1,!0)},fr.prototype.findIndexWithChild=function(e){for(;;){var t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){var n=e.pmViewDesc;if(n)for(var i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==n)return i;return-1}e=t}},fr.prototype.updateNextNode=function(e,t,n,i,o){for(var r=this.index;r<this.top.children.length;r++){var a=this.top.children[r];if(a instanceof tr){var s=this.preMatch.matched.get(a);if(null!=s&&s!=o)return!1;var c=a.dom;if(!(this.lock&&(c==this.lock||1==c.nodeType&&c.contains(this.lock.parentNode))&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&ur(t,a.outerDeco)))&&a.update(e,t,n,i))return this.destroyBetween(this.index,r),a.dom!=c&&(this.changed=!0),this.index++,!0;break}}return!1},fr.prototype.addNode=function(e,t,n,i,o){this.top.children.splice(this.index++,0,tr.create(this.top,e,t,n,i,o)),this.changed=!0},fr.prototype.placeWidget=function(e,t,n){var i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){var o=new Yo(this.top,e,t,n);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++},fr.prototype.addTextblockHacks=function(){for(var e=this.top.children[this.index-1];e instanceof er;)e=e.children[e.children.length-1];e&&e instanceof ir&&!/\n$/.test(e.node.text)||((po.safari||po.chrome)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG"),this.addHackNode("BR"))},fr.prototype.addHackNode=function(e){if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack(e))this.index++;else{var t=document.createElement(e);"IMG"==e&&(t.className="ProseMirror-separator"),"BR"==e&&(t.className="ProseMirror-trailingBreak"),this.top.children.splice(this.index++,0,new or(this.top,Xo,t,null)),this.changed=!0}};var _r=po.safari||po.chrome&&po.chrome_version<63;function Or(e,t){var n=e.docView.domFromPos(t,0),i=n.node,o=n.offset,r=o<i.childNodes.length?i.childNodes[o]:null,a=o?i.childNodes[o-1]:null;if(po.safari&&r&&"false"==r.contentEditable)return jr(r);if(!(r&&"false"!=r.contentEditable||a&&"false"!=a.contentEditable)){if(r)return jr(r);if(a)return jr(a)}}function jr(e){return e.contentEditable="true",po.safari&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Cr(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function kr(e,t){if(t instanceof rt){var n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(wr(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else wr(e)}function wr(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=null)}function Sr(e,t,n,i){return e.someProp("createSelectionBetween",(function(i){return i(e,t,n)}))||it.between(t,n,i)}function xr(e){var t=e.root.getSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Er(e,t){var n=e.selection,i=n.$anchor,o=n.$head,r=t>0?i.max(o):i.min(o),a=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return a&&et.findFrom(a,t)}function Ir(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Tr(e,t,n){var i=e.state.selection;if(!(i instanceof it)){if(i instanceof rt&&i.node.isInline)return Ir(e,new it(t>0?i.$to:i.$from));var o=Er(e.state,t);return!!o&&Ir(e,o)}if(!i.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var r=Er(e.state,t);return!!(r&&r instanceof rt)&&Ir(e,r)}if(!(po.mac&&n.indexOf("m")>-1)){var a,s=i.$head,c=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!c||c.isText)return!1;var d=t<0?s.pos-c.nodeSize:s.pos;return!!(c.isAtom||(a=e.docView.descAt(d))&&!a.contentDOM)&&(rt.isSelectable(c)?Ir(e,new rt(t<0?e.state.doc.resolve(s.pos-c.nodeSize):s)):!!po.webkit&&Ir(e,new it(e.state.doc.resolve(t<0?d:d+c.nodeSize))))}}function Dr(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Br(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Pr(e){var t=e.root.getSelection(),n=t.focusNode,i=t.focusOffset;if(n){var o,r,a=!1;for(po.gecko&&1==n.nodeType&&i<Dr(n)&&Br(n.childNodes[i])&&(a=!0);;)if(i>0){if(1!=n.nodeType)break;var s=n.childNodes[i-1];if(Br(s))o=n,r=--i;else{if(3!=s.nodeType)break;i=(n=s).nodeValue.length}}else{if(Mr(n))break;for(var c=n.previousSibling;c&&Br(c);)o=n.parentNode,r=go(c),c=c.previousSibling;if(c)i=Dr(n=c);else{if((n=n.parentNode)==e.dom)break;i=0}}a?zr(e,t,n,i):o&&zr(e,t,o,r)}}function Ar(e){var t=e.root.getSelection(),n=t.focusNode,i=t.focusOffset;if(n){for(var o,r,a=Dr(n);;)if(i<a){if(1!=n.nodeType)break;if(!Br(n.childNodes[i]))break;o=n,r=++i}else{if(Mr(n))break;for(var s=n.nextSibling;s&&Br(s);)o=s.parentNode,r=go(s)+1,s=s.nextSibling;if(s)i=0,a=Dr(n=s);else{if((n=n.parentNode)==e.dom)break;i=a=0}}o&&zr(e,t,o,r)}}function Mr(e){var t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function zr(e,t,n,i){if(So(t)){var o=document.createRange();o.setEnd(n,i),o.setStart(n,i),t.removeAllRanges(),t.addRange(o)}else t.extend&&t.extend(n,i);e.domObserver.setCurSelection();var r=e.state;setTimeout((function(){e.state==r&&yr(e)}),50)}function Rr(e,t,n){var i=e.state.selection;if(i instanceof it&&!i.empty||n.indexOf("s")>-1)return!1;if(po.mac&&n.indexOf("m")>-1)return!1;var o=i.$from,r=i.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Er(e.state,t);if(a&&a instanceof rt)return Ir(e,a)}if(!o.parent.inlineContent){var s=t<0?o:r,c=i instanceof st?et.near(s,t):et.findFrom(s,t);return!!c&&Ir(e,c)}return!1}function Fr(e,t){if(!(e.state.selection instanceof it))return!0;var n=e.state.selection,i=n.$head,o=n.$anchor,r=n.empty;if(!i.sameParent(o))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!i.textOffset&&(t<0?i.nodeBefore:i.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(i.pos-a.nodeSize,i.pos):s.delete(i.pos,i.pos+a.nodeSize),e.dispatch(s),!0}return!1}function Nr(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Lr(e,t){var n=t.keyCode,i=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||po.mac&&72==n&&"c"==i?Fr(e,-1)||Pr(e):46==n||po.mac&&68==n&&"c"==i?Fr(e,1)||Ar(e):13==n||27==n||(37==n?Tr(e,-1,i)||Pr(e):39==n?Tr(e,1,i)||Ar(e):38==n?Rr(e,-1,i)||Pr(e):40==n?function(e){if(po.safari&&!(e.state.selection.$head.parentOffset>0)){var t=e.root.getSelection(),n=t.focusNode,i=t.focusOffset;if(n&&1==n.nodeType&&0==i&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;Nr(e,o,!0),setTimeout((function(){return Nr(e,o,!1)}),20)}}}(e)||Rr(e,1,i)||Ar(e):i==(po.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Vr(e){var t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(po.safari&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(e.parentNode.lastChild==e||po.safari&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0}}function Hr(e,t,n,i,o){if(t<0){var a=e.lastSelectionTime>Date.now()-50?e.lastSelectionOrigin:null,s=gr(e,a);if(s&&!e.state.selection.eq(s)){var c=e.state.tr.setSelection(s);"pointer"==a?c.setMeta("pointer",!0):"key"==a&&c.scrollIntoView(),e.dispatch(c)}}else{var d=e.state.doc.resolve(t),l=d.sharedDepth(n);t=d.before(l+1),n=e.state.doc.resolve(n).after(l+1);var p=e.state.selection,u=function(e,t,n){var i=e.docView.parseRange(t,n),o=i.node,r=i.fromOffset,a=i.toOffset,s=i.from,c=i.to,d=e.root.getSelection(),l=null,p=d.anchorNode;if(p&&e.dom.contains(1==p.nodeType?p:p.parentNode)&&(l=[{node:p,offset:d.anchorOffset}],So(d)||l.push({node:d.focusNode,offset:d.focusOffset})),po.chrome&&8===e.lastKeyCode)for(var u=a;u>r;u--){var h=o.childNodes[u-1],f=h.pmViewDesc;if("BR"==h.nodeName&&!f){a=u;break}if(!f||f.size)break}var b=e.state.doc,m=e.someProp("domParser")||ee.fromSchema(e.state.schema),g=b.resolve(s),v=null,y=m.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:r,to:a,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",editableContent:!0,findPositions:l,ruleFromNode:Vr,context:g});if(l&&null!=l[0].pos){var _=l[0].pos,O=l[1]&&l[1].pos;null==O&&(O=_),v={anchor:_+s,head:O+s}}return{doc:y,sel:v,from:s,to:c}}(e,t,n);if(po.chrome&&e.cursorWrapper&&u.sel&&u.sel.anchor==e.cursorWrapper.deco.from){var h=e.cursorWrapper.deco.type.toDOM.nextSibling,f=h&&h.nodeValue?h.nodeValue.length:1;u.sel={anchor:u.sel.anchor+f,head:u.sel.anchor+f}}var b,m,g=e.state.doc,v=g.slice(u.from,u.to);8===e.lastKeyCode&&Date.now()-100<e.lastKeyCodeTime?(b=e.state.selection.to,m="end"):(b=e.state.selection.from,m="start"),e.lastKeyCode=null;var y=function(e,t,n,i,o){var r=e.findDiffStart(t,n);if(null==r)return null;var a=e.findDiffEnd(t,n+e.size,n+t.size),s=a.a,c=a.b;if("end"==o){var d=Math.max(0,r-Math.min(s,c));i-=s+d-r}if(s<r&&e.size<t.size){c=(r-=i<=r&&i>=s?r-i:0)+(c-s),s=r}else if(c<r){s=(r-=i<=r&&i>=c?r-i:0)+(s-c),c=r}return{start:r,endA:s,endB:c}}(v.content,u.doc.content,u.from,b,m);if(!y){if(!(i&&p instanceof it&&!p.empty&&p.$head.sameParent(p.$anchor))||e.composing||u.sel&&u.sel.anchor!=u.sel.head){if((po.ios&&e.lastIOSEnter>Date.now()-225||po.android)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&e.someProp("handleKeyDown",(function(t){return t(e,xo(13,"Enter"))})))return void(e.lastIOSEnter=0);if(u.sel){var _=Kr(e,e.state.doc,u.sel);_&&!_.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(_))}return}y={start:p.from,endA:p.to,endB:p.to}}e.domChangeCount++,e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof it&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),po.ie&&po.ie_version<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>u.from&&" "==u.doc.textBetween(y.start-u.from-1,y.start-u.from+1)&&(y.start--,y.endA--,y.endB--);var O,j=u.doc.resolveNoCache(y.start-u.from),C=u.doc.resolveNoCache(y.endB-u.from),k=j.sameParent(C)&&j.parent.inlineContent;if((po.ios&&e.lastIOSEnter>Date.now()-225&&(!k||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!k&&j.pos<u.doc.content.size&&(O=et.findFrom(u.doc.resolve(j.pos+1),1,!0))&&O.head==C.pos)&&e.someProp("handleKeyDown",(function(t){return t(e,xo(13,"Enter"))})))e.lastIOSEnter=0;else if(e.state.selection.anchor>y.start&&function(e,t,n,i,o){if(!i.parent.isTextblock||n-t<=o.pos-i.pos||$r(i,!0,!1)<o.pos)return!1;var r=e.resolve(t);if(r.parentOffset<r.parent.content.size||!r.parent.isTextblock)return!1;var a=e.resolve($r(r,!0,!0));if(!a.parent.isTextblock||a.pos>n||$r(a,!0,!1)<n)return!1;return i.parent.content.cut(i.parentOffset).eq(a.parent.content)}(g,y.start,y.endA,j,C)&&e.someProp("handleKeyDown",(function(t){return t(e,xo(8,"Backspace"))})))po.android&&po.chrome&&e.domObserver.suppressSelectionUpdates();else{po.chrome&&po.android&&y.toB==y.from&&(e.lastAndroidDelete=Date.now()),po.android&&!k&&j.start()!=C.start()&&0==C.parentOffset&&j.depth==C.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==y.endA&&(y.endB-=2,C=u.doc.resolveNoCache(y.endB-u.from),setTimeout((function(){e.someProp("handleKeyDown",(function(t){return t(e,xo(13,"Enter"))}))}),20));var w,S,x,E,I=y.start,T=y.endA;if(k)if(j.pos==C.pos)po.ie&&po.ie_version<=11&&0==j.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((function(){return yr(e)}),20)),w=e.state.tr.delete(I,T),S=g.resolve(y.start).marksAcross(g.resolve(y.endA));else if(y.endA==y.endB&&(E=g.resolve(y.start))&&(x=function(e,t){for(var n,i,o,a=e.firstChild.marks,s=t.firstChild.marks,c=a,d=s,l=0;l<s.length;l++)c=s[l].removeFromSet(c);for(var p=0;p<a.length;p++)d=a[p].removeFromSet(d);if(1==c.length&&0==d.length)i=c[0],n="add",o=function(e){return e.mark(i.addToSet(e.marks))};else{if(0!=c.length||1!=d.length)return null;i=d[0],n="remove",o=function(e){return e.mark(i.removeFromSet(e.marks))}}for(var u=[],h=0;h<t.childCount;h++)u.push(o(t.child(h)));if(r.from(u).eq(e))return{mark:i,type:n}}(j.parent.content.cut(j.parentOffset,C.parentOffset),E.parent.content.cut(E.parentOffset,y.endA-E.start()))))w=e.state.tr,"add"==x.type?w.addMark(I,T,x.mark):w.removeMark(I,T,x.mark);else if(j.parent.child(j.index()).isText&&j.index()==C.index()-(C.textOffset?0:1)){var D=j.parent.textBetween(j.parentOffset,C.parentOffset);if(e.someProp("handleTextInput",(function(t){return t(e,I,T,D)})))return;w=e.state.tr.insertText(D,I,T)}if(w||(w=e.state.tr.replace(I,T,u.doc.slice(y.start-u.from,y.endB-u.from))),u.sel){var B=Kr(e,w.doc,u.sel);B&&!(po.chrome&&po.android&&e.composing&&B.empty&&(y.start!=y.endB||e.lastAndroidDelete<Date.now()-100)&&(B.head==I||B.head==w.mapping.map(T)-1)||po.ie&&B.empty&&B.head==I)&&w.setSelection(B)}S&&w.ensureMarks(S),e.dispatch(w.scrollIntoView())}}}function Kr(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Sr(e,t.resolve(n.anchor),t.resolve(n.head))}function $r(e,t,n){for(var i=e.depth,o=t?e.end():e.pos;i>0&&(t||e.indexAfter(i)==e.node(i).childCount);)i--,o++,t=!1;if(n)for(var r=e.node(i).maybeChild(e.indexAfter(i));r&&!r.isLeaf;)r=r.firstChild,o++;return o}function Wr(e,t){for(var n=[],i=t.content,o=t.openStart,r=t.openEnd;o>1&&r>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,r--;var a=i.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),i=a.content}var s=e.someProp("clipboardSerializer")||pe.fromSchema(e.state.schema),c=Qr(),d=c.createElement("div");d.appendChild(s.serializeFragment(i,{document:c}));for(var l,p=d.firstChild;p&&1==p.nodeType&&(l=Xr[p.nodeName.toLowerCase()]);){for(var u=l.length-1;u>=0;u--){for(var h=c.createElement(l[u]);d.firstChild;)h.appendChild(d.firstChild);d.appendChild(h),"tbody"!=l[u]&&(o++,r++)}p=d.firstChild}return p&&1==p.nodeType&&p.setAttribute("data-pm-slice",o+" "+r+" "+JSON.stringify(n)),{dom:d,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ur(e,t,n,i,o){var a,s,c=o.parent.type.spec.code;if(!n&&!t)return null;var d=t&&(i||c||!n);if(d){if(e.someProp("transformPastedText",(function(e){t=e(t,c||i)})),c)return t?new u(r.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):u.empty;var l=e.someProp("clipboardTextParser",(function(e){return e(t,o,i)}));if(l)s=l;else{var p=o.marks(),h=e.state.schema,f=pe.fromSchema(h);a=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=a.appendChild(document.createElement("p"));e&&t.appendChild(f.serializeNode(h.text(e,p)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),a=function(e){var t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,i=Qr().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&Xr[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return"</"+e+">"})).reverse().join(""));if(i.innerHTML=e,n)for(var r=0;r<n.length;r++)i=i.querySelector(n[r])||i;return i}(n),po.webkit&&function(e){for(var t=e.querySelectorAll(po.chrome?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<t.length;n++){var i=t[n];1==i.childNodes.length&&" "==i.textContent&&i.parentNode&&i.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),i)}}(a);var b=a&&a.querySelector("[data-pm-slice]"),m=b&&/^(\d+) (\d+) (.*)/.exec(b.getAttribute("data-pm-slice"));if(!s){var g=e.someProp("clipboardParser")||e.someProp("domParser")||ee.fromSchema(e.state.schema);s=g.parseSlice(a,{preserveWhitespace:!(!d&&!m),context:o,ruleFromNode:function(e){if("BR"==e.nodeName&&!e.nextSibling&&e.parentNode&&!Gr.test(e.parentNode.nodeName))return{ignore:!0}}})}if(m)s=function(e,t){if(!e.size)return e;var n,i=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}for(var o=e.content,a=e.openStart,s=e.openEnd,c=n.length-2;c>=0;c-=2){var d=i.nodes[n[c]];if(!d||d.hasRequiredAttrs())break;o=r.from(d.create(n[c+1],o)),a++,s++}return new u(o,a,s)}(Jr(s,+m[1],+m[2]),m[3]);else if((s=u.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var i=t.node(n).contentMatchAt(t.index(n)),o=void 0,a=[];if(e.forEach((function(e){if(a){var t,n=i.findWrapping(e.type);if(!n)return a=null;if(t=a.length&&o.length&&function e(t,n,i,o,a){if(a<t.length&&a<n.length&&t[a]==n[a]){var s=e(t,n,i,o.lastChild,a+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(a==t.length-1?i.type:t[a+1]))return o.copy(o.content.append(r.from(Zr(i,t,a+1))))}}(n,o,e,a[a.length-1],0))a[a.length-1]=t;else{a.length&&(a[a.length-1]=function e(t,n){if(0==n)return t;var i=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),o=t.contentMatchAt(t.childCount).fillBefore(r.empty,!0);return t.copy(i.append(o))}(a[a.length-1],o.length));var s=Zr(e,n);a.push(s),i=i.matchType(s.type,s.attrs),o=n}}})),a)return{v:r.from(a)}},i=t.depth;i>=0;i--){var o=n(i);if(o)return o.v}return e}(s.content,o),!0)).openStart||s.openEnd){for(var v=0,y=0,_=s.content.firstChild;v<s.openStart&&!_.type.spec.isolating;v++,_=_.firstChild);for(var O=s.content.lastChild;y<s.openEnd&&!O.type.spec.isolating;y++,O=O.lastChild);s=Jr(s,v,y)}return e.someProp("transformPasted",(function(e){s=e(s)})),s}var Gr=/^(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 Zr(e,t,n){void 0===n&&(n=0);for(var i=t.length-1;i>=n;i--)e=t[i].create(null,r.from(e));return e}function qr(e,t,n,i,o,a){var s=t<0?e.firstChild:e.lastChild,c=s.content;return o<i-1&&(c=qr(c,t,n,i,o+1,a)),o>=n&&(c=t<0?s.contentMatchAt(0).fillBefore(c,e.childCount>1||a<=o).append(c):c.append(s.contentMatchAt(s.childCount).fillBefore(r.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(c))}function Jr(e,t,n){return t<e.openStart&&(e=new u(qr(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new u(qr(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Xr={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Yr=null;function Qr(){return Yr||(Yr=document.implementation.createHTMLDocument("title"))}var ea={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ta=po.ie&&po.ie_version<=11,na=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};na.prototype.set=function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset},na.prototype.eq=function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset};var ia=function(e,t){var n=this;this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;t<e.length;t++)n.queue.push(e[t]);po.ie&&po.ie_version<=11&&e.some((function(e){return"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new na,ta&&(this.onCharData=function(e){n.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};ia.prototype.flushSoon=function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))},ia.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},ia.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,ea),ta&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},ia.prototype.stop=function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout((function(){return e.flush()}),20)}this.observer.disconnect()}ta&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},ia.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},ia.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},ia.prototype.suppressSelectionUpdates=function(){var e=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return e.suppressingSelectionUpdates=!1}),50)},ia.prototype.onSelectionChange=function(){if((!(e=this.view).editable||e.root.activeElement==e.dom)&&xr(e)){var e;if(this.suppressingSelectionUpdates)return yr(this.view);if(po.ie&&po.ie_version<=11&&!this.view.state.selection.empty){var t=this.view.root.getSelection();if(t.focusNode&&Oo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}},ia.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},ia.prototype.ignoreSelectionChange=function(e){if(0==e.rangeCount)return!0;var t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0},ia.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&xr(this.view)&&!this.ignoreSelectionChange(t),i=-1,o=-1,r=!1,a=[];if(this.view.editable)for(var s=0;s<e.length;s++){var c=this.registerMutation(e[s],a);c&&(i=i<0?c.from:Math.min(c.from,i),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(r=!0))}if(po.gecko&&a.length>1){var d=a.filter((function(e){return"BR"==e.nodeName}));if(2==d.length){var l=d[0],p=d[1];l.parentNode&&l.parentNode.parentNode==p.parentNode?p.remove():l.remove()}}(i>-1||n)&&(i>-1&&(this.view.docView.markDirty(i,o),function(e){if(oa)return;oa=!0,"normal"==getComputedStyle(e.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(i,o,r,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||yr(this.view),this.currentSelection.set(t))}},ia.prototype.registerMutation=function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var i=0;i<e.addedNodes.length;i++)t.push(e.addedNodes[i]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};var o=e.previousSibling,r=e.nextSibling;if(po.ie&&po.ie_version<=11&&e.addedNodes.length)for(var a=0;a<e.addedNodes.length;a++){var s=e.addedNodes[a],c=s.previousSibling,d=s.nextSibling;(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(o=c),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(r=d)}var l=o&&o.parentNode==e.target?go(o)+1:0,p=n.localPosFromDOM(e.target,l,-1),u=r&&r.parentNode==e.target?go(r):e.target.childNodes.length;return{from:p,to:n.localPosFromDOM(e.target,u,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}};var oa=!1;var ra={},aa={};function sa(e,t){e.lastSelectionOrigin=t,e.lastSelectionTime=Date.now()}function ca(e){e.someProp("handleDOMEvents",(function(t){for(var n in t)e.eventHandlers[n]||e.dom.addEventListener(n,e.eventHandlers[n]=function(t){return da(e,t)})}))}function da(e,t){return e.someProp("handleDOMEvents",(function(n){var i=n[t.type];return!!i&&(i(e,t)||t.defaultPrevented)}))}function la(e){return{left:e.clientX,top:e.clientY}}function pa(e,t,n,i,o){if(-1==i)return!1;for(var r=e.state.doc.resolve(i),a=function(i){if(e.someProp(t,(function(t){return i>r.depth?t(e,n,r.nodeAfter,r.before(i),o,!0):t(e,n,r.node(i),r.before(i),o,!1)})))return{v:!0}},s=r.depth+1;s>0;s--){var c=a(s);if(c)return c.v}return!1}function ua(e,t,n){e.focused||e.focus();var i=e.state.tr.setSelection(t);"pointer"==n&&i.setMeta("pointer",!0),e.dispatch(i)}function ha(e,t,n,i,o){return pa(e,"handleClickOn",t,n,i)||e.someProp("handleClick",(function(n){return n(e,t,i)}))||(o?function(e,t){if(-1==t)return!1;var n,i,o=e.state.selection;o instanceof rt&&(n=o.node);for(var r=e.state.doc.resolve(t),a=r.depth+1;a>0;a--){var s=a>r.depth?r.nodeAfter:r.node(a);if(rt.isSelectable(s)){i=n&&o.$from.depth>0&&a>=o.$from.depth&&r.before(o.$from.depth+1)==o.$from.pos?r.before(o.$from.depth):r.before(a);break}}return null!=i&&(ua(e,rt.create(e.state.doc,i),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),i=n.nodeAfter;return!!(i&&i.isAtom&&rt.isSelectable(i))&&(ua(e,new rt(n),"pointer"),!0)}(e,n))}function fa(e,t,n,i){return pa(e,"handleDoubleClickOn",t,n,i)||e.someProp("handleDoubleClick",(function(n){return n(e,t,i)}))}function ba(e,t,n,i){return pa(e,"handleTripleClickOn",t,n,i)||e.someProp("handleTripleClick",(function(n){return n(e,t,i)}))||function(e,t,n){if(0!=n.button)return!1;var i=e.state.doc;if(-1==t)return!!i.inlineContent&&(ua(e,it.create(i,0,i.content.size),"pointer"),!0);for(var o=i.resolve(t),r=o.depth+1;r>0;r--){var a=r>o.depth?o.nodeAfter:o.node(r),s=o.before(r);if(a.inlineContent)ua(e,it.create(i,s+1,s+1+a.content.size),"pointer");else{if(!rt.isSelectable(a))continue;ua(e,rt.create(i,s),"pointer")}return!0}}(e,n,i)}function ma(e){return Ca(e)}aa.keydown=function(e,t){if(e.shiftKey=16==t.keyCode||t.shiftKey,!ya(e,t)&&(e.lastKeyCode=t.keyCode,e.lastKeyCodeTime=Date.now(),!po.android||!po.chrome||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!po.ios||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",(function(n){return n(e,t)}))||Lr(e,t)?t.preventDefault():sa(e,"key");else{var n=Date.now();e.lastIOSEnter=n,e.lastIOSEnterFallbackTimeout=setTimeout((function(){e.lastIOSEnter==n&&(e.someProp("handleKeyDown",(function(t){return t(e,xo(13,"Enter"))})),e.lastIOSEnter=0)}),200)}},aa.keyup=function(e,t){16==t.keyCode&&(e.shiftKey=!1)},aa.keypress=function(e,t){if(!(ya(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||po.mac&&t.metaKey))if(e.someProp("handleKeyPress",(function(n){return n(e,t)})))t.preventDefault();else{var n=e.state.selection;if(!(n instanceof it&&n.$from.sameParent(n.$to))){var i=String.fromCharCode(t.charCode);e.someProp("handleTextInput",(function(t){return t(e,n.$from.pos,n.$to.pos,i)}))||e.dispatch(e.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}}};var ga=po.mac?"metaKey":"ctrlKey";ra.mousedown=function(e,t){e.shiftKey=t.shiftKey;var n=ma(e),i=Date.now(),o="singleClick";i-e.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,i=t.y-e.clientY;return n*n+i*i<100}(t,e.lastClick)&&!t[ga]&&("singleClick"==e.lastClick.type?o="doubleClick":"doubleClick"==e.lastClick.type&&(o="tripleClick")),e.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};var r=e.posAtCoords(la(t));r&&("singleClick"==o?(e.mouseDown&&e.mouseDown.done(),e.mouseDown=new va(e,r,t,n)):("doubleClick"==o?fa:ba)(e,r.pos,r.inside,t)?t.preventDefault():sa(e,"pointer"))};var va=function(e,t,n,i){var o,r,a=this;if(this.view=e,this.startDoc=e.state.doc,this.pos=t,this.event=n,this.flushed=i,this.selectNode=n[ga],this.allowDefault=n.shiftKey,this.delayedSelectionSync=!1,t.inside>-1)o=e.state.doc.nodeAt(t.inside),r=t.inside;else{var s=e.state.doc.resolve(t.pos);o=s.parent,r=s.depth?s.before():0}this.mightDrag=null;var c=i?null:n.target,d=c?e.docView.nearestDesc(c,!0):null;this.target=d?d.dom:null;var l=e.state.selection;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||l instanceof rt&&l.from<=r&&l.to>r)&&(this.mightDrag={node:o,pos:r,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&po.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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),sa(e,"pointer")};function ya(e,t){return!!e.composing||!!(po.safari&&Math.abs(t.timeStamp-e.compositionEndedAt)<500)&&(e.compositionEndedAt=-2e8,!0)}va.prototype.done=function(){var e=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 yr(e.view)})),this.view.mouseDown=null},va.prototype.up=function(e){if(this.done(),this.view.dom.contains(3==e.target.nodeType?e.target.parentNode:e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(la(e))),this.allowDefault||!t?sa(this.view,"pointer"):ha(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||po.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||po.chrome&&!(this.view.state.selection instanceof it)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ua(this.view,et.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):sa(this.view,"pointer")}},va.prototype.move=function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),sa(this.view,"pointer"),0==e.buttons&&this.done()},ra.touchdown=function(e){ma(e),sa(e,"pointer")},ra.contextmenu=function(e){return ma(e)};var _a=po.android?5e3:-1;function Oa(e,t){clearTimeout(e.composingTimeout),t>-1&&(e.composingTimeout=setTimeout((function(){return Ca(e)}),t))}function ja(e){var t;for(e.composing&&(e.composing=!1,e.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.compositionNodes.length>0;)e.compositionNodes.pop().markParentsDirty()}function Ca(e,t){if(!(po.android&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),ja(e),t||e.docView.dirty){var n=gr(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}aa.compositionstart=aa.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),Ca(e,!0),e.markCursor=null;else if(Ca(e),po.gecko&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var i=e.root.getSelection(),o=i.focusNode,r=i.focusOffset;o&&1==o.nodeType&&0!=r;){var a=r<0?o.lastChild:o.childNodes[r-1];if(!a)break;if(3==a.nodeType){i.collapse(a,a.nodeValue.length);break}o=a,r=-1}e.composing=!0}Oa(e,_a)},aa.compositionend=function(e,t){e.composing&&(e.composing=!1,e.compositionEndedAt=t.timeStamp,Oa(e,20))};var ka=po.ie&&po.ie_version<15||po.ios&&po.webkit_version<604;function wa(e,t,n,i){var o=Ur(e,t,n,e.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,i,o||u.empty)})))return!0;if(!o)return!1;var r=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=r?e.state.tr.replaceSelectionWith(r,e.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}ra.copy=aa.cut=function(e,t){var n=e.state.selection,i="cut"==t.type;if(!n.empty){var o=ka?null:t.clipboardData,r=Wr(e,n.content()),a=r.dom,s=r.text;o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",s)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var i=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),i.removeAllRanges(),i.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},aa.paste=function(e,t){if(!e.composing||po.android){var n=ka?null:t.clipboardData;n&&wa(e,n.getData("text/plain"),n.getData("text/html"),t)?t.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.shiftKey||e.state.selection.$from.parent.type.spec.code,i=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(i.contentEditable="true"),i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((function(){e.focus(),i.parentNode&&i.parentNode.removeChild(i),n?wa(e,i.value,null,t):wa(e,i.textContent,i.innerHTML,t)}),50)}}(e,t)}};var Sa=function(e,t){this.slice=e,this.move=t},xa=po.mac?"altKey":"ctrlKey";for(var Ea in ra.dragstart=function(e,t){var n=e.mouseDown;if(n&&n.done(),t.dataTransfer){var i=e.state.selection,o=i.empty?null:e.posAtCoords(la(t));if(o&&o.pos>=i.from&&o.pos<=(i instanceof rt?i.to-1:i.to));else if(n&&n.mightDrag)e.dispatch(e.state.tr.setSelection(rt.create(e.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){var r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&e.dispatch(e.state.tr.setSelection(rt.create(e.state.doc,r.posBefore)))}var a=e.state.selection.content(),s=Wr(e,a),c=s.dom,d=s.text;t.dataTransfer.clearData(),t.dataTransfer.setData(ka?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",ka||t.dataTransfer.setData("text/plain",d),e.dragging=new Sa(a,!t[xa])}},ra.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},aa.dragover=aa.dragenter=function(e,t){return t.preventDefault()},aa.drop=function(e,t){var n=e.dragging;if(e.dragging=null,t.dataTransfer){var i=e.posAtCoords(la(t));if(i){var o=e.state.doc.resolve(i.pos);if(o){var r=n&&n.slice;r?e.someProp("transformPasted",(function(e){r=e(r)})):r=Ur(e,t.dataTransfer.getData(ka?"Text":"text/plain"),ka?null:t.dataTransfer.getData("text/html"),!1,o);var a=n&&!t[xa];if(e.someProp("handleDrop",(function(n){return n(e,t,r||u.empty,a)})))t.preventDefault();else if(r){t.preventDefault();var s=r?Fe(e.state.doc,o.pos,r):o.pos;null==s&&(s=o.pos);var c=e.state.tr;a&&c.deleteSelection();var d=c.mapping.map(s),l=0==r.openStart&&0==r.openEnd&&1==r.content.childCount,p=c.doc;if(l?c.replaceRangeWith(d,d,r.content.firstChild):c.replaceRange(d,d,r),!c.doc.eq(p)){var h=c.doc.resolve(d);if(l&&rt.isSelectable(r.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(r.content.firstChild))c.setSelection(new rt(h));else{var f=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((function(e,t,n,i){return f=i})),c.setSelection(Sr(e,h,c.doc.resolve(f)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}}}}}},ra.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.root.getSelection())&&yr(e)}),20))},ra.blur=function(e,t){e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.set({}),e.focused=!1)},ra.beforeinput=function(e,t){if(po.chrome&&po.android&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.domChangeCount;setTimeout((function(){if(e.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,xo(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},aa)ra[Ea]=aa[Ea];function Ia(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var i in t)if(!(i in e))return!1;return!0}var Ta=function(e,t){this.spec=t||za,this.side=this.spec.side||0,this.toDOM=e};Ta.prototype.map=function(e,t,n,i){var o=e.mapResult(t.from+i,this.side<0?-1:1),r=o.pos;return o.deleted?null:new Pa(r-n,r-n,this)},Ta.prototype.valid=function(){return!0},Ta.prototype.eq=function(e){return this==e||e instanceof Ta&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ia(this.spec,e.spec))},Ta.prototype.destroy=function(e){this.spec.destroy&&this.spec.destroy(e)};var Da=function(e,t){this.spec=t||za,this.attrs=e};Da.prototype.map=function(e,t,n,i){var o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,r=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return o>=r?null:new Pa(o,r,this)},Da.prototype.valid=function(e,t){return t.from<t.to},Da.prototype.eq=function(e){return this==e||e instanceof Da&&Ia(this.attrs,e.attrs)&&Ia(this.spec,e.spec)},Da.is=function(e){return e.type instanceof Da};var Ba=function(e,t){this.spec=t||za,this.attrs=e};Ba.prototype.map=function(e,t,n,i){var o=e.mapResult(t.from+i,1);if(o.deleted)return null;var r=e.mapResult(t.to+i,-1);return r.deleted||r.pos<=o.pos?null:new Pa(o.pos-n,r.pos-n,this)},Ba.prototype.valid=function(e,t){var n,i=e.content.findIndex(t.from),o=i.index,r=i.offset;return r==t.from&&!(n=e.child(o)).isText&&r+n.nodeSize==t.to},Ba.prototype.eq=function(e){return this==e||e instanceof Ba&&Ia(this.attrs,e.attrs)&&Ia(this.spec,e.spec)};var Pa=function(e,t,n){this.from=e,this.to=t,this.type=n},Aa={spec:{configurable:!0},inline:{configurable:!0}};Pa.prototype.copy=function(e,t){return new Pa(e,t,this.type)},Pa.prototype.eq=function(e,t){return void 0===t&&(t=0),this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to},Pa.prototype.map=function(e,t,n){return this.type.map(e,this,t,n)},Pa.widget=function(e,t,n){return new Pa(e,e,new Ta(t,n))},Pa.inline=function(e,t,n,i){return new Pa(e,t,new Da(n,i))},Pa.node=function(e,t,n,i){return new Pa(e,t,new Ba(n,i))},Aa.spec.get=function(){return this.type.spec},Aa.inline.get=function(){return this.type instanceof Da},Object.defineProperties(Pa.prototype,Aa);var Ma=[],za={},Ra=function(e,t){this.local=e&&e.length?e:Ma,this.children=t&&t.length?t:Ma};Ra.create=function(e,t){return t.length?Ka(t,e,0,za):Fa},Ra.prototype.find=function(e,t,n){var i=[];return this.findInner(null==e?0:e,null==t?1e9:t,i,0,n),i},Ra.prototype.findInner=function(e,t,n,i,o){for(var r=0;r<this.local.length;r++){var a=this.local[r];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+i,a.to+i))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){var c=this.children[s]+1;this.children[s+2].findInner(e-c,t-c,n,i+c,o)}},Ra.prototype.map=function(e,t,n){return this==Fa||0==e.maps.length?this:this.mapInner(e,t,0,0,n||za)},Ra.prototype.mapInner=function(e,t,n,i,o){for(var r,a=0;a<this.local.length;a++){var s=this.local[a].map(e,n,i);s&&s.type.valid(t,s)?(r||(r=[])).push(s):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(e,t,n,i,o,r,a){for(var s=e.slice(),c=function(e,t,n,i){for(var a=0;a<s.length;a+=3){var c=s[a+1],d=void 0;-1==c||e>c+r||(t>=s[a]+r?s[a+1]=-1:n>=o&&(d=i-n-(t-e))&&(s[a]+=d,s[a+1]+=d))}},d=0;d<n.maps.length;d++)n.maps[d].forEach(c);for(var l=!1,p=0;p<s.length;p+=3)if(-1==s[p+1]){var u=n.map(e[p]+r),h=u-o;if(h<0||h>=i.content.size){l=!0;continue}var f=n.map(e[p+1]+r,-1)-o,b=i.content.findIndex(h),m=b.index,g=b.offset,v=i.maybeChild(m);if(v&&g==h&&g+v.nodeSize==f){var y=s[p+2].mapInner(n,v,u+1,e[p]+r+1,a);y!=Fa?(s[p]=h,s[p+1]=f,s[p+2]=y):(s[p+1]=-2,l=!0)}else l=!0}if(l){var _=Ka(function(e,t,n,i,o,r,a){function s(e,t){for(var r=0;r<e.local.length;r++){var c=e.local[r].map(i,o,t);c?n.push(c):a.onRemove&&a.onRemove(e.local[r].spec)}for(var d=0;d<e.children.length;d+=3)s(e.children[d+2],e.children[d]+t+1)}for(var c=0;c<e.length;c+=3)-1==e[c+1]&&s(e[c+2],t[c]+r+1);return n}(s,e,t||[],n,o,r,a),i,0,a);t=_.local;for(var O=0;O<s.length;O+=3)s[O+1]<0&&(s.splice(O,3),O-=3);for(var j=0,C=0;j<_.children.length;j+=3){for(var k=_.children[j];C<s.length&&s[C]<k;)C+=3;s.splice(C,0,_.children[j],_.children[j+1],_.children[j+2])}}return new Ra(t&&t.sort($a),s)}(this.children,r,e,t,n,i,o):r?new Ra(r.sort($a)):Fa},Ra.prototype.add=function(e,t){return t.length?this==Fa?Ra.create(e,t):this.addInner(e,t,0):this},Ra.prototype.addInner=function(e,t,n){var i,o=this,r=0;e.forEach((function(e,a){var s,c=a+n;if(s=Va(t,e,c)){for(i||(i=o.children.slice());r<i.length&&i[r]<a;)r+=3;i[r]==a?i[r+2]=i[r+2].addInner(e,s,c+1):i.splice(r,0,a,a+e.nodeSize,Ka(s,e,c+1,za)),r+=3}}));for(var a=La(r?Ha(t):t,-n),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||a.splice(s--,1);return new Ra(a.length?this.local.concat(a).sort($a):this.local,i||this.children)},Ra.prototype.remove=function(e){return 0==e.length||this==Fa?this:this.removeInner(e,0)},Ra.prototype.removeInner=function(e,t){for(var n=this.children,i=this.local,o=0;o<n.length;o+=3){for(var r=void 0,a=n[o]+t,s=n[o+1]+t,c=0,d=void 0;c<e.length;c++)(d=e[c])&&d.from>a&&d.to<s&&(e[c]=null,(r||(r=[])).push(d));if(r){n==this.children&&(n=this.children.slice());var l=n[o+2].removeInner(r,a+1);l!=Fa?n[o+2]=l:(n.splice(o,3),o-=3)}}if(i.length)for(var p=0,u=void 0;p<e.length;p++)if(u=e[p])for(var h=0;h<i.length;h++)i[h].eq(u,t)&&(i==this.local&&(i=this.local.slice()),i.splice(h--,1));return n==this.children&&i==this.local?this:i.length||n.length?new Ra(i,n):Fa},Ra.prototype.forChild=function(e,t){if(this==Fa)return this;if(t.isLeaf)return Ra.empty;for(var n,i,o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(n=this.children[o+2]);break}for(var r=e+1,a=r+t.content.size,s=0;s<this.local.length;s++){var c=this.local[s];if(c.from<a&&c.to>r&&c.type instanceof Da){var d=Math.max(r,c.from)-r,l=Math.min(a,c.to)-r;d<l&&(i||(i=[])).push(c.copy(d,l))}}if(i){var p=new Ra(i.sort($a));return n?new Na([p,n]):p}return n||Fa},Ra.prototype.eq=function(e){if(this==e)return!0;if(!(e instanceof Ra)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0},Ra.prototype.locals=function(e){return Wa(this.localsInner(e))},Ra.prototype.localsInner=function(e){if(this==Fa)return Ma;if(e.inlineContent||!this.local.some(Da.is))return this.local;for(var t=[],n=0;n<this.local.length;n++)this.local[n].type instanceof Da||t.push(this.local[n]);return t};var Fa=new Ra;Ra.empty=Fa,Ra.removeOverlap=Wa;var Na=function(e){this.members=e};function La(e,t){if(!t||!e.length)return e;for(var n=[],i=0;i<e.length;i++){var o=e[i];n.push(new Pa(o.from+t,o.to+t,o.type))}return n}function Va(e,t,n){if(t.isLeaf)return null;for(var i=n+t.nodeSize,o=null,r=0,a=void 0;r<e.length;r++)(a=e[r])&&a.from>n&&a.to<i&&((o||(o=[])).push(a),e[r]=null);return o}function Ha(e){for(var t=[],n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Ka(e,t,n,i){var o=[],r=!1;t.forEach((function(t,a){var s=Va(e,t,a+n);if(s){r=!0;var c=Ka(s,t,n+a+1,i);c!=Fa&&o.push(a,a+t.nodeSize,c)}}));for(var a=La(r?Ha(e):e,-n).sort($a),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||(i.onRemove&&i.onRemove(a[s].spec),a.splice(s--,1));return a.length||o.length?new Ra(a,o):Fa}function $a(e,t){return e.from-t.from||e.to-t.to}function Wa(e){for(var t=e,n=0;n<t.length-1;n++){var i=t[n];if(i.from!=i.to)for(var o=n+1;o<t.length;o++){var r=t[o];if(r.from!=i.from){r.from<i.to&&(t==e&&(t=e.slice()),t[n]=i.copy(i.from,r.from),Ua(t,o,i.copy(r.from,i.to)));break}r.to!=i.to&&(t==e&&(t=e.slice()),t[o]=r.copy(r.from,i.to),Ua(t,o+1,r.copy(i.to,r.to)))}}return t}function Ua(e,t,n){for(;t<e.length&&$a(n,e[t])>0;)t++;e.splice(t,0,n)}function Ga(e){var t=[];return e.someProp("decorations",(function(n){var i=n(e.state);i&&i!=Fa&&t.push(i)})),e.cursorWrapper&&t.push(Ra.create(e.state.doc,[e.cursorWrapper.deco])),Na.from(t)}Na.prototype.map=function(e,t){var n=this.members.map((function(n){return n.map(e,t,za)}));return Na.from(n)},Na.prototype.forChild=function(e,t){if(t.isLeaf)return Ra.empty;for(var n=[],i=0;i<this.members.length;i++){var o=this.members[i].forChild(e,t);o!=Fa&&(o instanceof Na?n=n.concat(o.members):n.push(o))}return Na.from(n)},Na.prototype.eq=function(e){if(!(e instanceof Na)||e.members.length!=this.members.length)return!1;for(var t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0},Na.prototype.locals=function(e){for(var t,n=!0,i=0;i<this.members.length;i++){var o=this.members[i].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(var r=0;r<o.length;r++)t.push(o[r])}else t=o}return t?Wa(n?t:t.sort($a)):Ma},Na.from=function(e){switch(e.length){case 0:return Fa;case 1:return e[0];default:return new Na(e)}};var Za,qa,Ja=function(e,t){this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ns),this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):e.apply?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=es(this),this.markCursor=null,this.cursorWrapper=null,Qa(this),this.nodeViews=ts(this),this.docView=nr(this.state.doc,Ya(this),Ga(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(e){e.shiftKey=!1,e.mouseDown=null,e.lastKeyCode=null,e.lastKeyCodeTime=0,e.lastClick={time:0,x:0,y:0,type:""},e.lastSelectionOrigin=null,e.lastSelectionTime=0,e.lastIOSEnter=0,e.lastIOSEnterFallbackTimeout=null,e.lastAndroidDelete=0,e.composing=!1,e.composingTimeout=null,e.compositionNodes=[],e.compositionEndedAt=-2e8,e.domObserver=new ia(e,(function(t,n,i,o){return Hr(e,t,n,i,o)})),e.domObserver.start(),e.domChangeCount=0,e.eventHandlers=Object.create(null);var t=function(t){var n=ra[t];e.dom.addEventListener(t,e.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||da(e,t)||!e.editable&&t.type in aa||n(e,t)})};for(var n in ra)t(n);po.safari&&e.dom.addEventListener("input",(function(){return null})),ca(e)}(this),this.prevDirectPlugins=[],this.pluginViews=[],this.updatePluginViews()},Xa={props:{configurable:!0},root:{configurable:!0},isDestroyed:{configurable:!0}};function Ya(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var i in n)"class"==i&&(t.class+=" "+n[i]),"style"==i?t.style=(t.style?t.style+";":"")+n[i]:t[i]||"contenteditable"==i||"nodeName"==i||(t[i]=String(n[i]))})),[Pa.node(0,e.state.doc.content.size,t)]}function Qa(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),e.cursorWrapper={dom:t,deco:Pa.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function es(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function ts(e){var t={};return e.someProp("nodeViews",(function(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])})),t}function ns(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}if(Xa.props.get=function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props},Ja.prototype.update=function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&ca(this),this._props=e,e.plugins&&(e.plugins.forEach(ns),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)},Ja.prototype.setProps=function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var i in t.state=this.state,e)t[i]=e[i];this.update(t)},Ja.prototype.updateState=function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)},Ja.prototype.updateStateInner=function(e,t){var n=this,i=this.state,o=!1,r=!1;if(e.storedMarks&&this.composing&&(ja(this),r=!0),this.state=e,t){var a=ts(this);(function(e,t){var n=0,i=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var r in t)i++;return n!=i})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),ca(this)}this.editable=es(this),Qa(this);var s=Ga(this),c=Ya(this),d=t?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",l=o||!this.docView.matchesNode(e.doc,c,s);!l&&e.selection.eq(i.selection)||(r=!0);var p,u,h,f,b,m,g,v,y,_,O,j="preserve"==d&&r&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,i=e.dom.getBoundingClientRect(),o=Math.max(0,i.top),r=(i.left+i.right)/2,a=o+1;a<Math.min(innerHeight,i.bottom);a+=5){var s=e.root.elementFromPoint(r,a);if(s!=e.dom&&e.dom.contains(s)){var c=s.getBoundingClientRect();if(c.top>=o-20){t=s,n=c.top;break}}}return{refDOM:t,refTop:n,stack:Bo(e.dom)}}(this);if(r){this.domObserver.stop();var C=l&&(po.ie||po.chrome)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(f=i.selection,b=e.selection,m=Math.min(f.$anchor.sharedDepth(f.head),b.$anchor.sharedDepth(b.head)),f.$anchor.start(m)!=b.$anchor.start(m));if(l){var k=po.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!o&&this.docView.update(e.doc,c,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=nr(e.doc,c,s,this.dom,this)),k&&!this.trackWrites&&(C=!0)}C||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(p=this,u=p.docView.domFromPos(p.state.selection.anchor,0),h=p.root.getSelection(),Oo(u.node,u.offset,h.anchorNode,h.anchorOffset)))?yr(this,C):(kr(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(i),"reset"==d)this.dom.scrollTop=0;else if("to selection"==d){var w=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(e){return e(n)}))||(e.selection instanceof rt?Do(this,this.docView.domAfterPos(e.selection.from).getBoundingClientRect(),w):Do(this,this.coordsAtPos(e.selection.head,1),w))}else j&&(v=(g=j).refDOM,y=g.refTop,_=g.stack,O=v?v.getBoundingClientRect().top:0,Po(_,0==O?0:O-y))},Ja.prototype.destroyPluginViews=function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()},Ja.prototype.updatePluginViews=function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t<this.pluginViews.length;t++){var n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var i=0;i<this.directPlugins.length;i++){var o=this.directPlugins[i];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(var r=0;r<this.state.plugins.length;r++){var a=this.state.plugins[r];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}},Ja.prototype.someProp=function(e,t){var n,i=this._props&&this._props[e];if(null!=i&&(n=t?t(i):i))return n;for(var o=0;o<this.directPlugins.length;o++){var r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var c=a[s].props[e];if(null!=c&&(n=t?t(c):c))return n}},Ja.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Ja.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(Ao)return e.focus(Ao);var t=Bo(e);e.focus(null==Ao?{get preventScroll(){return Ao={preventScroll:!0},!0}}:void 0),Ao||(Ao=!1,Po(t,0))}(this.dom),yr(this),this.domObserver.start()},Xa.root.get=function(){var e=this._root;if(null==e)for(var t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=function(){return document.getSelection()}),this._root=t;return e||document},Ja.prototype.posAtCoords=function(e){return Ro(this,e)},Ja.prototype.coordsAtPos=function(e,t){return void 0===t&&(t=1),Lo(this,e,t)},Ja.prototype.domAtPos=function(e,t){return void 0===t&&(t=0),this.docView.domFromPos(e,t)},Ja.prototype.nodeDOM=function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null},Ja.prototype.posAtDOM=function(e,t,n){void 0===n&&(n=-1);var i=this.docView.posFromDOM(e,t,n);if(null==i)throw new RangeError("DOM position not inside the editor");return i},Ja.prototype.endOfTextblock=function(e,t){return Zo(this,t||this.state,e)},Ja.prototype.destroy=function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.eventHandlers)e.dom.removeEventListener(t,e.eventHandlers[t]);clearTimeout(e.composingTimeout),clearTimeout(e.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ga(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Xa.isDestroyed.get=function(){return null==this.docView},Ja.prototype.dispatchEvent=function(e){return function(e,t){da(e,t)||!ra[t.type]||!e.editable&&t.type in aa||ra[t.type](e,t)}(this,e)},Ja.prototype.dispatch=function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))},Object.defineProperties(Ja.prototype,Xa),"undefined"!=typeof WeakMap){var is=new WeakMap;Za=function(e){return is.get(e)},qa=function(e,t){return is.set(e,t),t}}else{var rs=[],as=0;Za=function(e){for(var t=0;t<rs.length;t+=2)if(rs[t]==e)return rs[t+1]},qa=function(e,t){return 10==as&&(as=0),rs[as++]=e,rs[as++]=t}}var ss=function(e,t,n,i){this.left=e,this.top=t,this.right=n,this.bottom=i},cs=function(e,t,n,i){this.width=e,this.height=t,this.map=n,this.problems=i};function ds(e){if(e.colwidth)return e.colwidth.slice();for(var t=[],n=0;n<e.colspan;n++)t.push(0);return t}function ls(e,t){var n=e.getAttribute("data-colwidth"),i=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(e){return Number(e)})):null,o=Number(e.getAttribute("colspan")||1),r={colspan:o,rowspan:Number(e.getAttribute("rowspan")||1),colwidth:i&&i.length==o?i:null};for(var a in t){var s=t[a].getFromDOM,c=s&&s(e);null!=c&&(r[a]=c)}return r}function ps(e,t){var n={};for(var i in 1!=e.attrs.colspan&&(n.colspan=e.attrs.colspan),1!=e.attrs.rowspan&&(n.rowspan=e.attrs.rowspan),e.attrs.colwidth&&(n["data-colwidth"]=e.attrs.colwidth.join(",")),t){var o=t[i].setDOMAttr;o&&o(e.attrs[i],n)}return n}function us(e){var t=e.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var i in t)n[i]={default:t[i].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:e.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:e.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(e){return ls(e,t)}}],toDOM:function(e){return["td",ps(e,t),0]}},table_header:{content:e.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(e){return ls(e,t)}}],toDOM:function(e){return["th",ps(e,t),0]}}}}function hs(e){var t=e.cached.tableNodeTypes;if(!t)for(var n in t=e.cached.tableNodeTypes={},e.nodes){var i=e.nodes[n],o=i.spec.tableRole;o&&(t[o]=i)}return t}cs.prototype.findCell=function(e){for(var t=0;t<this.map.length;t++){var n=this.map[t];if(n==e){for(var i=t%this.width,o=t/this.width|0,r=i+1,a=o+1,s=1;r<this.width&&this.map[t+s]==n;s++)r++;for(var c=1;a<this.height&&this.map[t+this.width*c]==n;c++)a++;return new ss(i,o,r,a)}}throw new RangeError("No cell with offset "+e+" found")},cs.prototype.colCount=function(e){for(var t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")},cs.prototype.nextCell=function(e,t,n){var i=this.findCell(e),o=i.left,r=i.right,a=i.top,s=i.bottom;return"horiz"==t?(n<0?0==o:r==this.width)?null:this.map[a*this.width+(n<0?o-1:r)]:(n<0?0==a:s==this.height)?null:this.map[o+this.width*(n<0?a-1:s)]},cs.prototype.rectBetween=function(e,t){var n=this.findCell(e),i=n.left,o=n.right,r=n.top,a=n.bottom,s=this.findCell(t),c=s.left,d=s.right,l=s.top,p=s.bottom;return new ss(Math.min(i,c),Math.min(r,l),Math.max(o,d),Math.max(a,p))},cs.prototype.cellsInRect=function(e){for(var t=[],n={},i=e.top;i<e.bottom;i++)for(var o=e.left;o<e.right;o++){var r=i*this.width+o,a=this.map[r];n[a]||(n[a]=!0,o==e.left&&o&&this.map[r-1]==a||i==e.top&&i&&this.map[r-this.width]==a||t.push(a))}return t},cs.prototype.positionAt=function(e,t,n){for(var i=0,o=0;;i++){var r=o+n.child(i).nodeSize;if(i==e){for(var a=t+e*this.width,s=(e+1)*this.width;a<s&&this.map[a]<o;)a++;return a==s?r-1:this.map[a]}o=r}},cs.get=function(e){return Za(e)||qa(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);for(var t=function(e){for(var t=-1,n=!1,i=0;i<e.childCount;i++){var o=e.child(i),r=0;if(n)for(var a=0;a<i;a++)for(var s=e.child(a),c=0;c<s.childCount;c++){var d=s.child(c);a+d.attrs.rowspan>i&&(r+=d.attrs.colspan)}for(var l=0;l<o.childCount;l++){var p=o.child(l);r+=p.attrs.colspan,p.attrs.rowspan>1&&(n=!0)}-1==t?t=r:t!=r&&(t=Math.max(t,r))}return t}(e),n=e.childCount,i=[],o=0,r=null,a=[],s=0,c=t*n;s<c;s++)i[s]=0;for(var d=0,l=0;d<n;d++){var p=e.child(d);l++;for(var u=0;;u++){for(;o<i.length&&0!=i[o];)o++;if(u==p.childCount)break;for(var h=p.child(u),f=h.attrs,b=f.colspan,m=f.rowspan,g=f.colwidth,v=0;v<m;v++){if(v+d>=n){(r||(r=[])).push({type:"overlong_rowspan",pos:l,n:m-v});break}for(var y=o+v*t,_=0;_<b;_++){0==i[y+_]?i[y+_]=l:(r||(r=[])).push({type:"collision",row:d,pos:l,n:b-_});var O=g&&g[_];if(O){var j=(y+_)%t*2,C=a[j];null==C||C!=O&&1==a[j+1]?(a[j]=O,a[j+1]=1):C==O&&a[j+1]++}}}o+=b,l+=h.nodeSize}for(var k=(d+1)*t,w=0;o<k;)0==i[o++]&&w++;w&&(r||(r=[])).push({type:"missing",row:d,n:w}),l++}for(var S=new cs(t,n,i,r),x=!1,E=0;!x&&E<a.length;E+=2)null!=a[E]&&a[E+1]<n&&(x=!0);x&&function(e,t,n){e.problems||(e.problems=[]);for(var i=0,o={};i<e.map.length;i++){var r=e.map[i];if(!o[r]){o[r]=!0;for(var a=n.nodeAt(r),s=null,c=0;c<a.attrs.colspan;c++){var d=(i+c)%e.width,l=t[2*d];null==l||a.attrs.colwidth&&a.attrs.colwidth[c]==l||((s||(s=ds(a.attrs)))[c]=l)}s&&e.problems.unshift({type:"colwidth mismatch",pos:r,colwidth:s})}}}(S,a,e);return S}(e))};var fs=new jt("selectingCells");function bs(e){for(var t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function ms(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function gs(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:bs(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var i=t.type.spec.tableRole;if("cell"==i||"header_cell"==i)return e.doc.resolve(n)}for(var o=e.nodeBefore,r=e.pos;o;o=o.lastChild,r--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(r-o.nodeSize)}}(t.$head)}function vs(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function ys(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function _s(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Os(e){return cs.get(e.node(-1)).findCell(e.pos-e.start(-1))}function js(e){return cs.get(e.node(-1)).colCount(e.pos-e.start(-1))}function Cs(e,t,n){var i=e.start(-1),o=cs.get(e.node(-1)).nextCell(e.pos-i,t,n);return null==o?null:e.node(0).resolve(i+o)}function ks(e,t,n){var i={};for(var o in e)i[o]=e[o];return i[t]=n,i}function ws(e,t,n){void 0===n&&(n=1);var i=ks(e,"colspan",e.colspan-n);return i.colwidth&&(i.colwidth=i.colwidth.slice(),i.colwidth.splice(t,n),i.colwidth.some((function(e){return e>0}))||(i.colwidth=null)),i}function Ss(e,t,n){void 0===n&&(n=1);var i=ks(e,"colspan",e.colspan+n);if(i.colwidth){i.colwidth=i.colwidth.slice();for(var o=0;o<n;o++)i.colwidth.splice(t,0,0)}return i}function xs(e,t,n){for(var i=hs(t.type.schema).header_cell,o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=i)return!1;return!0}var Es=function(e){function t(t,n){void 0===n&&(n=t);var i=t.node(-1),o=cs.get(i),r=t.start(-1),a=o.rectBetween(t.pos-r,n.pos-r),s=t.node(0),c=o.cellsInRect(a).filter((function(e){return e!=n.pos-r}));c.unshift(n.pos-r);var d=c.map((function(e){var t=i.nodeAt(e),n=e+r+1;return new nt(s.resolve(n),s.resolve(n+t.content.size))}));e.call(this,d[0].$from,d[0].$to,d),this.$anchorCell=t,this.$headCell=n}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(e,n){var i=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(vs(i)&&vs(o)&&_s(i,o)){var r=this.$anchorCell.node(-1)!=i.node(-1);return r&&this.isRowSelection()?t.rowSelection(i,o):r&&this.isColSelection()?t.colSelection(i,o):new t(i,o)}return it.between(i,o)},t.prototype.content=function(){for(var e=this.$anchorCell.node(-1),t=cs.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},a=[],s=i.top;s<i.bottom;s++){for(var c=[],d=s*t.width+i.left,l=i.left;l<i.right;l++,d++){var p=t.map[d];if(!o[p]){o[p]=!0;var h=t.findCell(p),f=e.nodeAt(p),b=i.left-h.left,m=h.right-i.right;if(b>0||m>0){var g=f.attrs;b>0&&(g=ws(g,0,b)),m>0&&(g=ws(g,g.colspan-m,m)),f=h.left<i.left?f.type.createAndFill(g):f.type.create(g,f.content)}if(h.top<i.top||h.bottom>i.bottom){var v=ks(f.attrs,"rowspan",Math.min(h.bottom,i.bottom)-Math.max(h.top,i.top));f=h.top<i.top?f.type.createAndFill(v):f.type.create(v,f.content)}c.push(f)}}a.push(e.child(s).copy(r.from(c)))}var y=this.isColSelection()&&this.isRowSelection()?e:a;return new u(r.from(y),1,1)},t.prototype.replace=function(t,n){void 0===n&&(n=u.empty);for(var i=t.steps.length,o=this.ranges,r=0;r<o.length;r++){var a=o[r],s=a.$from,c=a.$to,d=t.mapping.slice(i);t.replace(d.map(s.pos),d.map(c.pos),r?u.empty:n)}var l=e.findFrom(t.doc.resolve(t.mapping.slice(i).map(this.to)),-1);l&&t.setSelection(l)},t.prototype.replaceWith=function(e,t){this.replace(e,new u(r.from(t),0,0))},t.prototype.forEachCell=function(e){for(var t=this.$anchorCell.node(-1),n=cs.get(t),i=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i)),r=0;r<o.length;r++)e(t.nodeAt(o[r]),i+o[r])},t.prototype.isColSelection=function(){var e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount},t.colSelection=function(e,n){void 0===n&&(n=e);var i=cs.get(e.node(-1)),o=e.start(-1),r=i.findCell(e.pos-o),a=i.findCell(n.pos-o),s=e.node(0);return r.top<=a.top?(r.top>0&&(e=s.resolve(o+i.map[r.left])),a.bottom<i.height&&(n=s.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))):(a.top>0&&(n=s.resolve(o+i.map[a.left])),r.bottom<i.height&&(e=s.resolve(o+i.map[i.width*(i.height-1)+r.right-1]))),new t(e,n)},t.prototype.isRowSelection=function(){var e=cs.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),i=e.colCount(this.$headCell.pos-t);if(Math.min(n,i)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,r=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,r)==e.width},t.prototype.eq=function(e){return e instanceof t&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos},t.rowSelection=function(e,n){void 0===n&&(n=e);var i=cs.get(e.node(-1)),o=e.start(-1),r=i.findCell(e.pos-o),a=i.findCell(n.pos-o),s=e.node(0);return r.left<=a.left?(r.left>0&&(e=s.resolve(o+i.map[r.top*i.width])),a.right<i.width&&(n=s.resolve(o+i.map[i.width*(a.top+1)-1]))):(a.left>0&&(n=s.resolve(o+i.map[a.top*i.width])),r.right<i.width&&(e=s.resolve(o+i.map[i.width*(r.top+1)-1]))),new t(e,n)},t.prototype.toJSON=function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}},t.fromJSON=function(e,n){return new t(e.resolve(n.anchor),e.resolve(n.head))},t.create=function(e,n,i){return void 0===i&&(i=n),new t(e.resolve(n),e.resolve(i))},t.prototype.getBookmark=function(){return new Is(this.$anchorCell.pos,this.$headCell.pos)},t}(et);Es.prototype.visible=!1,et.jsonID("cell",Es);var Is=function(e,t){this.anchor=e,this.head=t};function Ts(e){if(!(e.selection instanceof Es))return null;var t=[];return e.selection.forEachCell((function(e,n){t.push(Pa.node(n,n+e.nodeSize,{class:"selectedCell"}))})),Ra.create(e.doc,t)}function Ds(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,i=e.openEnd;1==t.childCount&&(n>0&&i>0||"table"==t.firstChild.type.spec.tableRole);)n--,i--,t=t.firstChild.content;var o=t.firstChild,a=o.type.spec.tableRole,s=o.type.schema,c=[];if("row"==a)for(var d=0;d<t.childCount;d++){var l=t.child(d).content,p=d?0:Math.max(0,n-1),h=d<t.childCount-1?0:Math.max(0,i-1);(p||h)&&(l=Bs(hs(s).row,new u(l,p,h)).content),c.push(l)}else{if("cell"!=a&&"header_cell"!=a)return null;c.push(n||i?Bs(hs(s).row,new u(t,n,i)).content:t)}return function(e,t){for(var n=[],i=0;i<t.length;i++)for(var o=t[i],a=o.childCount-1;a>=0;a--)for(var s=o.child(a).attrs,c=s.rowspan,d=s.colspan,l=i;l<i+c;l++)n[l]=(n[l]||0)+d;for(var p=0,u=0;u<n.length;u++)p=Math.max(p,n[u]);for(var h=0;h<n.length;h++)if(h>=t.length&&t.push(r.empty),n[h]<p){for(var f=hs(e).cell.createAndFill(),b=[],m=n[h];m<p;m++)b.push(f);t[h]=t[h].append(r.from(b))}return{height:t.length,width:p,rows:t}}(s,c)}function Bs(e,t){var n=e.createAndFill();return new _e(n).replace(0,n.content.size,t).doc}function Ps(e,t,n){var i=e.width,o=e.height,a=e.rows;if(i!=t){for(var s=[],c=[],d=0;d<a.length;d++){for(var l=a[d],p=[],u=s[d]||0,h=0;u<t;h++){var f=l.child(h%l.childCount);u+f.attrs.colspan>t&&(f=f.type.create(ws(f.attrs,f.attrs.colspan,u+f.attrs.colspan-t),f.content)),p.push(f),u+=f.attrs.colspan;for(var b=1;b<f.attrs.rowspan;b++)s[d+b]=(s[d+b]||0)+f.attrs.colspan}c.push(r.from(p))}a=c,i=t}if(o!=n){for(var m=[],g=0,v=0;g<n;g++,v++){for(var y=[],_=a[v%o],O=0;O<_.childCount;O++){var j=_.child(O);g+j.attrs.rowspan>n&&(j=j.type.create(ks(j.attrs,"rowspan",Math.max(1,n-j.attrs.rowspan)),j.content)),y.push(j)}m.push(r.from(y))}a=m,o=n}return{width:i,height:o,rows:a}}function As(e,t,n,i,o,r,a,s){if(0==a||a==t.height)return!1;for(var c=!1,d=o;d<r;d++){var l=a*t.width+d,p=t.map[l];if(t.map[l-t.width]==p){c=!0;var u=n.nodeAt(p),h=t.findCell(p),f=h.top,b=h.left;e.setNodeMarkup(e.mapping.slice(s).map(p+i),null,ks(u.attrs,"rowspan",a-f)),e.insert(e.mapping.slice(s).map(t.positionAt(a,b,n)),u.type.createAndFill(ks(u.attrs,"rowspan",f+u.attrs.rowspan-a))),d+=u.attrs.colspan-1}}return c}function Ms(e,t,n,i,o,r,a,s){if(0==a||a==t.width)return!1;for(var c=!1,d=o;d<r;d++){var l=d*t.width+a,p=t.map[l];if(t.map[l-1]==p){c=!0;var u=n.nodeAt(p),h=t.colCount(p),f=e.mapping.slice(s).map(p+i);e.setNodeMarkup(f,null,ws(u.attrs,a-h,u.attrs.colspan-(a-h))),e.insert(f+u.nodeSize,u.type.createAndFill(ws(u.attrs,0,a-h))),d+=u.attrs.rowspan-1}}return c}function zs(e,t,n,i,o){var a=n?e.doc.nodeAt(n-1):e.doc,s=cs.get(a),c=i.top,d=i.left,l=d+o.width,p=c+o.height,h=e.tr,f=0;function b(){a=n?h.doc.nodeAt(n-1):h.doc,s=cs.get(a),f=h.mapping.maps.length}(function(e,t,n,i,o,a,s){var c,d,l=hs(e.doc.type.schema);if(o>t.width)for(var p=0,u=0;p<t.height;p++){var h=n.child(p);u+=h.nodeSize;var f=[],b=void 0;b=null==h.lastChild||h.lastChild.type==l.cell?c||(c=l.cell.createAndFill()):d||(d=l.header_cell.createAndFill());for(var m=t.width;m<o;m++)f.push(b);e.insert(e.mapping.slice(s).map(u-1+i),f)}if(a>t.height){for(var g=[],v=0,y=(t.height-1)*t.width;v<Math.max(t.width,o);v++){var _=!(v>=t.width)&&n.nodeAt(t.map[y+v]).type==l.header_cell;g.push(_?d||(d=l.header_cell.createAndFill()):c||(c=l.cell.createAndFill()))}for(var O=l.row.create(null,r.from(g)),j=[],C=t.height;C<a;C++)j.push(O);e.insert(e.mapping.slice(s).map(i+n.nodeSize-2),j)}return!(!c&&!d)})(h,s,a,n,l,p,f)&&b(),As(h,s,a,n,d,l,c,f)&&b(),As(h,s,a,n,d,l,p,f)&&b(),Ms(h,s,a,n,c,p,d,f)&&b(),Ms(h,s,a,n,c,p,l,f)&&b();for(var m=c;m<p;m++){var g=s.positionAt(m,d,a),v=s.positionAt(m,l,a);h.replace(h.mapping.slice(f).map(g+n),h.mapping.slice(f).map(v+n),new u(o.rows[m-c],0,0))}b(),h.setSelection(new Es(h.doc.resolve(n+s.positionAt(c,d,a)),h.doc.resolve(n+s.positionAt(p-1,l-1,a)))),t(h)}Is.prototype.map=function(e){return new Is(e.map(this.anchor),e.map(this.head))},Is.prototype.resolve=function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&_s(t,n)?new Es(t,n):et.near(n,1)};var Rs=lo({ArrowLeft:Ns("horiz",-1),ArrowRight:Ns("horiz",1),ArrowUp:Ns("vert",-1),ArrowDown:Ns("vert",1),"Shift-ArrowLeft":Ls("horiz",-1),"Shift-ArrowRight":Ls("horiz",1),"Shift-ArrowUp":Ls("vert",-1),"Shift-ArrowDown":Ls("vert",1),Backspace:Vs,"Mod-Backspace":Vs,Delete:Vs,"Mod-Delete":Vs});function Fs(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Ns(e,t){return function(n,i,o){var r=n.selection;if(r instanceof Es)return Fs(n,i,et.near(r.$headCell,t));if("horiz"!=e&&!r.empty)return!1;var a=Ws(o,e,t);if(null==a)return!1;if("horiz"==e)return Fs(n,i,et.near(n.doc.resolve(r.head+t),t));var s,c=n.doc.resolve(a),d=Cs(c,e,t);return s=d?et.near(d,1):t<0?et.near(n.doc.resolve(c.before(-1)),-1):et.near(n.doc.resolve(c.after(-1)),1),Fs(n,i,s)}}function Ls(e,t){return function(n,i,o){var r=n.selection;if(!(r instanceof Es)){var a=Ws(o,e,t);if(null==a)return!1;r=new Es(n.doc.resolve(a))}var s=Cs(r.$headCell,e,t);return!!s&&Fs(n,i,new Es(r.$anchorCell,s))}}function Vs(e,t){var n=e.selection;if(!(n instanceof Es))return!1;if(t){var i=e.tr,o=hs(e.schema).cell.createAndFill().content;n.forEachCell((function(e,t){e.content.eq(o)||i.replace(i.mapping.map(t+1),i.mapping.map(t+e.nodeSize-1),new u(o,0,0))})),i.docChanged&&t(i)}return!0}function Hs(e,t){var n=bs(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new Es(n))),!0)}function Ks(e,t,n){if(!ms(e.state))return!1;var i=Ds(n),o=e.state.selection;if(o instanceof Es){i||(i={width:1,height:1,rows:[r.from(Bs(hs(e.state.schema).cell,n))]});var a=o.$anchorCell.node(-1),s=o.$anchorCell.start(-1),c=cs.get(a).rectBetween(o.$anchorCell.pos-s,o.$headCell.pos-s);return i=Ps(i,c.right-c.left,c.bottom-c.top),zs(e.state,e.dispatch,s,c,i),!0}if(i){var d=gs(e.state),l=d.start(-1);return zs(e.state,e.dispatch,l,cs.get(d.node(-1)).findCell(d.pos-l),i),!0}return!1}function $s(e,t){if(!t.ctrlKey&&!t.metaKey){var n,i=Us(e,t.target);if(t.shiftKey&&e.state.selection instanceof Es)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&i&&null!=(n=bs(e.state.selection.$anchor))&&Gs(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!i)return;e.root.addEventListener("mouseup",r),e.root.addEventListener("dragstart",r),e.root.addEventListener("mousemove",a)}function o(t,n){var i=Gs(e,n),o=null==fs.getState(e.state);if(!i||!_s(t,i)){if(!o)return;i=t}var r=new Es(t,i);if(o||!e.state.selection.eq(r)){var a=e.state.tr.setSelection(r);o&&a.setMeta(fs,t.pos),e.dispatch(a)}}function r(){e.root.removeEventListener("mouseup",r),e.root.removeEventListener("dragstart",r),e.root.removeEventListener("mousemove",a),null!=fs.getState(e.state)&&e.dispatch(e.state.tr.setMeta(fs,-1))}function a(n){var a,s=fs.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(Us(e,n.target)!=i&&!(a=Gs(e,t)))return r();a&&o(a,n)}}function Ws(e,t,n){if(!(e.state.selection instanceof it))return null;for(var i=e.state.selection.$head,o=i.depth-1;o>=0;o--){var r=i.node(o);if((n<0?i.index(o):i.indexAfter(o))!=(n<0?0:r.childCount))return null;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){var a=i.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?a:null}}return null}function Us(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Gs(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?bs(e.state.doc.resolve(n.pos)):null}var Zs=new jt("fix-tables");function qs(e,t){var n,i=function(t,i){"table"==t.type.spec.tableRole&&(n=function(e,t,n,i){var o=cs.get(t);if(!o.problems)return i;i||(i=e.tr);for(var r,a,s=[],c=0;c<o.height;c++)s.push(0);for(var d=0;d<o.problems.length;d++){var l=o.problems[d];if("collision"==l.type){for(var p=t.nodeAt(l.pos),u=0;u<p.attrs.rowspan;u++)s[l.row+u]+=l.n;i.setNodeMarkup(i.mapping.map(n+1+l.pos),null,ws(p.attrs,p.attrs.colspan-l.n,l.n))}else if("missing"==l.type)s[l.row]+=l.n;else if("overlong_rowspan"==l.type){var h=t.nodeAt(l.pos);i.setNodeMarkup(i.mapping.map(n+1+l.pos),null,ks(h.attrs,"rowspan",h.attrs.rowspan-l.n))}else if("colwidth mismatch"==l.type){var f=t.nodeAt(l.pos);i.setNodeMarkup(i.mapping.map(n+1+l.pos),null,ks(f.attrs,"colwidth",l.colwidth))}}for(var b=0;b<s.length;b++)s[b]&&(null==r&&(r=b),a=b);for(var m=0,g=n+1;m<o.height;m++){var v=t.child(m),y=g+v.nodeSize,_=s[m];if(_>0){var O="cell";v.firstChild&&(O=v.firstChild.type.spec.tableRole);for(var j=[],C=0;C<_;C++)j.push(hs(e.schema)[O].createAndFill());var k=0!=m&&r!=m-1||a!=m?y-1:g+1;i.insert(i.mapping.map(k),j)}g=y}return i.setMeta(Zs,{fixTables:!0})}(e,t,i,n))};return t?t.doc!=e.doc&&function e(t,n,i,o){var r=t.childCount,a=n.childCount;e:for(var s=0,c=0;s<a;s++){for(var d=n.child(s),l=c,p=Math.min(r,s+3);l<p;l++)if(t.child(l)==d){c=l+1,i+=d.nodeSize;continue e}o(d,i),c<r&&t.child(c).sameMarkup(d)?e(t.child(c),d,i+1,o):d.nodesBetween(0,d.content.size,o,i+1),i+=d.nodeSize}}(t.doc,e.doc,0,i):e.doc.descendants(i),n}function Js(e){var t,n=e.selection,i=gs(e),o=i.node(-1),r=i.start(-1),a=cs.get(o);return(t=n instanceof Es?a.rectBetween(n.$anchorCell.pos-r,n.$headCell.pos-r):a.findCell(i.pos-r)).tableStart=r,t.map=a,t.table=o,t}function Xs(e,t,n){var i=t.map,o=t.tableStart,r=t.table,a=n>0?-1:0;xs(i,r,n+a)&&(a=0==n||n==i.width?null:0);for(var s=0;s<i.height;s++){var c=s*i.width+n;if(n>0&&n<i.width&&i.map[c-1]==i.map[c]){var d=i.map[c],l=r.nodeAt(d);e.setNodeMarkup(e.mapping.map(o+d),null,Ss(l.attrs,n-i.colCount(d))),s+=l.attrs.rowspan-1}else{var p=null==a?hs(r.type.schema).cell:r.nodeAt(i.map[c+a]).type,u=i.positionAt(s,n,r);e.insert(e.mapping.map(o+u),p.createAndFill())}}return e}function Ys(e,t){if(!ms(e))return!1;if(t){var n=Js(e);t(Xs(e.tr,n,n.left))}return!0}function Qs(e,t){if(!ms(e))return!1;if(t){var n=Js(e);t(Xs(e.tr,n,n.right))}return!0}function ec(e,t,n){for(var i=t.map,o=t.table,r=t.tableStart,a=e.mapping.maps.length,s=0;s<i.height;){var c=s*i.width+n,d=i.map[c],l=o.nodeAt(d);if(n>0&&i.map[c-1]==d||n<i.width-1&&i.map[c+1]==d)e.setNodeMarkup(e.mapping.slice(a).map(r+d),null,ws(l.attrs,n-i.colCount(d)));else{var p=e.mapping.slice(a).map(r+d);e.delete(p,p+l.nodeSize)}s+=l.attrs.rowspan}}function tc(e,t){if(!ms(e))return!1;if(t){var n=Js(e),i=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;ec(i,n,o),o!=n.left;o--)n.table=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc,n.map=cs.get(n.table);t(i)}return!0}function nc(e,t,n){for(var i=hs(t.type.schema).header_cell,o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=i)return!1;return!0}function ic(e,t,n){for(var i=t.map,o=t.tableStart,r=t.table,a=o,s=0;s<n;s++)a+=r.child(s).nodeSize;var c=[],d=n>0?-1:0;nc(i,r,n+d)&&(d=0==n||n==i.height?null:0);for(var l=0,p=i.width*n;l<i.width;l++,p++)if(n>0&&n<i.height&&i.map[p]==i.map[p-i.width]){var u=i.map[p],h=r.nodeAt(u).attrs;e.setNodeMarkup(o+u,null,ks(h,"rowspan",h.rowspan+1)),l+=h.colspan-1}else{var f=null==d?hs(r.type.schema).cell:r.nodeAt(i.map[p+d*i.width]).type;c.push(f.createAndFill())}return e.insert(a,hs(r.type.schema).row.create(null,c)),e}function oc(e,t){if(!ms(e))return!1;if(t){var n=Js(e);t(ic(e.tr,n,n.top))}return!0}function rc(e,t){if(!ms(e))return!1;if(t){var n=Js(e);t(ic(e.tr,n,n.bottom))}return!0}function ac(e,t,n){for(var i=t.map,o=t.table,r=t.tableStart,a=0,s=0;s<n;s++)a+=o.child(s).nodeSize;var c=a+o.child(n).nodeSize,d=e.mapping.maps.length;e.delete(a+r,c+r);for(var l=0,p=n*i.width;l<i.width;l++,p++){var u=i.map[p];if(n>0&&u==i.map[p-i.width]){var h=o.nodeAt(u).attrs;e.setNodeMarkup(e.mapping.slice(d).map(u+r),null,ks(h,"rowspan",h.rowspan-1)),l+=h.colspan-1}else if(n<i.width&&u==i.map[p+i.width]){var f=o.nodeAt(u),b=f.type.create(ks(f.attrs,"rowspan",f.attrs.rowspan-1),f.content),m=i.positionAt(n+1,l,o);e.insert(e.mapping.slice(d).map(r+m),b),l+=f.attrs.colspan-1}}}function sc(e,t){if(!ms(e))return!1;if(t){var n=Js(e),i=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;ac(i,n,o),o!=n.top;o--)n.table=n.tableStart?i.doc.nodeAt(n.tableStart-1):i.doc,n.map=cs.get(n.table);t(i)}return!0}function cc(e){var t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function dc(e,t){var n=e.selection;if(!(n instanceof Es)||n.$anchorCell.pos==n.$headCell.pos)return!1;var i=Js(e),o=i.map;if(function(e,t){for(var n=e.width,i=e.height,o=e.map,r=t.top*n+t.left,a=r,s=(t.bottom-1)*n+t.left,c=r+(t.right-t.left-1),d=t.top;d<t.bottom;d++){if(t.left>0&&o[a]==o[a-1]||t.right<n&&o[c]==o[c+1])return!0;a+=n,c+=n}for(var l=t.left;l<t.right;l++){if(t.top>0&&o[r]==o[r-n]||t.bottom<i&&o[s]==o[s+n])return!0;r++,s++}return!1}(o,i))return!1;if(t){for(var a,s,c=e.tr,d={},l=r.empty,p=i.top;p<i.bottom;p++)for(var u=i.left;u<i.right;u++){var h=o.map[p*o.width+u],f=i.table.nodeAt(h);if(!d[h])if(d[h]=!0,null==a)a=h,s=f;else{cc(f)||(l=l.append(f.content));var b=c.mapping.map(h+i.tableStart);c.delete(b,b+f.nodeSize)}}if(c.setNodeMarkup(a+i.tableStart,null,ks(Ss(s.attrs,s.attrs.colspan,i.right-i.left-s.attrs.colspan),"rowspan",i.bottom-i.top)),l.size){var m=a+1+s.content.size,g=cc(s)?a+1:m;c.replaceWith(g+i.tableStart,m+i.tableStart,l)}c.setSelection(new Es(c.doc.resolve(a+i.tableStart))),t(c)}return!0}function lc(e,t){var n=hs(e.schema);return pc((function(e){var t=e.node;return n[t.type.spec.tableRole]}))(e,t)}function pc(e){return function(t,n){var i,o,r=t.selection;if(r instanceof Es){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,o=r.$anchorCell.pos}else{if(!(i=function(e){for(var t=e.depth;t>0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(r.$from)))return!1;o=bs(r.$from).pos}if(1==i.attrs.colspan&&1==i.attrs.rowspan)return!1;if(n){var a=i.attrs,s=[],c=a.colwidth;a.rowspan>1&&(a=ks(a,"rowspan",1)),a.colspan>1&&(a=ks(a,"colspan",1));for(var d,l=Js(t),p=t.tr,u=0;u<l.right-l.left;u++)s.push(c?ks(a,"colwidth",c&&c[u]?[c[u]]:null):a);for(var h=l.top;h<l.bottom;h++){var f=l.map.positionAt(h,l.left,l.table);h==l.top&&(f+=i.nodeSize);for(var b=l.left,m=0;b<l.right;b++,m++)b==l.left&&h==l.top||p.insert(d=p.mapping.map(f+l.tableStart,1),e({node:i,row:h,col:b}).createAndFill(s[m]))}p.setNodeMarkup(o,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof Es&&p.setSelection(new Es(p.doc.resolve(r.$anchorCell.pos),d&&p.doc.resolve(d))),n(p)}return!0}}function uc(e,t){return function(n,i){if(!ms(n))return!1;var o=gs(n);if(o.nodeAfter.attrs[e]===t)return!1;if(i){var r=n.tr;n.selection instanceof Es?n.selection.forEachCell((function(n,i){n.attrs[e]!==t&&r.setNodeMarkup(i,null,ks(n.attrs,e,t))})):r.setNodeMarkup(o.pos,null,ks(o.nodeAfter.attrs,e,t)),i(r)}return!0}}function hc(e,t,n){for(var i=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1}),o=0;o<i.length;o++){var r=t.table.nodeAt(i[o]);if(r&&r.type!==n.header_cell)return!1}return!0}function fc(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!ms(t))return!1;if(n){for(var i=hs(t.schema),o=Js(t),r=t.tr,a=o.map.cellsInRect("column"==e?new ss(o.left,0,o.right,o.map.height):"row"==e?new ss(0,o.top,o.map.width,o.bottom):o),s=a.map((function(e){return o.table.nodeAt(e)})),c=0;c<a.length;c++)s[c].type==i.header_cell&&r.setNodeMarkup(o.tableStart+a[c],i.cell,s[c].attrs);if(0==r.steps.length)for(var d=0;d<a.length;d++)r.setNodeMarkup(o.tableStart+a[d],i.header_cell,s[d].attrs);n(r)}return!0}}(e):function(t,n){if(!ms(t))return!1;if(n){var i=hs(t.schema),o=Js(t),r=t.tr,a=hc("row",o,i),s=hc("column",o,i),c=("column"===e?a:"row"===e&&s)?1:0,d="column"==e?new ss(0,c,1,o.map.height):"row"==e?new ss(c,0,o.map.width,1):o,l="column"==e?s?i.cell:i.header_cell:"row"==e?a?i.cell:i.header_cell:i.cell;o.map.cellsInRect(d).forEach((function(e){var t=e+o.tableStart,n=r.doc.nodeAt(t);n&&r.setNodeMarkup(t,l,n.attrs)})),n(r)}return!0}}var bc=fc("row",{useDeprecatedLogic:!0}),mc=fc("column",{useDeprecatedLogic:!0}),gc=fc("cell",{useDeprecatedLogic:!0});function vc(e){return function(t,n){if(!ms(t))return!1;var i=function(e,t){if(t<0){var n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(var i=e.index(-1)-1,o=e.before();i>=0;i--){var r=e.node(-1).child(i);if(r.childCount)return o-1-r.lastChild.nodeSize;o-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;for(var a=e.node(-1),s=e.indexAfter(-1),c=e.after();s<a.childCount;s++){var d=a.child(s);if(d.childCount)return c+1;c+=d.nodeSize}}}(gs(t),e);if(null!=i){if(n){var o=t.doc.resolve(i);n(t.tr.setSelection(it.between(o,ys(o))).scrollIntoView())}return!0}}}function yc(e,t){for(var n=e.selection.$anchor,i=n.depth;i>0;i--){if("table"==n.node(i).type.spec.tableRole)return t&&t(e.tr.delete(n.before(i),n.after(i)).scrollIntoView()),!0}return!1}var _c=function(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Oc(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))};function Oc(e,t,n,i,o,r){for(var a=0,s=!0,c=t.firstChild,d=e.firstChild,l=0,p=0;l<d.childCount;l++)for(var u=d.child(l).attrs,h=u.colspan,f=u.colwidth,b=0;b<h;b++,p++){var m=o==p?r:f&&f[b],g=m?m+"px":"";a+=m||i,m||(s=!1),c?(c.style.width!=g&&(c.style.width=g),c=c.nextSibling):t.appendChild(document.createElement("col")).style.width=g}for(;c;){var v=c.nextSibling;c.parentNode.removeChild(c),c=v}s?(n.style.width=a+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=a+"px")}_c.prototype.update=function(e){return e.type==this.node.type&&(this.node=e,Oc(e,this.colgroup,this.table,this.cellMinWidth),!0)},_c.prototype.ignoreMutation=function(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))};var jc=new jt("tableColumnResizing");function Cc(e){void 0===e&&(e={});var t=e.handleWidth;void 0===t&&(t=5);var n=e.cellMinWidth;void 0===n&&(n=25);var i=e.View;void 0===i&&(i=_c);var o=e.lastColumnResizable;return void 0===o&&(o=!0),new yt({key:jc,state:{init:function(e,t){return this.spec.props.nodeViews[hs(t.schema).table.name]=function(e,t){return new i(e,n,t)},new kc(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return jc.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,n){!function(e,t,n,i,o){var r=jc.getState(e.state);if(!r.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var c=a.getBoundingClientRect(),d=c.left,l=c.right;t.clientX-d<=n?s=wc(e,t,"left"):l-t.clientX<=n&&(s=wc(e,t,"right"))}if(s!=r.activeHandle){if(!o&&-1!==s){var p=e.state.doc.resolve(s),u=p.node(-1),h=cs.get(u),f=p.start(-1);if(h.colCount(p.pos-f)+p.nodeAfter.attrs.colspan-1==h.width-1)return}xc(e,s)}}}(e,n,t,0,o)},mouseleave:function(e){!function(e){var t=jc.getState(e.state);t.activeHandle>-1&&!t.dragging&&xc(e,-1)}(e)},mousedown:function(e,t){!function(e,t,n){var i=jc.getState(e.state);if(-1==i.activeHandle||i.dragging)return!1;var o=e.state.doc.nodeAt(i.activeHandle),r=function(e,t,n){var i=n.colspan,o=n.colwidth,r=o&&o[o.length-1];if(r)return r;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,c=i;if(o)for(var d=0;d<i;d++)o[d]&&(s-=o[d],c--);return s/c}(e,i.activeHandle,o.attrs);function a(t){window.removeEventListener("mouseup",a),window.removeEventListener("mousemove",s);var i=jc.getState(e.state);i.dragging&&(!function(e,t,n){for(var i=e.state.doc.resolve(t),o=i.node(-1),r=cs.get(o),a=i.start(-1),s=r.colCount(i.pos-a)+i.nodeAfter.attrs.colspan-1,c=e.state.tr,d=0;d<r.height;d++){var l=d*r.width+s;if(!d||r.map[l]!=r.map[l-r.width]){var p=r.map[l],u=o.nodeAt(p).attrs,h=1==u.colspan?0:s-r.colCount(p);if(!u.colwidth||u.colwidth[h]!=n){var f=u.colwidth?u.colwidth.slice():Ec(u.colspan);f[h]=n,c.setNodeMarkup(a+p,null,ks(u,"colwidth",f))}}}c.docChanged&&e.dispatch(c)}(e,i.activeHandle,Sc(i.dragging,t,n)),e.dispatch(e.state.tr.setMeta(jc,{setDragging:null})))}function s(t){if(!t.which)return a(t);var i=jc.getState(e.state),o=Sc(i.dragging,t,n);!function(e,t,n,i){var o=e.state.doc.resolve(t),r=o.node(-1),a=o.start(-1),s=cs.get(r).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1,c=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=c.nodeName;)c=c.parentNode;Oc(r,c.firstChild,c,i,s,n)}(e,i.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(jc,{setDragging:{startX:t.clientX,startWidth:r}})),window.addEventListener("mouseup",a),window.addEventListener("mousemove",s),t.preventDefault()}(e,t,n)}},decorations:function(e){var t=jc.getState(e);if(t.activeHandle>-1)return function(e,t){for(var n=[],i=e.doc.resolve(t),o=i.node(-1),r=cs.get(o),a=i.start(-1),s=r.colCount(i.pos-a)+i.nodeAfter.attrs.colspan,c=0;c<r.height;c++){var d=s+c*r.width-1;if(!(s!=r.width&&r.map[d]==r.map[d+1]||0!=c&&r.map[d-1]==r.map[d-1-r.width])){var l=r.map[d],p=a+l+o.nodeAt(l).nodeSize-1,u=document.createElement("div");u.className="column-resize-handle",n.push(Pa.widget(p,u))}}return Ra.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}})}var kc=function(e,t){this.activeHandle=e,this.dragging=t};function wc(e,t,n){var i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i)return-1;var o=i.pos,r=bs(e.state.doc.resolve(o));if(!r)return-1;if("right"==n)return r.pos;var a=cs.get(r.node(-1)),s=r.start(-1),c=a.map.indexOf(r.pos-s);return c%a.width==0?-1:s+a.map[c-1]}function Sc(e,t,n){var i=t.clientX-e.startX;return Math.max(n,e.startWidth+i)}function xc(e,t){e.dispatch(e.state.tr.setMeta(jc,{setHandle:t}))}function Ec(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function Ic(e){void 0===e&&(e={});var t=e.allowTableNodeSelection;return void 0===t&&(t=!1),new yt({key:fs,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(fs);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var i=e.mapping.mapResult(t),o=i.deleted,r=i.pos;return o?null:r}},props:{decorations:Ts,handleDOMEvents:{mousedown:$s},createSelectionBetween:function(e){if(null!=fs.getState(e.state))return e.state.selection},handleTripleClick:Hs,handleKeyDown:Rs,handlePaste:Ks},appendTransaction:function(e,n,i){return function(e,t,n){var i,o,r=(t||e).selection,a=(t||e).doc;if(r instanceof rt&&(o=r.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)i=Es.create(a,r.from);else if("row"==o){var s=a.resolve(r.from+1);i=Es.rowSelection(s,s)}else if(!n){var c=cs.get(r.node),d=r.from+1,l=d+c.map[c.width*c.height-1];i=Es.create(a,d+1,l)}}else r instanceof it&&function(e){var t=e.$from,n=e.$to;if(t.pos==n.pos||t.pos<t.pos-6)return!1;for(var i=t.pos,o=n.pos,r=t.depth;r>=0&&!(t.after(r+1)<t.end(r));r--,i++);for(var a=n.depth;a>=0&&!(n.before(a+1)>n.start(a));a--,o--);return i==o&&/row|table/.test(t.node(r).type.spec.tableRole)}(r)?i=it.create(a,r.from):r instanceof it&&function(e){for(var t,n,i=e.$from,o=e.$to,r=i.depth;r>0;r--){var a=i.node(r);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var c=o.node(s);if("cell"===c.type.spec.tableRole||"header_cell"===c.type.spec.tableRole){n=c;break}}return t!==n&&0===o.parentOffset}(r)&&(i=it.create(a,r.$from.start(),r.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}(i,qs(i,n),t)}})}kc.prototype.apply=function(e){var t=this,n=e.getMeta(jc);if(n&&null!=n.setHandle)return new kc(n.setHandle,null);if(n&&void 0!==n.setDragging)return new kc(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){var i=e.mapping.map(t.activeHandle,-1);vs(e.doc.resolve(i))||(i=null),t=new kc(i,t.dragging)}return t};var Tc=["blockquote",0],Dc=["hr"],Bc=["pre",["code",0]],Pc=["ol",0],Ac=["ul",0],Mc=["li",0],zc=function(e){for(var t,n={},i=e.attributes,o=0;o<i.length;o++)n[(t=i[o]).name]=t.value;return n},Rc=function(e){var t={};return e.forEach((function(e){t[e]={default:null}})),t},Fc=function(){return Rc(["style","class","id"])},Nc=function(e,t){for(var n in e)if(n&&null!==e[n]&&n!==t)return!0;return!1},Lc=function(e,t){var n={};for(var i in e)i&&null!==e[i]&&i!==t&&(n[i]=e[i]);return n},Vc=function(e){var t;return(t={})[e]={name:e,inclusive:!0,parseDOM:[{tag:e}],toDOM:function(){return[e,0]}},t},Hc=At.__assign({link:{attrs:At.__assign({},Fc(),{href:{default:null},target:{default:null},title:{default:null}}),inclusive:!1,parseDOM:[{tag:"a",getAttrs:zc}],toDOM:function(e){return["a",Lc(e.attrs),0]}}},Vc("strong"),Vc("b"),Vc("em"),Vc("i"),Vc("u"),Vc("del"),Vc("sub"),Vc("sup"),Vc("code"),{style:{attrs:At.__assign({},Fc()),parseDOM:[{tag:"span",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["span",Lc(e.attrs),0]:["span",0]}}}),Kc=function(e){var t;return(t={})[e]={default:null,getFromDOM:function(t){return t.getAttribute(e)},setDOMAttr:function(t,n){n[e]=t}},t},$c=At.__assign({},Kc("style"),Kc("class"),Kc("id"),Kc("headers")),Wc={doc:{content:"colgroup*"},col:{attrs:Rc(["id","class","style","span"]),parseDOM:[{getAttrs:zc,tag:"col"}],toDOM:function(e){return["col",e.attrs]}},colgroup:{attrs:Rc(["id","class","style","span"]),content:"col*",parseDOM:[{getAttrs:zc,tag:"colgroup"}],toDOM:function(e){return["colgroup",e.attrs,0]}},text:{inline:!0,group:"inline"}},Uc=new Y({nodes:Wc,marks:{}}),Gc=us({tableGroup:"block",cellContent:"block+",cellAttributes:$c});Gc.table_row.attrs=At.__assign({},Gc.table_row.attrs,Rc([Ct,"style","class","id"])),Gc.table_row.toDOM=function(e){return["tr",Lc(e.attrs),0]},Gc.table_row.parseDOM=[{tag:"tr",getAttrs:zc}],Gc.table.attrs=At.__assign({},Gc.table.attrs,Rc(["style","class","id","k-colgroup-data"])),Gc.table.toDOM=function(e){var t=Nc(e.attrs)?Lc(e.attrs,"k-colgroup-data"):{},n=null;if(e.attrs["k-colgroup-data"]&&!function(e){for(var t=!1,n=e.child(0),i=0;i<n.childCount;i++){if(n.child(i).attrs.colwidth){t=!0;break}}return t}(e)){var i=Tt(Et(e.attrs["k-colgroup-data"]),Uc,{preserveWhitespace:!1}),o=It(i).firstChild;if(o){var r=Array.from(o.children).map((function(e){return["col",zc(e)]}));n=["colgroup",zc(o)].concat(r)}}return n?["table",t,n,["tbody",0]]:["table",t,["tbody",0]]},Gc.table.parseDOM=[{tag:"table",getAttrs:function(e){var t=zc(e),n=Array.from(e.childNodes).find((function(e){return"COLGROUP"===e.nodeName}));return n&&(t["k-colgroup-data"]=n.outerHTML),t}}];var Zc=At.__assign({doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:At.__assign({},Fc()),parseDOM:[{tag:"p",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["p",Lc(e.attrs),0]:["p",0]}},div:{content:"block*",group:"block",attrs:At.__assign({},Fc()),parseDOM:[{tag:"div",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["div",Lc(e.attrs),0]:["div",0]}},blockquote:{attrs:At.__assign({},Fc()),content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["blockquote",Lc(e.attrs),0]:Tc}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return Dc}},heading:{attrs:At.__assign({},Fc(),{level:{default:1}}),content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:function(e){return At.__assign({},zc(e),{level:1})}},{tag:"h2",getAttrs:function(e){return At.__assign({},zc(e),{level:2})}},{tag:"h3",getAttrs:function(e){return At.__assign({},zc(e),{level:3})}},{tag:"h4",getAttrs:function(e){return At.__assign({},zc(e),{level:4})}},{tag:"h5",getAttrs:function(e){return At.__assign({},zc(e),{level:5})}},{tag:"h6",getAttrs:function(e){return At.__assign({},zc(e),{level:6})}}],toDOM:function(e){return Nc(e.attrs,"level")?["h"+e.attrs.level,Lc(e.attrs,"level"),0]:["h"+e.attrs.level,0]}},code_block:{content:"text*",marks:"",group:"block",code:!0,defining:!0,parseDOM:[{tag:"pre",preserveWhitespace:"full"}],toDOM:function(){return Bc}},text:{inline:!0,group:"inline"},image:{inline:!0,attrs:At.__assign({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}},Fc()),group:"inline",draggable:!0,parseDOM:[{tag:"img",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["img",Lc(e.attrs)]:["img"]}},hard_break:{inline:!0,attrs:At.__assign({},Fc()),group:"inline",selectable:!1,parseDOM:[{tag:"br",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["br",Lc(e.attrs)]:["br"]}},ordered_list:{content:"list_item+",group:"block",attrs:At.__assign({},Fc(),{type:{default:null},order:{default:1}}),parseDOM:[{tag:"ol",getAttrs:function(e){return At.__assign({},zc(e),{order:e.hasAttribute("start")?parseInt(e.getAttribute("start")||"1",10):1})}}],toDOM:function(e){return 1===e.attrs.order?Nc(e.attrs,"order")?["ol",Lc(e.attrs,"order"),0]:Pc:["ol",At.__assign({},Lc(e.attrs,"order"),{start:e.attrs.order}),0]}},bullet_list:{content:"list_item+",group:"block",attrs:At.__assign({},Fc()),parseDOM:[{tag:"ul",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["ul",Lc(e.attrs),0]:Ac}},list_item:{content:"(paragraph | heading) block*",attrs:At.__assign({},Fc()),parseDOM:[{tag:"li",getAttrs:zc}],toDOM:function(e){return Nc(e.attrs)?["li",Lc(e.attrs),0]:Mc},defining:!0}},Gc),qc=function(){};qc.prototype.append=function(e){return e.length?(e=qc.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},qc.prototype.prepend=function(e){return e.length?qc.from(e).append(this):this},qc.prototype.appendInner=function(e){return new Xc(this,e)},qc.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?qc.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},qc.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},qc.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},qc.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var i=[];return this.forEach((function(t,n){return i.push(e(t,n))}),t,n),i},qc.from=function(e){return e instanceof qc?e:e&&e.length?new Jc(e):qc.empty};var Jc=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,i){for(var o=t;o<n;o++)if(!1===e(this.values[o],i+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,i){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],i+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(qc);qc.empty=new Jc([]);var Xc=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,i){var o=this.left.length;return!(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),i))&&(!(n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,i+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,i){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,i+o))&&(!(n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,i))&&void 0)},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(qc),Yc=qc,Qc=function(e,t){this.items=e,this.eventCount=t};Qc.prototype.popEvent=function(e,t){var n=this;if(0==this.eventCount)return null;for(var i,o,r=this.items.length;;r--){if(this.items.get(r-1).selection){--r;break}}t&&(i=this.remapping(r,this.items.length),o=i.maps.length);var a,s,c=e.tr,d=[],l=[];return this.items.forEach((function(e,t){if(!e.step)return i||(i=n.remapping(r,t+1),o=i.maps.length),o--,void l.push(e);if(i){l.push(new ed(e.map));var p,u=e.step.map(i.slice(o));u&&c.maybeStep(u).doc&&(p=c.mapping.maps[c.mapping.maps.length-1],d.push(new ed(p,null,null,d.length+l.length))),o--,p&&i.appendMap(p,o)}else c.maybeStep(e.step);return e.selection?(a=i?e.selection.map(i.slice(o)):e.selection,s=new Qc(n.items.slice(0,r).append(l.reverse().concat(d)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:c,selection:a}},Qc.prototype.addTransform=function(e,t,n,i){for(var o=[],r=this.eventCount,a=this.items,s=!i&&a.length?a.get(a.length-1):null,c=0;c<e.steps.length;c++){var d,l=e.steps[c].invert(e.docs[c]),p=new ed(e.mapping.maps[c],l,t);(d=s&&s.merge(p))&&(p=d,c?o.pop():a=a.slice(0,a.length-1)),o.push(p),t&&(r++,t=null),i||(s=p)}var u,h,f,b=r-n.depth;return b>nd&&(h=b,(u=a).forEach((function(e,t){if(e.selection&&0==h--)return f=t,!1})),a=u.slice(f),r-=b),new Qc(a.append(o),r)},Qc.prototype.remapping=function(e,t){var n=new ve;return this.items.forEach((function(t,i){var o=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:null;n.appendMap(t.map,o)}),e,t),n},Qc.prototype.addMaps=function(e){return 0==this.eventCount?this:new Qc(this.items.append(e.map((function(e){return new ed(e)}))),this.eventCount)},Qc.prototype.rebased=function(e,t){if(!this.eventCount)return this;var n=[],i=Math.max(0,this.items.length-t),o=e.mapping,r=e.steps.length,a=this.eventCount;this.items.forEach((function(e){e.selection&&a--}),i);var s=t;this.items.forEach((function(t){var i=o.getMirror(--s);if(null!=i){r=Math.min(r,i);var c=o.maps[i];if(t.step){var d=e.steps[i].invert(e.docs[i]),l=t.selection&&t.selection.map(o.slice(s+1,i));l&&a++,n.push(new ed(c,d,l))}else n.push(new ed(c))}}),i);for(var c=[],d=t;d<r;d++)c.push(new ed(o.maps[d]));var l=this.items.slice(0,i).append(c).append(n),p=new Qc(l,a);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-n.length)),p},Qc.prototype.emptyItemCount=function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e},Qc.prototype.compress=function(e){void 0===e&&(e=this.items.length);var t=this.remapping(0,e),n=t.maps.length,i=[],o=0;return this.items.forEach((function(r,a){if(a>=e)i.push(r),r.selection&&o++;else if(r.step){var s=r.step.map(t.slice(n)),c=s&&s.getMap();if(n--,c&&t.appendMap(c,n),s){var d=r.selection&&r.selection.map(t.slice(n));d&&o++;var l,p=new ed(c.invert(),s,d),u=i.length-1;(l=i.length&&i[u].merge(p))?i[u]=l:i.push(p)}}else r.map&&n--}),this.items.length,0),new Qc(Yc.from(i.reverse()),o)},Qc.empty=new Qc(Yc.empty,0);var ed=function(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i};ed.prototype.merge=function(e){if(this.step&&e.step&&!e.selection){var t=e.step.merge(this.step);if(t)return new ed(t.getMap().invert(),t,this.selection)}};var td=function(e,t,n,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i},nd=20;function id(e){var t=[];return e.forEach((function(e,n,i,o){return t.push(i,o)})),t}function od(e,t){if(!e)return null;for(var n=[],i=0;i<e.length;i+=2){var o=t.map(e[i],1),r=t.map(e[i+1],-1);o<=r&&n.push(o,r)}return n}function rd(e,t,n,i){var o=cd(t),r=ld.get(t).spec.config,a=(i?e.undone:e.done).popEvent(t,o);if(a){var s=a.selection.resolve(a.transform.doc),c=(i?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),r,o),d=new td(i?c:a.remaining,i?a.remaining:c,null,0);n(a.transform.setSelection(s).setMeta(ld,{redo:i,historyState:d}).scrollIntoView())}}var ad=!1,sd=null;function cd(e){var t=e.plugins;if(sd!=t){ad=!1,sd=t;for(var n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){ad=!0;break}}return ad}function dd(e){return e.setMeta(pd,!0)}var ld=new jt("history"),pd=new jt("closeHistory");function ud(e){return e={depth:e&&e.depth||100,newGroupDelay:e&&e.newGroupDelay||500},new yt({key:ld,state:{init:function(){return new td(Qc.empty,Qc.empty,null,0)},apply:function(t,n,i){return function(e,t,n,i){var o,r=n.getMeta(ld);if(r)return r.historyState;n.getMeta(pd)&&(e=new td(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(ld))return a.getMeta(ld).redo?new td(e.done.addTransform(n,null,i,cd(t)),e.undone,id(n.mapping.maps[n.steps.length-1]),e.prevTime):new td(e.done,e.undone.addTransform(n,null,i,cd(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new td(e.done.rebased(n,o),e.undone.rebased(n,o),od(e.prevRanges,n.mapping),e.prevTime):new td(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),od(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-i.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,i){for(var o=0;o<t.length;o+=2)e<=t[o+1]&&i>=t[o]&&(n=!0)})),n}(n,e.prevRanges)),c=a?od(e.prevRanges,n.mapping):id(n.mapping.maps[n.steps.length-1]);return new td(e.done.addTransform(n,s?t.selection.getBookmark():null,i,cd(t)),Qc.empty,c,n.time)}(n,i,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n="historyUndo"==t.inputType?hd(e.state,e.dispatch):"historyRedo"==t.inputType&&fd(e.state,e.dispatch);return n&&t.preventDefault(),n}}}})}function hd(e,t){var n=ld.getState(e);return!(!n||0==n.done.eventCount)&&(t&&rd(n,e,t,!1),!0)}function fd(e,t){var n=ld.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&rd(n,e,t,!0),!0)}function bd(e){var t=ld.getState(e);return t?t.done.eventCount:0}function md(e){var t=ld.getState(e);return t?t.undone.eventCount:0}var gd=function(e,t){var n;this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,i,o){var r=n;if(t[1]){var a=t[0].lastIndexOf(t[1]);r+=t[0].slice(a+t[1].length);var s=(i+=a)-o;s>0&&(r=t[0].slice(a-s,a)+r,i=o)}return e.tr.insertText(r,i,o)}):t};function vd(e){var t=e.rules,n=new yt({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,i,o,r){return yd(e,i,o,r,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var i=e.state.selection.$cursor;i&&yd(e,i.pos,i.pos,"",t,n)}))}}},isInputRules:!0});return n}function yd(e,t,n,i,o,r){if(e.composing)return!1;var a=e.state,s=a.doc.resolve(t);if(s.parent.type.spec.code)return!1;for(var c=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"")+i,d=0;d<o.length;d++){var l=o[d].match.exec(c),p=l&&o[d].handler(a,l,t-(l[0].length-i.length),n);if(p)return e.dispatch(p.setMeta(r,{transform:p,from:t,to:n,text:i})),!0}return!1}function _d(e,t){for(var n=e.plugins,i=0;i<n.length;i++){var o=n[i],r=void 0;if(o.spec.isInputRules&&(r=o.getState(e))){if(t){for(var a=e.tr,s=r.transform,c=s.steps.length-1;c>=0;c--)a.step(s.steps[c].invert(s.docs[c]));if(r.text){var d=a.doc.resolve(r.from).marks();a.replaceWith(r.from,r.to,e.schema.text(r.text,d))}else a.delete(r.from,r.to);t(a)}return!0}}return!1}var Od=new gd(/--$/,"—"),jd=new gd(/\.\.\.$/,"…"),Cd=new gd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),kd=new gd(/"$/,"”"),wd=new gd(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),Sd=new gd(/'$/,"’"),xd=[Cd,kd,wd,Sd];function Ed(e,t,n,i){return new gd(e,(function(e,o,r,a){var s=n instanceof Function?n(o):n,c=e.tr.delete(r,a),d=c.doc.resolve(r).blockRange(),l=d&&De(d,t,s);if(!l)return null;c.wrap(d,l);var p=c.doc.resolve(r-1).nodeBefore;return p&&p.type==t&&Ae(c.doc,r-1)&&(!i||i(o,p))&&c.join(r-1),c}))}function Id(e,t,n){return new gd(e,(function(e,i,o,r){var a=e.doc.resolve(o),s=n instanceof Function?n(i):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t)?e.tr.delete(o,r).setBlockType(o,o,t,s):null}))}var Td={mark:"strong",altMarks:["b"],altStyle:{name:"font-weight",value:/^(bold(er)?|[5-9]\d{2,})$/}},Dd={mark:"em",altMarks:["i"],altStyle:{name:"font-style",value:/^italic$/i}},Bd={mark:"u",altStyle:{name:"text-decoration",value:/^underline$/i}},Pd={mark:"del",altStyle:{name:"text-decoration",value:/^line-through$/i}},Ad={mark:"sub"},Md={mark:"sup"},zd={mark:"link"},Rd="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Fd=function(e,t){var n={},i=t&&t.applyToWord||!1;if(n["Mod-z"]=hd,n["Shift-Mod-z"]=fd,n.Backspace=vi(_d,$n,Wn,Gn),n.Enter=vi(ti,oi,ri,si),Rd||(n["Mod-y"]=fd),e.marks.strong&&(n["Mod-b"]=Gt(dn,At.__assign({},Td,{applyToWord:i}))),e.marks.em&&(n["Mod-i"]=Gt(dn,At.__assign({},Dd,{applyToWord:i}))),e.marks.u&&(n["Mod-u"]=Gt(dn,At.__assign({},Bd,{applyToWord:i}))),e.nodes.hard_break){var o=e.nodes.hard_break,r=vi(ii,(function(e,t){return t(e.tr.replaceSelectionWith(o.create()).scrollIntoView()),!0}));n["Shift-Enter"]=r}return n},Nd=function(e){var t,n={};return e.nodes.list_item&&(n.Enter=(t=e.nodes.list_item,function(e,n){return zn(t)(e,(function(t){var i=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();i&&t.ensureMarks(i),n(t)}))})),n},Ld=/style=['"]?[^'"]*?mso-list:\s*[a-zA-Z]+(\d+)\s[a-zA-Z]+(\d+)\s(\w+)/gi,Vd=function(e){return/^MsoListParagraph/.test(e.className)},Hd=function(e){var t=e.innerHTML;return t=(t=t.replace(/<!--(.|\s)*?-->/gi,"")).replace(/<\/?[^>]+?\/?>/gm,"")},Kd=function(e,t){var n=document.createElement(e);return n.style.listStyleType=t,n},$d=function(e){var t=null;return/^\d/.test(e)||(t=(/^[a-z]/.test(e)?"lower-":"upper-")+(/^[ivxlcdm]/i.test(e)?"roman":"alpha")),t},Wd=function(e,t){var n=[];Array.from(e).forEach((function(e){if(e.nodeType===Node.ELEMENT_NODE){var i=e;i.getAttribute("datalist")?(n.push(e),t.add(n)):Vd(i)&&n.length?n.push(e):(n=[],"DIV"===i.nodeName?Wd(i.children,t):"TABLE"===i.nodeName&&Array.from(i.querySelectorAll("td,th")).forEach((function(e){Wd(e.children,t)})))}}))},Ud=function(e){var t,n=e.innerHTML,i=function(e){return e.replace(/^(?: |[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/ /g," "),/^[\u2022\u00b7\u00a7\u00d8oØüvn][\u00a0 ]+/.test(n)?{tag:"ul",style:(t=i(Hd(e)),/^[\u2022\u00b7\u00FC\u00D8\u002dv-]/.test(t)?null:/^o/.test(t)?"circle":"square")}:/^\s*\w+[\.\)][\u00a0 ]{2,}/.test(n)?{tag:"ol",style:$d(i(Hd(e)))}:void 0},Gd=function(e){var t,n=e.nodeName.toLowerCase();e.firstChild&&e.firstChild.nodeType===Node.COMMENT_NODE&&e.removeChild(e.firstChild),1===e.childNodes.length?t=e.firstChild.nodeType===Node.TEXT_NODE?Hd(e):e.firstChild.innerHTML.replace(/^\w+[\.\)]( )+ /,""):(e.removeChild(e.firstChild),3===e.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(e.firstChild.nodeValue)&&e.removeChild(e.firstChild),/^( |\s)+$/i.test(e.firstChild.innerHTML)&&e.removeChild(e.firstChild),t="p"!==n?"<"+n+">"+e.innerHTML+"</"+n+">":e.innerHTML),e.parentNode.removeChild(e);var i=document.createElement("li");return i.innerHTML=t,i},Zd=function(e){var t=document.createElement("div");t.innerHTML=function(e){return e=e.replace(Ld,(function(e,t,n){return'datalist="'+t+'" datalevel="'+n+'" '+e}))}(e);var n=new Set;return Wd(t.children,n),n.forEach((function(e){return function(e){var t,n,i,o,r,a,s,c,d,l,p,u,h,f=-1,b={};for(c=0;c<e.length;c++){var m=(h={datalist:(d=e[c]).getAttribute("datalist"),datalevel:d.getAttribute("datalevel")}).datalist,g=Ud(d);if(l=g&&g.tag){if(p=h.datalevel||parseFloat(d.style.marginLeft||0),h.datalevel||d.style.marginLeft){var v=l+m;b[p]||(b[p]={}),(!n||n<0)&&(n=p,i=m,o=(s=e.filter((function(e){return e.getAttribute("datalist")===String(i)})))[s.length-1],a=Kd(l,g&&g.style),d.parentNode.insertBefore(a,d),f=p,b[p][v]=a),r=o===d,u=b[p][v],(p>f||!u)&&(u=Kd(l,g&&g.style),b[p][v]=u,t.appendChild(u)),t=Gd(d),u.appendChild(t),r?n=f=-1:f=p}}else!t||r&&!Vd(d)||(d.style.marginLeft&&(d.style.marginLeft=""),d.style.marginLeft&&(d.style.margin=""),t.appendChild(d))}}(e)})),t.innerHTML},qd=function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.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,"")},Jd=function(e){return e.replace(/<!--[\s\S]+?-->/g,"")},Xd=function(e,t){return e.replace(new RegExp("<\\/?("+t+")(?:\\s[^>]*?)?>","gi"),"")},Yd=function(e){e.ownerElement&&e.ownerElement.removeAttribute(e.name)},Qd=function(e){/^Mso/.test(e.value)&&Yd(e)},el=/\s*;\s*/,tl=/\s*:\s*/,nl=function(e){var t,n,i=e.value.split(el).filter((function(e){return Boolean(e)})),o=e.ownerElement.style,r="";i.forEach((function(e){var i;i=e.split(tl),t=i[0],n=i[1],void 0!==o[t]&&(r+=t+": "+n+"; ")})),(r=r.trim())?e.value=r:Yd(e)},il=function(e,t){var n=e;if(t.convertMsLists&&(n=Zd(n)),t.stripTags&&(n=Xd(n,t.stripTags)),t.attributes){var i=document.createElement("div");i.innerHTML=n,Array.from(i.querySelectorAll("*")).forEach((function(e){return function(e,t){if(e.nodeType===Node.ELEMENT_NODE){for(var n=e.attributes.length-1;n>=0;n--){var i=e.attributes[n];t[i.name]?t[i.name](i):t["*"]&&t["*"](i)}"SPAN"===e.nodeName&&0===e.attributes.length&&function(e){var t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}}(e)}}(e,t.attributes)})),n=i.innerHTML}return n};function ol(e){for(var t=e.length,n=new Array(t/2),i=0;i<t;i+=2)n[i]=String.fromCharCode(parseInt(e.substring(i,i+2),16));return btoa(n.join(""))}var rl=/<img\s[^>]*?src=(?:'|")file:\/[^'"]+(?:'|")[^>]*>/gi,al=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,sl=new RegExp("(?:("+al.source+"))([\\da-fA-F\\s]+)\\}","g"),cl=/[^\da-fA-F]/g,dl=/file:\/[^'"]+\.(jpg|png|gif)/i,ll=/\\(png|jpeg)blip\\/,pl=function(e,t){var n=e.match(rl);if(!n||-1===t.types.indexOf("text/rtf"))return e;var i=t.getData("text/rtf"),o=[],r=i.match(sl);if(!i||!r)return e;for(var a=0,s=r;a<s.length;a++){var c=s[a],d=ll.exec(c);if(d){var l=c.replace(al,"").replace(cl,"");o.push("data:image/"+d[1]+";base64,"+ol(l))}}return n.length!==o.length?e:e.replace(rl,(function(e){var t=o.shift()||"";return e.replace(dl,t)}))},ul=function(e,t,n,i,o){var r,a,s,c,d,l,p=[],u=[],h=t.matchCase,f=t.matchWord,b=t.useRegExp,m=t.text;if(b&&(/^\\$/.test(m)||/[^\\]\\$/.test(m))&&(m=m.substring(0,m.length-1)),!m)return p;var g=h?"g":"gi",v=b?new RegExp(m,g):yl(m,g);return e.nodesBetween(n,i,(function(t,h,b){if(o(p))return!1;t.inlineContent&&h+t.content.size>=n&&(u.length=0,t.nodesBetween(0,t.content.size,(function(t,b,m,g){if(o(p))return!1;var y=1+h+b;if(t.isText&&y+t.nodeSize>=n){if(d=t.text||"",l=m.childCount-1>=g+1&&m.child(g+1),u.push(n<=y?{text:d,start:y}:{text:d.slice(n-y),start:n}),l&&l.isText)return;for(a=u.map((function(e){return e.text})).join(""),r=v.exec(a);null!==r&&(s=u[0].start+r.index,c=s+r[0].length,n<=s&&i>=c&&vl(r,f)&&p.push(it.create(e,s,c)),!o(p));)r=v.exec(a)}else u.length=0})))})),p},hl=function(e,t){var n=t.backward,i=t.matchCyclic,o=At.__rest(t,["backward","matchCyclic"]),r=n?function(){return!1}:function(e){return e.length>0},a=e.doc,s=e.selection,c=[];return n?!(c=ul(a,o,0,s.from,r)).length&&i&&(c=ul(a,o,s.from,a.content.size,r)):!(c=ul(a,o,s.to,a.content.size,r)).length&&i&&(c=ul(a,o,0,s.to,r)),c.length?c[c.length-1]:null},fl=function(e,t){return ul(e,t,0,e.content.size,(function(){return!1}))},bl=function(e,t,n){var i=e.from,o=e.to;return n.insertText(t,i,o).setSelection(it.create(n.doc,i,i+t.length)),n},ml=function(e,t,n){var i=fl(e.doc,n);if(0===i.length)return null;for(var o=e.tr,r=i.length-1;r>=0;r--)o.insertText(t,i[r].from,i[r].to);return o},gl=/^[\s0-9~`!@#$%\^&*\(\)_\-=+\\|\[\]{};:'"\?/.,<>]?$/,vl=function(e,t){if(t){if(!0===t){var n=e.input,i=n.charAt(e.index-1),o=n.charAt(e.index+e[0].length);return gl.test(i)&&gl.test(o)}return t(e)}return!0},yl=function(e,t){var n=e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d").replace(/\s/g,"\\s");return new RegExp(n,t)};function _l(e){var t={class:"k-placeholder","data-placeholder":e};return new yt({key:new jt("placeholder"),props:{decorations:function(e){var n=e.doc,i=n.content.firstChild;if(!(0===n.childCount||1===n.childCount&&i.inlineContent&&0===i.childCount))return Ra.empty;var o=[];return n.descendants((function(e,n){o.push(Pa.node(n,n+e.nodeSize,t))})),Ra.create(n,o)}}})}var Ol=/\s+/g,jl=/text-align/,Cl=function(){return new yt({key:new jt("spaces-fix"),props:{decorations:function(e){var t,n,i,o,r=[],a=e.doc;return a.nodesBetween(0,a.content.size,(function(e,a,s){if(e.type.isText&&function(e){return jl.test(e&&e.attrs&&e.attrs.style||"")}(s))for(n=Ol.exec(e.text||"");null!==n;){if(t=a+n.index,i=n[0].length,n.index+i<n.input.length)for(o=0;o<=i-1;o+=2)r.push(Pa.inline(t+o,t+o+1,{style:"white-space: normal"}));n=Ol.exec(e.text||"")}})),Ra.create(a,r)}}})},kl=new jt("highlight");function wl(e){return void 0===e&&(e=kl),new yt({key:e,state:{init:function(){return null},apply:function(e){return e.getMeta(this.spec.key)}},props:{decorations:function(e){var t=(this.spec.key.getState(e)||[]).map((function(e){return Pa.inline(e.from,e.to,e.attrs)}));return Ra.create(e.doc,t)}}})}var Sl=new jt("image-resize"),xl={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}},El=Object.keys(xl),Il=function(e,t,n){e.style[t]=n+"px"},Tl=/[^\-]width:|[^\-]height:/,Dl=/^.+$/,Bl=function(){function e(e,t,n,i){this.activeHandle=e,this.dragging=t,this.rect=n,this.nodePosition=i}return e.prototype.apply=function(t){var n=t.getMeta(Sl);return n?new e(n.activeHandle,n.setDragging,n.rect,n.nodePosition):this},e}(),Pl=function(e,t,n){var i=t.target.getAttribute("data-direction");if(!i)return!1;var o=Sl.getState(e.state);t.preventDefault();var r=e.state.tr;function a(t){!function(e,t,n){var i=Sl.getState(e.state),o=i.rect,r=i.dragging,a=i.nodePosition,s=i.activeHandle;if(r&&o){var c=e.nodeDOM(a),d=xl[s],l=(t.clientX-r.startX)*d.x,p=(t.clientY-r.startY)*d.y,u=d.x?l+c.width:o.width,h=d.y?p+c.height:o.height;if(n.lockRatio&&d.x&&d.y){var f=Math.min(u/c.width,h/c.height),b=c.width*f,m=c.height*f;r.startX=t.clientX-(u-b)*d.x,r.startY=t.clientY-(h-m)*d.y,u=b,h=m}else r.startX=d.x?t.clientX:r.startX,r.startY=d.y?t.clientY:r.startY;Il(c,"width",u),Il(c,"height",h),o.top=c.offsetTop,o.left=c.offsetLeft,o.width=c.offsetWidth,o.height=c.offsetHeight;var g=c.nextElementSibling;g.style.width=o.width+"px",g.style.height=o.height+"px",g.style.top=o.top+"px",g.style.left=o.left+"px"}}(e,t,n)}return r.setMeta(Sl,{setDragging:{startX:t.clientX,startY:t.clientY},activeHandle:i,rect:o.rect,nodePosition:o.nodePosition}),r.setMeta("addToHistory",!1),e.dispatch(r),t.view.addEventListener("mouseup",(function t(n){n.view.removeEventListener("mouseup",t),n.view.removeEventListener("mousemove",a),function(e){var t=Sl.getState(e.state),n=t.rect,i=t.dragging,o=t.nodePosition;if(i&&n){var r=e.state.selection;if(r instanceof rt){var a=r.node.attrs,s=n.width,c=n.height,d=void 0;if(Tl.test(a.style||"")){var l=Mt(a.style,{style:"width",value:Dl,newValue:s+"px"}),p=Mt(l.style||"",{style:"height",value:Dl,newValue:c+"px"}).style;d=At.__assign({},a,{style:p})}else d=At.__assign({},a,{width:s,height:c});var u=r.node.type.createAndFill(d);if(u){var h=e.state.tr;h.replaceWith(o,o+1,u),h.setSelection(rt.create(h.doc,o)),h.setMeta("commandName","image-resize"),h.setMeta("args",d),h.setMeta(Sl,{setDragging:null,activeHandle:null,rect:n,nodePosition:o}),e.dispatch(h)}}}}(e)})),t.view.addEventListener("mousemove",a),!0},Al=function(e){return void 0===e&&(e={node:"image",lockRatio:!0}),new yt({key:Sl,view:function(t){return{resize:function(){Sl.getState(t.state).rect&&t.dispatch(t.state.tr.setMeta("resize",!0))},get window(){return t.dom.ownerDocument&&t.dom.ownerDocument.defaultView},attachResize:function(){var e=this.window;e&&(e.removeEventListener("resize",this.resize),e.addEventListener("resize",this.resize))},removeResize:function(){var e=this.window;e&&e.removeEventListener("resize",this.resize)},update:function(t,n){var i=t.state,o=i.selection,r=i.schema.nodes[e.node],a=Sl.getState(i),s=a.rect;if(o instanceof rt&&r===o.node.type){var c=t.nodeDOM(o.from),d={top:c.offsetTop,left:c.offsetLeft,width:c.offsetWidth,height:c.offsetHeight};if(!n.selection.eq(o)||s&&(s.width!==d.width||s.height!==d.height||s.top!==d.top||s.left!==d.left)){var l=i.tr;l.setMeta(Sl,{rect:d,nodePosition:o.from}),t.dispatch(l),this.attachResize()}}else s&&(a.rect=null,a.nodePosition=-1)},destroy:function(){this.removeResize()}}},state:{init:function(){return new Bl("",null,null,-1)},apply:function(e,t){return t.apply(e)}},props:{handleDOMEvents:{mousedown:function(t,n){return Pl(t,n,e)}},decorations:function(t){var n=t.selection,i=t.schema.nodes[e.node],o=Sl.getState(t).rect;if(o&&n instanceof rt&&i===n.node.type){var r=document.createElement("div");r.className="k-editor-resize-handles-wrapper",r.style.width=o.width+"px",r.style.height=o.height+"px",r.style.top=o.top+"px",r.style.left=o.left+"px";for(var a=0;a<El.length;a++){var s=document.createElement("div");s.className="k-editor-resize-handle "+El[a],s.setAttribute("data-direction",El[a]),r.appendChild(s)}return Ra.create(t.doc,[Pa.widget(t.selection.from+1,r)])}return Ra.empty}}})},Ml=new jt("caret-color");function zl(){return new yt({key:Ml,props:{decorations:function(e){var t=e.doc,n=e.selection,i=e.storedMarks;if(!n.empty||!i)return Ra.empty;var o=en((i||[]).find((function(e){return"style"===e.type.name})),{name:"color",value:/^.+$/});if(!o)return Ra.empty;var r=n.$anchor.parent,a=[];return t.descendants((function(e,t){e.eq(r)&&a.push(Pa.node(t,t+e.nodeSize,{style:"caret-color: "+o}))})),Ra.create(t,a)}}})}function Rl(e){return void 0===e&&(e={}),new yt({view:function(t){return new Fl(t,e)}})}var Fl=function(e,t){var n=this;this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var i=function(e){return n[t](e)};return e.dom.addEventListener(t,i),{name:t,handler:i}}))};Fl.prototype.destroy=function(){var e=this;this.handlers.forEach((function(t){var n=t.name,i=t.handler;return e.editorView.dom.removeEventListener(n,i)}))},Fl.prototype.update=function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())},Fl.prototype.setCursor=function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},Fl.prototype.updateOverlay=function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,i=t.nodeAfter;if(n||i){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),r=n?o.bottom:o.top;n&&i&&(r=(r+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,c,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,c=-pageYOffset;else{var l=d.getBoundingClientRect();s=l.left-d.scrollLeft,c=l.top-d.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-c+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"},Fl.prototype.scheduleRemoval=function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)},Fl.prototype.dragover=function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,o="function"==typeof i?i(this.editorView,t):i;if(t&&!o){var r=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(r=Fe(this.editorView.state.doc,r,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(r),this.scheduleRemoval(5e3)}}},Fl.prototype.dragend=function(){this.scheduleRemoval(20)},Fl.prototype.drop=function(){this.scheduleRemoval(20)},Fl.prototype.dragleave=function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)};var Nl=function(e){function t(t){e.call(this,t,t)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.map=function(n,i){var o=n.resolve(i.map(this.head));return t.valid(o)?new t(o):e.near(o)},t.prototype.content=function(){return u.empty},t.prototype.eq=function(e){return e instanceof t&&e.head==this.head},t.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},t.fromJSON=function(e,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new t(e.resolve(n.pos))},t.prototype.getBookmark=function(){return new Ll(this.anchor)},t.valid=function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),i=e.node(t);if(0!=n)for(var o=i.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(i.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),i=e.node(t);if(n!=i.childCount)for(var o=i.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(i.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock},t.findFrom=function(e,n,i){e:for(;;){if(!i&&t.valid(e))return e;for(var o=e.pos,r=null,a=e.depth;;a--){var s=e.node(a);if(n>0?e.indexAfter(a)<s.childCount:e.index(a)>0){r=s.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=n;var c=e.doc.resolve(o);if(t.valid(c))return c}for(;;){var d=n>0?r.firstChild:r.lastChild;if(!d){if(r.isAtom&&!r.isText&&!rt.isSelectable(r)){e=e.doc.resolve(o+r.nodeSize*n),i=!1;continue e}break}r=d,o+=n;var l=e.doc.resolve(o);if(t.valid(l))return l}return null}},t}(et);Nl.prototype.visible=!1,et.jsonID("gapcursor",Nl);var Ll=function(e){this.pos=e};Ll.prototype.map=function(e){return new Ll(e.map(this.pos))},Ll.prototype.resolve=function(e){var t=e.resolve(this.pos);return Nl.valid(t)?new Nl(t):et.near(t)};var Vl=function(){return new yt({props:{decorations:Wl,createSelectionBetween:function(e,t,n){if(t.pos==n.pos&&Nl.valid(n))return new Nl(n)},handleClick:$l,handleKeyDown:Hl}})},Hl=lo({ArrowLeft:Kl("horiz",-1),ArrowRight:Kl("horiz",1),ArrowUp:Kl("vert",-1),ArrowDown:Kl("vert",1)});function Kl(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,i,o){var r=e.selection,a=t>0?r.$to:r.$from,s=r.empty;if(r instanceof it){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var c=Nl.findFrom(a,t,s);return!!c&&(i&&i(e.tr.setSelection(new Nl(c))),!0)}}function $l(e,t,n){if(!e.editable)return!1;var i=e.state.doc.resolve(t);if(!Nl.valid(i))return!1;var o=e.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(o>-1&&rt.isSelectable(e.state.doc.nodeAt(o)))&&(e.dispatch(e.state.tr.setSelection(new Nl(i))),!0)}function Wl(e){if(!(e.selection instanceof Nl))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Ra.create(e.doc,[Pa.widget(e.selection.head,t,{key:"gapcursor"})])}var Ul=function(e,t,n){for(var i,o=e.table,r=e.table_row,a=e.table_cell,s=[],c=0;c<t+1;c++){i=[];for(var d=0;d<n+1;d++)i.push(a.createAndFill());s.push(r.createAndFill(void 0,i))}return o.createAndFill(void 0,s)},Gl=function(e,t){for(var n=e.$head,i=n.depth;i>0;i--){var o=n.node(i);if(o.type.name===t)return{pos:n.before(i),node:o}}return null},Zl=function(e,t){return oc(e,t&&function(e){var n,i=Gl(e.selection,"table_row"),o=Gl(e.selection,"table");if(i&&o&&i.node.attrs[Ct]){for(var r=0,a=0;a<o.node.nodeSize;a++)if(o.node.child(a).eq(i.node)){r=a;break}var s=o.node.child(r-1),c=i.pos-s.nodeSize;e.setNodeMarkup(c,void 0,((n={})[Ct]=i.node.attrs[Ct],n))}return t(e)})},ql=function(e,t){return rc(e,t&&function(e){var n,i=Gl(e.selection,"table_row");if(i&&i.node.attrs[Ct]){var o=i.pos+i.node.nodeSize;e.setNodeMarkup(o,void 0,((n={})[Ct]=i.node.attrs[Ct],n))}return t(e)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(2);t.outerWidth=function(e){var t=e.offsetWidth,n=getComputedStyle(e);return t+=parseFloat(n.marginLeft)||0+parseFloat(n.marginRight)||0},t.removeEntries=function(e,t){return Object.keys(e).filter((function(e){return t(e)})).reduce((function(t,n){var i;return Object.assign(t,((i={})[n]=e[n],i))}),{})},t.removeEmptyEntries=function(e){return t.removeEntries(e,(function(t){return null!==e[t]&&void 0!==e[t]&&""!==e[t]}))},t.isEmpty=function(e){return 0===Object.keys(e).length},t.isNullOrUndefined=function(e){return null==e},t.isPresent=function(e){return!t.isNullOrUndefined(e)},t.detectIE=function(){if(!i.isDocumentAvailable())return!1;var e=window.navigator.userAgent,t=e.indexOf("MSIE "),n=e.indexOf("Trident/");return t>0||n>0},t.safeString=function(e){return t.isNullOrUndefined(e)?"":e.toString()},t.first=function(e){return e[0]},t.last=function(e){return e[e.length-1]},t.unique=function(e){return Array.from(new Set(e))},t.split=function(e){return function(t){return t.split(e)}},t.trim=function(e){return e.trim()},t.filter=function(e){return function(t){return t.filter(e)}},t.toArray=function(e){return e instanceof Array?e:[e]},t.getUniqueStyleValues=function(e,n){if(e.hasNodesWithoutMarks)return"";var i=e.marks.filter((function(e){return"style"===e.type.name})).map((function(e){return e.attrs.style})).map(t.safeString).map(t.split(";")).map(t.filter((function(e){return e.includes(n)}))).map((function(e){return 0!==e.length?e:[n+": INVALID"]})).map(t.first).map(t.split(":")).map(t.last).map(t.trim).reduce((function(e,t){return e.indexOf(t)>-1?e:e.concat([t])}),[]);return i.indexOf("INVALID")>-1||1!==i.length?"":i[0]},t.conditionallyExecute=function(e){return function(t){return function(n){return t?e(n):n}}},t.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.reduce((function(e,t){return t(e)}),t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"ColorContrastSvgComponent",(function(){return qt})),n.d(t,"ColorInputComponent",(function(){return Dt})),n.d(t,"ContrastValidationComponent",(function(){return Gt})),n.d(t,"ContrastComponent",(function(){return Zt})),n.d(t,"FlatColorPickerActionButtonsComponent",(function(){return Nt})),n.d(t,"FlatColorPickerHeaderComponent",(function(){return Ft})),n.d(t,"FocusOnDomReadyDirective",(function(){return Ut})),n.d(t,"ColorGradientLocalizationService",(function(){return Tt})),n.d(t,"ColorPaletteLocalizationService",(function(){return At})),n.d(t,"ColorPickerLocalizationService",(function(){return ut})),n.d(t,"ColorPickerCustomMessagesComponent",(function(){return $t})),n.d(t,"FlatColorPickerLocalizationService",(function(){return ht})),n.d(t,"ColorPickerMessages",(function(){return Kt})),n.d(t,"ColorPaletteService",(function(){return Mt})),n.d(t,"FlatColorPickerService",(function(){return bt})),n.d(t,"MaskingService",(function(){return Te})),n.d(t,"NumericTextBoxMessages",(function(){return ye})),n.d(t,"RangeSliderCustomMessagesComponent",(function(){return He})),n.d(t,"RangeSliderMessages",(function(){return Le})),n.d(t,"SHARED_DIRECTIVES",(function(){return ot})),n.d(t,"SliderCustomMessagesComponent",(function(){return Fe})),n.d(t,"SliderMessages",(function(){return ze})),n.d(t,"SliderBase",(function(){return ne})),n.d(t,"SlidersCommonModule",(function(){return Me})),n.d(t,"SwitchCustomMessagesComponent",(function(){return Ue})),n.d(t,"Messages",(function(){return $e})),n.d(t,"TextFieldsBase",(function(){return st})),n.d(t,"TextBoxCustomMessagesComponent",(function(){return tt})),n.d(t,"TextBoxMessages",(function(){return et})),n.d(t,"SliderComponent",(function(){return ie})),n.d(t,"RangeSliderComponent",(function(){return re})),n.d(t,"LabelTemplateDirective",(function(){return te})),n.d(t,"SwitchComponent",(function(){return ae})),n.d(t,"TextBoxDirective",(function(){return se})),n.d(t,"TextAreaDirective",(function(){return ce})),n.d(t,"NumericTextBoxComponent",(function(){return ve})),n.d(t,"NumericTextBoxCustomMessagesComponent",(function(){return _e})),n.d(t,"MaskedTextBoxComponent",(function(){return Be})),n.d(t,"InputsModule",(function(){return ln})),n.d(t,"SliderTicksComponent",(function(){return Ae})),n.d(t,"SliderModule",(function(){return Ne})),n.d(t,"RangeSliderModule",(function(){return Ke})),n.d(t,"SwitchModule",(function(){return Ge})),n.d(t,"NumericTextBoxModule",(function(){return qe})),n.d(t,"MaskedTextBoxModule",(function(){return Je})),n.d(t,"TextBoxModule",(function(){return at})),n.d(t,"TextAreaModule",(function(){return pt})),n.d(t,"CheckBoxModule",(function(){return en})),n.d(t,"RadioButtonModule",(function(){return nn})),n.d(t,"ColorPickerComponent",(function(){return Ht})),n.d(t,"ColorPaletteComponent",(function(){return Rt})),n.d(t,"ColorGradientComponent",(function(){return Pt})),n.d(t,"ColorPickerModule",(function(){return Yt})),n.d(t,"FlatColorPickerComponent",(function(){return Lt})),n.d(t,"ColorPickerCancelEvent",(function(){return mt})),n.d(t,"CheckBoxDirective",(function(){return Qt})),n.d(t,"RadioButtonDirective",(function(){return tn})),n.d(t,"HintComponent",(function(){return sn})),n.d(t,"ErrorComponent",(function(){return rn})),n.d(t,"FormFieldComponent",(function(){return cn})),n.d(t,"FormFieldModule",(function(){return dn})),n.d(t,"TextBoxComponent",(function(){return Qe})),n.d(t,"TextBoxPrefixTemplateDirective",(function(){return Ye})),n.d(t,"TextBoxSuffixTemplateDirective",(function(){return Xe})),n.d(t,"TextAreaComponent",(function(){return dt})),n.d(t,"TextAreaSuffixComponent",(function(){return lt})),n.d(t,"InputSeparatorComponent",(function(){return it})),n.d(t,"SharedModule",(function(){return rt})),n.d(t,"LocalizedColorPickerMessagesDirective",(function(){return Wt})),n.d(t,"LocalizedNumericTextBoxMessagesDirective",(function(){return Ze})),n.d(t,"LocalizedTextBoxMessagesDirective",(function(){return nt})),n.d(t,"LocalizedSliderMessagesDirective",(function(){return Re})),n.d(t,"LocalizedRangeSliderMessagesDirective",(function(){return Ve})),n.d(t,"LocalizedSwitchMessagesDirective",(function(){return We})),n.d(t,"ColorPickerCloseEvent",(function(){return gt})),n.d(t,"ColorPickerOpenEvent",(function(){return vt})),n.d(t,"ActiveColorClickEvent",(function(){return yt}));var i=n(0),o=n(1),r=n(10),a=n(5),s=n(4),c=n(3),d=n(2),l=n(13),p=n(14),u=n(45),h=n(12),f=n(16),b=n(20),m=function(e){return null!=e},g=function(e,t){return e===t||null===e&&void 0===t||void 0===e&&null===t},v=function(e){return e&&(!e.touched||e.control&&"blur"===e.control.updateOn)},y=function(e,t,n){return!m(e)||isNaN(e)||e<=t?t:e>=n?n:e},_={small:"sm",medium:"md",large:"lg"},O={small:"sm",medium:"md",large:"lg",full:"full"},j=function(e,t,n,i){switch(t){case"size":return{toRemove:"k-"+e+"-"+_[n],toAdd:i?"k-"+e+"-"+_[i]:null};case"rounded":return{toRemove:"k-rounded-"+O[n],toAdd:i?"k-rounded-"+O[i]:null};case"fillMode":return{toRemove:"k-"+e+"-"+n,toAdd:i?"k-"+e+"-"+i:null}}},C=function(e){return Math.min(e,20)},k=function(e){return(String(e).split(".")[1]||"").length},w=function(e,t){return Math.max(k(e),k(t))},S=function(e,t){var n=C(t);return parseFloat(e.toFixed(n))},x=function(e,t){var n=w(e,t);return S(e+t,n)},E=function(e,t){return x(e,-t)},I=function(e,t){var n=k(e)+k(t);return S(e*t,n)},T=function(e,t){if(0===t)return NaN;var n=w(e,t),i=Math.pow(10,n);return i*e/(i*t)},D=function(e,t){return Math.abs(E(e,I(t,Math.floor(T(e,t)))))},B=function(e){return(e.max-e.min)/e.smallStep*e.fixedTickWidth},P=function(e,t,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=1),n<=0)throw new Error("Invalid argument: smallStep must be a positive number");var i=Math.abs(E(t,e)),o=Math.floor(T(i,n));return x(o,1)},A=function(e){var t=e.trackWidth,n=e.min,i=e.max,o=e.reverse,r=e.value,a=t/Math.abs(i-n),s=m(r)?a*(r-n):n;return o&&(s=t-s),Math.floor(s)},M=function(e,t,n){var i=t.max,o=t.min,r=t.smallStep,a=t.largeStep;void 0===n&&(n=!1);var s,c=n&&a?I(r,a):r,d=E(e,o),l=D(d,c);return s=E(d,0===l?c:l),V(x(s,o),o,i)},z=function(e,t,n){var i=t.max,o=t.min,r=t.smallStep,a=t.largeStep;void 0===n&&(n=!1);var s=n&&a?I(r,a):r,c=E(e,o),d=D(c,s),l=x(E(c,d),s);return V(x(l,o),o,i)},R=function(e){return e.id.indexOf("k-start-handle")>-1},F=function(e,t,n){return n>e?e:n<t?t:n},N=function(e,t,n){return n?[F(e,t,n[0]),F(e,t,n[1])]:[t,t]},L=function(e){return e},V=function(e,t,n){return Math.max(Math.min(e,n),t)},H=function(e,t,n){var i,o,r=n.min,a=n.max,s=n.vertical,c=n.rtl,d=(i=t.getBoundingClientRect(),o=document.documentElement,{left:i.left+(window.pageXOffset||o.scrollLeft)-(o.clientLeft||0),top:i.top+(window.pageYOffset||o.scrollTop)-(o.clientTop||0)}),l=(s?e.pageY-d.top:e.pageX-d.left)*((a-r)/(s?t.clientHeight:t.clientWidth)),p=c||s?a-l:r+l,u=k(n.smallStep);return function(e,t){var n=t.smallStep,i=t.min,o=t.max,r=V(e,i,o);if(e!==r)return r;var a=M(e,t),s=z(e,t);return(e-i)%n==0?e:s-e<=(s-a)/2?s:a}(p=S(p,u+1),n)},K=function(e){return e.className.indexOf("k-button-increase")>=0||e.className.indexOf("k-button-decrease")>=0},$=function(e){return z(e.value,e)},W=function(e){return M(e.value,e)},U=function(e){return z(e.value,e,!0)},G=function(e){return M(e.value,e,!0)},Z=function(e){if(o.isDevMode&&e&&e[0]>e[1])throw new Error("[RangeSlider] The start value should not be greater than the end value.")},q=function(){function e(e,t,n,i){this.props=e,this.wrapper=t,this.track=n,this.renderer=i,this.props=e,this.wrapper=t,this.track=n,this.tickSizes=this.getTickSizes()}return e.prototype.resizeTrack=function(){var e=this.props.vertical?"height":"width",t=this.props.vertical?"width":"height",n=this.trackWidth();this.track.parentElement.style[e]=n+"px",this.track.parentElement.style[t]=""},e.prototype.resizeTicks=function(e,t){var n=this,i=this.props.vertical?"height":"width";t.slice().map((function(e,t){return e.style[i]=n.tickSizes[t]+"px"})),this.props.vertical&&this.adjustPadding(e)},e.prototype.resizeWrapper=function(){var e=this.props.vertical?"height":"width",t=B(this.props),n=this.wrapper.parentElement;t&&(n.style[e]="auto")},e.prototype.trackWidth=function(){return this.props.fixedTickWidth?B(this.props):this.elementSize(this.track.parentElement)},e.prototype.getTickSizes=function(){for(var e=this.props,t=e.min,n=e.max,i=e.smallStep,o=P(t,n,i),r=this.trackWidth(),a=r/E(n,t),s=[],c=0,d=0,l=0;l<o;l++){d=+(d+=0===l||l===o-1?i/2*a:i*a).toFixed(2)-.01;var p=Math.round(d-c);s.push(p),c+=p}return c>=r&&(s[s.length-1]-=1),s},e.prototype.adjustPadding=function(e){var t=this.tickSizes.reduce((function(e,t){return e+t}),0),n=this.trackWidth()-t;if(0!==n){var i=n+this.elementOffset(this.track);e.style.paddingTop=i+"px"}},e.prototype.elementOffset=function(e){var t=this.props.vertical,n=getComputedStyle(e);return parseInt(t?n.bottom:n.left,10)},e.prototype.elementSize=function(e){return this.props.vertical?e.clientHeight:e.clientWidth},e}(),J=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t.prototype.positionHandle=function(e){var t=this.props,n=t.max,i=t.min,o=t.reverse,r=t.vertical?"bottom":"left",a=this.trackWidth(),s=F(n,i,this.props.value);this.handlePosition=A({min:i,max:n,reverse:o,value:s,trackWidth:a}),this.renderer.setStyle(e,r,this.handlePosition+"px")},t.prototype.positionSelection=function(e){var t=this.props,n=t.reverse,i=t.vertical?"height":"width",o=this.handlePosition;n&&(o=this.trackWidth()-o),this.renderer.setStyle(e,i,o+"px")},t}(q),X=function(e,t){return Boolean((n=e.className,String(n).trim().split(" ")).find((function(e){return e===t})));var n};function Y(e,t){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];if(e&&e.nativeElement)return e.nativeElement[t].apply(e.nativeElement,n)}var Q=function(e,t){for(;e&&!t(e);)e=e.parentNode;return e},ee={name:"@progress/kendo-angular-inputs",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1645536043,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"},te=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoSliderLabelTemplate]"}),Object(i.__param)(0,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),ne=function(){function e(e,t,n,i,r,s){var c=this;this.localizationService=e,this.injector=t,this.renderer=n,this.ngZone=i,this.changeDetector=r,this.hostElement=s,this.title=L,this.tickPlacement="both",this.vertical=!1,this.min=0,this.max=10,this.smallStep=1,this.largeStep=null,this.disabled=!1,this.readonly=!1,this.tabindex=0,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.valueChange=new o.EventEmitter,this.sliderClass=!0,this.widgetClass=!0,this.subscriptions=new a.Subscription,this.ifEnabled=function(e,t){c.isDisabled||e.call(c,t)},Object(l.validatePackage)(ee),this.direction=e.rtl?"rtl":"ltr"}return Object.defineProperty(e.prototype,"horizontalClass",{get:function(){return!this.vertical},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"verticalClass",{get:function(){return this.vertical},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),e.prototype.setDisabledState=function(e){this.changeDetector.markForCheck(),this.disabled=e},e.prototype.ngOnInit=function(){var e=this;this.subscriptions.add(this.localizationService.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.sizeComponent()}))),this.hostElement&&this.renderer.removeAttribute(this.hostElement.nativeElement,"tabindex"),this.control=this.injector.get(r.NgControl,null)},Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled||this.readonly},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return!1},Object.defineProperty(e.prototype,"reverse",{get:function(){return this.localizationService.rtl&&!this.vertical},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"keyBinding",{get:function(){var e,t=this.reverse;return(e={})[d.Keys.ArrowLeft]=t?$:W,e[d.Keys.ArrowRight]=t?W:$,e[d.Keys.ArrowDown]=W,e[d.Keys.ArrowUp]=$,e[d.Keys.PageUp]=U,e[d.Keys.PageDown]=G,e[d.Keys.Home]=function(e){return e.min},e[d.Keys.End]=function(e){return e.max},e},enumerable:!0,configurable:!0}),e.prototype.resetStyles=function(e){var t=this;e.forEach((function(e){e&&(t.vertical?(t.renderer.removeStyle(e,"width"),t.renderer.removeStyle(e,"left"),t.renderer.removeStyle(e,"right")):(t.renderer.removeStyle(e,"height"),t.renderer.removeStyle(e,"bottom")),t.renderer.removeStyle(e,"padding-top"))}))},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Function)],e.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"tickPlacement",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"vertical",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"min",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"max",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"smallStep",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"largeStep",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"fixedTickWidth",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-slider-horizontal"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"horizontalClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-slider-vertical"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"verticalClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-slider"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"sliderClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-widget"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"widgetClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-state-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.ViewChild)("wrap",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"wrapper",void 0),Object(i.__decorate)([Object(o.ViewChild)("track",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"track",void 0),Object(i.__decorate)([Object(o.ViewChild)("sliderSelection",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"sliderSelection",void 0),Object(i.__decorate)([Object(o.ViewChild)("ticks",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"ticksContainer",void 0),Object(i.__decorate)([Object(o.ViewChild)("ticks",{static:!1}),Object(i.__metadata)("design:type",Object)],e.prototype,"ticks",void 0),Object(i.__decorate)([Object(o.ContentChild)(te,{static:!1}),Object(i.__metadata)("design:type",te)],e.prototype,"labelTemplate",void 0),e}(),ie=function(e){function t(t,n,i,o,r,a){var s=e.call(this,t,n,i,o,r,a)||this;return s.localization=t,s.injector=n,s.renderer=i,s.ngZone=o,s.changeDetector=r,s.hostElement=a,s.focusableId="k-"+Object(d.guid)(),s.animate=!0,s.showButtons=!0,s.value=s.min,s.focusChangedProgrammatically=!1,s.onWrapClick=function(e){var t=e.target;if(!s.isDisabled&&!K(t)&&!K(t.parentNode)){var n=H(e,s.track.nativeElement,s.getProps());s.changeValue(n)}Y(s.draghandle,"focus")},s.onKeyDown=function(e){var t=s.getProps(),n=t.max,i=t.min,o=s.keyBinding[e.keyCode];if(!s.isDisabled&&o){var r=o(t);s.changeValue(F(n,i,r)),e.preventDefault()}},s.ngChange=function(e){},s.ngTouched=function(){},s.decreaseValue=function(){s.changeValue(M(s.value,s.getProps()))},s.increaseValue=function(){s.changeValue(z(s.value,s.getProps()))},s.handleBlur=function(){s.changeDetector.markForCheck(),s.focused=!1,(Object(d.hasObservers)(s.onBlur)||v(s.control))&&s.ngZone.run((function(){s.ngTouched(),s.focusChangedProgrammatically||s.onBlur.emit()}))},s}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"currentValue",{get:function(){return m(this.value)?this.value.toString():""},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.disabled||(this.focusChangedProgrammatically=!0,Y(this.draghandle,"focus"),this.focusChangedProgrammatically=!1)},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,Y(this.draghandle,"blur"),this.handleBlur(),this.focusChangedProgrammatically=!1},t.prototype.ngOnChanges=function(e){var t=this;Object(d.anyChanged)(["value","fixedTickWidth","tickPlacement"],e,!0)&&this.ngZone.onStable.asObservable().pipe(Object(s.take)(1)).subscribe((function(){t.sizeComponent(!1)}))},t.prototype.ngAfterViewInit=function(){var e=this;Object(d.isDocumentAvailable)()&&(this.showButtons&&(this.setValueChangeInterval(this.increaseButton.nativeElement,(function(){return e.increaseValue()})),this.setValueChangeInterval(this.decreaseButton.nativeElement,(function(){return e.decreaseValue()}))),this.sizeComponent(!1),this.ticks&&this.ticks.tickElements.changes.subscribe((function(){return e.sizeComponent(!1)})),this.attachElementEventHandlers())},t.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe()},Object.defineProperty(t.prototype,"incrementMessage",{get:function(){return this.incrementTitle||this.localizationService.get("increment")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"decrementMessage",{get:function(){return this.decrementTitle||this.localizationService.get("decrement")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragHandleMessage",{get:function(){return this.dragHandleTitle||this.localizationService.get("dragHandle")},enumerable:!0,configurable:!0}),t.prototype.handleDragPress=function(e){e.originalEvent&&e.originalEvent.preventDefault(),this.renderer.removeClass(this.hostElement.nativeElement,"k-slider-transitions")},t.prototype.onHandleDrag=function(e){this.dragging=!0,this.changeValue(H(e,this.track.nativeElement,this.getProps()))},t.prototype.onHandleRelease=function(){this.dragging=!1,this.renderer.addClass(this.hostElement.nativeElement,"k-slider-transitions")},t.prototype.writeValue=function(e){this.changeDetector.markForCheck(),this.value=e,this.sizeComponent(this.animate)},t.prototype.registerOnChange=function(e){this.ngChange=e},t.prototype.registerOnTouched=function(e){this.ngTouched=e},t.prototype.changeValue=function(e){var t=this;g(this.value,e)||this.ngZone.run((function(){t.value=e,t.ngChange(e),t.valueChange.emit(e),t.sizeComponent(t.animate),t.changeDetector.markForCheck()}))},t.prototype.sizeComponent=function(e){if(Object(d.isDocumentAvailable)()){var t=this.wrapper.nativeElement,n=this.track.nativeElement,i=this.sliderSelection.nativeElement,o=this.draghandle.nativeElement,r=this.ticks?this.ticksContainer.nativeElement:null;e||this.renderer.removeClass(this.hostElement.nativeElement,"k-slider-transitions"),this.resetStyles([n,i,o,r,this.hostElement.nativeElement]);var a=this.getProps(),s=new J(a,t,n,this.renderer);s.resizeTrack(),this.ticks&&s.resizeTicks(this.ticksContainer.nativeElement,this.ticks.tickElements.map((function(e){return e.nativeElement}))),s.positionHandle(o),s.positionSelection(i),e||(this.hostElement.nativeElement.getBoundingClientRect(),this.renderer.addClass(this.hostElement.nativeElement,"k-slider-transitions")),this.fixedTickWidth&&s.resizeWrapper()}},Object.defineProperty(t.prototype,"focused",{set:function(e){this.isFocused!==e&&this.hostElement&&(this.isFocused=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragging",{set:function(e){if(this.isDragged!==e&&this.sliderSelection&&this.draghandle){var t=this.sliderSelection.nativeElement,n=this.draghandle.nativeElement;e?(this.renderer.addClass(t,"k-pressed"),this.renderer.addClass(n,"k-pressed")):(this.renderer.removeClass(t,"k-pressed"),this.renderer.removeClass(n,"k-pressed")),this.isDragged=e}},enumerable:!0,configurable:!0}),t.prototype.setValueChangeInterval=function(e,t){var n=this;this.ngZone.runOutsideAngular((function(){var i=Object(a.fromEvent)(e,"mousedown"),o=Object(a.fromEvent)(e,"mouseup"),r=Object(a.fromEvent)(e,"mouseout"),c=i.pipe(Object(s.filter)((function(e){return 0===e.button&&!n.isDisabled})),Object(s.concatMap)((function(){return Object(a.interval)(150).pipe(Object(s.startWith)(-1),Object(s.takeUntil)(Object(a.merge)(o,r)))}))).subscribe((function(){n.isFocused||Y(n.draghandle,"focus"),t()}));n.subscriptions.add(c)}))},t.prototype.getProps=function(){return{buttons:this.showButtons,disabled:this.disabled,fixedTickWidth:this.fixedTickWidth,largeStep:this.largeStep,max:this.max,min:this.min,readonly:this.readonly,reverse:this.reverse,rtl:this.localizationService.rtl,smallStep:this.smallStep,value:F(this.max,this.min,this.value),vertical:this.vertical}},t.prototype.attachElementEventHandlers=function(){var e=this,t=this.hostElement.nativeElement,n=!1,i=!1;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focusin",(function(){e.isFocused||e.ngZone.run((function(){e.focusChangedProgrammatically||e.onFocus.emit(),e.focused=!0}))}))),e.subscriptions.add(e.renderer.listen(t,"focusout",(function(t){e.isFocused&&(n?(t.relatedTarget!==e.draghandle.nativeElement&&e.handleBlur(),n=!1):i||e.handleBlur())}))),e.subscriptions.add(e.renderer.listen(t,"mouseenter",(function(){i=!0}))),e.subscriptions.add(e.renderer.listen(t,"mouseleave",(function(){i=!1}))),e.subscriptions.add(e.renderer.listen(t,"keydown",(function(e){n=e.keyCode===d.Keys.Tab})))}))},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"dragHandleTitle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"incrementTitle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"animate",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"decrementTitle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],t.prototype,"showButtons",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],t.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.ViewChild)("draghandle",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"draghandle",void 0),Object(i.__decorate)([Object(o.ViewChild)("decreaseButton",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"decreaseButton",void 0),Object(i.__decorate)([Object(o.ViewChild)("increaseButton",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"increaseButton",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoSlider",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.slider"},{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return n}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-slider",template:'\n <ng-container kendoSliderLocalizedMessages\n i18n-increment="kendo.slider.increment|The title of the **Increase** button of the Slider."\n increment="increment"\n i18n-decrement="kendo.slider.decrement|The title of the **Decrease** button of the Slider."\n decrement="decrement"\n i18n-dragHandle="kendo.slider.dragHandle|The title of the drag handle of the Slider."\n dragHandle="Drag"\n >\n <div class="k-slider-wrap" #wrap\n [class.k-slider-buttons]="showButtons"\n [class.k-slider-topleft]="tickPlacement === \'before\'"\n [class.k-slider-bottomright]="tickPlacement === \'after\'"\n [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"\n >\n <button *ngIf="showButtons" type="button" #decreaseButton\n class="k-button-decrease k-button k-button-md k-rounded-full k-button-rectangle k-button-solid k-button-solid-base k-icon-button"\n [title]="decrementMessage"\n [attr.tabindex]="-1"\n role="presentation">\n <span class="k-button-icon k-icon"\n [class.k-i-arrow-w]="!vertical"\n [class.k-i-arrow-s]="vertical">\n </span>\n </button>\n <div class="k-slider-track-wrap">\n <ul kendoSliderTicks\n #ticks\n *ngIf="tickPlacement !== \'none\'"\n [tickTitle]="title"\n [vertical]="vertical"\n [step]="smallStep"\n [largeStep]="largeStep"\n [min]="min"\n [max]="max"\n [labelTemplate]="labelTemplate?.templateRef"\n [attr.aria-hidden]="true"\n >\n </ul>\n <div #track class="k-slider-track">\n <div #sliderSelection class="k-slider-selection">\n </div>\n <a #draghandle\n role="slider"\n [attr.aria-valuemin]="min"\n [attr.aria-valuemax]="max"\n [attr.aria-valuenow]="currentValue"\n [attr.aria-valuetext]="currentValue"\n [attr.aria-disabled]="disabled ? true : undefined"\n [attr.aria-readonly]="readonly ? true : undefined"\n [attr.aria-orientation]="vertical ? \'vertical\' : \'horizontal\'"\n [style.touch-action]="isDisabled ? \'\' : \'none\'"\n class="k-draghandle"\n [title]="dragHandleMessage"\n [attr.tabindex]="disabled ? \'-1\' : tabIndex"\n [id]="focusableId"\n kendoDraggable\n (kendoPress)="ifEnabled(handleDragPress, $event)"\n (kendoDrag)="ifEnabled(onHandleDrag, $event)"\n (kendoRelease)="ifEnabled(onHandleRelease, $event)"\n ></a>\n </div>\n </div>\n <button *ngIf="showButtons" type="button" #increaseButton\n class="k-button-increase k-button k-button-md k-rounded-full k-button-rectangle k-button-solid k-button-solid-base k-icon-button"\n [title]="incrementMessage"\n (click)="$event.preventDefault()"\n [attr.tabindex]="-1"\n [attr.aria-label]="currentValue"\n role="presentation">\n <span class="k-button-icon k-icon"\n [class.k-i-arrow-e]="!vertical"\n [class.k-i-arrow-n]="vertical">\n </span>\n </button>\n <kendo-resize-sensor (resize)="sizeComponent(false)"></kendo-resize-sensor>\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService,o.Injector,o.Renderer2,o.NgZone,o.ChangeDetectorRef,o.ElementRef])],t)}(ne),oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t.prototype.positionHandle=function(e){if(e.id){var t=this.props,n=t.max,i=t.min,o=t.reverse,r=t.vertical?"bottom":"left",a=this.trackWidth(),s=R(e)?N(n,i,this.props.value)[0]:N(n,i,this.props.value)[1];R(e)?(this.startHandlePosition=A({min:i,max:n,reverse:o,value:s,trackWidth:a}),this.renderer.setStyle(e,r,this.startHandlePosition+"px")):(this.endHandlePosition=A({min:i,max:n,reverse:o,value:s,trackWidth:a}),this.renderer.setStyle(e,r,this.endHandlePosition+"px"))}},t.prototype.positionSelection=function(e,t){var n=this.props,i=n.reverse,o=n.vertical,r=o?"height":"width",a=o?"bottom":i?"right":"left",s=Math.abs(this.endHandlePosition-this.startHandlePosition),c=o?e.style.bottom:e.style.left;this.renderer.setStyle(t,r,s+"px"),this.renderer.setStyle(t,a,i?this.trackWidth()-parseFloat(c)+"px":parseFloat(c)+"px")},t}(q),re=function(e){function t(t,n,o,r,a,s){var c=e.call(this,t,n,o,r,a,s)||this;return c.localization=t,c.injector=n,c.renderer=o,c.ngZone=r,c.changeDetector=a,c.hostElement=s,c.startHandleId="k-start-handle-"+Object(d.guid)(),c.endHandleId="k-end-handle-"+Object(d.guid)(),c.focusableId=c.startHandleId,c.handleZIndex=0,c.activeHandle="startHandle",c.focusChangedProgrammatically=!1,c.onWrapClick=function(e){if(!c.isDisabled){c.value=c.value||[c.min,c.min];var t=H(e,c.track.nativeElement,c.getProps()),n=void 0,i=n=c.value,o=i[0],r=i[1];t<=o?(n=[t,r],c.activeHandle="startHandle"):o<t&&t<r?t<(o+r)/2?(n=[t,r],c.activeHandle="startHandle"):(n=[o,t],c.activeHandle="endHandle"):t>=r&&(n=[o,t],c.activeHandle="endHandle"),Y("startHandle"===c.activeHandle?c.draghandleStart:c.draghandleEnd,"focus"),c.changeValue(n)}},c.onKeyDown=function(e){c.value=c.value||[c.min,c.min];var t=c.getProps(),n=t.max,o=t.min,r=c.keyBinding[e.keyCode];if(!c.isDisabled&&r){c.renderer.setStyle(e.target,"zIndex",++c.handleZIndex);var a=R(e.target),s=r(Object(i.__assign)({},t,{value:a?c.value[0]:c.value[1]}));a?s>c.value[1]&&(c.value[1]=s):s<c.value[0]&&(c.value[0]=s);var d=F(n,o,s),l=a?[d,c.value[1]]:[c.value[0],d];c.changeValue(l),e.preventDefault()}},c.ngChange=function(e){},c.ngTouched=function(){},c.handleBlur=function(){c.changeDetector.markForCheck(),c.focused=!1,(Object(d.hasObservers)(c.onBlur)||v(c.control))&&c.ngZone.run((function(){c.ngTouched(),c.focusChangedProgrammatically||c.onBlur.emit()}))},c}var n;return Object(i.__extends)(t,e),n=t,t.prototype.focus=function(){this.focusChangedProgrammatically=!0,Y(this.draghandleStart,"focus"),this.focusChangedProgrammatically=!1},t.prototype.blur=function(){this.focusChangedProgrammatically=!0,Y("startHandle"===this.activeHandle?this.draghandleStart:this.draghandleEnd,"blur"),this.handleBlur(),this.focusChangedProgrammatically=!1},t.prototype.ngOnInit=function(){this.value||(this.value=[this.min,this.max]),e.prototype.ngOnInit.call(this)},t.prototype.ngOnChanges=function(e){var t=this;Object(d.anyChanged)(["value","fixedTickWidth","tickPlacement"],e,!0)&&(e.value&&e.value.currentValue&&Z(e.value.currentValue),this.ngZone.onStable.asObservable().pipe(Object(s.take)(1)).subscribe((function(){t.sizeComponent()})))},t.prototype.ngAfterViewInit=function(){var e=this;Object(d.isDocumentAvailable)()&&(this.sizeComponent(),this.ticks&&this.ticks.tickElements.changes.subscribe((function(){return e.sizeComponent()})),this.attachElementEventHandlers())},t.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe()},t.prototype.textFor=function(e){return this.localization.get(e)},Object.defineProperty(t.prototype,"valueText",{get:function(){return this.value?this.value[0]+" - "+this.value[1]:""},enumerable:!0,configurable:!0}),t.prototype.handleDragPress=function(e){e.originalEvent&&e.originalEvent.preventDefault();var t=e.originalEvent.target;this.draggedHandle=t,this.renderer.setStyle(t,"zIndex",++this.handleZIndex)},t.prototype.onHandleDrag=function(e){var t=this;this.value=this.value||[this.min,this.min];var n=e.originalEvent.target,i=this.draggedHandle.getBoundingClientRect();this.lastHandlePosition={x:i.left,y:i.top},this.dragging={value:!0,target:n};var o=e.pageX<this.lastHandlePosition.x,r=e.pageX>this.lastHandlePosition.x,a=e.pageY>this.lastHandlePosition.y,s=function(){return t.changeValue([H(e,t.track.nativeElement,t.getProps()),t.value[1]])},c=function(){return t.changeValue([t.value[0],H(e,t.track.nativeElement,t.getProps())])},d=function(){return t.changeValue([H(e,t.track.nativeElement,t.getProps()),H(e,t.track.nativeElement,t.getProps())])},l=R(this.draggedHandle),p=this.vertical,u=!p,h=p&&a||(this.reverse?u&&r:u&&o);this.value[0]===this.value[1]?h?l?s():d():l?d():c():l?s():c()},t.prototype.onHandleRelease=function(e){this.dragging={value:!1,target:e.originalEvent.target},this.draggedHandle=void 0},t.prototype.writeValue=function(e){Z(e),this.value=e,this.sizeComponent()},t.prototype.registerOnChange=function(e){this.ngChange=e},t.prototype.registerOnTouched=function(e){this.ngTouched=e},t.prototype.changeValue=function(e){var t,n,i=this;this.value&&(t=this.value,n=e,g(t[0],n[0])&&g(t[1],n[1]))||this.ngZone.run((function(){i.value=e,i.ngChange(e),i.value&&i.valueChange.emit(e),i.sizeComponent()}))},t.prototype.sizeComponent=function(){if(Object(d.isDocumentAvailable)()){var e=this.wrapper.nativeElement,t=this.track.nativeElement,n=this.sliderSelection.nativeElement,i=this.draghandleStart.nativeElement,o=this.draghandleEnd.nativeElement,r=this.ticks?this.ticksContainer.nativeElement:null;this.resetStyles([t,n,i,o,r,this.hostElement.nativeElement]);var a=this.getProps(),s=new oe(a,e,t,this.renderer);s.resizeTrack(),this.ticks&&s.resizeTicks(this.ticksContainer.nativeElement,this.ticks.tickElements.map((function(e){return e.nativeElement}))),s.positionHandle(i),s.positionHandle(o),s.positionSelection(i,n),this.fixedTickWidth&&s.resizeWrapper()}},Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled||this.readonly},enumerable:!0,configurable:!0}),t.prototype.isEmpty=function(){return!1},Object.defineProperty(t.prototype,"focused",{set:function(e){this.isFocused!==e&&this.hostElement&&(this.isFocused=e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragging",{set:function(e){if(this.isDragged!==e.value&&this.sliderSelection&&this.draghandleStart&&this.draghandleEnd){var t=this.sliderSelection.nativeElement,n=e.target;e.value?(this.renderer.addClass(t,"k-pressed"),this.renderer.addClass(n,"k-pressed")):(this.renderer.removeClass(t,"k-pressed"),this.renderer.removeClass(n,"k-pressed")),this.isDragged=e.value}},enumerable:!0,configurable:!0}),t.prototype.getProps=function(){return{disabled:this.disabled,fixedTickWidth:this.fixedTickWidth,largeStep:this.largeStep,max:this.max,min:this.min,readonly:this.readonly,reverse:this.reverse,rtl:this.localizationService.rtl,smallStep:this.smallStep,value:N(this.max,this.min,this.value),vertical:this.vertical,buttons:!1}},t.prototype.attachElementEventHandlers=function(){var e=this,t=this.hostElement.nativeElement,n=!1,i=!1;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focusin",(function(){e.isFocused||e.ngZone.run((function(){e.focusChangedProgrammatically||e.onFocus.emit(),e.focused=!0}))}))),e.subscriptions.add(e.renderer.listen(t,"focusout",(function(t){e.isFocused&&(n?(t.relatedTarget!==e.draghandleStart.nativeElement&&t.relatedTarget!==e.draghandleEnd.nativeElement&&e.handleBlur(),n=!1):i||e.handleBlur())}))),e.subscriptions.add(e.renderer.listen(t,"mouseenter",(function(){i=!0}))),e.subscriptions.add(e.renderer.listen(t,"mouseleave",(function(){i=!1}))),e.subscriptions.add(e.renderer.listen(t,"keydown",(function(e){n=e.keyCode===d.Keys.Tab})))}))},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],t.prototype,"value",void 0),Object(i.__decorate)([Object(o.ViewChild)("draghandleStart",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"draghandleStart",void 0),Object(i.__decorate)([Object(o.ViewChild)("draghandleEnd",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],t.prototype,"draghandleEnd",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoRangeSlider",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.rangeslider"},{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return n}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-rangeslider",template:'\n <ng-container kendoSliderLocalizedMessages\n i18n-dragHandleStart="kendo.rangeslider.dragHandleStart|The title of the **Start** drag handle of the Slider."\n dragHandleStart="Drag"\n i18n-dragHandleEnd="kendo.rangeslider.dragHandleEnd|The title of the **End** drag handle of the Slider."\n dragHandleEnd="Drag"\n >\n\n <div class="k-slider-wrap" #wrap\n [class.k-slider-topleft]="tickPlacement === \'before\'"\n [class.k-slider-bottomright]="tickPlacement === \'after\'"\n [kendoEventsOutsideAngular]="{ click: onWrapClick, keydown: onKeyDown }"\n >\n <div class="k-slider-track-wrap">\n <ul kendoSliderTicks\n #ticks\n *ngIf="tickPlacement !== \'none\'"\n [tickTitle]="title"\n [vertical]="vertical"\n [step]="smallStep"\n [largeStep]="largeStep"\n [min]="min"\n [max]="max"\n [labelTemplate]="labelTemplate?.templateRef"\n [attr.aria-hidden]="true"\n >\n </ul>\n <div #track class="k-slider-track">\n <div #sliderSelection class="k-slider-selection">\n </div>\n <a #draghandleStart\n role="slider"\n [id]="startHandleId"\n [attr.tabindex]="disabled ? undefined : tabindex"\n [attr.aria-valuemin]="min"\n [attr.aria-valuemax]="max"\n [attr.aria-valuenow]="value ? value[0] : null"\n [attr.aria-valuetext]="valueText"\n [attr.aria-disabled]="disabled ? true : undefined"\n [attr.aria-readonly]="readonly ? true : undefined"\n [attr.aria-orientation]="vertical ? \'vertical\' : \'horizontal\'"\n [style.touch-action]="isDisabled ? \'\' : \'none\'"\n class="k-draghandle"\n [title]="textFor(\'dragHandleStart\')"\n kendoDraggable\n (kendoPress)="ifEnabled(handleDragPress ,$event)"\n (kendoDrag)="ifEnabled(onHandleDrag ,$event)"\n (kendoRelease)="ifEnabled(onHandleRelease, $event)"\n ></a>\n <a #draghandleEnd\n role="slider"\n [id]="endHandleId"\n [attr.tabindex]="disabled ? undefined : tabindex"\n [attr.aria-valuemin]="min"\n [attr.aria-valuemax]="max"\n [attr.aria-valuenow]="value ? value[1] : null"\n [attr.aria-valuetext]="valueText"\n [attr.aria-disabled]="disabled ? true : undefined"\n [attr.aria-readonly]="readonly ? true : undefined"\n [attr.aria-orientation]="vertical ? \'vertical\' : \'horizontal\'"\n [style.touch-action]="isDisabled ? \'\' : \'none\'"\n class="k-draghandle"\n [title]="textFor(\'dragHandleEnd\')"\n kendoDraggable\n (kendoPress)="ifEnabled(handleDragPress ,$event)"\n (kendoDrag)="ifEnabled(onHandleDrag ,$event)"\n (kendoRelease)="ifEnabled(onHandleRelease, $event)"\n ></a>\n </div>\n </div>\n <kendo-resize-sensor (resize)="sizeComponent()"></kendo-resize-sensor>\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService,o.Injector,o.Renderer2,o.NgZone,o.ChangeDetectorRef,o.ElementRef])],t)}(ne),ae=function(){function e(e,t,n,i,r,s){var c=this;this.renderer=e,this.hostElement=t,this.localizationService=n,this.injector=i,this.changeDetector=r,this.ngZone=s,this.focusableId="k-"+Object(d.guid)(),this.disabled=!1,this.readonly=!1,this.tabindex=0,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.valueChange=new o.EventEmitter,this.hostClasses=!0,this.initialized=!1,this.hostClickSubscription=new a.Subscription,this._checked=!1,this._size="medium",this._trackRounded="full",this._thumbRounded="full",this.ngChange=function(e){},this.ngTouched=function(){},this.handleFocus=function(){c.isFocused||(c.focused=!0,Object(d.hasObservers)(c.onFocus)&&c.ngZone.run((function(){c.onFocus.emit()})))},this.handleBlur=function(e){var t=e&&e.relatedTarget;c.hostElement.nativeElement.contains(t)||(c.changeDetector.markForCheck(),c.focused=!1,(Object(d.hasObservers)(c.onBlur)||v(c.control))&&c.ngZone.run((function(){c.ngTouched(),c.onBlur.emit()})))},Object(l.validatePackage)(ee),this.direction=n.rtl?"rtl":"ltr",this.keyDownHandler=this.keyDownHandler.bind(this),this.clickHandler=this.clickHandler.bind(this)}var t;return t=e,Object.defineProperty(e.prototype,"checked",{get:function(){return this._checked},set:function(e){this.setHostClasses(e),this._checked=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"thumbRounded",{get:function(){return this._thumbRounded},set:function(e){this.handleThumbClasses(e),this._thumbRounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trackRounded",{get:function(){return this._trackRounded},set:function(e){this.handleTrackClasses(e),this._trackRounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ieClass",{get:function(){return p.a&&p.a.msie},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaDisabled",{get:function(){return!!this.disabled||void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLabelMessage",{get:function(){return this.onLabel||this.localizationService.get("on")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offLabelMessage",{get:function(){return this.offLabel||this.localizationService.get("off")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isEnabled",{get:function(){return!this.disabled&&!this.readonly},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;if(this.hostElement){var t=this.hostElement.nativeElement;this.renderer.removeAttribute(t,"tabindex")}this.localizationChangeSubscription=this.localizationService.changes.pipe(Object(s.skip)(1)).subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr"})),this.control=this.injector.get(r.NgControl,null),this.ngZone.onStable.pipe(Object(s.take)(1)).subscribe((function(){return e.initialized=!0}))},e.prototype.ngAfterViewInit=function(){var e=this.hostElement.nativeElement;this.attachHostClickHandler(),this.checked||e.classList.contains("k-switch-off")||this.renderer.addClass(e,"k-switch-off"),this.handleClasses(this.size,"size"),this.handleTrackClasses(this.trackRounded),this.handleThumbClasses(this.thumbRounded)},e.prototype.ngOnDestroy=function(){this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe(),this.hostClickSubscription&&this.hostClickSubscription.unsubscribe()},e.prototype.focus=function(){this.track&&this.track.nativeElement.focus()},e.prototype.blur=function(){this.track&&this.track.nativeElement.blur()},e.prototype.setDisabledState=function(e){this.disabled=e,this.changeDetector.markForCheck()},e.prototype.writeValue=function(e){this.checked=null!==e&&e,this.changeDetector.markForCheck()},e.prototype.registerOnChange=function(e){this.ngChange=e},e.prototype.registerOnTouched=function(e){this.ngTouched=e},e.prototype.keyDownHandler=function(e){var t=e.keyCode;!this.isEnabled||t!==d.Keys.Space&&t!==d.Keys.Enter||(this.changeValue(!this.checked),e.preventDefault())},e.prototype.clickHandler=function(){this.isEnabled&&this.changeValue(!this.checked)},e.prototype.isEmpty=function(){return!1},e.prototype.changeValue=function(e){var t=this;this.checked!==e&&this.ngZone.run((function(){t.checked=e,t.ngChange(e),t.valueChange.emit(e),t.changeDetector.markForCheck()}))},Object.defineProperty(e.prototype,"focused",{set:function(e){if(this.isFocused!==e&&this.hostElement){var t=this.hostElement.nativeElement;e?this.renderer.addClass(t,"k-focus"):this.renderer.removeClass(t,"k-focus"),this.isFocused=e}},enumerable:!0,configurable:!0}),e.prototype.attachHostClickHandler=function(){var e=this;this.ngZone.runOutsideAngular((function(){e.hostClickSubscription.add(e.renderer.listen(e.hostElement.nativeElement,"click",e.clickHandler))}))},e.prototype.setHostClasses=function(e){var t=this.hostElement.nativeElement;e?(this.renderer.removeClass(t,"k-switch-off"),this.renderer.addClass(t,"k-switch-on")):(this.renderer.removeClass(t,"k-switch-on"),this.renderer.addClass(t,"k-switch-off"))},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("switch",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},e.prototype.handleTrackClasses=function(e){var t=this.hostElement.nativeElement,n=this.track.nativeElement,i=j("switch","rounded",this.trackRounded,e);i.toRemove&&(this.renderer.removeClass(t,i.toRemove),this.renderer.removeClass(n,i.toRemove)),i.toAdd&&(this.renderer.addClass(t,i.toAdd),this.renderer.addClass(n,i.toAdd))},e.prototype.handleThumbClasses=function(e){var t=this.thumb.nativeElement,n=j("switch","rounded",this.thumbRounded,e);n.toRemove&&this.renderer.removeClass(t,n.toRemove),n.toAdd&&this.renderer.addClass(t,n.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"onLabel",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"offLabel",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[Boolean])],e.prototype,"checked",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"thumbRounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"trackRounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-ie"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ieClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaDisabled",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-readonly"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaReadonly",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-switch"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.ViewChild)("track",{static:!0}),Object(i.__metadata)("design:type",Object)],e.prototype,"track",void 0),Object(i.__decorate)([Object(o.ViewChild)("thumb",{static:!0}),Object(i.__metadata)("design:type",Object)],e.prototype,"thumb",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoSwitch",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.switch"},{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}],selector:"kendo-switch",template:'\n <ng-container kendoSwitchLocalizedMessages\n i18n-on="kendo.switch.on|The **On** label of the Switch."\n on="ON"\n i18n-off="kendo.switch.off|The **Off** label of the Switch."\n off="OFF"\n >\n\n <span\n #track\n class="k-switch-track"\n [id]="focusableId"\n role="switch"\n [style.transitionDuration]="initialized ? \'200ms\' : \'0ms\'"\n [attr.aria-checked]="checked"\n [attr.tabindex]="(disabled ? undefined : tabIndex)"\n [kendoEventsOutsideAngular]="{ keydown: keyDownHandler, focus: handleFocus, blur: handleBlur }"\n >\n <span class="k-switch-label-on" [attr.aria-hidden]="true" >{{onLabelMessage}}</span>\n <span class="k-switch-label-off" [attr.aria-hidden]="true">{{offLabelMessage}}</span>\n </span>\n <span\n class="k-switch-thumb-wrap"\n tabindex="-1"\n [style.transitionDuration]="initialized ? \'200ms\' : \'0ms\'" [kendoEventsOutsideAngular]="{\n keydown: keyDownHandler,\n focus: handleFocus,\n blur: handleBlur\n }">\n <span #thumb class="k-switch-thumb"></span>\n </span>\n '}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef,c.LocalizationService,o.Injector,o.ChangeDetectorRef,o.NgZone])],e)}(),se=function(){function e(e,t,n){this.renderer=e,this.inputElement=t,this.ngZone=n,this.hostClasses=!0,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.onValueChange=new o.EventEmitter,this.autoFillStart=new o.EventEmitter,this.autoFillEnd=new o.EventEmitter,this.listeners=[]}var t;return t=e,Object.defineProperty(e.prototype,"value",{get:function(){return this.inputElement.nativeElement.value},set:function(e){this.inputElement&&(this.inputElement.nativeElement.value=null==e?"":e,this.onValueChange.emit())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.inputElement.nativeElement.id},set:function(e){this.renderer.setAttribute(this.inputElement.nativeElement,"id",e)},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this,t=this.inputElement.nativeElement;this.listeners=[this.renderer.listen(t,"focus",(function(){return e.onFocus.emit()})),this.renderer.listen(t,"blur",(function(){return e.onBlur.emit()}))],this.ngZone.runOutsideAngular((function(){e.renderer.listen(t,"animationstart",(function(t){"autoFillStart"===t.animationName?e.autoFillStart.emit():"autoFillEnd"===t.animationName&&e.autoFillEnd.emit()}))}))},e.prototype.ngOnDestroy=function(){this.listeners.forEach((function(e){return e()}))},Object(i.__decorate)([Object(o.HostBinding)("class.k-textbox"),Object(o.HostBinding)("class.k-input"),Object(o.HostBinding)("class.k-input-md"),Object(o.HostBinding)("class.k-rounded-md"),Object(o.HostBinding)("class.k-input-solid"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),e=t=Object(i.__decorate)([Object(o.Directive)({selector:"input[kendoTextBox]",providers:[{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}]}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef,o.NgZone])],e)}(),ce=function(){function e(e,t,n,i,r,a){this.renderer=e,this.element=t,this.zone=n,this.changeDetector=i,this.injector=r,this.elementClasses=!0,this.autofillClass=!0,this.valueChange=new o.EventEmitter,this.autoSize=!1,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.onValueChange=new o.EventEmitter,this.autoFillStart=new o.EventEmitter,this.autoFillEnd=new o.EventEmitter,this.listeners=[],this.ngChange=function(e){},this.ngTouched=function(){},this.direction=a?"rtl":"ltr"}var t;return t=e,Object.defineProperty(e.prototype,"id",{get:function(){return this.element.nativeElement.id},set:function(e){this.renderer.setAttribute(this.element.nativeElement,"id",e)},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){this.elementValue=e,this.resize()},e.prototype.registerOnChange=function(e){this.ngChange=e},e.prototype.registerOnTouched=function(e){this.ngTouched=e},e.prototype.setDisabledState=function(e){this.setElementProperty("disabled",e)},e.prototype.ngOnInit=function(){var e=this,t=this.element.nativeElement;this.zone.runOutsideAngular((function(){e.listeners=[e.renderer.listen(t,"focus",e.handleFocus.bind(e)),e.renderer.listen(t,"blur",e.handleBlur.bind(e)),e.renderer.listen(t,"animationstart",(function(t){"autoFillStart"===t.animationName?e.autoFillStart.emit():"autoFillEnd"===t.animationName&&e.autoFillEnd.emit()}))],Object(d.isDocumentAvailable)()&&e.autoSize&&(e.resizeSubscription=Object(a.fromEvent)(window,"resize").pipe(Object(s.debounceTime)(50)).subscribe((function(){return e.resize()}))),e.inputSubscription=Object(a.fromEvent)(t,"input").subscribe(e.handleInput.bind(e))})),this.control=this.injector.get(r.NgControl,null)},e.prototype.ngOnChanges=function(e){var t=this,n=this.element.nativeElement;e.value&&(this.elementValue=this.value),e.autoSize&&(this.autoSize?(this.initialHeight=n.offsetHeight,this.renderer.setStyle(n,"resize","none")):(this.renderer.setStyle(n,"overflow-y","auto"),this.renderer.setStyle(n,"resize","both"),n.style.height=this.initialHeight+"px")),this.zone.onStable.pipe(Object(s.take)(1)).subscribe((function(){return t.resize()}))},e.prototype.ngOnDestroy=function(){this.listeners.forEach((function(e){return e()})),this.inputSubscription&&this.inputSubscription.unsubscribe(),this.resizeSubscription&&this.resizeSubscription.unsubscribe()},Object.defineProperty(e.prototype,"elementValue",{get:function(){return this.element?this.element.nativeElement.value:""},set:function(e){this.setElementProperty("value",null==e?"":e)},enumerable:!0,configurable:!0}),e.prototype.setElementProperty=function(e,t){this.element&&this.renderer.setProperty(this.element.nativeElement,e,t)},e.prototype.resize=function(){if(this.autoSize){var e=this.element.nativeElement;this.renderer.setStyle(e,"overflow-y","hidden"),e.style.height=this.initialHeight+"px";var t=e.scrollHeight;t>this.initialHeight&&(e.style.height=t+"px")}},e.prototype.handleInput=function(){var e=this,t=this.elementValue;this.value=t,(this.control||Object(d.hasObservers)(this.onValueChange)||Object(d.hasObservers)(this.valueChange))&&this.zone.run((function(){e.ngChange(t),e.onValueChange.emit(t),e.valueChange.emit(t),e.changeDetector.markForCheck()})),this.resize()},e.prototype.handleFocus=function(){var e=this;Object(d.hasObservers)(this.onFocus)&&this.zone.run((function(){e.onFocus.emit()}))},e.prototype.handleBlur=function(){var e=this;(Object(d.hasObservers)(this.onBlur)||v(this.control))&&this.zone.run((function(){e.ngTouched(),e.onBlur.emit(),e.changeDetector.markForCheck()}))},Object(i.__decorate)([Object(o.HostBinding)("class.k-textarea"),Object(o.HostBinding)("class.k-input"),Object(o.HostBinding)("class.k-input-md"),Object(o.HostBinding)("class.k-rounded-md"),Object(o.HostBinding)("class.k-input-solid"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"elementClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-autofill"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"autofillClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"autoSize",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),e=t=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t})),multi:!0},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}],selector:"textarea[kendoTextArea]"}),Object(i.__param)(5,Object(o.Optional)()),Object(i.__param)(5,Object(o.Inject)(c.RTL)),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef,o.NgZone,o.ChangeDetectorRef,o.Injector,Boolean])],e)}(),de=/[eE][\-+]?([0-9]+)/,le=function(e){return e>=0?Math.floor(e):Math.ceil(e)},pe=function(e){},ue=function(e){return!isNaN(e)&&null!==e};function he(e,t){var n=t-String(e).length,i=e;if(n>0){var o=new Array(n+1).join("0");i=parseFloat(e+o)}return i}var fe;!function(e){e[e.Down=-1]="Down",e[e.None=0]="None",e[e.Up=1]="Up"}(fe||(fe={}));var be,me=["min","max","step","decimals"],ge={decimals:null,max:null,min:null,step:1},ve=function(){function e(e,t,n,i,r,a,s){var c=this;this.intl=e,this.renderer=t,this.localizationService=n,this.injector=i,this.ngZone=r,this.changeDetector=a,this.hostElement=s,this.focusableId="k-"+Object(d.guid)(),this.disabled=!1,this.readonly=!1,this.title="",this.autoCorrect=!1,this.decimals=null,this.step=1,this.spinners=!0,this.rangeValidation=!0,this.tabindex=0,this.changeValueOnScroll=!0,this.selectOnFocus=!0,this.value=null,this.valueChange=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.ArrowDirection=fe,this.arrowDirection=fe.None,this.hostClasses=!0,this.inputValue="",this.minValidateFn=pe,this.maxValidateFn=pe,this._format="n2",this.isPasted=!1,this.mouseDown=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",this.ngChange=pe,this.ngTouched=pe,this.ngValidatorChange=pe,this.domEvents=[],this.increasePress=function(e){c.arrowPress(fe.Up,e)},this.decreasePress=function(e){c.arrowPress(fe.Down,e)},this.releaseArrow=function(){clearTimeout(c.spinTimeout),c.arrowDirection!==fe.None&&(c.arrowDirection=fe.None,c.changeDetector.detectChanges())},this.handlePaste=function(){c.isPasted=!0},this.handleInput=function(){var e=c.numericInput.nativeElement,t=e.selectionStart,n=e.selectionEnd,i=e.value;if(c.pressedKey===d.Keys.NumpadDecimal&&(i=c.replaceNumpadDotValue()),c.isPasted&&(i=c.formatInputValue(c.intl.parseNumber(i))),!c.isValid(i))return e.value=c.inputValue,void c.setSelection(t-1,n-1);var o=c.intl.parseNumber(i),r=c.restrictDecimals(o);if(c.autoCorrect){var a=c.limitInputValue(r);r=a.value,t=a.selectionStart,n=a.selectionEnd}o!==r||c.hasTrailingZeros(i)||!c.focused?(c.setInputValue(r),c.setSelection(t,n)):c.inputValue=i,c.isPasted&&(e.value=c.inputValue),c.updateValue(r),c.previousSelection=null,c.isPasted=!1},this.handleDragEnter=function(){c.focused||c.isDisabled||c.setInputValue(c.value,!0)},this.handleMouseDown=function(){c.mouseDown=!0},this.handleFocus=function(){if(!c.focused&&(c.focused=!0,!c.isDisabled)){var e=c.selectOnFocus||!c.mouseDown;c.ngZone.runOutsideAngular((function(){setTimeout((function(){e?c.selectAll():c.selectCaret()}),0)}))}c.mouseDown=!1,Object(d.hasObservers)(c.onFocus)&&c.ngZone.run((function(){c.onFocus.emit()}))},this.handleBlur=function(){c.changeDetector.markForCheck(),c.focused=!1,c.inputValue!==c.elementValue&&c.handleInput(),c.setInputValue(),(Object(d.hasObservers)(c.onBlur)||v(c.control))&&c.ngZone.run((function(){c.ngTouched(),c.onBlur.emit()}))},this.handleKeyDown=function(e){if(!c.isDisabled){var t;e.keyCode===d.Keys.ArrowDown?t=-1:e.keyCode===d.Keys.ArrowUp&&(t=1),t&&c.step&&(e.preventDefault(),c.addStep(t));var n=c.numericInput.nativeElement;c.previousSelection={end:n.selectionEnd,start:n.selectionStart},c.pressedKey=e.keyCode}},this.handleWheel=function(e){if(c.focused&&!c.isDisabled&&c.changeValueOnScroll){e.preventDefault();var t=function(e){var t=0;return e.wheelDelta?t=(t=e.wheelDelta/120)>0?Math.ceil(t):Math.floor(t):e.detail&&(t=Math.round(-e.detail/3)),t}(e);c.addStep(t)}},Object(l.validatePackage)(ee),this.direction=n.rtl?"rtl":"ltr"}var t;return t=e,Object.defineProperty(e.prototype,"format",{get:function(){var e=this._format;return null!=e?e:"n2"},set:function(e){this._format=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disableClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.subscriptions=this.localizationService.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr"})),this.subscriptions.add(this.intl.changes.subscribe(this.intlChange.bind(this))),this.hostElement&&this.renderer.removeAttribute(this.hostElement.nativeElement,"tabindex"),this.control=this.injector.get(r.NgControl,null),this.ngZone.runOutsideAngular((function(){e.domEvents.push(e.renderer.listen(e.hostElement.nativeElement,"mousewheel",e.handleWheel.bind(e))),e.domEvents.push(e.renderer.listen(e.hostElement.nativeElement,"DOMMouseScroll",e.handleWheel.bind(e)))}))},e.prototype.ngAfterViewInit=function(){var e=this;["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.ngOnChanges=function(e){var t,n;Object(d.anyChanged)(me,e,!1)&&this.parseOptions(me.filter((function(t){return e[t]}))),this.verifySettings(),Object(d.anyChanged)(["min","max","rangeValidation"],e,!1)&&(this.minValidateFn=this.rangeValidation?(n=this.min,function(e){return!m(n)||!m(e.value)||e.value>=n?null:{minError:{minValue:n,value:e.value}}}):pe,this.maxValidateFn=this.rangeValidation?(t=this.max,function(e){return!m(t)||!m(e.value)||e.value<=t?null:{maxError:{maxValue:t,value:e.value}}}):pe,this.ngValidatorChange()),Object(d.anyChanged)(["autoCorrect","decimals","min"],e)&&delete this.numericRegex,Object(d.anyChanged)(["value","format"],e,!1)&&(this.verifyValue(this.value),this.value=this.restrictModelValue(this.value),this.focused&&this.intl.parseNumber(this.elementValue)===this.value||this.setInputValue())},e.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe(),clearTimeout(this.spinTimeout),this.domEvents.forEach((function(e){return e()}))},e.prototype.validate=function(e){return this.minValidateFn(e)||this.maxValidateFn(e)},e.prototype.registerOnValidatorChange=function(e){this.ngValidatorChange=e},e.prototype.writeValue=function(e){this.verifyValue(e);var t=this.restrictModelValue(e);this.value=t,this.setInputValue()},e.prototype.registerOnChange=function(e){this.ngChange=e},e.prototype.registerOnTouched=function(e){this.ngTouched=e},e.prototype.setDisabledState=function(e){this.changeDetector.markForCheck(),this.disabled=e},e.prototype.focus=function(){Y(this.numericInput,"focus")},e.prototype.blur=function(){Y(this.numericInput,"blur")},e.prototype.notifyValueChange=function(){this.setInputValue()},Object.defineProperty(e.prototype,"incrementTitle",{get:function(){return this.localizationService.get("increment")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decrementTitle",{get:function(){return this.localizationService.get("decrement")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"decimalSeparator",{get:function(){return this.intl.numberSymbols().decimal},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elementValue",{get:function(){return this.numericInput.nativeElement.value},set:function(e){this.renderer.setProperty(this.numericInput.nativeElement,"value",e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focused",{get:function(){return this.isFocused},set:function(e){if(this.isFocused!==e&&this.hostElement){var t=this.hostElement.nativeElement;e?this.renderer.addClass(t,"k-focus"):this.renderer.removeClass(t,"k-focus"),this.isFocused=e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasDecimals",{get:function(){return null!==this.decimals&&this.decimals>=0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled||this.readonly},enumerable:!0,configurable:!0}),e.prototype.arrowPress=function(e,t){var n,i,o;(t.preventDefault(),this.isDisabled||(n=t,i=n.button&&2===n.button,o=n.which&&3===n.which,i||o))||(p.e||(this.focused=!0,this.focus()),this.arrowDirection!==e&&(this.arrowDirection=e,this.changeDetector.detectChanges()),this.step?this.spin(e,500):this.setInputValue())},e.prototype.updateValue=function(e){var t=this;g(this.value,e)||this.ngZone.run((function(){t.value=e,t.ngChange(e),t.valueChange.emit(e),t.changeDetector.markForCheck()}))},e.prototype.replaceNumpadDotValue=function(){var e=this.inputValue||"";if(this.previousSelection){var t=this.numericInput.nativeElement,n=t.selectionStart,i=t.selectionEnd,o=this.previousSelection,r=o.start,a=o.end;t.value=e=e.substring(0,r)+this.decimalSeparator+e.substring(a),this.setSelection(n,i)}return e},e.prototype.isValid=function(e){var t,n,i,o,r,a;return this.numericRegex||(this.numericRegex=(t={autoCorrect:this.autoCorrect,decimals:this.decimals,min:this.min,separator:this.decimalSeparator},i=t.autoCorrect,o=t.decimals,r=t.min,"."===(a=t.separator)&&(a="\\"+a),n=0===o?"\\d*":"(?:(?:\\d+("+a+"\\d*)?)|(?:"+a+"\\d*))?",new RegExp("^"+(i&&null!==r&&r>=0?"":"-?")+n+"$"))),this.numericRegex.test(e)},e.prototype.spin=function(e,t){var n=this;clearTimeout(this.spinTimeout),this.spinTimeout=window.setTimeout((function(){n.spin(e,50)}),t),this.addStep(e)},e.prototype.addStep=function(e){var t=x(this.value||0,this.step*e);t=this.limitValue(t),t=this.restrictDecimals(t),this.setInputValue(t),this.updateValue(t)},e.prototype.setSelection=function(e,t){this.focused&&Y(this.numericInput,"setSelectionRange",e,t)},e.prototype.limitValue=function(e){var t=e;return this.isInRange(e)||(ue(this.max)&&e>this.max&&(t=this.max),ue(this.min)&&e<this.min&&(t=this.min)),t},e.prototype.limitInputValue=function(e){var t=this.numericInput.nativeElement,n=t.selectionStart,i=t.selectionEnd,o=t.value,r=e,a=!1;if(!this.isInRange(e)){var s=o.length-String(this.inputValue).length,c=this.min,d=this.max,l=ue(d),p=ue(c),u=void 0,h=void 0,f=e;if(0===n&&this.inputValue.substr(1)===o)return{selectionEnd:i,selectionStart:n,value:null};if(l&&e>d?e>0?h=!0:u=d:p&&e<c&&(e>0?u=c:h=!0),u){var b=this.tryPadValue(e,u);b&&le(e)!==le(u)&&(f=b,a=!0)}else h&&this.inputValue&&n!==o.length&&(f=parseFloat(o.substr(0,n)+o.substr(n+s)));r=this.limitValue(f),a=(a||r!==f)&&this.previousSelection&&this.previousSelection.end-this.previousSelection.start+s>0}return{selectionEnd:a?String(r).length:i,selectionStart:n,value:r}},e.prototype.tryPadValue=function(e,t){var n,i=String(Math.floor(t)).length,o=he(e,i),r=he(e,i+1);return this.isInRange(o)?n=o:this.isInRange(r)&&(n=r),n},e.prototype.isInRange=function(e){return!ue(e)||(!ue(this.min)||this.min<=e)&&(!ue(this.max)||e<=this.max)},e.prototype.restrictModelValue=function(e){var t=this.restrictDecimals(e,!0);return this.autoCorrect&&this.limitValue(t)!==t&&(t=null),t},e.prototype.restrictDecimals=function(e,t){var n=e;if(e&&this.hasDecimals){var i=this.decimals,o=String(e);if(t||de.test(o))n=S(e,i);else{var r=o.split("."),a=r[1];a&&a.length>i&&(a=a.substr(0,i),n=parseFloat(r[0]+"."+a))}}return n},e.prototype.formatInputValue=function(e){var t=String(e),n=de.exec(t);return n&&(t=e.toFixed(C(parseInt(n[1],10)))),t.replace(".",this.decimalSeparator)},e.prototype.formatValue=function(e,t){return null!==e&&function(e){return void 0!==e}(e)&&""!==e?t&&!this.readonly?this.formatInputValue(e):this.intl.formatNumber(e,this.format):""},e.prototype.setInputValue=function(e,t){void 0===e&&(e=this.value),void 0===t&&(t=this.focused);var n=this.formatValue(e,t);this.elementValue=n,this.inputValue=n},e.prototype.verifySettings=function(){if(Object(o.isDevMode)()&&null!==this.min&&null!==this.max&&this.min>this.max)throw new Error("The max value should be bigger than the min. See http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-min and http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-max.")},e.prototype.verifyValue=function(e){if(Object(o.isDevMode)()&&e&&"number"!=typeof e)throw new Error("The NumericTextBox component requires value of type Number and "+JSON.stringify(e)+" was set.")},e.prototype.parseOptions=function(e){for(var t=0;t<e.length;t++){var n=e[t],i=this[n];if("string"==typeof i){var r=parseFloat(i),a=!isNaN(r);if(Object(o.isDevMode)()&&!a&&""!==i)throw new Error("The NumericTextBox component requires value of type Number or a String representing a number for the "+n+" property and "+JSON.stringify(i)+" was set.");this[n]=a?r:ge[n]}}},e.prototype.intlChange=function(){delete this.numericRegex,!this.numericInput||this.focused&&this.isValid(this.elementValue)||this.setInputValue()},e.prototype.hasTrailingZeros=function(e){if(this.hasDecimals&&this.focused){var t=e.split(this.decimalSeparator)[1];return t&&t.length>this.decimals&&t.lastIndexOf("0")===t.length-1}},e.prototype.selectAll=function(){this.setInputValue(),this.setSelection(0,this.inputValue.length)},e.prototype.selectCaret=function(){var e,t,n,i=this.numericInput.nativeElement.selectionStart,o=this.elementValue,r=o.substring(0,i);if(this.setInputValue(),r.length){var a=(e=r,t=this.decimalSeparator,n=t+"0123456789-",e.split("").reduce((function(e,t){return n.includes(t)?++e:e}),0)),s=this.adjustSignificantChars(o,a);this.setSelection(s,s)}else this.setSelection(0,0)},e.prototype.numberOfLeadingZeroes=function(e){var t=e.indexOf(this.decimalSeparator),n=e.match(/^[^1-9]*?(0+)/);if(n){var i=n[0].length,o=n[1].length;return i===t?o-1:o}return 0},e.prototype.adjustSignificantChars=function(e,t){var n=this.numberOfLeadingZeroes(e);return n>0?Math.max(0,t-n):t},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("input",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"autoCorrect",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"format",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"max",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"min",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"decimals",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"step",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"spinners",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"rangeValidation",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"changeValueOnScroll",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"selectOnFocus",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"maxlength",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.ViewChild)("numericInput",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"numericInput",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disableClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-input"),Object(o.HostBinding)("class.k-numerictextbox"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoNumericTextBox",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.numerictextbox"},{provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t})),multi:!0},{provide:r.NG_VALIDATORS,useExisting:Object(o.forwardRef)((function(){return t})),multi:!0},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}],selector:"kendo-numerictextbox",template:'\n <ng-container kendoNumericTextBoxLocalizedMessages\n i18n-increment="kendo.numerictextbox.increment|The title for the **Increment** button in the NumericTextBox"\n increment="Increase value"\n i18n-decrement="kendo.numerictextbox.decrement|The title for the **Decrement** button in the NumericTextBox"\n decrement="Decrease value"\n >\n </ng-container>\n <input\n role="spinbutton"\n class="k-input-inner"\n autocomplete="off"\n autocorrect="off"\n [id]="focusableId"\n [attr.aria-valuemin]="min"\n [attr.aria-valuemax]="max"\n [attr.aria-valuenow]="value"\n [attr.title]="title"\n [attr.placeholder]="placeholder"\n [attr.maxLength]="maxlength"\n [tabindex]="tabIndex"\n [disabled]="disabled"\n [readonly]="readonly"\n [kendoEventsOutsideAngular]="{\n mousedown: handleMouseDown,\n dragenter: handleDragEnter,\n keydown: handleKeyDown,\n input: handleInput,\n focus: handleFocus,\n blur: handleBlur,\n paste: handlePaste\n }"\n #numericInput />\n <span\n class="k-input-spinner k-spin-button" *ngIf="spinners"\n [kendoEventsOutsideAngular]="{ mouseup: releaseArrow, mouseleave: releaseArrow }"\n >\n <button\n type="button"\n [kendoEventsOutsideAngular]="{ mousedown: increasePress }"\n [attr.aria-hidden]="true"\n [attr.aria-label]="incrementTitle"\n [title]="incrementTitle"\n [class.k-active]="arrowDirection === ArrowDirection.Up"\n class="k-spinner-increase k-button k-icon-button k-button-solid k-button-solid-base"\n tabindex="-1"\n >\n <span class="k-button-icon k-icon k-i-arrow-n"></span>\n </button>\n <button\n type="button"\n [kendoEventsOutsideAngular]="{ mousedown: decreasePress }"\n [attr.aria-hidden]="true"\n [attr.aria-label]="decrementTitle"\n [title]="decrementTitle"\n [class.k-active]="arrowDirection === ArrowDirection.Down"\n class="k-spinner-decrease k-button k-icon-button k-button-solid k-button-solid-base"\n tabindex="-1"\n >\n <span class="k-button-icon k-icon k-i-arrow-s"></span>\n </button>\n </span>\n '}),Object(i.__metadata)("design:paramtypes",[u.IntlService,o.Renderer2,c.LocalizationService,o.Injector,o.NgZone,o.ChangeDetectorRef,o.ElementRef])],e)}(),ye=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"decrement",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"increment",void 0),t}(c.ComponentMessages),_e=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:ye,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-numerictextbox-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(ye);!function(e){e[e.Literal=0]="Literal",e[e.Mask=1]="Mask",e[e.Undefined=2]="Undefined"}(be||(be={}));var Oe=function(){function e(e,t,n){void 0===n&&(n=be.Undefined),this.value=e,this.rest=t,this.type=n}return e.prototype.map=function(t){return new e(t(this.value),this.rest)},e.prototype.chain=function(e){return e(this.value,this.rest)},e.prototype.fold=function(e,t){return e(this.value,this.rest)},e.prototype.concat=function(e){return this.map((function(t,n){return e.chain((function(e,n){return t.concat([e])}))}))},e.prototype.toString=function(){return"Result({ value: '"+this.value+"', rest: "+this.rest+" })"},e}(),je=function(){function e(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]),this.input=e,this.control=t,this.inputCursor=0,this.controlCursor=0}return e.prototype.eof=function(){return this.inputCursor>=this.input.length},e.prototype.next=function(){return{char:this.input[this.inputCursor++],control:this.control[this.controlCursor++]}},e.prototype.peek=function(){return{char:this.input[this.inputCursor],control:this.control[this.controlCursor]}},e.prototype.eat_input=function(){this.inputCursor++},e.prototype.eat_control=function(){this.controlCursor++},e.prototype.eat=function(){this.inputCursor++,this.controlCursor++},e}(),Ce=function(e){return(e||"").split("")},ke=function(){function e(e){this.parse=e}return e.prototype.run=function(e,t){return void 0===t&&(t=""),e instanceof je?this.parse(e):this.parse(new je(Ce(e),Ce(t)))},e.prototype.map=function(t){var n=this;return new e((function(e){return n.parse(e).map(t)}))},e.prototype.chain=function(t){var n=this;return new e((function(e){return n.parse(e).chain((function(e,n){return t(e).run(n)}))}))},e.prototype.isLiteral=function(e){return this.run(e).type===be.Literal},e}(),we=function(e,t){return new ke((function(n){var i=n.next().char,o=e[i];return"\\"===i?(i=n.next().char,new Oe(t.literal(i),n)):new Oe(o?t.mask(o):t.literal(i),n)}))},Se=function(e){var t=e.prompt,n=e.promptPlaceholder;return new ke((function(e){var i=e.next().char;return new Oe(i===t?n:i,e)}))},xe=function(e){return new ke((function(t){var n=t.next().char;return new Oe(e?n:"",t)}))},Ee=function(e){return e.reduce((function(e,t){return n=t,e.chain((function(e){return n.map((function(t){return e.concat([t])}))}));var n}),(t=[],new ke((function(e){return new Oe(t,e)}))));var t},Ie=function(e){return new ke((function(t){for(var n=new Oe([],t);!t.eof();)n=n.concat(e.run(t));return n}))},Te=function(){function e(){this.rules={},this.prompt="_",this.mask="",this.promptPlaceholder=" ",this.includeLiterals=!1,this.maskTokens=[],this.unmaskTokens=[],this.rawTokens=[],this.validationTokens=[]}return e.prototype.update=function(e){var t=e.mask,n=void 0===t?"":t,i=e.prompt,o=void 0===i?"":i,r=e.promptPlaceholder,a=void 0===r?" ":r,s=e.rules,c=void 0===s?{}:s,d=e.includeLiterals,l=void 0!==d&&d;this.mask=n,this.prompt=o,this.promptPlaceholder=a,this.rules=c,this.includeLiterals=l,this.tokenize()},e.prototype.validationValue=function(e){void 0===e&&(e="");var t=e;return Ee(this.validationTokens).run(e).fold((function(e){t=e.join("")})),t},e.prototype.rawValue=function(e){void 0===e&&(e="");var t=e;return this.rawTokens.length?(Ee(this.rawTokens).run(e).fold((function(e){t=e.join("")})),t):t},e.prototype.maskRaw=function(e){void 0===e&&(e="");var t=e;return this.maskTokens.length?(Ee(this.maskTokens).run(e).fold((function(e){t=e.join("")})),t):t},e.prototype.maskInput=function(e,t,n){return e.length<t.length?this.maskRemoved(e,t,n):this.maskInserted(e,t,n)},e.prototype.maskInRange=function(e,t,n,i){var o="",r=i,a=t.split("").slice(0,n),s=t.split("").slice(i);return Ee(this.maskTokens.slice(n,i)).run(e).fold((function(e){o=a.concat(e).concat(s).join("")})),{selection:r,value:o}},e.prototype.maskRemoved=function(e,t,n){var i=this,o="",r=n,a=e.split("").slice(n),s=e.split("").slice(0,n).join(""),c=this.maskTokens.length-(e.length-n);return Ee(this.maskTokens.slice(0,c)).run(s,t).fold((function(e){r=i.adjustPosition(e,r),o=e.concat(a).join("")})),{selection:r,value:o}},e.prototype.adjustPosition=function(e,t){var n=e[t];return this.maskTokens[t].isLiteral(n)||n===this.prompt?t:t+1},e.prototype.maskInserted=function(e,t,n){var i=this,o="",r=n,a=e.slice(0,n);return Ee(this.unmaskTokens).run(a,t).chain((function(e){r=e.join("").length;var n=t.slice(r);return Ee(i.maskTokens).run(e.join("")+n,t)})).fold((function(e){o=e.join("")})),{selection:r,value:o}},Object.defineProperty(e.prototype,"maskTokenCreator",{get:function(){var e=this.prompt,t=this.promptPlaceholder;return{literal:function(e){return t=e,new ke((function(e){return e.peek().char===t?(e.eat(),new Oe(t,e,be.Literal)):new Oe(t,e,be.Literal)}));var t},mask:function(n){return function(e){var t=e.prompt,n=e.promptPlaceholder;return function(e){return new ke((function(i){for(;!i.eof();){var o=i.peek(),r=o.char,a=o.control;if(r===a&&a===t)return i.eat(),new Oe(t,i,be.Mask);if(e.test(r))return i.eat(),new Oe(r,i,be.Mask);if(r===n)return i.eat(),new Oe(t,i,be.Mask);i.eat_input()}return i.eat(),new Oe(t,i,be.Mask)}))}}({prompt:e,promptPlaceholder:t})(n)}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"unmaskTokenCreator",{get:function(){var e=this;return{literal:function(e){return t=e,new ke((function(e){return e.eof()?new Oe("",e):(e.peek().char===t&&e.eat(),new Oe(t,e))}));var t},mask:function(t){return(n=e.prompt,function(e){return new ke((function(t){for(;!t.eof();){var i=t.peek(),o=i.char,r=i.control;if(o===n&&r===n)return t.eat(),new Oe(o,t);if(e.test(o))return t.eat(),new Oe(o,t);t.eat_input()}return t.eat(),new Oe("",t)}))})(t);var n}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rawTokenCreator",{get:function(){var e=this.prompt,t=this.promptPlaceholder,n=this.includeLiterals;return{literal:function(e){return xe(n)},mask:function(n){return Se({prompt:e,promptPlaceholder:t})}}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validationTokenCreator",{get:function(){var e=this.prompt;return{literal:function(e){return xe(!1)},mask:function(t){return Se({prompt:e,promptPlaceholder:""})}}},enumerable:!0,configurable:!0}),e.prototype.tokenize=function(){var e=this;Ie(we(this.rules,this.maskTokenCreator)).run(this.mask).fold((function(t,n){e.maskTokens=t})),Ie(we(this.rules,this.unmaskTokenCreator)).run(this.mask).fold((function(t,n){e.unmaskTokens=t})),Ie(we(this.rules,this.rawTokenCreator)).run(this.mask).fold((function(t,n){e.rawTokens=t})),Ie(we(this.rules,this.validationTokenCreator)).run(this.mask).fold((function(t,n){e.validationTokens=t}))},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),De=Promise.resolve(null),Be=function(){function e(e,t,n,i,r,a,s){var c=this;this.service=e,this.renderer=t,this.hostElement=n,this.ngZone=i,this.injector=r,this.changeDetector=a,this.focusableId="k-"+Object(d.guid)(),this.disabled=!1,this.readonly=!1,this.hostClasses=!0,this.prompt="_",this.promptPlaceholder=" ",this.includeLiterals=!1,this.maskOnFocus=!1,this.maskValidation=!0,this.tabindex=0,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.valueChange=new o.EventEmitter,this.focusClick=!1,this.defaultRules={"#":/[\d\s\+\-]/,"&":/[\S]/,0:/[\d]/,9:/[\d\s]/,"?":/[a-zA-Z\s]/,A:/[a-zA-Z0-9]/,C:/./,L:/[a-zA-Z]/,a:/[a-zA-Z0-9\s]/},this.isPasted=!1,this.selection=[0,0],this._size="medium",this._rounded="medium",this._fillMode="solid",this.handleFocus=function(){c.focused=!0,c.maskOnFocus&&c.emptyMask&&(c.updateInput(c.service.maskRaw(c.value)),c.ngZone.runOutsideAngular((function(){setTimeout((function(){c.setSelection(0,0)}),0)}))),Object(d.hasObservers)(c.onFocus)&&c.ngZone.run((function(){c.onFocus.emit()}))},this.handleClick=function(){if(c.focused&&!c.focusClick){c.focusClick=!0;var e=c.input.nativeElement;e.selectionStart===e.selectionEnd&&c.setFocusSelection()}},this.handleBlur=function(){c.changeDetector.markForCheck(),c.focused=!1,c.focusClick=!1,c.maskOnFocus&&c.emptyMask&&c.updateInput(c.maskedValue),(Object(d.hasObservers)(c.onBlur)||v(c.control))&&c.ngZone.run((function(){c.onTouched(),c.onBlur.emit()}))},this.onChange=function(e){},this.onTouched=function(){},Object(l.validatePackage)(ee),this.direction=s?"rtl":"ltr",this.updateService()}var t;return t=e,Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostDisabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rules",{get:function(){return this._rules||this.defaultRules},set:function(e){this._rules=Object.assign({},this.defaultRules,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.hostElement&&this.renderer.removeAttribute(this.hostElement.nativeElement,"tabindex"),this.control=this.injector.get(r.NgControl,null)},e.prototype.ngAfterViewInit=function(){var e=this;["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.isEmpty=function(){if(this.input)return!Boolean(this.input.nativeElement.value)},e.prototype.handleDragDrop=function(){return!1},e.prototype.focus=function(){this.input&&(this.input.nativeElement.focus(),this.setFocusSelection())},e.prototype.blur=function(){this.input&&this.input.nativeElement.blur()},e.prototype.pasteHandler=function(e){var t=e.target,n=t.selectionStart,i=t.selectionEnd;i!==n&&(this.isPasted=!0,this.selection=[n,i])},e.prototype.inputHandler=function(e){var t,n=e.target.value,i=this.selection,o=i[0],r=i[1];if(!this.mask)return this.updateValue(n),void(this.isPasted=!1);if(this.isPasted){this.isPasted=!1;var a=this.maskedValue.length-r,s=n.length-a;t=this.service.maskInRange(n.slice(o,s),this.maskedValue,o,r)}else t=this.service.maskInput(n,this.maskedValue,e.target.selectionStart);this.updateInput(t.value,t.selection),this.updateValue(t.value)},e.prototype.ngOnChanges=function(e){var t=this;if(e.value&&(this.value=this.normalizeValue()),this.mask){var n=this.extractChanges(e);if(this.updateService(n),Object(d.isChanged)("value",e)){var i=this.service.maskRaw(this.value);i!==this.maskedValue&&this.updateInput(i)}else Object(d.anyChanged)(["promptPlaceholder","includeLiterals"],e)?De.then((function(){t.updateValue(t.maskedValue)})):this.updateInput(this.service.maskRaw(this.value))}else this.updateInput(this.value)},e.prototype.writeValue=function(e){this.value=this.normalizeValue(e),this.updateInput(this.service.maskRaw(this.value))},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.changeDetector.markForCheck(),this.disabled=e},e.prototype.validate=function(e){return!1!==this.maskValidation&&this.mask&&this.service.validationValue(this.maskedValue)&&-1!==this.maskedValue.indexOf(this.prompt)?{patternError:{mask:this.mask,maskedValue:this.maskedValue,value:this.value}}:null},e.prototype.updateValue=function(e){this.mask&&!this.service.validationValue(e)?this.value="":this.value=this.service.rawValue(e),this.onChange(this.value),this.valueChange.emit(this.value)},e.prototype.updateInput=function(e,t){void 0===e&&(e=""),this.maskedValue=e;var n=this.maskOnFocus&&!this.focused&&this.emptyMask?"":e;this.renderer.setProperty(this.input.nativeElement,"value",n),void 0!==t&&this.setSelection(t,t)},e.prototype.extractChanges=function(e){return Object.keys(e).filter((function(e){return"rules"!==e})).reduce((function(t,n){return t[n]=e[n].currentValue,t}),{})},e.prototype.updateService=function(e){var t=Object.assign({includeLiterals:this.includeLiterals,mask:this.mask,prompt:this.prompt,promptPlaceholder:this.promptPlaceholder,rules:this.rules},e);this.service.update(t)},e.prototype.setSelection=function(e,t){void 0===e&&(e=this.selection[0]),void 0===t&&(t=this.selection[1]),this.focused&&Y(this.input,"setSelectionRange",e,t)},Object.defineProperty(e.prototype,"emptyMask",{get:function(){return this.service.maskRaw()===this.maskedValue},enumerable:!0,configurable:!0}),e.prototype.setFocusSelection=function(){var e=this.input.nativeElement.selectionStart,t=this.maskedValue?this.maskedValue.indexOf(this.prompt):0;t>=0&&t<e&&(this.selection=[t,t],this.setSelection())},Object.defineProperty(e.prototype,"focused",{get:function(){return this.isFocused},set:function(e){if(this.isFocused!==e&&this.hostElement){var t=this.hostElement.nativeElement;e?this.renderer.addClass(t,"k-focus"):this.renderer.removeClass(t,"k-focus"),this.isFocused=e}},enumerable:!0,configurable:!0}),e.prototype.normalizeValue=function(e){void 0===e&&(e=this.value);var t=m(e);if(t&&"string"!=typeof e){if(Object(o.isDevMode)())throw new Error("The MaskedTextBox component supports only string values.");return String(e)}return t?e:""},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("input",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-input"),Object(o.HostBinding)("class.k-maskedtextbox"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hostDisabledClass",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"mask",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"rules",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"prompt",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"promptPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"includeLiterals",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"maskOnFocus",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"maskValidation",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.ViewChild)("input",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"input",void 0),Object(i.__decorate)([Object(o.HostListener)("paste",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"pasteHandler",null),Object(i.__decorate)([Object(o.HostListener)("input",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"inputHandler",null),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoMaskedTextBox",providers:[Te,{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{multi:!0,provide:r.NG_VALIDATORS,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}],selector:"kendo-maskedtextbox",template:'\n <input type="text"\n #input\n autocomplete="off"\n autocorrect="off"\n autocapitalize="off"\n spellcheck="false"\n class="k-input-inner"\n [id]="focusableId"\n [tabindex]="tabIndex"\n [attr.title]="title"\n [disabled]="disabled"\n [readonly]="readonly"\n [kendoEventsOutsideAngular]="{\n focus: handleFocus,\n blur: handleBlur,\n click: handleClick,\n dragstart: handleDragDrop,\n drop: handleDragDrop\n }"\n />\n '}),Object(i.__param)(6,Object(o.Optional)()),Object(i.__param)(6,Object(o.Inject)(c.RTL)),Object(i.__metadata)("design:paramtypes",[Te,o.Renderer2,o.ElementRef,o.NgZone,o.Injector,o.ChangeDetectorRef,Boolean])],e)}(),Pe=function(e){this.value=e,this.classes={"k-tick":!0}},Ae=function(){function e(){this.wrapperClasses="k-reset k-slider-items",this.ticks=[]}return e.prototype.ngOnChanges=function(e){this.createTicks()},e.prototype.createTicks=function(){for(var e,t,n,i,o,r,a,s,c=P(this.min,this.max,this.step),d=this.largeStep,l={max:this.max,min:this.min,smallStep:this.step},p=[],u=0;u<c;u++)p.push(new Pe((e=u,n=void 0,i=void 0,o=void 0,r=void 0,a=void 0,s=void 0,n=(t=l).max,i=t.min,o=t.smallStep,r=t.reverse,a=t.vertical,s=x(i,I(e,o)),a||r?Math.abs(E(s,n)):s))),d&&u%d==0&&(p[u].large=!0,p[u].classes["k-tick-large"]=!0);p.length>0&&(Object.assign(p[0].classes,this.endTickClasses(!0)),Object.assign(p[p.length-1].classes,this.endTickClasses(!1))),this.ticks=p},e.prototype.endTickClasses=function(e){return{"k-first":e&&!this.vertical||!e&&this.vertical,"k-last":!e&&!this.vertical||e&&this.vertical}},Object(i.__decorate)([Object(o.HostBinding)("class"),Object(i.__metadata)("design:type",String)],e.prototype,"wrapperClasses",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Function)],e.prototype,"tickTitle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"vertical",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"step",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"largeStep",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"min",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"max",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"labelTemplate",void 0),Object(i.__decorate)([Object(o.ViewChildren)("tickElement"),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"tickElements",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoSliderTicks]",template:'\n <li #tickElement *ngFor="let tick of ticks;"\n [ngClass]="tick.classes"\n title="{{ tickTitle(tick.value) }}"\n role="presentation"\n >\n <ng-container [ngSwitch]="tick.large">\n <span class="k-label" *ngSwitchCase="true">\n <ng-container [ngTemplateOutlet]="labelTemplate || defaultLabel" [ngTemplateOutletContext]="tick">\n </ng-container>\n </span>\n <ng-container *ngSwitchCase="false"> </ng-container>\n </ng-container>\n </li>\n\n <ng-template #defaultLabel let-value="value">\n {{ tickTitle(value) }}\n </ng-template>\n '})],e)}(),Me=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Ae,te],exports:[te,Ae,d.DraggableModule,d.EventsModule,d.ResizeSensorModule],imports:[h.CommonModule,d.DraggableModule,d.EventsModule,d.ResizeSensorModule]})],e)}(),ze=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"decrement",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"increment",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"dragHandle",void 0),t}(c.ComponentMessages),Re=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:ze,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoSliderLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(ze),Fe=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:ze,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-slider-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(ze),Ne=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[ie,Fe,Re],exports:[ie,Fe,te,Re],imports:[h.CommonModule,Me]})],e)}(),Le=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"dragHandleStart",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"dragHandleEnd",void 0),t}(c.ComponentMessages),Ve=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:Le,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoSliderLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(Le),He=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:Le,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-rangeslider-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(Le),Ke=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[re,He,Ve],exports:[re,He,Ve,te],imports:[h.CommonModule,Me]})],e)}(),$e=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"on",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"off",void 0),t}(c.ComponentMessages),We=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:$e,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoSwitchLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}($e),Ue=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:$e,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-switch-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}($e),Ge=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[ae,Ue,We],exports:[ae,Ue,We],imports:[h.CommonModule,d.EventsModule,d.ResizeSensorModule]})],e)}(),Ze=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:ye,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoNumericTextBoxLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(ye),qe=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Ze,ve,_e],exports:[ve,_e],imports:[h.CommonModule,d.EventsModule]})],e)}(),Je=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Be],exports:[Be],imports:[h.CommonModule,d.EventsModule]})],e)}(),Xe=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoTextBoxSuffixTemplate]"}),Object(i.__param)(0,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),Ye=function(){function e(e){this.templateRef=e}return e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoTextBoxPrefixTemplate]"}),Object(i.__param)(0,Object(o.Optional)()),Object(i.__metadata)("design:paramtypes",[o.TemplateRef])],e)}(),Qe=function(){function e(e,t,n,i,r,a){var s=this;this.localizationService=e,this.ngZone=t,this.changeDetector=n,this.renderer=i,this.injector=r,this.hostElement=a,this.focusableId="k-"+Object(d.guid)(),this.title="",this.disabled=!1,this.readonly=!1,this.tabindex=0,this.value=null,this.selectOnFocus=!1,this.showSuccessIcon=!1,this.showErrorIcon=!1,this.clearButton=!1,this.valueChange=new o.EventEmitter,this.inputFocus=new o.EventEmitter,this.inputBlur=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.hostClasses=!0,this._isFocused=!1,this.focusChangedProgrammatically=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",this.handleInputFocus=function(){s.disabled||(s.selectOnFocus&&s.value&&s.ngZone.run((function(){setTimeout((function(){s.selectAll()}))})),Object(d.hasObservers)(s.onFocus)&&(s.isFocused||s.ngZone.run((function(){s.onFocus.emit()}))),Object(d.hasObservers)(s.inputFocus)&&(!s.focusChangedProgrammatically||s.focusChangedProgrammatically&&s.clearButtonClicked)&&s.ngZone.run((function(){s.inputFocus.emit()})),s.ngZone.run((function(){s.isFocused=!0})))},this.handleInputBlur=function(){s.changeDetector.markForCheck(),(Object(d.hasObservers)(s.inputBlur)||v(s.control))&&s.ngZone.run((function(){s.ngTouched(),s.inputBlur.emit()}))},this.handleInput=function(e){var t,n,i=(n=navigator.userAgent,(Object(p.b)(n).safari||Object(p.c)(n)&&"mobilesafari"===Object(p.c)(n).browser)&&(t=e.target.value,/[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|\u203B/g.test(t))?e.data:e.target.value);s.updateValue(i)},this.ngChange=function(e){},this.ngTouched=function(){},Object(l.validatePackage)(ee),this.direction=e.rtl?"rtl":"ltr"}var t;return t=e,Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.control=this.injector.get(r.NgControl,null),this.checkClearButton(),this.subscriptions=this.localizationService.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr"}))},e.prototype.ngAfterViewInit=function(){var e=this,t=this.hostElement.nativeElement,n=!1,i=!1;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focusin",(function(){e.isFocused||e.ngZone.run((function(){e.onFocus.emit(),e.isFocused=!0}))}))),e.subscriptions.add(e.renderer.listen(t,"focusout",(function(t){e.isFocused&&(i?(Q(t.relatedTarget,(function(t){return t===e.hostElement.nativeElement}))||e.handleBlur(),i=!1):n||e.clearButtonClicked||e.handleBlur())}))),e.subscriptions.add(e.renderer.listen(t,"mouseenter",(function(){n=!0}))),e.subscriptions.add(e.renderer.listen(t,"mouseleave",(function(){n=!1}))),e.subscriptions.add(e.renderer.listen(t,"keydown",(function(e){i=e.keyCode===d.Keys.Tab})))}));["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.ngOnChanges=function(e){(e.disabled||e.readonly||e.value)&&this.checkClearButton()},e.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe()},e.prototype.focus=function(){this.input&&(this.focusChangedProgrammatically=!0,this.isFocused=!0,this.input.nativeElement.focus(),this.focusChangedProgrammatically=!1)},e.prototype.blur=function(){this.focusChangedProgrammatically=!0;var e=this.hostElement.nativeElement.querySelector(":focus");e&&e.blur(),this.isFocused=!1,this.focusChangedProgrammatically=!1},e.prototype.clearTitle=function(){return this.localizationService.get("clear")},e.prototype.checkClearButton=function(){this.showClearButton=!this.disabled&&!this.readonly&&this.clearButton&&!!this.value},e.prototype.clearValue=function(e){e&&e.preventDefault(),this.clearButtonClicked=!0,this.input.nativeElement.value="",this.input.nativeElement.focus(),this.updateValue(""),this.checkClearButton(),this.clearButtonClicked=!1},e.prototype.writeValue=function(e){this.value=e,this.checkClearButton()},e.prototype.registerOnChange=function(e){this.ngChange=e},e.prototype.registerOnTouched=function(e){this.ngTouched=e},e.prototype.setDisabledState=function(e){this.changeDetector.markForCheck(),this.disabled=e},e.prototype.showErrorsInitial=function(){if(!this.control)return!1;var e=this.control,t=e.invalid,n=e.dirty,i=e.touched;return t&&(n||i)},e.prototype.showSuccessInitial=function(){if(!this.control)return!1;var e=this.control,t=e.valid,n=e.dirty,i=e.touched;return t&&(n||i)},Object.defineProperty(e.prototype,"successIconClasses",{get:function(){return this.successIcon?""+this.successIcon:"k-input-validation-icon k-icon k-i-check"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"errorIconClasses",{get:function(){return this.errorIcon?""+this.errorIcon:"k-input-validation-icon k-icon k-i-warning"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonClasses",{get:function(){return this.clearButtonIcon?this.clearButtonIcon:"k-icon k-i-x"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasErrors",{get:function(){return"initial"===this.showErrorIcon?this.showErrorsInitial():this.showErrorIcon},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSuccessful",{get:function(){return"initial"===this.showSuccessIcon?this.showSuccessInitial():this.showSuccessIcon},enumerable:!0,configurable:!0}),e.prototype.setSelection=function(e,t){this.isFocused&&Y(this.input,"setSelectionRange",e,t)},e.prototype.selectAll=function(){this.value&&this.setSelection(0,this.value.length)},e.prototype.updateValue=function(e){var t=this;g(this.value,e)||this.ngZone.run((function(){t.value=e,t.ngChange(e),t.valueChange.emit(e),t.checkClearButton(),t.changeDetector.markForCheck()}))},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){if(this._isFocused!==e&&this.hostElement){var t=this.hostElement.nativeElement;e&&!this.disabled?this.renderer.addClass(t,"k-focus"):this.renderer.removeClass(t,"k-focus"),this._isFocused=e}},enumerable:!0,configurable:!0}),e.prototype.handleBlur=function(){var e=this;this.ngZone.run((function(){e.focusChangedProgrammatically||e.onBlur.emit(),e.isFocused=!1}))},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("input",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"selectOnFocus",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"showSuccessIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"showErrorIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"successIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"errorIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"clearButtonIcon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"maxlength",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"inputFocus",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"inputBlur",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.ViewChild)("input",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"input",void 0),Object(i.__decorate)([Object(o.ContentChild)(Xe,{static:!1}),Object(i.__metadata)("design:type",Xe)],e.prototype,"suffixTemplate",void 0),Object(i.__decorate)([Object(o.ContentChild)(Ye,{static:!1}),Object(i.__metadata)("design:type",Ye)],e.prototype,"prefixTemplate",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-textbox"),Object(o.HostBinding)("class.k-input"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoTextBox",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.textbox"},{provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t})),multi:!0},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))}],selector:"kendo-textbox",template:'\n <ng-container kendoTextBoxLocalizedMessages\n i18n-clear="kendo.textbox.clear|The title for the **Clear** button in the TextBox."\n clear="Clear">\n </ng-container>\n <span class="k-input-prefix">\n <ng-template\n *ngIf="prefixTemplate"\n [ngTemplateOutlet]="prefixTemplate?.templateRef">\n </ng-template>\n </span>\n <input #input\n class="k-input-inner"\n [id]="focusableId"\n [disabled]="disabled"\n [readonly]="readonly"\n [attr.tabindex]="disabled ? undefined : tabindex"\n [value]="value"\n [attr.placeholder]="placeholder"\n [attr.title]="title"\n [attr.maxlength]="maxlength"\n [kendoEventsOutsideAngular]="{\n focus: handleInputFocus,\n blur: handleInputBlur,\n input: handleInput}"\n />\n <span\n role="button"\n class="k-clear-value"\n *ngIf="showClearButton"\n (click)="clearValue()"\n (mousedown)="$event.preventDefault()"\n [tabindex]="tabIndex"\n [attr.aria-label]="clearTitle()"\n [title]="clearTitle()"\n (keydown.enter)="clearValue($event)"\n (keydown.space)="clearValue($event)">\n <span [ngClass]="clearButtonClasses"></span>\n </span>\n <span *ngIf="hasErrors" [ngClass]="errorIconClasses"></span>\n <span *ngIf="isSuccessful" [ngClass]="successIconClasses"></span>\n <span class="k-input-suffix">\n <ng-template\n *ngIf="suffixTemplate"\n [ngTemplateOutlet]="suffixTemplate?.templateRef">\n </ng-template>\n </span>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService,o.NgZone,o.ChangeDetectorRef,o.Renderer2,o.Injector,o.ElementRef])],e)}(),et=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"clear",void 0),t}(c.ComponentMessages),tt=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:et,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-textbox-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(et),nt=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:et,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoTextBoxLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(et),it=function(){function e(){this.hostClass=!0}return Object(i.__decorate)([Object(o.HostBinding)("class.k-input-separator"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-input-separator, kendo-textbox-separator",template:""})],e)}(),ot=[it,ce],rt=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[ot],exports:[ot]})],e)}(),at=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[se,Qe,Xe,Ye,tt,nt],exports:[se,Qe,Xe,Ye,d.EventsModule,tt,nt,ot],imports:[h.CommonModule,d.EventsModule,rt]})],e)}(),st=function(){function e(e,t,n,i,r,s){var c=this;this.localizationService=e,this.ngZone=t,this.changeDetector=n,this.renderer=i,this.injector=r,this.hostElement=s,this.title="",this.disabled=!1,this.readonly=!1,this.value=null,this.selectOnFocus=!1,this.inputFocus=new o.EventEmitter,this.inputBlur=new o.EventEmitter,this.subscriptions=new a.Subscription,this._isFocused=!1,this.focusChangedProgrammatically=!1,this.handleInputBlur=function(){c.changeDetector.markForCheck(),(Object(d.hasObservers)(c.inputBlur)||v(c.control))&&c.ngZone.run((function(){c.ngTouched(),c.inputBlur.emit()}))},this.ngChange=function(e){},this.ngTouched=function(){}}return Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.setDisabledState=function(e){this.changeDetector.markForCheck(),this.disabled=e},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"selectOnFocus",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"inputFocus",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"inputBlur",void 0),Object(i.__decorate)([Object(o.ViewChild)("input",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"input",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),e}(),ct={vertical:"k-resize-vertical",horizontal:"k-resize-horizontal",both:"k-resize-both",none:"k-resize-none",auto:"k-resize-none"},dt=function(e){function t(t,n,i,r,a,s){var c=e.call(this,t,n,i,r,a,s)||this;return c.localizationService=t,c.ngZone=n,c.changeDetector=i,c.renderer=r,c.injector=a,c.hostElement=s,c.focusableId="k-"+Object(d.guid)(),c.hostClasses=!0,c.flow="vertical",c.tabindex=0,c.resizable="vertical",c.onFocus=new o.EventEmitter,c.onBlur=new o.EventEmitter,c.valueChange=new o.EventEmitter,c._size="medium",c._rounded="medium",c._fillMode="solid",c.handleInput=function(e){var t=e.target.value;c.updateValue(t),c.resize()},c.handleInputFocus=function(){c.disabled||(c.selectOnFocus&&c.value&&c.ngZone.run((function(){setTimeout((function(){c.selectAll()}))})),Object(d.hasObservers)(c.onFocus)&&(c.isFocused||c.ngZone.run((function(){c.onFocus.emit()}))),Object(d.hasObservers)(c.inputFocus)&&(c.focusChangedProgrammatically||c.ngZone.run((function(){c.inputFocus.emit()}))),c.ngZone.run((function(){c.isFocused=!0})))},Object(l.validatePackage)(ee),c.direction=t.rtl?"rtl":"ltr",c}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"flowCol",{get:function(){return"vertical"===this.flow},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"flowRow",{get:function(){return"horizontal"===this.flow},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){var e=this,t=this.hostElement.nativeElement,n=!1,i=!1;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focusin",(function(){e.isFocused||e.ngZone.run((function(){e.onFocus.emit(),e.isFocused=!0}))}))),e.subscriptions.add(e.renderer.listen(t,"focusout",(function(t){e.isFocused&&(i?(Q(t.relatedTarget,(function(t){return t===e.hostElement.nativeElement}))||e.handleBlur(),i=!1):n||e.handleBlur())}))),e.subscriptions.add(e.renderer.listen(t,"mouseenter",(function(){n=!0}))),e.subscriptions.add(e.renderer.listen(t,"mouseleave",(function(){n=!1}))),e.subscriptions.add(e.renderer.listen(t,"keydown",(function(e){i=e.keyCode===d.Keys.Tab}))),e.handleFlow()}));["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)}))},t.prototype.ngOnInit=function(){var e=this;this.control=this.injector.get(r.NgControl,null),Object(d.isDocumentAvailable)()&&"auto"===this.resizable&&(this.resizeSubscription=Object(a.fromEvent)(window,"resize").pipe(Object(s.debounceTime)(50)).subscribe((function(){return e.resize()}))),this.hostElement&&this.renderer.removeAttribute(this.hostElement.nativeElement,"tabindex"),this.subscriptions=this.localizationService.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr"}))},t.prototype.ngOnChanges=function(e){var t=this.hostElement.nativeElement,n=this.input.nativeElement;e.flow&&this.handleFlow(),e.resizable&&("auto"===this.resizable?this.initialHeight=n.offsetHeight:(this.renderer.setStyle(n,"overflow-y","auto"),this.renderer.setStyle(n,"resize","both"),n.style.height=this.initialHeight+"px")),e.cols&&(m(e.cols.currentValue)?this.renderer.setStyle(t,"width","auto"):this.renderer.removeStyle(t,"width"))},t.prototype.ngAfterViewChecked=function(){this.resize()},t.prototype.writeValue=function(e){this.value=e},t.prototype.registerOnChange=function(e){this.ngChange=e},t.prototype.registerOnTouched=function(e){this.ngTouched=e},t.prototype.updateValue=function(e){var t=this;g(this.value,e)||this.ngZone.run((function(){t.value=e,t.ngChange(e),t.valueChange.emit(e),t.changeDetector.markForCheck()}))},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.resizeSubscription&&this.resizeSubscription.unsubscribe()},Object.defineProperty(t.prototype,"resizableClass",{get:function(){return ct[this.resizable]},enumerable:!0,configurable:!0}),t.prototype.focus=function(){this.input&&(this.focusChangedProgrammatically=!0,this.isFocused=!0,this.input.nativeElement.focus(),this.focusChangedProgrammatically=!1)},t.prototype.blur=function(){this.focusChangedProgrammatically=!0;var e=this.hostElement.nativeElement.querySelector(":focus");e&&e.blur(),this.isFocused=!1,this.focusChangedProgrammatically=!1},t.prototype.resize=function(){if("auto"===this.resizable){var e=this.input.nativeElement;this.renderer.setStyle(e,"overflow-y","hidden"),this.renderer.setStyle(e,"height",this.initialHeight+"px");var t=e.scrollHeight;t>this.initialHeight&&(e.style.height=t+"px")}},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){if(this._isFocused!==e&&this.hostElement){var t=this.hostElement.nativeElement;e&&!this.disabled?this.renderer.addClass(t,"k-focus"):this.renderer.removeClass(t,"k-focus"),this._isFocused=e}},enumerable:!0,configurable:!0}),t.prototype.handleBlur=function(){var e=this;this.ngZone.run((function(){e.focusChangedProgrammatically||e.onBlur.emit(),e.isFocused=!1}))},t.prototype.setSelection=function(e,t){this.isFocused&&Y(this.input,"setSelectionRange",e,t)},t.prototype.selectAll=function(){this.value&&this.setSelection(0,this.value.length)},t.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("input",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},t.prototype.handleFlow=function(){var e="vertical"===this.flow,t=this.hostElement.nativeElement,n=this.input.nativeElement,i=t.children[1];this.renderer.setStyle(n,"flex",e?"none":"1"),i&&this.renderer.setStyle(i,"align-items",e?"center":"start")},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-textarea"),Object(o.HostBinding)("class.k-input"),Object(i.__metadata)("design:type",Boolean)],t.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.!k-flex-col"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"flowCol",null),Object(i.__decorate)([Object(o.HostBinding)("class.!k-flex-row"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],t.prototype,"flowRow",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"flow",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"rows",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"cols",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"maxlength",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],t.prototype,"tabindex",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],t.prototype,"tabIndex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"resizable",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],t.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),t=n=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoTextArea",providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.textarea"},{provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return n})),multi:!0},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-textarea",template:'\n <textarea\n #input\n [attr.aria-multiline]="true"\n [attr.aria-disabled]="disabled ? true : undefined"\n [attr.aria-readonly]="readonly ? true : undefined"\n class="k-input-inner"\n [ngClass]="resizableClass"\n [id]="focusableId"\n [value]="value"\n [attr.placeholder]="placeholder"\n [disabled]="disabled"\n [readonly]="readonly"\n [attr.rows]="rows"\n [attr.cols]="cols"\n [attr.tabindex]="tabIndex"\n [attr.title]="title"\n [attr.maxlength]="maxlength"\n [kendoEventsOutsideAngular]="{\n focus: handleInputFocus,\n blur: handleInputBlur,\n input: handleInput}">\n </textarea>\n <ng-content select="kendo-textarea-suffix"></ng-content>\n ',styles:["\n :host {\n display: inline-flex;\n }\n "]}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService,o.NgZone,o.ChangeDetectorRef,o.Renderer2,o.Injector,o.ElementRef])],t)}(st),lt=function(){function e(){this.hostClass=!0}return Object(i.__decorate)([Object(o.HostBinding)("class.k-input-suffix"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),e=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoTextAreaSuffix",selector:"kendo-textarea-suffix",template:"<ng-content></ng-content>"})],e)}(),pt=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[dt,lt],exports:[dt,d.EventsModule,lt,ot],imports:[h.CommonModule,d.EventsModule,rt]})],e)}(),ut=function(e){function t(t,n,i){return e.call(this,t,n,i)||this}return Object(i.__extends)(t,e),t=Object(i.__decorate)([Object(i.__param)(0,Object(o.Inject)(c.L10N_PREFIX)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__param)(2,Object(o.Optional)()),Object(i.__param)(2,Object(o.Inject)(c.RTL)),Object(i.__metadata)("design:paramtypes",[String,c.MessageService,Boolean])],t)}(c.LocalizationService),ht=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r.colorPickerLocalization=o,r}return Object(i.__extends)(t,e),t.prototype.get=function(t){return this.colorPickerLocalization?this.colorPickerLocalization.get(t):e.prototype.get.call(this,t)},t=Object(i.__decorate)([Object(i.__param)(0,Object(o.Inject)(c.L10N_PREFIX)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__param)(2,Object(o.Optional)()),Object(i.__param)(2,Object(o.Inject)(c.RTL)),Object(i.__param)(3,Object(o.Optional)()),Object(i.__param)(3,Object(o.Inject)(ut)),Object(i.__metadata)("design:paramtypes",[String,c.MessageService,Boolean,ut])],t)}(c.LocalizationService),ft={basic:{colors:"000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",columns:10},office:{colors:"ffffff, 000000, e6e6e6, 435569, 4371c4, ed7e32, a5a4a5, febf04, 5a9bd5, 71ae48, f2f2f3, 7f7f7f, d1cece, d5dde3, dae1f4, fce5d4, deeded, fff2cc, deeaf6, e1efd9, d7d8d8, 585959, aeabab, adbaca, b4c5e7, f6caac, dbdbdb, ffe498, bcd6ee, c5e0b2, bfbfc0, 3f3f3f, 767070, 8595b1, 8fabdb, f5b183, c9c8c9, fed965, 9bc4e5, a8d08d, a5a5a6, 262625, 393939, 334050, 2e5496, c45a11, 7b7b7a, bf9000, 2f75b5, 548235, 7f7f7f, 0b0c0c, 161616, 222a34, 203764, 843d0b, 525252, 7f6000, 1d4d79, 375623",columns:10},apex:{colors:"ffffff, 000000, c9c2d1, 69676d, ceb966, 9cb084, 6bb1c9, 6585cf, 7e6bc9, a379bb, f2f2f2, 7f7f7f, f4f2f5, e0e0e2, f5f1e0, ebefe6, e1eff4, e0e6f5, e5e1f4, ece4f1, d8d8d8, 595959, e9e6ec, c2c1c5, ebe3c1, d7dfcd, c3dfe9, c1ceeb, cbc3e9, dac9e3, bfbfbf, 3f3f3f, dedae3, a4a3a8, e1d5a3, c3cfb5, a6d0de, a2b5e2, b1a6de, c7aed6, a5a5a5, 262626, 9688a5, 4e4d51, ae9638, 758c5a, 3d8da9, 365bb0, 533da9, 7d4d99, 7f7f7f, 0c0c0c, 635672, 343336, 746425, 4e5d3c, 295e70, 243c75, 372970, 533366",columns:10},austin:{colors:"ffffff, 000000, caf278, 3e3d2d, 94c600, 71685a, ff6700, 909465, 956b43, fea022, f2f2f2, 7f7f7f, f4fce4, dddcd0, efffc0, e3e1dc, ffe0cb, e8e9df, ece1d6, feecd2, d8d8d8, 595959, e9f9c9, bbb9a1, dfff82, c8c3ba, ffc299, d2d4c0, dac3ad, fed9a6, bfbfbf, 3f3f3f, dff7ae, ada598, cfff43, ada598, ffa365, bcbfa1, c8a585, fec67a, a5a5a5, 262626, a9ea25, 2e2d21, 6f9400, 544e43, bf4d00, 6c6f4b, 6f5032, d77b00, 7f7f7f, 0c0c0c, 74a50f, 1f1e16, 4a6300, 38342d, 7f3300, 484a32, 4a3521, 8f5200",columns:10},clarity:{colors:"ffffff, 292934, f3f2dc, d2533c, 93a299, ad8f67, 726056, 4c5a6a, 808da0, 79463d, f2f2f2, e7e7ec, e7e5b9, f6dcd8, e9ecea, eee8e0, e4dedb, d8dde3, e5e8ec, e9d6d3, d8d8d8, c4c4d1, d5d185, edbab1, d3d9d6, ded2c2, c9beb8, b2bcc8, ccd1d9, d3aea7, bfbfbf, 8a8aa3, aca73b, e4978a, bec7c1, cdbba3, af9e94, 8c9bac, b2bac6, bd857c, a5a5a5, 56566e, 56531d, a43925, 6b7c72, 866b48, 554840, 39434f, 5c697b, 5a342d, 7f7f7f, 3b3b4b, 22210b, 6d2619, 47534c, 594730, 39302b, 262d35, 3d4652, 3c231e",columns:10},slipstream:{colors:"ffffff, 000000, b4dcfa, 212745, 4e67c8, 5eccf3, a7ea52, 5dceaf, ff8021, f14124, f2f2f2, 7f7f7f, 8bc9f7, c7cce4, dbe0f4, def4fc, edfadc, def5ef, ffe5d2, fcd9d3, d8d8d8, 595959, 4facf3, 909aca, b8c2e9, beeafa, dbf6b9, beebdf, ffcca6, f9b3a7, bfbfbf, 3f3f3f, 0d78c9, 5967af, 94a3de, 9ee0f7, caf297, 9de1cf, ffb279, f68d7b, a5a5a5, 262626, 063c64, 181d33, 31479f, 11b2eb, 81d319, 34ac8b, d85c00, c3260c, 7f7f7f, 0c0c0c, 021828, 101322, 202f6a, 0b769c, 568c11, 22725c, 903d00, 821908",columns:10},metro:{colors:"ffffff, 000000, d6ecff, 4e5b6f, 7fd13b, ea157a, feb80a, 00addc, 738ac8, 1ab39f, f2f2f2, 7f7f7f, a7d6ff, d9dde4, e5f5d7, fad0e4, fef0cd, c5f2ff, e2e7f4, c9f7f1, d8d8d8, 595959, 60b5ff, b3bcca, cbecb0, f6a1c9, fee29c, 8be6ff, c7d0e9, 94efe3, bfbfbf, 3f3f3f, 007dea, 8d9baf, b2e389, f272af, fed46b, 51d9ff, aab8de, 5fe7d5, a5a5a5, 262626, 003e75, 3a4453, 5ea226, af0f5b, c58c00, 0081a5, 425ea9, 138677, 7f7f7f, 0c0c0c, 00192e, 272d37, 3f6c19, 750a3d, 835d00, 00566e, 2c3f71, 0c594f",columns:10},flow:{colors:"ffffff, 000000, dbf5f9, 04617b, 0f6fc6, 009dd9, 0bd0d9, 10cf9b, 7cca62, a5c249, f2f2f2, 7f7f7f, b2e9f2, b4ecfc, c7e2fa, c4eeff, c9fafc, c9faed, e4f4df, edf2da, d8d8d8, 595959, 76d9e8, 6adafa, 90c6f6, 89deff, 93f5f9, 94f6db, cae9c0, dbe6b6, bfbfbf, 3f3f3f, 21b2c8, 20c8f7, 59a9f2, 4fceff, 5df0f6, 5ff2ca, b0dfa0, c9da91, a5a5a5, 262626, 105964, 02485c, 0b5394, 0075a2, 089ca2, 0b9b74, 54a838, 7e9532, 7f7f7f, 0c0c0c, 062328, 01303d, 073763, 004e6c, 05686c, 07674d, 387025, 546321",columns:10},hardcover:{colors:"ffffff, 000000, ece9c6, 895d1d, 873624, d6862d, d0be40, 877f6c, 972109, aeb795, f2f2f2, 7f7f7f, e1dca5, f2e0c6, f0d0c9, f6e6d5, f5f2d8, e7e5e1, fbc7bc, eef0e9, d8d8d8, 595959, d0c974, e6c28d, e2a293, eeceaa, ece5b2, cfccc3, f78f7a, dee2d4, bfbfbf, 3f3f3f, a29a36, daa454, d4735e, e6b681, e2d88c, b7b2a5, f35838, ced3bf, a5a5a5, 262626, 514d1b, 664515, 65281a, a2641f, a39428, 655f50, 711806, 879464, 7f7f7f, 0c0c0c, 201e0a, 442e0e, 431b11, 6c4315, 6d621a, 433f35, 4b1004, 5a6243",columns:10},trek:{colors:"ffffff, 000000, fbeec9, 4e3b30, f0a22e, a5644e, b58b80, c3986d, a19574, c17529, f2f2f2, 7f7f7f, f7e09e, e1d6cf, fcecd5, eddfda, f0e7e5, f3eae1, ece9e3, f5e3d1, d8d8d8, 595959, f3cc5f, c4ad9f, f9d9ab, dcc0b6, e1d0cc, e7d5c4, d9d4c7, ebc7a3, bfbfbf, 3f3f3f, d29f0f, a78470, f6c781, cba092, d2b9b2, dbc1a7, c6bfab, e1ac76, a5a5a5, 262626, 694f07, 3a2c24, c87d0e, 7b4b3a, 926255, a17242, 7b7153, 90571e, 7f7f7f, 0c0c0c, 2a1f03, 271d18, 855309, 523226, 614138, 6b4c2c, 524b37, 603a14",columns:10},verve:{colors:"ffffff, 000000, d2d2d2, 666666, ff388c, e40059, 9c007f, 68007f, 005bd3, 00349e, f2f2f2, 7f7f7f, bdbdbd, e0e0e0, ffd7e8, ffc6dc, ffb8f1, f1b2ff, c3dcff, b8cfff, d8d8d8, 595959, 9d9d9d, c1c1c1, ffafd1, ff8eba, ff71e4, e365ff, 87baff, 72a0ff, bfbfbf, 3f3f3f, 696969, a3a3a3, ff87ba, ff5597, ff2ad7, d519ff, 4b98ff, 2b71ff, a5a5a5, 262626, 343434, 4c4c4c, e90062, ab0042, 75005f, 4e005f, 00449e, 002676, 7f7f7f, 0c0c0c, 151515, 333333, 9b0041, 72002c, 4e003f, 34003f, 002d69, 00194f",columns:10},monochrome:{colors:"000000, 1a1a1a, 333333, 4d4d4d, 666666, 808080, 999999, b3b3b3, cccccc, e6e6e6, f2f2f2, ffffff",columns:12},accessible:{colors:"black, grey, darkred, red, darkorange, gold, green, blue, darkblue, purple, white, darkgrey, saddlebrown, pink, orange, yellow, lightgreen, lightskyblue, lightblue, mediumpurple",columns:10}},bt=function(){function e(){}return e.prototype.getPaletteSettings=function(e,t){var n="name"!==t?"office":"accessible",i=e.palette,o="string"==typeof i&&ft[i]?ft[i].columns:void 0;return{palette:i||n,tileSize:e.tileSize||24,columns:e.columns||o||10}},e.prototype.paletteTileLayout=function(e){return"number"==typeof e?{width:e,height:e}:{width:e.width?e.width:e.height,height:e.height?e.height:e.width}},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),mt=function(e){function t(t){var n=e.call(this)||this;return n.originalEvent=t,n}return Object(i.__extends)(t,e),t}(d.PreventableEvent),gt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(d.PreventableEvent),vt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),t}(d.PreventableEvent),yt=function(){function e(e){this.color=e,this.openPrevented=!1}return e.prototype.preventOpen=function(){this.openPrevented=!0},e.prototype.isOpenPrevented=function(){return this.openPrevented},e}(),_t=function(e,t,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);if(-1===["hex","rgba","name"].indexOf(t))throw new Error("Unsupported color output format '"+t+"'. The available options are 'hex', 'rgba' or 'name'.");if(m(e)){if("name"===t)return function(e,t){if(e=e.toLowerCase().trim(),m(b.namedColors[e]))return e;Object(b.parseColor)(e,t)&&(e=Object(b.parseColor)(e,t).toHex());var n=Object.keys(b.namedColors).find((function(t){return b.namedColors[t]===e}));if(!n&&!t)throw new Error("The provided color "+e+" is not supported for 'format=\"name\"' property.To display "+e+" color, the component 'format' property should be set to 'hex' or 'rgba' ");return n}(e,i);var o=Object(b.parseColor)(e.trim(),i);if(m(o))return"hex"===t?Ct(o,n):o.toCssRgba()}},Ot=function(e,t){void 0===t&&(t=!0);var n=Object(b.parseColor)(e,t);return m(n)?n.toBytes():{}},jt=function(e,t,n){void 0===t&&(t="rgba"),void 0===n&&(n=!1);var i=y(e.h,0,359.9),o=y(e.s,0,1),r=y(e.v,0,1),a=y(e.a,0,1),s=b.Color.fromHSV(i,o,r,a);return"hex"===t?Ct(s,n):s.toCssRgba()},Ct=function(e,t){return t&&e.a<1?e.toCss({alpha:!0}):e.toCss()},kt=function(e){return jt({h:e,s:1,v:1,a:1})};var wt=function(e,t){var n=y(e.r,0,255),i=y(e.g,0,255),o=y(e.b,0,255),r=y(e.a,0,1),a=y(t.r,0,255),s=y(t.g,0,255),c=y(t.b,0,255);return{r:Math.round((1-r)*a+r*n),g:Math.round((1-r)*s+r*i),b:Math.round((1-r)*c+r*o)}},St=function(e){var t=[e.r,e.g,e.b].map((function(e){return(e/=255)<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}));return.2126*t[0]+.7152*t[1]+.0722*t[2]},xt=function(e,t){return n=St(wt(e,t)),i=St(wt(t,{r:0,g:0,b:0,a:1})),(Math.max(n,i)+.05)/(Math.min(n,i)+.05);var n,i},Et=function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return{length:Math.sqrt(Math.pow(n,2)+Math.pow(i,2)),angle:Math.atan2(i,n)}},It=function(e,t){return 0===e.length?"":e.reduce((function(e,n,i,o){return 0===i?"M "+n[0]+","+n[1]:e+" "+t(n,i,o)}),"")},Tt=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r.flatColorPickerLocalization=o,r}return Object(i.__extends)(t,e),t.prototype.get=function(t){return this.flatColorPickerLocalization?this.flatColorPickerLocalization.get(t):e.prototype.get.call(this,t)},t=Object(i.__decorate)([Object(i.__param)(0,Object(o.Inject)(c.L10N_PREFIX)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__param)(2,Object(o.Optional)()),Object(i.__param)(2,Object(o.Inject)(c.RTL)),Object(i.__param)(3,Object(o.Optional)()),Object(i.__param)(3,Object(o.Inject)(ht)),Object(i.__metadata)("design:paramtypes",[String,c.MessageService,Boolean,ht])],t)}(c.LocalizationService),Dt=function(){function e(e,t,n){this.host=e,this.renderer=t,this.localizationService=n,this.focusableId="k-"+Object(d.guid)(),this.opacity=!0,this.disabled=!1,this.readonly=!1,this.valueChange=new o.EventEmitter,this.colorInputClass=!0,this.rgba={},this.subscriptions=new a.Subscription}return Object.defineProperty(e.prototype,"isFocused",{get:function(){if(!Object(d.isDocumentAvailable)()||!m(this.host))return!1;var e=document.activeElement;return this.host.nativeElement.contains(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rgbaInputValid",{get:function(){var e=this;return Object.keys(this.rgba).every((function(t){return m(e.rgba[t])}))},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.initDomEvents()},e.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe()},e.prototype.ngOnChanges=function(e){m(e.value)&&!this.isFocused&&(this.hex=_t(this.value,"hex",this.opacity),this.rgba=Ot(this.value),this.rgba.a=_t(this.value,"rgba",this.opacity)?this.rgba.a:1)},Object.defineProperty(e.prototype,"formatButtonTitle",{get:function(){return this.localizationService.get("formatButton")},enumerable:!0,configurable:!0}),e.prototype.handleRgbaValueChange=function(){var e,t,n,i,o,r=(e=this.rgba,t=y(e.r,0,255),n=y(e.g,0,255),i=y(e.b,0,255),o=y(e.a,0,1),b.Color.fromBytes(t,n,i,o).toCssRgba());this.rgbaInputValid&&r!==this.value&&(this.value=r,this.rgba=Ot(this.value),this.hex=_t(r,"hex",this.opacity),this.valueChange.emit(r))},e.prototype.handleHexValueChange=function(e){this.hex=e;var t=_t(e,"rgba",this.opacity);m(t)&&t!==this.value&&(this.value=t,this.rgba=Ot(t),this.valueChange.emit(t))},e.prototype.handleRgbaInputBlur=function(){this.rgbaInputValid||(this.rgba=Ot(this.value))},e.prototype.handleHexInputBlur=function(){this.hex=_t(this.value,"hex",this.opacity)},e.prototype.toggleFormatView=function(){this.formatView="hex"===this.formatView?"rgba":"hex"},e.prototype.initDomEvents=function(){var e=this;this.host&&this.subscriptions.add(this.renderer.listen(this.toggleFormatButton.nativeElement,"click",(function(){return e.toggleFormatView()})))},Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"formatView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"opacity",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-colorgradient-inputs"),Object(o.HostBinding)("class.k-hstack"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"colorInputClass",void 0),Object(i.__decorate)([Object(o.ViewChild)("opacityInput",{static:!1}),Object(i.__metadata)("design:type",ve)],e.prototype,"opacityInput",void 0),Object(i.__decorate)([Object(o.ViewChild)("hexInput",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"hexInput",void 0),Object(i.__decorate)([Object(o.ViewChild)("blueInput",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"blueInput",void 0),Object(i.__decorate)([Object(o.ViewChild)("toggleFormatButton",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"toggleFormatButton",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-colorinput",template:'\n <div class="k-vstack">\n <button #toggleFormatButton\n class="k-colorgradient-toggle-mode k-button k-button-md k-button-flat k-button-flat-base k-icon-button"\n [attr.aria-label]="formatButtonTitle"\n [attr.title]="formatButtonTitle"\n type="button"\n >\n <span class="k-button-icon k-icon k-i-arrows-kpi"></span>\n </button>\n </div>\n <div *ngIf="formatView === \'hex\'" class="k-vstack">\n <input\n #hexInput\n [id]="focusableId"\n class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-hex-value"\n [disabled]="disabled"\n [readonly]="readonly"\n [value]="hex || \'\'"\n (blur)="handleHexInputBlur()"\n (input)="handleHexValueChange(hexInput.value)"\n />\n <label [for]="focusableId" class="k-colorgradient-input-label">HEX</label>\n </div>\n <ng-container *ngIf="formatView === \'rgba\'">\n <div class="k-vstack">\n <kendo-numerictextbox\n #red\n [disabled]="disabled"\n [readonly]="readonly"\n [min]="0"\n [max]="255"\n [(value)]="rgba.r"\n [autoCorrect]="true"\n [spinners]="false"\n [format]="\'n\'"\n [decimals]="0"\n (blur)="handleRgbaInputBlur()"\n (valueChange)="handleRgbaValueChange()">\n </kendo-numerictextbox>\n <label [for]="red.focusableId" class="k-colorgradient-input-label">R</label>\n </div>\n <div class="k-vstack">\n <kendo-numerictextbox\n #green\n [disabled]="disabled"\n [readonly]="readonly"\n [min]="0"\n [max]="255"\n [(value)]="rgba.g"\n [autoCorrect]="true"\n [spinners]="false"\n [format]="\'n\'"\n [decimals]="0"\n (blur)="handleRgbaInputBlur()"\n (valueChange)="handleRgbaValueChange()">\n </kendo-numerictextbox>\n <label [for]="green.focusableId" class="k-colorgradient-input-label">G</label>\n </div>\n <div class="k-vstack">\n <kendo-numerictextbox\n #blue\n [disabled]="disabled"\n [readonly]="readonly"\n [min]="0"\n [max]="255"\n [(value)]="rgba.b"\n [autoCorrect]="true"\n [spinners]="false"\n [format]="\'n\'"\n [decimals]="0"\n (blur)="handleRgbaInputBlur()"\n (valueChange)="handleRgbaValueChange()">\n </kendo-numerictextbox>\n <label [for]="blue.focusableId" class="k-colorgradient-input-label">B</label>\n </div>\n <div class="k-vstack" *ngIf="opacity">\n <kendo-numerictextbox #opacityInput\n #alpha\n [disabled]="disabled"\n [readonly]="readonly"\n [min]="0"\n [max]="1"\n [(value)]="rgba.a"\n [autoCorrect]="true"\n [spinners]="false"\n [step]="0.01"\n [format]="\'n2\'"\n [decimals]="2"\n (blur)="handleRgbaInputBlur()"\n (valueChange)="handleRgbaValueChange()">\n </kendo-numerictextbox>\n <label [for]="alpha.focusableId" class="k-colorgradient-input-label">A</label>\n </div>\n </ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.Renderer2,c.LocalizationService])],e)}(),Bt=0,Pt=function(){function e(e,t,n,i,r){var s=this;this.host=e,this.ngZone=t,this.renderer=n,this.cdr=i,this.localizationService=r,this.hostClasses=!0,this.id="k-colorgradient-"+Bt++,this.opacity=!0,this.disabled=!1,this.readonly=!1,this.clearButton=!1,this.delay=0,this.format="rgba",this.valueChange=new o.EventEmitter,this.backgroundColor="rgba(255, 0, 0, 1)",this.hsva=new a.BehaviorSubject({}),this._tabindex=0,this.listeners=[],this.hueSliderTouched=!1,this.alphaSliderTouched=!1,this.updateValues=new a.Subject,this.notifyNgChanged=function(){},this.notifyNgTouched=function(){},Object(l.validatePackage)(ee),this.dynamicRTLSubscription=r.changes.subscribe((function(e){var t=e.rtl;s.direction=t?"rtl":"ltr"}))}var t;return t=e,Object.defineProperty(e.prototype,"readonlyAttribute",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gradientId",{get:function(){return this.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabindex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=_t(e,this.format,this.opacity)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrastTool",{get:function(){return this._contrastTool},set:function(e){this._contrastTool=_t(e,this.format,this.opacity)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?void 0:this._tabindex},set:function(e){if(m(e)){var t=Number(e);this._tabindex=isNaN(t)?0:t}else this._tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return!(!Object(d.isDocumentAvailable)()||!m(this.host))&&(this.host.nativeElement===document.activeElement||this.host.nativeElement.contains(document.activeElement))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"alphaSliderValue",{get:function(){if(m(this.hsva.value)&&m(this.hsva.value.a))return 100*this.hsva.value.a},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gradientRect",{get:function(){return this.gradientWrapper.nativeElement.getBoundingClientRect()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrastToolVisible",{get:function(){return this.contrastTool&&this.contrastTool.length>0},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.updateUI(),this.cdr.detectChanges(),this.addEventListeners(),this.subscribeChanges()},e.prototype.ngOnChanges=function(e){Object(d.isChanged)("value",e)&&!this.isFocused&&this.updateUI(),Object(d.isChanged)("delay",e)&&(this.unsubscribeChanges(),this.subscribeChanges())},e.prototype.ngOnDestroy=function(){this.listeners.forEach((function(e){return e()})),this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.unsubscribeChanges()},e.prototype.focus=function(){this.disabled||this.gradientDragHandle.nativeElement.focus()},e.prototype.reset=function(){this.handleValueChange(void 0),this.updateUI(),this.host.nativeElement.focus()},e.prototype.handleDragPress=function(e){this.disabled||this.readonly||!m(e.originalEvent)||(this.focus(),e.originalEvent.preventDefault())},e.prototype.onHandleDrag=function(e){this.disabled||this.readonly||(this.renderer.addClass(this.gradientWrapper.nativeElement,"k-dragging"),this.changePosition(e))},e.prototype.onHandleRelease=function(){this.disabled||this.readonly||(this.renderer.removeClass(this.gradientWrapper.nativeElement,"k-dragging"),this.handleValueChange(jt(this.hsva.value,this.format,this.opacity)))},e.prototype.onKeyboardAction=function(e){var t=this;if(!this.disabled&&!this.readonly&&e.key&&-1!==e.key.indexOf("Arrow")){e.preventDefault();var n=this.gradientDragHandle.nativeElement;this.renderer.addClass(this.gradientWrapper.nativeElement,"k-dragging");var i=0,o=0;switch(e.key){case"ArrowRight":i=5;break;case"ArrowLeft":i=-5;break;case"ArrowUp":o=-5;break;case"ArrowDown":o=5}var r=parseInt(n.style.top,10)+o,a=parseInt(n.style.left,10)+i;this.renderer.setStyle(n,"top",r+"px"),this.renderer.setStyle(n,"left",a+"px"),this.ngZone.run((function(){return t.moveDragHandle(a,r)}))}},e.prototype.changePosition=function(e){var t=this;if(!this.disabled&&!this.readonly){this.gradientDragHandle.nativeElement.focus();var n=this.gradientRect,i=e.clientX-n.left,o=e.clientY-n.top;this.ngZone.run((function(){return t.moveDragHandle(i,o)}))}},e.prototype.handleHueSliderChange=function(e){var t=this.hsva.value;t.h=e,this.hsva.next(t),this.handleValueChange(jt(this.hsva.value,this.format,this.opacity)),this.backgroundColor=kt(e),this.setBackgroundColor(this.backgroundColor),this.setAlphaSliderBackground(this.backgroundColor),this.hueSliderTouched=!0},e.prototype.handleAlphaSliderChange=function(e){var t=this.hsva.value;t.a=e/100,this.hsva.next(t),this.handleValueChange(jt(this.hsva.value,this.format,this.opacity)),this.alphaSliderTouched=!0},e.prototype.handleInputsValueChange=function(e){var t=_t(e,this.format,this.opacity);this.value!==t&&(this.handleValueChange(t),this.updateUI())},e.prototype.writeValue=function(e){this.value=e,m(this.gradientWrapper)&&this.updateUI()},e.prototype.registerOnChange=function(e){this.notifyNgChanged=e},e.prototype.registerOnTouched=function(e){this.notifyNgTouched=e},e.prototype.setDisabledState=function(e){this.cdr.markForCheck(),this.disabled=e},Object.defineProperty(e.prototype,"colorGradientHandleTitle",{get:function(){return this.localizationService.get("colorGradientHandle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorGradientHandleAriaLabel",{get:function(){var e=_t(this.value,this.format,this.opacity);return""+(this.value?e:this.localizationService.get("colorGradientHandle"))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hueSliderTitle",{get:function(){return this.localizationService.get("hueSliderHandle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"opacitySliderTitle",{get:function(){return this.localizationService.get("opacitySliderHandle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonTitle",{get:function(){return this.localizationService.get("clearButton")},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return!1},e.prototype.moveDragHandle=function(e,t){var n=this.gradientRect,o=n.width,r=n.height,a=y(t,0,r),s=y(e,0,o);this.setDragHandleElementPosition(a,s);var c=this.hsva.value;c.s=s/o,c.v=1-a/r,this.hsva.next(c),this.updateValues.next(jt(this.hsva.value,this.format,this.opacity)),this.setAlphaSliderBackground(jt(Object(i.__assign)({},this.hsva.value,{a:1}),this.format,this.opacity))},e.prototype.handleValueChange=function(e){this.value!==e&&(this.value=e,this.valueChange.emit(e),this.notifyNgChanged(e),this.setHostElementAriaLabel())},e.prototype.setDragHandleElementPosition=function(e,t){var n=this.gradientDragHandle.nativeElement;this.renderer.setStyle(n,"top",e+"px"),this.renderer.setStyle(n,"left",t+"px")},e.prototype.setAlphaSliderBackground=function(e){if(m(this.alphaSlider)){var t=this.alphaSlider.track.nativeElement;this.renderer.setStyle(t,"background","linear-gradient(to top, transparent, "+e+")")}},e.prototype.setHostElementAriaLabel=function(){var e=_t(this.value,this.format,this.opacity);this.renderer.setAttribute(this.host.nativeElement,"aria-label",""+(this.value?e:this.localizationService.get("colorGradientNoColor")))},e.prototype.setBackgroundColor=function(e){this.renderer.setStyle(this.hsvRectangle.nativeElement,"background",e)},e.prototype.updateUI=function(){if(Object(d.isDocumentAvailable)()){if(this.hueSliderTouched||this.alphaSliderTouched)return this.hueSliderTouched=!1,void(this.alphaSliderTouched=!1);this.hsva.next(this.value?function(e,t){void 0===t&&(t=!0);var n=Object(b.parseColor)(e,t);return m(n)?n.toHSV():{}}(this.value):{h:0,s:0,v:1,a:1});var e=this.gradientRect,t=(1-this.hsva.value.v)*e.height,n=this.hsva.value.s*e.width;this.setDragHandleElementPosition(t,n),this.backgroundColor=kt(this.hsva.value.h),this.setBackgroundColor(this.backgroundColor),this.setAlphaSliderBackground(this.backgroundColor),this.setHostElementAriaLabel()}},e.prototype.addEventListeners=function(){var e=this;this.ngZone.runOutsideAngular((function(){var t=e.renderer.listen(e.host.nativeElement,"focusout",(function(t){var n,i,o;i=e.host.nativeElement,o=t.relatedTarget,(!i||!o||i!==o&&!i.contains(o))&&((n=e.host)&&n.nativeElement&&X(n.nativeElement,"ng-untouched"))&&e.ngZone.run((function(){return e.notifyNgTouched()}))})),n=e.renderer.listen(e.gradientDragHandle.nativeElement,"keydown",(function(t){e.onKeyboardAction(t)})),i=e.renderer.listen(e.gradientDragHandle.nativeElement,"keyup",(function(){e.renderer.removeClass(e.gradientWrapper.nativeElement,"k-dragging"),e.readonly||e.disabled||e.ngZone.run((function(){return e.handleValueChange(jt(e.hsva.value,e.format,e.opacity))}))})),o=e.renderer.listen(e.gradientDragHandle.nativeElement,"focusin",(function(){e.renderer.addClass(e.gradientDragHandle.nativeElement,"k-state-focus")})),r=e.renderer.listen(e.gradientDragHandle.nativeElement,"focusout",(function(){e.renderer.removeClass(e.gradientDragHandle.nativeElement,"k-state-focus")}));e.listeners.push(t,n,i,o,r)}))},e.prototype.subscribeChanges=function(){var e=this;this.changeRequestsSubscription=this.updateValues.pipe(Object(s.throttleTime)(this.delay)).subscribe((function(t){e.handleValueChange(t)}))},e.prototype.unsubscribeChanges=function(){this.changeRequestsSubscription&&this.changeRequestsSubscription.unsubscribe()},Object(i.__decorate)([Object(o.HostBinding)("class.k-colorgradient"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-readonly"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"readonlyAttribute",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-state-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.id"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"gradientId",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hostTabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"opacity",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number)],e.prototype,"delay",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"contrastTool",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"format",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.ViewChild)("gradientDragHandle",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"gradientDragHandle",void 0),Object(i.__decorate)([Object(o.ViewChild)("inputs",{static:!1}),Object(i.__metadata)("design:type",Dt)],e.prototype,"inputs",void 0),Object(i.__decorate)([Object(o.ViewChild)("alphaSlider",{static:!1}),Object(i.__metadata)("design:type",ie)],e.prototype,"alphaSlider",void 0),Object(i.__decorate)([Object(o.ViewChild)("gradientWrapper",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"gradientWrapper",void 0),Object(i.__decorate)([Object(o.ViewChild)("hsvRectangle",{static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"hsvRectangle",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoColorGradient",selector:"kendo-colorgradient",providers:[{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))},Tt,{provide:c.LocalizationService,useExisting:Tt},{provide:c.L10N_PREFIX,useValue:"kendo.colorgradient"}],template:'\n <ng-container kendoColorGradientLocalizedMessages\n i18n-colorGradientNoColor="kendo.colorgradient.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."\n colorGradientNoColor="Colorgradient no color chosen"\n i18n-colorGradientHandle="kendo.colorgradient.colorGradientHandle|The title for the gradient color drag handle chooser."\n colorGradientHandle="Choose color"\n i18n-clearButton="kendo.colorgradient.clearButton|The title for the clear button."\n clearButton="Clear value"\n i18n-hueSliderHandle="kendo.colorgradient.hueSliderHandle|The title for the hue slider handle."\n hueSliderHandle="Set hue"\n i18n-opacitySliderHandle="kendo.colorgradient.opacitySliderHandle|The title for the opacity slider handle."\n opacitySliderHandle="Set opacity"\n i18n-passContrast="kendo.colorgradient.passContrast|The pass message for the contrast tool."\n passContrast="Pass"\n i18n-failContrast="kendo.colorgradient.failContrast|The fail message for the contrast tool."\n failContrast="Fail"\n i18n-contrastRatio="kendo.colorgradient.contrastRatio|The contrast ratio message for the contrast tool."\n contrastRatio="Contrast ratio"\n i18n-formatButton="kendo.colorgradient.formatButton|The message for the input format toggle button."\n formatButton="Change color format">\n </ng-container>\n <div class="k-colorgradient-canvas k-hstack">\n <div class="k-hsv-rectangle" #hsvRectangle>\n <div\n #gradientWrapper\n kendoDraggable\n class="k-hsv-gradient"\n (click)="changePosition($event)"\n (kendoPress)="handleDragPress($event)"\n (kendoDrag)="onHandleDrag($event)"\n (kendoRelease)="onHandleRelease()">\n <div\n #gradientDragHandle\n class="k-hsv-draghandle k-draghandle"\n tabindex="0"\n [attr.title]="colorGradientHandleTitle"\n [attr.aria-label]="colorGradientHandleAriaLabel"\n >\n </div>\n </div>\n <svg kendoColorContrastSvg\n *ngIf="contrastToolVisible && gradientWrapper"\n class="k-color-contrast-svg"\n xmlns="http://www.w3.org/2000/svg"\n [wrapper]="gradientWrapper ? gradientWrapper : undefined"\n [hsva]="hsva"\n [backgroundColor]="contrastTool">\n </svg>\n </div>\n <div class="k-hsv-controls k-hstack {{ clearButton ? \'k-sliders-wrap-clearable\' : \'\' }}">\n <span class="k-clear-color k-button k-button-md k-button-flat k-button-flat-base k-button-icon"\n *ngIf="clearButton"\n (click)="reset()"\n (keydown.enter)="reset()"\n (keydown.space)="reset()"\n [attr.aria-label]="clearButtonTitle"\n [attr.title]="clearButtonTitle"\n tabindex="0">\n <span class="k-icon k-i-reset-color"></span>\n </span>\n <kendo-slider\n [ngClass]="{\'k-align-self-end\': clearButton}"\n class="k-hue-slider k-colorgradient-slider"\n [dragHandleTitle]="hueSliderTitle"\n [disabled]="disabled"\n [readonly]="readonly"\n [showButtons]="false"\n [tickPlacement]="\'none\'"\n [vertical]="true"\n [min]="0"\n [max]="360"\n [value]="hsva.value.h"\n [smallStep]="5"\n [largeStep]="10"\n (valueChange)="handleHueSliderChange($event)"\n >\n </kendo-slider>\n <kendo-slider\n *ngIf="opacity"\n #alphaSlider\n [ngClass]="{\'k-align-self-end\': clearButton}"\n class="k-alpha-slider k-colorgradient-slider"\n [dragHandleTitle]="opacitySliderTitle"\n [disabled]="disabled"\n [readonly]="readonly"\n [showButtons]="false"\n [tickPlacement]="\'none\'"\n [vertical]="true"\n [min]="0"\n [max]="100"\n [smallStep]="1"\n [largeStep]="10"\n [value]="alphaSliderValue"\n (valueChange)="handleAlphaSliderChange($event)"\n >\n </kendo-slider>\n </div>\n </div>\n <kendo-colorinput #inputs\n [opacity]="opacity"\n [formatView]="format"\n [value]="value"\n [disabled]="disabled"\n [readonly]="readonly"\n (valueChange)="handleInputsValueChange($event)"\n >\n </kendo-colorinput>\n <div class="k-colorgradient-color-contrast k-vbox"\n *ngIf="contrastToolVisible"\n kendoContrastTool\n [value]="value"\n [ratio]="contrastTool">\n </div>\n ',styles:["\n .k-clear-color {\n position: absolute;\n top: 0;\n left: 50%;\n transform: translateX(-50%);\n }\n .k-colorgradient-slider.k-align-self-end {\n height: 140px;\n }\n\n .k-color-contrast-svg {\n position: absolute;\n overflow: visible;\n pointer-events: none;\n left: 0px;\n top: 0px;\n }\n "]}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.NgZone,o.Renderer2,o.ChangeDetectorRef,c.LocalizationService])],e)}(),At=function(e){function t(t,n,i,o){var r=e.call(this,t,n,i)||this;return r.flatColorPickerLocalization=o,r}return Object(i.__extends)(t,e),t.prototype.get=function(t){return this.flatColorPickerLocalization?this.flatColorPickerLocalization.get(t):e.prototype.get.call(this,t)},t=Object(i.__decorate)([Object(i.__param)(0,Object(o.Inject)(c.L10N_PREFIX)),Object(i.__param)(1,Object(o.Optional)()),Object(i.__param)(2,Object(o.Optional)()),Object(i.__param)(2,Object(o.Inject)(c.RTL)),Object(i.__param)(3,Object(o.Optional)()),Object(i.__param)(3,Object(o.Inject)(ht)),Object(i.__metadata)("design:paramtypes",[String,c.MessageService,Boolean,ht])],t)}(c.LocalizationService),Mt=function(){function e(){this.colorRows=[]}return e.prototype.setColorMatrix=function(e,t){if(this.colorRows=[],m(e)&&e.length){t=t||e.length;for(var n=0;n<e.length;n+=t){var i=e.slice(n,t+n);this.colorRows.push(i)}}},e.prototype.getCellCoordsFor=function(e){if(m(e))for(var t=0;t<this.colorRows.length;t++)for(var n=0;n<this.colorRows[t].length;n++)if(this.colorRows[t][n]===e)return{row:t,col:n}},e.prototype.getColorAt=function(e){if(m(e)&&m(this.colorRows[e.row]))return this.colorRows[e.row][e.col]},e.prototype.getNextCell=function(e,t,n){if(!(m(e)&&m(e.row)&&m(e.col)))return{row:0,col:0};var i=this.clampIndex(e.row+n,this.colorRows.length-1);return{row:i,col:this.clampIndex(e.col+t,this.colorRows[i].length-1)}},e.prototype.clampIndex=function(e,t){return e<0?0:e>t?t:e},e=Object(i.__decorate)([Object(o.Injectable)()],e)}(),zt=0,Rt=function(){function e(e,t,n,i,r,a){var s=this;this.host=e,this.service=t,this.cdr=n,this.renderer=i,this.localizationService=r,this.ngZone=a,this.id="k-colorpalette-"+zt++,this.format="hex",this.disabled=!1,this.readonly=!1,this.tileSize={width:24,height:24},this.selectionChange=new o.EventEmitter,this.valueChange=new o.EventEmitter,this.cellSelection=new o.EventEmitter,this.hostClasses=!0,this.uniqueId=Object(d.guid)(),this._tabindex=0,this.notifyNgTouched=function(){},this.notifyNgChanged=function(){},Object(l.validatePackage)(ee),this.dynamicRTLSubscription=r.changes.subscribe((function(e){var t=e.rtl;s.direction=t?"rtl":"ltr"}))}var t;return t=e,Object.defineProperty(e.prototype,"paletteId",{get:function(){return this.id},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=_t(e,this.format)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},set:function(e){this._columns=e>1?e:1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"palette",{get:function(){return this._palette},set:function(e){var t=this;m(e)||(e="office"),"string"==typeof e&&m(ft[e])&&(this.columns=this.columns||ft[e].columns,e=ft[e].colors);var n="string"==typeof e?e.split(","):e;this._palette=n.map((function(e){return _t(e,t.format,!1,!1)}))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?void 0:this._tabindex},set:function(e){var t=Number(e);this._tabindex=isNaN(t)?0:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tileLayout",{get:function(){return"number"!=typeof this.tileSize?this.tileSize:{width:this.tileSize,height:this.tileSize}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"colorRows",{get:function(){return this.service.colorRows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabindex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readonlyAttribute",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){if(0===this.colorRows.length){var e="name"!==this.format?"office":"accessible";this.palette=this.palette||e,this.setRows()}},e.prototype.ngAfterViewInit=function(){var e=this;this.setHostElementAriaLabel(),this.value&&this.ngZone.onStable.pipe(Object(s.take)(1)).subscribe((function(){e.selectCell(e.value)}))},e.prototype.ngOnDestroy=function(){this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe()},e.prototype.ngOnChanges=function(e){(e.palette||e.columns)&&this.setRows(),(e.palette||e.value||e.columns)&&(this.selectCell(this.value),this.setHostElementAriaLabel())},e.prototype.handleKeydown=function(e){var t="rtl"===this.direction;switch(e.keyCode){case d.Keys.ArrowDown:this.handleCellNavigation(0,1);break;case d.Keys.ArrowUp:this.handleCellNavigation(0,-1);break;case d.Keys.ArrowRight:this.handleCellNavigation(t?-1:1,0);break;case d.Keys.ArrowLeft:this.handleCellNavigation(t?1:-1,0);break;case d.Keys.Enter:this.handleEnter();break;default:return}e.preventDefault()},e.prototype.handleHostBlur=function(){this.notifyNgTouched(),this.handleCellFocusOnBlur()},e.prototype.handleCellSelection=function(e,t){if(!this.readonly){this.selectedCell=t,this.focusedCell=this.selectedCell,this.focusInComponent=!0;var n=_t(e,this.format,!1,!1);this.cellSelection.emit(n),this.handleValueChange(n),this.selection!==n&&(this.selection=n,this.selectionChange.emit(n)),t&&(this.activeCellId="k-"+this.selectedCell.row+"-"+this.selectedCell.col+"-"+this.uniqueId)}},e.prototype.writeValue=function(e){this.value=e,this.selectCell(e)},e.prototype.registerOnChange=function(e){this.notifyNgChanged=e},e.prototype.registerOnTouched=function(e){this.notifyNgTouched=e},e.prototype.setDisabledState=function(e){this.cdr.markForCheck(),this.disabled=e},e.prototype.isEmpty=function(){return!1},e.prototype.reset=function(){this.focusedCell=null,m(this.value)&&this.handleValueChange(void 0),this.selectedCell=void 0},e.prototype.handleValueChange=function(e){this.value!==e&&(this.value=e,this.valueChange.emit(e),this.notifyNgChanged(e),this.setHostElementAriaLabel())},e.prototype.handleCellFocusOnBlur=function(){this.focusInComponent=!1,this.focusedCell=this.selectedCell},e.prototype.selectCell=function(e){this.selectedCell=this.service.getCellCoordsFor(e),this.focusedCell=this.selectedCell},e.prototype.setRows=function(){m(this.palette)&&(this.columns=this.columns||10,this.service.setColorMatrix(this.palette,this.columns))},e.prototype.handleCellNavigation=function(e,t){this.readonly||(this.focusedCell=this.service.getNextCell(this.focusedCell,e,t),this.focusInComponent=!0)},e.prototype.setHostElementAriaLabel=function(){var e=_t(this.value,this.format);this.renderer.setAttribute(this.host.nativeElement,"aria-label",""+(this.value?e:this.localizationService.get("colorPaletteNoColor")))},e.prototype.handleEnter=function(){if(m(this.focusedCell)){var e=this.service.getColorAt(this.focusedCell);this.handleCellSelection(e,this.focusedCell)}},Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.id"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"paletteId",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"format",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"columns",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"palette",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"tileSize",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"selectionChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"cellSelection",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hostTabindex",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-colorpalette"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(o.HostBinding)("class.k-state-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-readonly"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"readonlyAttribute",null),Object(i.__decorate)([Object(o.HostListener)("keydown",["$event"]),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[Object]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"handleKeydown",null),Object(i.__decorate)([Object(o.HostListener)("blur"),Object(i.__metadata)("design:type",Function),Object(i.__metadata)("design:paramtypes",[]),Object(i.__metadata)("design:returntype",void 0)],e.prototype,"handleHostBlur",null),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoColorPalette",selector:"kendo-colorpalette",providers:[{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))},Mt,At,{provide:c.LocalizationService,useExisting:At},{provide:c.L10N_PREFIX,useValue:"kendo.colorpalette"}],template:'\n <ng-container kendoColorPaletteLocalizedMessages\n i18n-colorPaletteNoColor="kendo.colorpalette.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."\n colorPaletteNoColor="Colorpalette no color chosen">\n </ng-container>\n <div role="listbox" class="k-colorpalette-table-wrap"\n [attr.aria-activedescendant]="activeCellId">\n <table class="k-colorpalette-table k-palette">\n <tbody>\n <tr *ngFor="let row of colorRows; let rowIndex = index">\n <td *ngFor="let color of row; let colIndex = index"\n role="option"\n [class.k-state-selected]="selectedCell?.row === rowIndex && selectedCell?.col === colIndex"\n [class.k-state-focus]="focusInComponent && focusedCell?.row === rowIndex && focusedCell?.col === colIndex"\n [attr.aria-selected]="selectedCell?.row === rowIndex && selectedCell?.col === colIndex"\n [attr.aria-label]="color"\n class="k-colorpalette-tile"\n [id]="\'k-\' + rowIndex + \'-\' + colIndex + \'-\' + uniqueId"\n [attr.value]="color"\n (click)="handleCellSelection(color, { row: rowIndex, col: colIndex })"\n [ngStyle]="{\n backgroundColor: color,\n width: tileLayout.width + \'px\',\n height: tileLayout.height + \'px\',\n minWidth: tileLayout.width + \'px\'\n }">\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,Mt,o.ChangeDetectorRef,o.Renderer2,c.LocalizationService,o.NgZone])],e)}(),Ft=function(){function e(e){this.localizationService=e,this.hostClasses=!0,this.viewChange=new o.EventEmitter,this.valuePaneClick=new o.EventEmitter,this.clearButtonClick=new o.EventEmitter}return e.prototype.onViewButtonClick=function(e){this.activeView=e,this.viewChange.emit(e)},Object.defineProperty(e.prototype,"viewButtons",{get:function(){return this.views&&this.views.indexOf("gradient")>=0&&this.views.indexOf("palette")>=0},enumerable:!0,configurable:!0}),e.prototype.getViewButtonIcon=function(e){return"gradient"===e?"k-i-color-canvas":"k-i-palette"},e.prototype.getText=function(e){return this.localizationService.get(e)},Object(i.__decorate)([Object(o.HostBinding)("class.k-coloreditor-header"),Object(o.HostBinding)("class.k-hstack"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"activeView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"views",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"preview",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"selection",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"viewChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valuePaneClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"clearButtonClick",void 0),Object(i.__decorate)([Object(o.ViewChildren)("viewButtons",{read:o.ElementRef}),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"viewButtonsCollection",void 0),Object(i.__decorate)([Object(o.ViewChild)("clearButton",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"clearButtonElement",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoFlatColorPickerHeader]",template:'\n <div class="k-coloreditor-header-actions k-hstack">\n <div *ngIf="viewButtons" class="k-button-group k-button-group-flat">\n <button *ngFor="let view of views"\n #viewButtons\n type="button"\n (click)="onViewButtonClick(view)"\n class="k-button k-button-md k-button-flat k-button-flat-base k-icon-button"\n [attr.title]="getText(view === \'gradient\' ? \'gradientView\' : \'paletteView\')"\n [attr.aria-label]="getText(view === \'gradient\' ? \'gradientView\' : \'paletteView\')"\n [attr.aria-pressed]="activeView === view"\n [ngClass]="activeView === view ? \'k-state-selected\' : \'\'"\n >\n <span\n class="k-button-icon k-icon"\n [ngClass]="getViewButtonIcon(view)">\n </span>\n </button>\n </div>\n </div>\n <div class="k-spacer"></div>\n <div class="k-coloreditor-header-actions k-hstack">\n <button *ngIf="clearButton"\n #clearButton\n type="button"\n class="k-button k-button-md k-button-flat k-button-flat-base k-icon-button k-coloreditor-reset"\n [attr.aria-label]="getText(\'clearButton\')"\n [attr.title]="getText(\'clearButton\')"\n (click)="clearButtonClick.emit()">\n <span class="k-button-icon k-icon k-i-reset-color"></span>\n </button>\n <div class="k-coloreditor-preview k-vstack" *ngIf="preview">\n <span\n class="k-coloreditor-preview-color k-color-preview"\n [attr.title]="getText(\'previewColor\')"\n [style.background-color]="selection">\n </span>\n <span class="k-coloreditor-current-color k-color-preview"\n [style.background-color]="value"\n [attr.title]="getText(\'revertSelection\')"\n (click)="valuePaneClick.emit($event)">\n </span>\n </div>\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],e)}(),Nt=function(){function e(e){this.localizationService=e,this.hostClasses=!0,this.actionButtonClick=new o.EventEmitter}return e.prototype.getText=function(e){return this.localizationService.get(e)},e.prototype.onActionButtonClick=function(e,t){var n={target:e,originalEvent:t};this.actionButtonClick.emit(n)},Object(i.__decorate)([Object(o.HostBinding)("class.k-coloreditor-footer"),Object(o.HostBinding)("class.k-actions"),Object(o.HostBinding)("class.k-hstack"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"actionButtonClick",void 0),Object(i.__decorate)([Object(o.ViewChild)("last",{read:o.ElementRef,static:!1}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"lastButton",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoFlatColorPickerActionButtons]",template:'\n <button\n class="k-coloreditor-cancel k-button k-button-md k-button-solid k-button-solid-base"\n [attr.title]="getText(\'cancelButton\')"\n (click)="onActionButtonClick(\'cancel\', $event)"\n type="button"\n >{{getText(\'cancelButton\')}}</button>\n <button #last\n class="k-coloreditor-apply k-button k-button-md k-button-solid k-button-solid-primary"\n [attr.title]="getText(\'applyButton\')"\n (click)="onActionButtonClick(\'apply\', $event)"\n type="button"\n >{{getText(\'applyButton\')}}</button>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],e)}(),Lt=function(){function e(e,t,n,i,r,s){var c=this;this.host=e,this.service=t,this.localizationService=n,this.cdr=i,this.renderer=r,this.ngZone=s,this.hostClasses=!0,this.readonly=!1,this.disabled=!1,this.format="rgba",this.clearButton=!0,this.preview=!0,this.actionsLayout="end",this.views=["gradient","palette"],this.valueChange=new o.EventEmitter,this.cancel=new o.EventEmitter,this.activeViewChange=new o.EventEmitter,this.actionButtonClick=new o.EventEmitter,this._tabindex=0,this._gradientSettings={opacity:!0,delay:0},this._paletteSettings={},this.subscriptions=new a.Subscription,this.notifyNgChanged=function(){},this.notifyNgTouched=function(){},Object(l.validatePackage)(ee),this.dynamicRTLSubscription=this.localizationService.changes.subscribe((function(e){var t=e.rtl;c.direction=t?"rtl":"ltr"}))}var t;return t=e,Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabindex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=_t(e,this.format,this.gradientSettings.opacity)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?void 0:this._tabindex},set:function(e){var t=Number(e);this._tabindex=isNaN(t)?0:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gradientSettings",{get:function(){return this._gradientSettings},set:function(e){Object.assign(this._gradientSettings,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paletteSettings",{get:function(){return this._paletteSettings},set:function(e){Object.assign(this._paletteSettings,e)},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.selection=this.value,this._paletteSettings=this.service.getPaletteSettings(this._paletteSettings,this.format),this.setActiveView()},e.prototype.ngAfterViewInit=function(){this.setHostElementAriaLabel(),this.initDomEvents(),this.setSizingVariables()},e.prototype.ngOnChanges=function(e){Object(d.isChanged)("value",e)&&(this.selection=this.value,this.setHostElementAriaLabel()),Object(d.isChanged)("paletteSettings",e)&&this.setSizingVariables()},e.prototype.ngOnDestroy=function(){this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.subscriptions.unsubscribe()},Object.defineProperty(e.prototype,"headerHasContent",{get:function(){return this.preview||this.views.length>1||this.clearButton},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return!1},e.prototype.focus=function(){this.disabled&&this.focused||(this.host.nativeElement.focus(),this.focused=!0)},e.prototype.blur=function(){this.focused&&(this.notifyNgTouched(),this.host.nativeElement.blur(),this.focused=!1)},e.prototype.reset=function(){m(this.value)&&(this.value=void 0,this.notifyNgChanged(void 0),this.setHostElementAriaLabel())},e.prototype.onViewChange=function(e){var t=this;this.activeView!==e&&(this.activeView=e,this.activeViewChange.emit(e),"gradient"===this.activeView&&this.ngZone.runOutsideAngular((function(){setTimeout((function(){t.gradient.gradientDragHandle.nativeElement.focus()}))})))},e.prototype.onClearButtonClick=function(){this.resetInnerComponentValue(),this.host.nativeElement.focus()},e.prototype.handleValueChange=function(e){this.preview?this.changeCurrentValue(e):this.setFlatColorPickerValue(e)},e.prototype.onAction=function(e){"apply"===e.target?this.setFlatColorPickerValue(this.selection):this.resetSelection(e.originalEvent),this.actionButtonClick.emit()},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.notifyNgChanged=e},e.prototype.registerOnTouched=function(e){this.notifyNgTouched=e},e.prototype.setDisabledState=function(e){this.cdr.markForCheck(),this.disabled=e},e.prototype.resetSelection=function(e){var t=new mt(e);this.cancel.emit(t),t.isDefaultPrevented()||(this.selection=this.value),this.notifyNgTouched()},e.prototype.setHostElementAriaLabel=function(){var e=_t(this.value,this.format,this.gradientSettings.opacity),t=""+(this.value?e:this.localizationService.get("flatColorPickerNoColor"));this.renderer.setAttribute(this.host.nativeElement,"aria-label",t)},e.prototype.setSizingVariables=function(){var e=this.service.paletteTileLayout(this.paletteSettings.tileSize),t="--kendo-color-preview-columns: "+this.paletteSettings.columns+";\n --kendo-color-preview-width: "+e.width+"px;\n --kendo-color-preview-height: "+e.height+"px;";this.host.nativeElement.querySelector(".k-coloreditor-views.k-vstack").setAttribute("style",t)},e.prototype.changeCurrentValue=function(e){this.selection=e,this.notifyNgTouched()},e.prototype.resetInnerComponentValue=function(){this.selection=null,this.gradient?this.gradient.reset():this.palette.reset()},e.prototype.setFlatColorPickerValue=function(e){this.value!==e&&(this.value=e,this.valueChange.emit(e),this.notifyNgChanged(e),this.setHostElementAriaLabel())},e.prototype.setActiveView=function(){if(m(this.activeView)){if(Object(o.isDevMode)()&&-1===this.views.indexOf(this.activeView))throw new Error("Invalid configuration: The current activeView is not present in the views collection")}else this.activeView=this.views[0]},e.prototype.initDomEvents=function(){var e=this;if(this.host){var t=this.host.nativeElement;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focus",(function(){e.focused=!0}))),e.subscriptions.add(e.renderer.listen(t,"blur",(function(){e.focused=!1,e.notifyNgTouched()})))}))}},Object(i.__decorate)([Object(o.HostBinding)("class.k-flatcolorpicker"),Object(o.HostBinding)("class.k-coloreditor"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-state-disabled"),Object(o.HostBinding)("attr.aria-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-readonly"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaReadonly",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hostTabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"format",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"preview",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"actionsLayout",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"activeView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"views",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"gradientSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"paletteSettings",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"cancel",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"activeViewChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"actionButtonClick",void 0),Object(i.__decorate)([Object(o.ViewChild)("header",{static:!1}),Object(i.__metadata)("design:type",Ft)],e.prototype,"header",void 0),Object(i.__decorate)([Object(o.ViewChild)("gradient",{static:!1}),Object(i.__metadata)("design:type",Pt)],e.prototype,"gradient",void 0),Object(i.__decorate)([Object(o.ViewChild)("palette",{static:!1}),Object(i.__metadata)("design:type",Rt)],e.prototype,"palette",void 0),Object(i.__decorate)([Object(o.ViewChild)("footer",{static:!1}),Object(i.__metadata)("design:type",Nt)],e.prototype,"footer",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoFlatColorPicker",selector:"kendo-flatcolorpicker",providers:[{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))},bt,ht,{provide:c.LocalizationService,useExisting:ht},{provide:c.L10N_PREFIX,useValue:"kendo.flatcolorpicker"}],template:'\n <ng-container kendoFlatColorPickerLocalizedMessages\n i18n-flatColorPickerNoColor="kendo.flatcolorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."\n flatColorPickerNoColor="Flatcolorpicker no color chosen"\n i18n-colorGradientNoColor="kendo.flatcolorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."\n colorGradientNoColor="Colorgradient no color chosen"\n i18n-colorPaletteNoColor="kendo.flatcolorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."\n colorPaletteNoColor="Colorpalette no color chosen"\n i18n-colorGradientHandle="kendo.flatcolorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."\n colorGradientHandle="Choose color"\n i18n-clearButton="kendo.flatcolorpicker.clearButton|The title for the clear button."\n clearButton="Clear value"\n i18n-hueSliderHandle="kendo.flatcolorpicker.hueSliderHandle|The title for the hue slider handle."\n hueSliderHandle="Set hue"\n i18n-opacitySliderHandle="kendo.flatcolorpicker.opacitySliderHandle|The title for the opacity slider handle."\n opacitySliderHandle="Set opacity"\n i18n-contrastRatio="kendo.flatcolorpicker.contrastRatio|The contrast ratio message for the contrast tool."\n contrastRatio="Contrast ratio"\n i18n-previewColor="kendo.flatcolorpicker.previewColor|The message for the color preview pane."\n previewColor="Color preview"\n i18n-revertSelection="kendo.flatcolorpicker.revertSelection|The message for the selected color pane."\n revertSelection="Revert selection"\n i18n-gradientView="kendo.flatcolorpicker.gradientView|The message for the gradient view button."\n gradientView="Gradient view"\n i18n-paletteView="kendo.flatcolorpicker.paletteView|The message for the palette view button."\n paletteView="Palette view"\n i18n-formatButton="kendo.flatcolorpicker.formatButton|The message for the input format toggle button."\n formatButton="Change color format"\n i18n-applyButton="kendo.flatcolorpicker.applyButton|The message for the Apply action button."\n applyButton="Apply"\n i18n-cancelButton="kendo.flatcolorpicker.cancelButton|The message for the Cancel action button."\n cancelButton="Cancel">\n </ng-container>\n <div kendoFlatColorPickerHeader\n *ngIf="headerHasContent"\n #header\n [clearButton]="clearButton"\n [activeView]="activeView"\n [views]="views"\n [value]="value"\n [selection]="selection"\n [preview]="preview"\n (clearButtonClick)="onClearButtonClick()"\n (viewChange)="onViewChange($event)"\n (valuePaneClick)="resetSelection($event)">\n </div>\n <div class="k-coloreditor-views k-vstack">\n <kendo-colorgradient #gradient\n *ngIf="activeView === \'gradient\'"\n [tabindex]="null"\n [value]="selection"\n [format]="format"\n [opacity]="gradientSettings.opacity"\n [delay]="gradientSettings.delay"\n [contrastTool]="gradientSettings.contrastTool"\n [readonly]="readonly"\n (valueChange)="handleValueChange($event)"\n >\n </kendo-colorgradient>\n <kendo-colorpalette #palette\n *ngIf="activeView === \'palette\'"\n kendoFocusOnDomReady\n [palette]="paletteSettings.palette"\n [columns]="paletteSettings.columns"\n [tileSize]="paletteSettings.tileSize"\n [format]="format"\n [value]="selection"\n (valueChange)="handleValueChange($event)"\n >\n </kendo-colorpalette>\n </div>\n <div kendoFlatColorPickerActionButtons *ngIf="preview"\n #footer\n [ngClass]="\'k-justify-content-\' + actionsLayout"\n (actionButtonClick)="onAction($event)">\n </div>\n'}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,bt,c.LocalizationService,o.ChangeDetectorRef,o.Renderer2,o.NgZone])],e)}(),Vt=["focus","blur"],Ht=function(){function e(e,t,n,i,r,s){var c=this;this.host=e,this.popupService=t,this.cdr=n,this.localizationService=i,this.ngZone=r,this.renderer=s,this.hostClasses=!0,this.role="listbox",this.views=["gradient","palette"],this.readonly=!1,this.disabled=!1,this.format="rgba",this.clearButton=!0,this.preview=!1,this.actionsLayout="end",this.valueChange=new o.EventEmitter,this.open=new o.EventEmitter,this.close=new o.EventEmitter,this.onFocus=new o.EventEmitter,this.onBlur=new o.EventEmitter,this.cancel=new o.EventEmitter,this.activeColorClick=new o.EventEmitter,this.activeViewChange=new o.EventEmitter,this.isFocused=!1,this._tabindex=0,this._popupSettings={animate:!0},this._paletteSettings={},this._gradientSettings={opacity:!0,delay:0},this._size="medium",this._rounded="medium",this._fillMode="solid",this.subscriptions=new a.Subscription,this.notifyNgTouched=function(){},this.notifyNgChanged=function(){},this.domFocusListener=function(e){return e.stopImmediatePropagation()},Object(l.validatePackage)(ee),this.dynamicRTLSubscription=this.localizationService.changes.subscribe((function(e){var t=e.rtl;c.direction=t?"rtl":"ltr"}))}var t;return t=e,Object.defineProperty(e.prototype,"focusedClass",{get:function(){return this.isFocused},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaExpanded",{get:function(){return this.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabindex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(e){this.views=[e]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=_t(e,this.format,this.gradientSettings.opacity)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign(this._popupSettings,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paletteSettings",{get:function(){return this._paletteSettings},set:function(e){this._paletteSettings=Object.assign(this._paletteSettings,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"gradientSettings",{get:function(){return this._gradientSettings},set:function(e){this._gradientSettings=Object.assign(this._gradientSettings,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?void 0:this._tabindex},set:function(e){var t=Number(e);this._tabindex=isNaN(t)?0:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.handleClasses(e,"fillMode"),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return m(this.popupRef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconStyles",{get:function(){return this.iconClass?this.iconClass:this.icon?"k-icon k-i-"+this.icon:void 0},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e="name"!==this.format?"office":"accessible",t=this._paletteSettings.palette,n="string"==typeof t&&ft[t]?ft[t].columns:void 0;this._paletteSettings={palette:t||e,tileSize:this._paletteSettings.tileSize||24,columns:this._paletteSettings.columns||n||10}},e.prototype.ngAfterViewInit=function(){var e=this;["size","rounded","fillMode"].forEach((function(t){e.handleClasses(e[t],t)})),this.setHostElementAriaLabel(),this.handleHostId(),this.initDomEvents()},e.prototype.ngOnChanges=function(e){e.format&&"name"===e.format.currentValue&&(this.activeView="palette"),"gradient"===this.activeView&&this.gradientSettings.opacity&&(this.format="rgba",this.value=_t(this.value,this.format,this.gradientSettings.opacity)),Object(d.isChanged)("value",e)&&this.setHostElementAriaLabel()},e.prototype.ngOnDestroy=function(){this.closePopup(),this.dynamicRTLSubscription&&this.dynamicRTLSubscription.unsubscribe(),this.subscriptions.unsubscribe(),this.handleDomEvents("remove",Vt)},e.prototype.handleCancelEvent=function(e){this.cancel.emit(e)},e.prototype.togglePopup=function(){this.focus(),this.toggleWithEvents(!this.isOpen)},e.prototype.handleWrapperClick=function(e){var t=this;if(!this.disabled){if(this.focus(),Object(d.closest)(e.target,(function(e){return e===t.activeColor.nativeElement}))){var n=new yt(this.value);return this.activeColorClick.emit(n),void(n.isOpenPrevented()&&!this.isOpen||this.toggleWithEvents(!this.isOpen))}this.toggleWithEvents(!this.isOpen)}},e.prototype.focus=function(){this.isFocused=!0,this.host.nativeElement.focus()},e.prototype.handleWrapperFocus=function(){var e=this;this.isFocused||this.ngZone.run((function(){e.focus(),e.onFocus.emit()}))},e.prototype.blur=function(){this.isFocused=!1,this.host.nativeElement.blur(),this.notifyNgTouched()},e.prototype.handleWrapperBlur=function(){var e=this;this.isOpen||this.ngZone.run((function(){e.onBlur.emit(),e.isFocused=!1}))},e.prototype.reset=function(){m(this.value)&&(this._value=void 0,this.setHostElementAriaLabel(),this.notifyNgChanged(void 0))},e.prototype.toggle=function(e){this.disabled||this.readonly||(this.cdr.markForCheck(),this.closePopup(),(e=m(e)?e:!this.isOpen)&&this.openPopup())},e.prototype.handleValueChange=function(e){var t=_t(e,this.format,this.gradientSettings.opacity);t!==this.value&&(this.value=t,this.valueChange.emit(t),this.setHostElementAriaLabel(),this.notifyNgChanged(t))},e.prototype.handlePopupBlur=function(e){this.popupBlurInvalid(e)||(this.isFocused=!1,this.onBlur.emit(),this.notifyNgTouched(),this.toggleWithEvents(!1))},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.notifyNgChanged=e},e.prototype.registerOnTouched=function(e){this.notifyNgTouched=e},e.prototype.setDisabledState=function(e){this.cdr.markForCheck(),this.disabled=e},e.prototype.handleWrapperKeyDown=function(e){var t=this;e.keyCode!==d.Keys.ArrowDown&&e.keyCode!==d.Keys.Enter||(e.preventDefault(),this.ngZone.run((function(){t.toggleWithEvents(!0)})))},e.prototype.handlePopupKeyDown=function(e){if(e.keyCode===d.Keys.Escape&&(this.toggleWithEvents(!1),this.host.nativeElement.focus()),e.keyCode===d.Keys.Tab){var t=e.shiftKey?this.firstFocusableElement.nativeElement:this.lastFocusableElement.nativeElement,n=e.shiftKey?this.lastFocusableElement.nativeElement:this.firstFocusableElement.nativeElement;e.target===t&&(e.preventDefault(),n.focus())}},e.prototype.isEmpty=function(){return!1},e.prototype.setHostElementAriaLabel=function(){var e=""+(this.value?this.value:this.localizationService.get("colorPickerNoColor"));this.renderer.setAttribute(this.host.nativeElement,"aria-label",e)},e.prototype.handleClasses=function(e,t){var n=this.host.nativeElement,i=j("picker",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},e.prototype.popupBlurInvalid=function(e){var t=this,n=this.popupRef.popupElement.contains(e.relatedTarget);return Object(d.closest)(e.relatedTarget,(function(e){return e===t.host.nativeElement}))||n},e.prototype.toggleWithEvents=function(e){var t,n=this.isOpen===e;this.disabled||this.readonly||n||(e?(t=new vt,this.open.emit(t)):(t=new gt,this.close.emit(t)),t.isDefaultPrevented()||this.toggle(e),e&&this.focusFirstElement())},e.prototype.focusFirstElement=function(){var e=this;this.ngZone.onStable.pipe(Object(s.take)(1)).subscribe((function(){if(e.flatColorPicker){var t=e.flatColorPicker.gradient;(t?t.gradientDragHandle:e.flatColorPicker.palette.host).nativeElement.focus()}}))},e.prototype.openPopup=function(){var e=this,t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.activeColor,animate:this.popupSettings.animate,appendTo:this.popupSettings.appendTo,popupAlign:i,anchorAlign:n,popupClass:"k-colorpicker-popup",content:this.popupTemplate,positionMode:"absolute"}),this.popupRef.popupAnchorViewportLeave.subscribe((function(){e.toggleWithEvents(!1),e.isOpen||e.host.nativeElement.focus({preventScroll:!0})}))},e.prototype.closePopup=function(){this.isOpen&&(this.popupRef.close(),this.popupRef=null)},Object.defineProperty(e.prototype,"firstFocusableElement",{get:function(){if(!this.flatColorPicker.header||this.views.length<=1&&!this.flatColorPicker.clearButton){var e=this.flatColorPicker.gradient;return e?e.gradientDragHandle:this.flatColorPicker.palette.host}return this.views.length>1?this.flatColorPicker.header.viewButtonsCollection.toArray()[0]:this.flatColorPicker.header.clearButtonElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastFocusableElement",{get:function(){if(this.preview)return this.flatColorPicker.footer.lastButton;if(this.flatColorPicker.palette)return this.flatColorPicker.palette.host;var e=this.flatColorPicker.gradient,t=e&&e.inputs;return e&&t&&"hex"===t.formatView?t.hexInput:this.gradientSettings.opacity?t.opacityInput.numericInput:t.blueInput},enumerable:!0,configurable:!0}),e.prototype.handleDomEvents=function(e,t){var n=this,i=this.host.nativeElement;t.forEach((function(t){return i[e+"EventListener"](t,n.domFocusListener,!0)}))},e.prototype.initDomEvents=function(){var e=this;if(this.host){var t=this.host.nativeElement;this.ngZone.runOutsideAngular((function(){e.subscriptions.add(e.renderer.listen(t,"focusin",(function(){e.handleWrapperFocus()}))),e.subscriptions.add(e.renderer.listen(t,"focusout",(function(t){var n=!!e.popupRef&&Object(d.closest)(t.relatedTarget,(function(t){return t===e.flatColorPicker.host.nativeElement})),i=Object(d.closest)(t.relatedTarget,(function(t){return t===e.host.nativeElement}));n||i||e.handleWrapperBlur()}))),e.handleDomEvents("add",Vt),e.subscriptions.add(e.renderer.listen(t,"keydown",(function(t){e.handleWrapperKeyDown(t)}))),e.subscriptions.add(e.renderer.listen(t,"click",(function(t){e.ngZone.run((function(){e.handleWrapperClick(t)}))})))}))}},e.prototype.handleHostId=function(){var e=this.host.nativeElement,t=e.getAttribute("id");if(t)this.focusableId=t;else{var n="k-"+Object(d.guid)();e.setAttribute("id",n),this.focusableId=n}},Object(i.__decorate)([Object(o.HostBinding)("class.k-colorpicker"),Object(o.HostBinding)("class.k-icon-picker"),Object(o.HostBinding)("class.k-picker"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-focus"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"focusedClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-disabled"),Object(o.HostBinding)("class.k-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-readonly"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaReadonly",null),Object(i.__decorate)([Object(o.HostBinding)("attr.aria-expanded"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"ariaExpanded",null),Object(i.__decorate)([Object(o.HostBinding)("attr.tabindex"),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"hostTabindex",null),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Array)],e.prototype,"views",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"view",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"activeView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"format",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"paletteSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object),Object(i.__metadata)("design:paramtypes",[Object])],e.prototype,"gradientSettings",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"icon",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"iconClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Number),Object(i.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"preview",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"actionsLayout",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"open",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"close",void 0),Object(i.__decorate)([Object(o.Output)("focus"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onFocus",void 0),Object(i.__decorate)([Object(o.Output)("blur"),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"onBlur",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"cancel",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"activeColorClick",void 0),Object(i.__decorate)([Object(o.Output)(),Object(i.__metadata)("design:type",o.EventEmitter)],e.prototype,"activeViewChange",void 0),Object(i.__decorate)([Object(o.ViewChild)("container",{read:o.ViewContainerRef,static:!0}),Object(i.__metadata)("design:type",o.ViewContainerRef)],e.prototype,"container",void 0),Object(i.__decorate)([Object(o.ViewChild)("activeColor",{static:!0}),Object(i.__metadata)("design:type",o.ElementRef)],e.prototype,"activeColor",void 0),Object(i.__decorate)([Object(o.ViewChild)("popupTemplate",{static:!0}),Object(i.__metadata)("design:type",o.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(i.__decorate)([Object(o.ViewChild)("flatColorPicker",{static:!1}),Object(i.__metadata)("design:type",Lt)],e.prototype,"flatColorPicker",void 0),e=t=Object(i.__decorate)([Object(o.Component)({exportAs:"kendoColorPicker",selector:"kendo-colorpicker",providers:[{multi:!0,provide:r.NG_VALUE_ACCESSOR,useExisting:Object(o.forwardRef)((function(){return t}))},{provide:d.KendoInput,useExisting:Object(o.forwardRef)((function(){return t}))},ut,{provide:c.LocalizationService,useExisting:ut},{provide:c.L10N_PREFIX,useValue:"kendo.colorpicker"}],template:'\n <ng-container kendoColorPickerLocalizedMessages\n i18n-colorPickerNoColor="kendo.colorpicker.colorPickerNoColor|The aria-label applied to the ColorPicker component when the value is empty."\n colorPickerNoColor="Colorpicker no color chosen"\n i18n-flatColorPickerNoColor="kendo.colorpicker.flatColorPickerNoColor|The aria-label applied to the FlatColorPicker component when the value is empty."\n flatColorPickerNoColor="Flatcolorpicker no color chosen"\n i18n-colorGradientNoColor="kendo.colorpicker.colorGradientNoColor|The aria-label applied to the ColorGradient component when the value is empty."\n colorGradientNoColor="Colorgradient no color chosen"\n i18n-colorPaletteNoColor="kendo.colorpicker.colorPaletteNoColor|The aria-label applied to the ColorPalette component when the value is empty."\n colorPaletteNoColor="Colorpalette no color chosen"\n i18n-colorGradientHandle="kendo.colorpicker.colorGradientHandle|The title for the gradient color drag handle chooser."\n colorGradientHandle="Choose color"\n i18n-clearButton="kendo.colorpicker.clearButton|The title for the clear button."\n clearButton="Clear value"\n i18n-hueSliderHandle="kendo.colorpicker.hueSliderHandle|The title for the hue slider handle."\n hueSliderHandle="Set hue"\n i18n-opacitySliderHandle="kendo.colorpicker.opacitySliderHandle|The title for the opacity slider handle."\n opacitySliderHandle="Set opacity"\n i18n-contrastRatio="kendo.colorpicker.contrastRatio|The contrast ratio message for the contrast tool."\n contrastRatio="Contrast ratio"\n i18n-previewColor="kendo.colorpicker.previewColor|The message for the color preview pane."\n previewColor="Color preview"\n i18n-revertSelection="kendo.colorpicker.revertSelection|The message for the selected color pane."\n revertSelection="Revert selection"\n i18n-gradientView="kendo.colorpicker.gradientView|The message for the gradient view button."\n gradientView="Gradient view"\n i18n-paletteView="kendo.colorpicker.paletteView|The message for the palette view button."\n paletteView="Palette view"\n i18n-formatButton="kendo.colorpicker.formatButton|The message for the input format toggle button."\n formatButton="Change color format"\n i18n-applyButton="kendo.colorpicker.applyButton|The message for the Apply action button."\n applyButton="Apply"\n i18n-cancelButton="kendo.colorpicker.cancelButton|The message for the Cancel action button."\n cancelButton="Cancel">\n </ng-container>\n <span #activeColor class="k-input-inner">\n <span\n class="k-value-icon k-color-preview"\n [ngClass]="{\'k-icon-color-preview\': iconStyles, \'k-no-color\': !value}">\n <span *ngIf="iconClass || icon" class="k-color-preview-icon k-icon" [ngClass]="iconStyles"></span>\n <span class="k-color-preview-mask" [style.background-color]="value"></span>\n </span>\n </span>\n <button\n tabindex="-1"\n type="button"\n class="k-input-button k-button k-button-md k-button-solid k-button-solid-base k-icon-button">\n <span class="k-button-icon k-icon k-i-arrow-s"></span>\n </button>\n <ng-template #popupTemplate>\n <kendo-flatcolorpicker\n #flatColorPicker\n [value]="value"\n [format]="format"\n [views]="views"\n [activeView]="activeView"\n [actionsLayout]="actionsLayout"\n [preview]="preview"\n [gradientSettings]="gradientSettings"\n [paletteSettings]="paletteSettings"\n [clearButton]="clearButton"\n (cancel)="handleCancelEvent($event)"\n (focusout)="handlePopupBlur($event)"\n (valueChange)="handleValueChange($event)"\n (keydown)="handlePopupKeyDown($event)"\n (activeViewChange)="activeViewChange.emit($event)"\n (actionButtonClick)="togglePopup()">\n </kendo-flatcolorpicker>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,f.PopupService,o.ChangeDetectorRef,c.LocalizationService,o.NgZone,o.Renderer2])],e)}(),Kt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(i.__extends)(t,e),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"colorPaletteNoColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"colorGradientNoColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"flatColorPickerNoColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"colorPickerNoColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"colorGradientHandle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"clearButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"hueSliderHandle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"opacitySliderHandle",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"hexInputPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"redInputPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"greenInputPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"blueInputPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"alphaInputPlaceholder",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"passContrast",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"failContrast",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"contrastRatio",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"previewColor",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"revertSelection",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"gradientView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"paletteView",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"formatButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"applyButton",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],t.prototype,"cancelButton",void 0),t}(c.ComponentMessages),$t=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(i.__decorate)([Object(o.Component)({providers:[{provide:Kt,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"kendo-colorpicker-messages, kendo-flatcolorpicker-messages, kendo-colorgradient-messages, kendo-colorpalette-messages",template:""}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(Kt),Wt=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(i.__extends)(t,e),n=t,t=n=Object(i.__decorate)([Object(o.Directive)({providers:[{provide:Kt,useExisting:Object(o.forwardRef)((function(){return n}))}],selector:"[kendoColorPickerLocalizedMessages], [kendoFlatColorPickerLocalizedMessages], [kendoColorGradientLocalizedMessages], [kendoColorPaletteLocalizedMessages]"}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],t)}(Kt),Ut=function(){function e(e,t){this.host=e,this.ngZone=t}return e.prototype.ngAfterContentInit=function(){this.focusOnNextTick()},e.prototype.focusOnNextTick=function(){var e=this;this.ngZone.runOutsideAngular((function(){return setTimeout((function(){return e.host.nativeElement.focus()}))}))},e=Object(i.__decorate)([Object(o.Directive)({selector:"[kendoFocusOnDomReady]"}),Object(i.__metadata)("design:paramtypes",[o.ElementRef,o.NgZone])],e)}(),Gt=function(){function e(e){this.localization=e}return Object.defineProperty(e.prototype,"passMessage",{get:function(){return this.localization.get("passContrast")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"failMessage",{get:function(){return this.localization.get("failContrast")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrastText",{get:function(){var e="AA"===this.type?4.5:7;return this.type+": "+e.toFixed(1)},enumerable:!0,configurable:!0}),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"type",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Boolean)],e.prototype,"pass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoContrastValidation]",template:'\n <span>{{contrastText}}</span>\n <ng-container *ngIf="value">\n <span class="k-contrast-validation k-text-success" *ngIf="pass">\n {{passMessage}}\n <span class="k-icon k-i-check"></span>\n </span>\n <span class="k-contrast-validation k-text-error" *ngIf="!pass">\n {{failMessage}}\n <span class="k-icon k-i-close"></span>\n </span>\n </ng-container>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],e)}(),Zt=function(){function e(e){this.localization=e}return Object.defineProperty(e.prototype,"formatedRatio",{get:function(){return this.contrastRatio.toFixed(2)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrastRatioText",{get:function(){return this.localization.get("contrastRatio")+": "+(this.value?this.formatedRatio:"n/a")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"satisfiesAACondition",{get:function(){return this.contrastRatio>=4.5},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"satisfiesAAACondition",{get:function(){return this.contrastRatio>=7},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"contrastRatio",{get:function(){return xt(Ot(this.value),Ot(this.ratio))},enumerable:!0,configurable:!0}),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"value",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"ratio",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoContrastTool]",template:'\n <div class="k-contrast-ratio">\n <span class="k-contrast-ratio-text">{{contrastRatioText}}</span>\n <ng-container *ngIf="value">\n <span class="k-contrast-validation k-text-success" *ngIf="satisfiesAACondition">\n <span class="k-icon k-i-check"></span>\n <span class="k-icon k-i-check" *ngIf="satisfiesAAACondition"></span>\n </span>\n <span class="k-contrast-validation k-text-error" *ngIf="!satisfiesAACondition">\n <span class="k-icon k-i-close"></span>\n </span>\n </ng-container>\n </div>\n <div kendoContrastValidation\n type="AA"\n [value]="value"\n [pass]="satisfiesAACondition">\n </div>\n <div kendoContrastValidation\n type="AAA"\n [value]="value"\n [pass]="satisfiesAAACondition">\n </div>\n '}),Object(i.__metadata)("design:paramtypes",[c.LocalizationService])],e)}(),qt=function(){function e(){this.hostClass=!0}return e.prototype.ngAfterViewInit=function(){var e=this;this.metrics=this.wrapper.getBoundingClientRect(),this.oldA=this.hsva.value.a,this.oldH=this.hsva.value.h,this.hsva.subscribe((function(t){t.h===e.oldH&&t.a===e.oldA||(e.oldH=t.h,e.oldA=t.a,e.setPaths())}))},e.prototype.ngOnChanges=function(e){m(e.backgroundColor)&&this.metrics&&this.setPaths()},e.prototype.setPaths=function(){var e,t,n=(t=Et,e=function(e,n,i,o){var r=t(n||e,i||e),a=r.angle+(o?Math.PI:0),s=.1*r.length;return[e[0]+Math.cos(a)*s,e[1]+Math.sin(a)*s]},function(t,n,i){var o=e(i[n-1],i[n-2],t),r=o[0],a=o[1],s=e(t,i[n-1],i[n+1],!0);return"C "+r+","+a+" "+s[0]+","+s[1]+" "+t[0]+","+t[1]});this.paths=[It(this.getPaths(4.5,16),n),It(this.getPaths(4.5,16,!0),n),It(this.getPaths(7,16),n),It(this.getPaths(7,16,!0),n)]},e.prototype.findValue=function(e,t,n,i,o){var r=(n+i)/2,a=Object.assign({},this.hsva.value,{s:t/this.metrics.width,v:1-r/this.metrics.height}),s=xt(Ot(jt(a)),Ot(this.backgroundColor||""));return n+.5>i?s<e+1&&s>e-1?r:null:o(s,e)?this.findValue(e,t,n,i-(i-n)/2,o):this.findValue(e,t,n+(i-n)/2,i,o)},e.prototype.getPaths=function(e,t,n){void 0===n&&(n=!1);for(var i=[],o=0;o<=this.metrics.width;o+=this.metrics.width/t){var r=this.findValue(e,o,0,this.metrics.height,n?function(e,t){return e<t}:function(e,t){return e>t});null!==r&&i.push([o,r])}return i},Object(i.__decorate)([Object(o.HostBinding)("class.k-color-contrast-svg"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",Object)],e.prototype,"wrapper",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",a.BehaviorSubject)],e.prototype,"hsva",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"backgroundColor",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"[kendoColorContrastSvg]",template:'\n <svg:path *ngFor="let path of paths" [attr.d]="path" fill="none" stroke="white" stroke-width="1"></svg:path>\n '})],e)}(),Jt=[Ht,Rt,Pt,Lt,Wt,$t],Xt=[Dt,Ut,Zt,Gt,Ft,Nt,qt],Yt=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Jt,Xt],exports:[Jt],imports:[Ne,qe,h.CommonModule,f.PopupModule,d.DraggableModule]})],e)}(),Qt=function(){function e(e,t){this.renderer=e,this.hostElement=t,this.kendoClass=!0,this._size="medium",this._rounded="medium"}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.handleClasses(e,"rounded"),this._rounded=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;["size","rounded"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("checkbox",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.HostBinding)("class.k-checkbox"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"kendoClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),e=Object(i.__decorate)([Object(o.Directive)({selector:"input[kendoCheckBox]"}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef])],e)}(),en=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[Qt],exports:[Qt],imports:[h.CommonModule]})],e)}(),tn=function(){function e(e,t){this.renderer=e,this.hostElement=t,this.kendoClass=!0,this._size="medium",Object(l.validatePackage)(ee)}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.handleClasses(e,"size"),this._size=e},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;["size"].forEach((function(t){e.handleClasses(e[t],t)}))},e.prototype.handleClasses=function(e,t){var n=this.hostElement.nativeElement,i=j("radio",t,this[t],e);i.toRemove&&this.renderer.removeClass(n,i.toRemove),i.toAdd&&this.renderer.addClass(n,i.toAdd)},Object(i.__decorate)([Object(o.HostBinding)("class.k-radio"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"kendoClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),e=Object(i.__decorate)([Object(o.Directive)({selector:"input[kendoRadioButton]"}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,o.ElementRef])],e)}(),nn=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[tn],exports:[tn],imports:[h.CommonModule]})],e)}(),on=0,rn=function(){function e(){this.hostClass=!0,this.align="start",this.id="kendo-error-"+on++,this.roleAttribute="alert"}return Object.defineProperty(e.prototype,"startClass",{get:function(){return"start"===this.align},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endClass",{get:function(){return"end"===this.align},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"idAttribute",{get:function(){return this.id},enumerable:!0,configurable:!0}),Object(i.__decorate)([Object(o.HostBinding)("class.k-form-error"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"align",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.role"),Object(i.__metadata)("design:type",String)],e.prototype,"roleAttribute",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-text-start"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"startClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-text-end"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"endClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.id"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"idAttribute",null),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-formerror",template:"\n <ng-content></ng-content>\n "})],e)}(),an=0,sn=function(){function e(){this.align="start",this.id="kendo-hint-"+an++,this.hostClass=!0}return Object.defineProperty(e.prototype,"startClass",{get:function(){return"start"===this.align},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"endClass",{get:function(){return"end"===this.align},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"idAttribute",{get:function(){return this.id},enumerable:!0,configurable:!0}),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"align",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-form-hint"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-text-start"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"startClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-text-end"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"endClass",null),Object(i.__decorate)([Object(o.HostBinding)("attr.id"),Object(i.__metadata)("design:type",String),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"idAttribute",null),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-formhint",template:"\n <ng-content></ng-content>\n "})],e)}(),cn=function(){function e(e,t,n){var i=this;this.renderer=e,this.localizationService=t,this.hostElement=n,this.hostClass=!0,this.showHints="initial",this.orientation="vertical",this.showErrors="initial",this.subscriptions=new a.Subscription,this.rtl=!1,Object(l.validatePackage)(ee),this.subscriptions.add(this.localizationService.changes.subscribe((function(e){var t=e.rtl;i.rtl=t,i.direction=i.rtl?"rtl":"ltr"})))}return Object.defineProperty(e.prototype,"errorClass",{get:function(){return!!this.control&&(this.control.invalid&&(this.control.touched||this.control.dirty))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return!!this.control&&(!this.isRadioControl(this.control)&&(this.disabledControl()||this.disabledElement()||this.disabledKendoInput()))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formControls",{set:function(e){this.validateFormControl(e),this.control=e.first},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"horizontal",{get:function(){return"horizontal"===this.orientation},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasHints",{get:function(){return"always"===this.showHints||this.showHintsInitial()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasErrors",{get:function(){return"always"===this.showErrors||this.showErrorsInitial()},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){this.setDescription()},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.disabledKendoInput=function(){return this.kendoInput&&this.kendoInput.disabled},e.prototype.disabledControl=function(){return this.control.disabled},e.prototype.disabledElement=function(){return this.controlElementRefs.toArray().every((function(e){return e.nativeElement.hasAttribute("disabled")}))},e.prototype.validateFormControl=function(e){if(Object(o.isDevMode)()&&1!==e.length&&!this.isControlGroup(e))throw new Error("The `kendo-formfield` component should contain only one control of type NgControl with a formControlName(https://angular.io/api/forms/FormControlName)or an ngModel(https://angular.io/api/forms/NgModel) binding.")},e.prototype.isControlGroup=function(e){var t=this;if(!e.length)return!1;var n=e.first.name;return e.toArray().every((function(e){return e.name===n&&t.isRadioControl(e)}))},e.prototype.isRadioControl=function(e){return e.valueAccessor instanceof r.RadioControlValueAccessor},e.prototype.updateDescription=function(){var e=this,t=this.findControlElements();t&&t.forEach((function(t){if(e.errorChildren.length>0||e.hintChildren.length>0){var n=e.generateDescriptionIds(t);e.renderer.setAttribute(t,"aria-describedby",n)}}))},e.prototype.findControlElements=function(){if(this.controlElementRefs)return this.kendoInput&&this.kendoInput.focusableId&&Object(d.isDocumentAvailable)()?[this.hostElement.nativeElement.querySelector("#"+this.kendoInput.focusableId)]:this.controlElementRefs.map((function(e){return e.nativeElement}))},e.prototype.generateDescriptionIds=function(e){var t=new Set;e.hasAttribute("aria-describedby")&&e.getAttribute("aria-describedby").split(" ").forEach((function(e){e.includes("kendo-hint-")||e.includes("kendo-error-")||t.add(e)}));return this.hintChildren.forEach((function(e){t.add(e.id)})),this.errorChildren.forEach((function(e){t.add(e.id)})),Array.from(t).join(" ")},e.prototype.showHintsInitial=function(){if(!this.control)return!0;var e=this.control,t=e.valid,n=e.untouched,i=e.pristine;return t||n&&i},e.prototype.showErrorsInitial=function(){if(!this.control)return!1;var e=this.control,t=e.invalid,n=e.dirty,i=e.touched;return t&&(n||i)},e.prototype.setDescription=function(){var e=this;this.updateDescription(),this.subscriptions.add(this.errorChildren.changes.subscribe((function(){return e.updateDescription()}))),this.subscriptions.add(this.hintChildren.changes.subscribe((function(){return e.updateDescription()})))},Object(i.__decorate)([Object(o.HostBinding)("class.k-form-field"),Object(i.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(i.__decorate)([Object(o.HostBinding)("attr.dir"),Object(i.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(i.__decorate)([Object(o.HostBinding)("class.k-form-field-error"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"errorClass",null),Object(i.__decorate)([Object(o.HostBinding)("class.k-form-field-disabled"),Object(i.__metadata)("design:type",Boolean),Object(i.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(i.__decorate)([Object(o.ContentChildren)(r.NgControl,{descendants:!0}),Object(i.__metadata)("design:type",o.QueryList),Object(i.__metadata)("design:paramtypes",[o.QueryList])],e.prototype,"formControls",null),Object(i.__decorate)([Object(o.ContentChildren)(r.NgControl,{read:o.ElementRef,descendants:!0}),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"controlElementRefs",void 0),Object(i.__decorate)([Object(o.ContentChild)(d.KendoInput,{static:!0}),Object(i.__metadata)("design:type",Object)],e.prototype,"kendoInput",void 0),Object(i.__decorate)([Object(o.ContentChildren)(rn,{descendants:!0}),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"errorChildren",void 0),Object(i.__decorate)([Object(o.ContentChildren)(sn,{descendants:!0}),Object(i.__metadata)("design:type",o.QueryList)],e.prototype,"hintChildren",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"showHints",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"orientation",void 0),Object(i.__decorate)([Object(o.Input)(),Object(i.__metadata)("design:type",String)],e.prototype,"showErrors",void 0),e=Object(i.__decorate)([Object(o.Component)({selector:"kendo-formfield",template:'\n <ng-content select="label, kendo-label"></ng-content>\n <div [class.k-form-field-wrap]="horizontal">\n <ng-content></ng-content>\n <ng-content select="kendo-formhint" *ngIf="hasHints"></ng-content>\n <ng-content select="kendo-formerror" *ngIf="hasErrors"></ng-content>\n </div>\n ',providers:[c.LocalizationService,{provide:c.L10N_PREFIX,useValue:"kendo.formfield"}]}),Object(i.__metadata)("design:paramtypes",[o.Renderer2,c.LocalizationService,o.ElementRef])],e)}(),dn=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({declarations:[sn,rn,cn],exports:[sn,rn,cn],imports:[h.CommonModule]})],e)}(),ln=function(){function e(){}return e=Object(i.__decorate)([Object(o.NgModule)({exports:[pt,at,Ne,Ke,Ge,qe,Je,Yt,en,nn,dn],imports:[h.CommonModule]})],e)}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=function(e){function t(t,n,i,o,r){var a=e.call(this,t,n,i,o,r)||this;return a.dialog=t,a.button=n,a.editor=i,a.localization=o,a.toolsService=r,a}return i.__extends(t,e),t.prototype.clickHandler=function(){this.editor.openDialog(this.dialog)},t.prototype.onStateChange=function(e){this.button.selected=e[this.command].selected,this.button.disabled=e[this.command].disabled},t}(n(43).EditorCommandBase);t.EditorCommandDialog=o},function(e,t,n){"use strict";n.r(t),n.d(t,"PopupComponent",(function(){return f.PopupComponent})),n.d(t,"AUTOCOMPLETE_VALUE_ACCESSOR",(function(){return vn})),n.d(t,"COMBOBOX_VALUE_ACCESSOR",(function(){return Gn})),n.d(t,"TOUCH_ENABLED",(function(){return gn})),n.d(t,"DataService",(function(){return an})),n.d(t,"DisabledItemsService",(function(){return sn})),n.d(t,"FilterInputDirective",(function(){return Mi})),n.d(t,"FilterableComponent",(function(){return un})),n.d(t,"ListItemDirective",(function(){return hn})),n.d(t,"CustomMessagesComponent",(function(){return Bi})),n.d(t,"LocalizedMessagesDirective",(function(){return Di})),n.d(t,"Messages",(function(){return Ti})),n.d(t,"NavigationService",(function(){return dn})),n.d(t,"SearchBarComponent",(function(){return Xt})),n.d(t,"SelectionService",(function(){return on})),n.d(t,"TagListComponent",(function(){return Ii})),n.d(t,"NoDataTemplateDirective",(function(){return ln})),n.d(t,"TagTemplateDirective",(function(){return Qn})),n.d(t,"DROPDOWNLIST_VALUE_ACCESSOR",(function(){return Jn})),n.d(t,"BaseCheckDirective",(function(){return Li})),n.d(t,"CheckAllDirective",(function(){return Hi})),n.d(t,"CheckDirective",(function(){return Vi})),n.d(t,"MultiSelectTreeSummaryTagDirective",(function(){return Wi})),n.d(t,"AutoCompleteComponent",(function(){return yn})),n.d(t,"ComboBoxComponent",(function(){return Zn})),n.d(t,"DropDownListComponent",(function(){return Xn})),n.d(t,"MultiSelectComponent",(function(){return ii})),n.d(t,"MultiColumnComboBoxComponent",(function(){return di})),n.d(t,"ComboBoxColumnComponent",(function(){return ai})),n.d(t,"ColumnCellTemplateDirective",(function(){return oi})),n.d(t,"ColumnHeaderTemplateDirective",(function(){return ri})),n.d(t,"DropDownTreeComponent",(function(){return mi})),n.d(t,"MultiSelectTreeComponent",(function(){return Ci})),n.d(t,"DropDownTreeFlatBindingDirective",(function(){return ki})),n.d(t,"DropDownTreeHierarchyBindingDirective",(function(){return wi})),n.d(t,"MultiSelectTreeFlatBindingDirective",(function(){return Si})),n.d(t,"MultiSelectTreeHierarchyBindingDirective",(function(){return xi})),n.d(t,"DropDownTreesExpandDirective",(function(){return Ei})),n.d(t,"DropDownTreesModule",(function(){return Gi})),n.d(t,"NodeTemplateDirective",(function(){return li})),n.d(t,"ItemTemplateDirective",(function(){return Yt})),n.d(t,"GroupTemplateDirective",(function(){return tn})),n.d(t,"FixedGroupTemplateDirective",(function(){return nn})),n.d(t,"CustomItemTemplateDirective",(function(){return Yn})),n.d(t,"HeaderTemplateDirective",(function(){return Qt})),n.d(t,"FooterTemplateDirective",(function(){return en})),n.d(t,"ValueTemplateDirective",(function(){return qn})),n.d(t,"TemplateContextDirective",(function(){return Ni})),n.d(t,"GroupTagTemplateDirective",(function(){return ei})),n.d(t,"SelectableDirective",(function(){return Fi})),n.d(t,"SummaryTagDirective",(function(){return Zi})),n.d(t,"FilterDirective",(function(){return Ai})),n.d(t,"DropDownsModule",(function(){return ro})),n.d(t,"MultiSelectModule",(function(){return oo})),n.d(t,"SharedModule",(function(){return $i})),n.d(t,"AutoCompleteModule",(function(){return Ji})),n.d(t,"ComboBoxModule",(function(){return Qi})),n.d(t,"DropDownListModule",(function(){return to})),n.d(t,"SharedDirectivesModule",(function(){return Ri})),n.d(t,"ListComponent",(function(){return fn})),n.d(t,"PreventableEvent",(function(){return pn})),n.d(t,"RemoveTagEvent",(function(){return ti}));var i,o,r,a=n(0),s=n(1),c=n(2),d=n(10),l=n(13),p=n(14),u=n(3),h=n(5),f=n(16),b=n(4),m=n(8),g=n(12),v=n(26),y=n(23),_={name:"@progress/kendo-angular-treeview",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1645772610,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"},O=function(){function e(){this.changes=new s.EventEmitter}return e.prototype.notify=function(){this.changes.emit()},e}(),j=function(){return!1},C=function(){return"none"},k=function(){return!1},w=function(){return!0},S=function(){return!1},x=function(){return!0},E=function(e,t){return t},I=function(){function e(){this.changes=new h.Subject}return e.prototype.expand=function(e,t){this.changes.next({dataItem:t,index:e,expand:!0})},e.prototype.collapse=function(e,t){this.changes.next({dataItem:t,index:e,expand:!1})},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),T=function(){function e(){this.INDEX_SEPARATOR="_"}return e.prototype.nodeIndex=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=""),""+t+(t?this.INDEX_SEPARATOR:"")+e},e.prototype.indexForLevel=function(e,t){return e.split(this.INDEX_SEPARATOR).slice(0,t).join(this.INDEX_SEPARATOR)},e.prototype.lastLevelIndex=function(e){void 0===e&&(e="");var t=e.split(this.INDEX_SEPARATOR);return t.length?parseInt(t[t.length-1],10):NaN},e.prototype.level=function(e){return e.split(this.INDEX_SEPARATOR).length},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),D=function(){function e(){this.changes=new h.Subject}return e.prototype.notifyLoaded=function(e){this.changes.next(e)},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),B=/^(?:a|input|select|option|textarea|button|object)$/i,P=function(e,t){var n=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return!!n&&n.call(e,t)},A=function(e,t){if(!document.documentElement.contains(e))return null;for(var n=e;null!==n&&1===n.nodeType;){if(P(n,t))return n;n=n.parentElement||n.parentNode}return null},M=function(){},z=function(e){return null!=e},R=function(e){return null==e},F=function(e){return Array.isArray(e)},N=function(e){return"boolean"==typeof e},L=function(e){return Object(c.isDocumentAvailable)()?e.closest?e.closest("li.k-treeview-item"):A(e,"li.k-treeview-item"):null},V=function(e){if(e.tagName){var t=e.tagName.toLowerCase(),n=e.getAttribute("tabIndex"),i="-1"===n,o=null!==n&&!i;return B.test(t)&&(o=!e.disabled&&!i),o}return!1},H=function(e){if(!Object(c.isDocumentAvailable)())return null;for(var t=e;t&&!P(t,".k-treeview-leaf:not(.k-treeview-load-more-button),.k-treeview-item,.k-treeview");)t=t.parentNode;return t?P(t,".k-treeview-leaf:not(.k-treeview-load-more-button)"):void 0},K=function(e){return z(A(e,".k-treeview-leaf.k-treeview-load-more-button"))},$=function(e,t){return Boolean(function(e,t){for(;e&&!t(e);)e=e.parentNode;return e}(e,(function(e){return e===t})))},W=function(e){return e.nativeElement.querySelector('li[tabindex="0"]')},U=function(e){return e?e.getAttribute("data-treeindex"):""},G=function(e){return(e||{}).index},Z=function(e,t){return!z(e)&&!z(t)||z(e)&&z(t)&&e.item.dataItem===t.item.dataItem},q=function(e){return z(e)?e.item.dataItem:e},J=function(e){return e&&Array.isArray(e)&&0!==e.length},X=function(e,t,n,i,o){var r=n.operator,a=n.ignoreCase,s=n.mode;void 0===o&&(o=0);var c="string"==typeof i?i:i[o];e.forEach((function(e){var n=("string"==typeof r?te(c,r,a):r)(e.dataItem,t);e.isMatch=n,e.visible=n,e.containsMatches=!1,n&&Y(e.parent),e.children&&e.children.length>0&&("strict"!==s&&n?Q(e.children):X(e.children,t,{operator:r,ignoreCase:a,mode:s},i,o+1))}))},Y=function(e){z(e)&&(e.containsMatches=!0,e.visible=!0,z(e.parent)&&!e.parent.containsMatches&&Y(e.parent))},Q=function(e){e.forEach((function(e){e.visible=!0,e.children&&Q(e.children)}))},ee={contains:function(e,t){return e.indexOf(t)>=0},doesnotcontain:function(e,t){return-1===e.indexOf(t)},startswith:function(e,t){return 0===e.lastIndexOf(t,0)},doesnotstartwith:function(e,t){return-1===e.lastIndexOf(t,0)},endswith:function(e,t){return e.indexOf(t,e.length-t.length)>=0},doesnotendwith:function(e,t){return e.indexOf(t,e.length-t.length)<0}},te=function(e,t,n){return function(i,o){return function(e,t){return function(n,i){return t?e(n.toLowerCase(),i.toLowerCase()):e(n,i)}}(ee[t],n)(Object(p.d)(e)(i),o)}},ne=function(e,t){return[e,t].filter((function(e){return z(e)})).join("_")},ie=function(e,t){if(!z(e)||0===e.children.length)return[];var n=e.children;return z(t)&&(n=n.filter(t)),n.forEach((function(e){return n=n.concat(ie(e,t))})),n},oe=function(e,t){return e.size===t.size&&Array.from(e).every((function(e){return t.has(e)}))},re=function(e,t){return{small:"k-"+e+"-sm",medium:"k-"+e+"-md",large:"k-"+e+"-lg"}[t]},ae=function(e){return e||{}},se=function(e){return ae(e).children||[]},ce=function(e){if(!Array.isArray(e)||0===e.length)return null;for(var t=e.length-1;t>=0;t-=1){var n=e[t];if(n.visible)return n}return null},de=function(){function e(){this.ib=new T,this.nodes=[]}return e.prototype.firstVisibleNode=function(){return(this.nodes||[]).find((function(e){return e.visible}))},e.prototype.lastVisibleNode=function(){for(var e=ce(this.nodes);z(e)&&se(e).length>0;){var t=se(e),n=ce(t);if(!z(n))return e;e=n}return e},e.prototype.closestNode=function(e){var t=ae(this.findNode(e)).prev||this.firstVisibleNode();return ae(t).index===e?this.visibleSibling(t,1):t},e.prototype.firstFocusableNode=function(){return this.nodes.find((function(e){return!e.disabled&&e.visible}))},e.prototype.findNode=function(e){return this.find(e,this.nodes)},e.prototype.findParent=function(e){var t=this.ib.level(e)-1;return this.findNode(this.ib.indexForLevel(e,t))},e.prototype.findVisibleChild=function(e){var t=this.findNode(e);return se(t).find((function(e){return e.visible}))},e.prototype.findVisiblePrev=function(e){var t=e.index,n=this.findParent(t),i=this.ib.lastLevelIndex(t),o=this.container(n).slice(0,i).every((function(e){return!e.visible}));if(0===i||o)return n;var r=this.findNode(t),a=this.visibleSibling(r,-1);if(a)for(var s=this.container(a);s.length>0&&s.some((function(e){return e.visible}));)a=ce(s),s=this.container(a);return a},e.prototype.findVisibleNext=function(e){var t=this.container(e),n=t.some((function(e){return e.visible}));return 0!==t.length&&n?t.find((function(e){return e.visible})):this.visibleSibling(e,1)},e.prototype.registerItem=function(e,t,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var r=this.ib.level(t),a=this.findParent(t);if(a||1===r){var s={id:e,children:[],index:t,parent:a,disabled:n,loadMoreButton:i,visible:o};this.insert(s,a)}},e.prototype.unregisterItem=function(e,t){var n=this.find(t,this.nodes);if(n&&n.id===e){var i=this.container(n.parent);i.splice(i.indexOf(n),1)}},e.prototype.childLevel=function(e){var t=e.filter((function(e){return z(e)}));return t&&t.length?this.ib.level(t[0].index):1},e.prototype.container=function(e){return e?e.children:this.nodes},e.prototype.find=function(e,t){var n=this.childLevel(t),i=this.ib.indexForLevel(e,n),o=n===this.ib.level(e),r=t.find((function(e){return e&&e.index===i}));return r?o?r:this.find(e,r.children):null},e.prototype.insert=function(e,t){this.container(t).splice(this.ib.lastLevelIndex(e.index),0,e)},e.prototype.visibleSibling=function(e,t){if(!e)return null;for(var n=this.findParent(e.index),i=this.container(n),o=i.indexOf(e)+t,r=i[o];z(r);){if(r.visible)return r;r=i[o+=t]}return this.visibleSibling(n,t)},e}(),le=function(){function e(e){var t,n=this;this.localization=e,this.expands=new h.Subject,this.moves=new h.Subject,this.checks=new h.Subject,this.selects=new h.Subject,this.loadMore=new h.Subject,this.navigable=!0,this.actions=((t={})[c.Keys.ArrowUp]=function(){return n.activate(n.model.findVisiblePrev(n.focusableItem),!0)},t[c.Keys.ArrowDown]=function(){return n.activate(n.model.findVisibleNext(n.focusableItem),!0)},t[c.Keys.ArrowLeft]=function(){return!n.isLoadMoreButton&&n.expand({expand:n.localization.rtl,intercept:n.localization.rtl?n.moveToFirstVisibleChild:n.moveToParent})},t[c.Keys.ArrowRight]=function(){return!n.isLoadMoreButton&&n.expand({expand:!n.localization.rtl,intercept:n.localization.rtl?n.moveToParent:n.moveToFirstVisibleChild})},t[c.Keys.Home]=function(){return n.activate(n.model.firstVisibleNode(),!0)},t[c.Keys.End]=function(){return n.activate(n.model.lastVisibleNode(),!0)},t[c.Keys.Enter]=function(){return n.handleEnter()},t[c.Keys.Space]=function(){return n.handleSpace()},t),this.isFocused=!1,this.shouldScroll=!1,this._model=new de,this.moveToFirstVisibleChild=this.moveToFirstVisibleChild.bind(this),this.moveToParent=this.moveToParent.bind(this)}return Object.defineProperty(e.prototype,"model",{get:function(){return this._model},set:function(e){this._model=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeIndex",{get:function(){return G(this.activeItem)||null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isActiveExpanded",{get:function(){return this.activeItem&&this.activeItem.children.length>0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoadMoreButton",{get:function(){return this.activeItem&&this.activeItem.loadMoreButton},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focusableItem",{get:function(){return this.activeItem||this.model.firstFocusableNode()},enumerable:!0,configurable:!0}),e.prototype.activate=function(e,t){void 0===t&&(t=!1),this.navigable&&e&&!this.isActive(G(e))&&(this.isFocused=!0,this.activeItem=e||this.activeItem,this.shouldScroll=t,this.notifyMove())},e.prototype.activateParent=function(e){this.activate(this.model.findParent(e))},e.prototype.activateIndex=function(e){e&&this.activate(this.model.findNode(e))},e.prototype.activateClosest=function(e){e&&G(this.focusableItem)===e&&(this.activeItem=this.model.closestNode(e),this.notifyMove())},e.prototype.activateFocusable=function(){this.activeItem||(this.activeItem=this.model.firstVisibleNode(),this.notifyMove())},e.prototype.deactivate=function(){this.navigable&&this.isFocused&&(this.isFocused=!1,this.notifyMove())},e.prototype.checkIndex=function(e){this.isDisabled(e)||this.checks.next(e)},e.prototype.selectIndex=function(e){this.isDisabled(e)||this.selects.next(e)},e.prototype.notifyLoadMore=function(e){z(e)&&this.loadMore.next(e)},e.prototype.isActive=function(e){return!!e&&(this.isFocused&&this.activeIndex===e)},e.prototype.isFocusable=function(e){return G(this.focusableItem)===e},e.prototype.isDisabled=function(e){return this.model.findNode(e).disabled},e.prototype.registerItem=function(e,t,n,i,o){void 0===i&&(i=!1),void 0===o&&(o=!0);var r=this.model.findNode(t);z(r)&&(this.model.unregisterItem(r.id,r.index),this.isActive(t)&&this.deactivate()),this.model.registerItem(e,t,n,i,o)},e.prototype.unregisterItem=function(e,t){this.isActive(t)&&this.activateParent(t),this.model.unregisterItem(e,t)},e.prototype.move=function(e){if(this.navigable){var t=this.actions[e.keyCode];t&&(t(),e.preventDefault())}},e.prototype.expand=function(e){var t=e.expand,n=e.intercept,i=G(this.activeItem);i&&!n(i)&&this.notifyExpand(t)},e.prototype.moveToParent=function(){return!this.isActiveExpanded&&(this.activate(this.model.findParent(G(this.activeItem))),!0)},e.prototype.moveToFirstVisibleChild=function(){return!!this.isActiveExpanded&&(this.activate(this.model.findVisibleChild(G(this.activeItem))),!0)},e.prototype.notifyExpand=function(e){this.expands.next(this.navigationState(e))},e.prototype.notifyMove=function(){this.moves.next(this.navigationState())},e.prototype.navigationState=function(e){return void 0===e&&(e=!1),{expand:e,index:this.activeIndex,isFocused:this.isFocused,shouldScroll:this.shouldScroll}},e.prototype.handleEnter=function(){this.navigable&&(this.isLoadMoreButton?this.notifyLoadMore(this.activeIndex):this.selectIndex(this.activeIndex))},e.prototype.handleSpace=function(){this.navigable&&(this.isLoadMoreButton?this.notifyLoadMore(this.activeIndex):this.checkIndex(this.activeIndex))},e=Object(a.__decorate)([Object(s.Injectable)(),Object(a.__metadata)("design:paramtypes",[u.LocalizationService])],e)}(),pe=function(){function e(){this.changes=new h.Subject}return e.prototype.childrenLoaded=function(e,t){this.changes.next({item:e,children:t})},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),ue=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewNodeTemplate]"}),Object(a.__param)(0,Object(s.Optional)()),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),he=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewLoadMoreButtonTemplate]"}),Object(a.__param)(0,Object(s.Optional)()),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),fe=function(){function e(){}return e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),be=function(){function e(){}return e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),me=function(){function e(){this.changes=new h.Subject}return e.prototype.isFirstSelected=function(e){return this.firstIndex===e},e.prototype.setFirstSelected=function(e,t){this.firstIndex===e&&!1===t?this.firstIndex=null:!this.firstIndex&&t&&(this.firstIndex=e)},e.prototype.select=function(e,t){this.changes.next({dataItem:t,index:e})},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),ge=/\d+$/,ve=function(){function e(){this.map=new Map}return e.prototype.reset=function(){this.map.clear()},e.prototype.registerItem=function(e,t){var n={children:[],item:e,parent:this.item(G(t))};this.map.set(e.index,n)},e.prototype.registerChildren=function(e,t){var n=this.item(e);n&&(n.children=t)},e.prototype.unregisterItem=function(e,t){var n=this.item(e);n&&n.item.dataItem===t&&(this.map.delete(e),n.parent&&n.parent.children&&(n.parent.children=n.parent.children.filter((function(e){return e.dataItem!==t}))))},e.prototype.replaceItem=function(e,t,n){t&&(this.unregisterItem(e,t.dataItem),this.registerItem(t,n),this.addToParent(t,n))},e.prototype.itemLookup=function(e){var t=this.item(e);return t?{children:this.mapChildren(t.children),item:t.item,parent:t.parent}:null},e.prototype.hasItem=function(e){return this.map.has(e)},e.prototype.item=function(e){return this.map.get(e)||null},e.prototype.addToParent=function(e,t){if(t){var n=this.item(t.index),i=parseInt(ge.exec(e.index)[0],10);n.children=n.children||[],n.children.splice(i,0,e)}},e.prototype.mapChildren=function(e){var t=this;return void 0===e&&(e=[]),e.map((function(e){var n=t.item(e.index),i=n.item,o=n.parent,r=n.children;return{children:t.mapChildren(r),item:i,parent:o}}))},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),ye=[I,T,ve,D,pe,le,me,O,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.treeview"},{provide:fe,useExisting:Object(s.forwardRef)((function(){return _e}))},{provide:be,useExisting:Object(s.forwardRef)((function(){return _e}))}],_e=function(){function e(e,t,n,i,o,r,a,c,d,p,u){var f=this;this.element=e,this.changeDetectorRef=t,this.expandService=n,this.navigationService=i,this.nodeChildrenService=o,this.selectionService=r,this.treeViewLookupService=a,this.ngZone=c,this.renderer=d,this.dataChangeNotification=p,this.localization=u,this.classNames=!0,this.role="tree",this.filterInputPlaceholder="",this.fetchNodes=function(){return f.data},this.childrenLoaded=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.expand=new s.EventEmitter,this.collapse=new s.EventEmitter,this.nodeDragStart=new s.EventEmitter,this.nodeDrag=new s.EventEmitter,this.filterStateChange=new s.EventEmitter,this.nodeDrop=new s.EventEmitter,this.nodeDragEnd=new s.EventEmitter,this.addItem=new s.EventEmitter,this.removeItem=new s.EventEmitter,this.checkedChange=new s.EventEmitter,this.selectionChange=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.nodeClick=new s.EventEmitter,this.nodeDblClick=new s.EventEmitter,this.trackBy=E,this.isDisabled=k,this.isVisible=x,this.navigable=!0,this.children=function(){return Object(h.of)([])},this.loadOnDemand=!0,this.filterable=!1,this.filter="",this.checkboxes=!1,this.expandIcons=!1,this.selectable=!1,this.touchActions=!0,this.isActive=!1,this.data=new h.BehaviorSubject([]),this._animate=!0,this._size="medium",this.subscriptions=new h.Subscription,this.domSubscriptions=[],Object(l.validatePackage)(_)}return Object.defineProperty(e.prototype,"direction",{get:function(){return this.localization.rtl?"rtl":"ltr"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"animate",{get:function(){return!this._animate},set:function(e){this._animate=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nodeTemplateRef",{get:function(){return this._nodeTemplateRef||this.nodeTemplateQuery},set:function(e){this._nodeTemplateRef=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadMoreButtonTemplateRef",{get:function(){return this._loadMoreButtonTemplateRef||this.loadMoreButtonTemplateQuery},set:function(e){this._loadMoreButtonTemplateRef=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nodes",{get:function(){return this.data.value},set:function(e){this.data.next(e||[]),this.dataChangeNotification.notify()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasChildren",{get:function(){return this._hasChildren||j},set:function(e){this._hasChildren=e,this.expandIcons=Boolean(this._isExpanded&&this._hasChildren)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isChecked",{get:function(){return this._isChecked||C},set:function(e){this._isChecked=e,this.checkboxes=Boolean(this._isChecked)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this._isExpanded||w},set:function(e){this._isExpanded=e,this.expandIcons=Boolean(this._isExpanded&&this._hasChildren)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected||S},set:function(e){this._isSelected=e,this.selectable=Boolean(this._isSelected)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.element.nativeElement,re("treeview",this.size)),e&&this.renderer.addClass(this.element.nativeElement,re("treeview",e)),this._size=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){this.navigationService.navigable=Boolean(this.navigable),Object(c.anyChanged)(["nodes","children","hasChildren","loadOnDemand"],e,!1)&&!this.loadOnDemand&&this.preloadChildNodes()},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe(),this.domSubscriptions.forEach((function(e){return e()}))},e.prototype.ngOnInit=function(){var e=this;this.subscriptions.add(this.nodeChildrenService.changes.subscribe((function(t){return e.childrenLoaded.emit(t)}))),this.subscriptions.add(this.expandService.changes.subscribe((function(t){var n=t.index,i=t.dataItem;return t.expand?e.expand.emit({index:n,dataItem:i}):e.collapse.emit({index:n,dataItem:i})}))),this.subscriptions.add(this.navigationService.checks.subscribe((function(t){return e.checkedChange.emit(e.treeViewLookupService.itemLookup(t))}))),this.subscriptions.add(this.selectionService.changes.subscribe((function(t){Object(c.hasObservers)(e.selectionChange)&&e.ngZone.run((function(){e.selectionChange.emit(t)}))}))),this.element&&this.ngZone.runOutsideAngular((function(){e.attachDomHandlers()})),this.size&&this.renderer.addClass(this.element.nativeElement,re("treeview",this.size))},e.prototype.blur=function(){if(Object(c.isDocumentAvailable)()){var e=W(this.element);document.activeElement===e&&e.blur()}},e.prototype.focus=function(e){var t=e||G(this.navigationService.focusableItem);this.navigationService.activateIndex(t);var n=W(this.element);n&&n.focus()},e.prototype.itemLookup=function(e){return this.treeViewLookupService.itemLookup(e)},e.prototype.rebindChildren=function(){this.dataChangeNotification.notify()},e.prototype.expandNode=function(e,t){this.expandService.expand(t,e)},e.prototype.collapseNode=function(e,t){this.expandService.collapse(t,e)},e.prototype.getNodePageSize=function(e){return this.verifyLoadMoreService(),this.loadMoreService.getGroupSize(e)},e.prototype.setNodePageSize=function(e,t){this.verifyLoadMoreService(),this.loadMoreService.setGroupSize(e,t)},e.prototype.preloadChildNodes=function(){this.treeViewLookupService.reset(),this.registerLookupItems(this.nodes)},e.prototype.attachDomHandlers=function(){var e=this.element.nativeElement;this.clickHandler=this.clickHandler.bind(this),this.domSubscriptions.push(this.renderer.listen(e,"contextmenu",this.clickHandler),this.renderer.listen(e,"click",this.clickHandler),this.renderer.listen(e,"dblclick",this.clickHandler),this.renderer.listen(e,"focusin",this.focusHandler.bind(this)),this.renderer.listen(e,"focusout",this.blurHandler.bind(this)),this.renderer.listen(e,"keydown",this.keydownHandler.bind(this)))},e.prototype.focusHandler=function(e){var t,n=this;P(e.target,".k-treeview-item")?t=e.target:V(e.target)||(t=L(e.target)),t&&(this.navigationService.activateIndex(U(e.target)),!this.isActive&&Object(c.hasObservers)(this.onFocus)&&this.ngZone.run((function(){n.onFocus.emit()})),this.isActive=!0)},e.prototype.blurHandler=function(e){var t=this;!this.isActive||!P(e.target,".k-treeview-item")||e.relatedTarget&&P(e.relatedTarget,".k-treeview-item")&&$(e.relatedTarget,this.element.nativeElement)||(this.navigationService.deactivate(),this.isActive=!1,Object(c.hasObservers)(this.onBlur)&&this.ngZone.run((function(){t.onBlur.emit()})))},e.prototype.clickHandler=function(e){var t=this,n=e.target;if(("contextmenu"!==e.type||Object(c.hasObservers)(this.nodeClick))&&("click"!==e.type||Object(c.hasObservers)(this.nodeClick)||Object(c.hasObservers)(this.selectionChange)||K(n))&&("dblclick"!==e.type||Object(c.hasObservers)(this.nodeDblClick))&&!V(n)&&(H(n)||K(n))&&$(n,this.element.nativeElement)){var i=U(L(n));i&&!this.navigationService.isDisabled(i)&&this.ngZone.run((function(){var n=t.treeViewLookupService.itemLookup(i);if("click"===e.type){if(t.navigationService.model.findNode(i).loadMoreButton)return void t.navigationService.notifyLoadMore(i);t.navigationService.selectIndex(i)}("dblclick"===e.type?t.nodeDblClick:t.nodeClick).emit({item:n.item,originalEvent:e,type:e.type})}))}},e.prototype.keydownHandler=function(e){var t=this;this.isActive&&this.navigable&&this.ngZone.run((function(){t.navigationService.move(e)}))},e.prototype.verifyLoadMoreService=function(){if(Object(s.isDevMode)()&&!z(this.loadMoreService))throw new Error("To use the TreeView paging functionality, you need to assign the `kendoTreeViewLoadMore` directive. See http://www.telerik.com/kendo-angular-ui/components/treeview/load-more-button/.")},e.prototype.registerLookupItems=function(e,t){var n=this;if(void 0===t&&(t=null),z(e)&&0!==e.length){var i=G(t),o=e.map((function(e,t){return function(e,t,n){return z(e)?{dataItem:e,index:ne(n,t)}:null}(e,t,i)}));z(t)&&this.treeViewLookupService.registerChildren(i,o),o.forEach((function(e){n.treeViewLookupService.registerItem(e,t),n.hasChildren(e.dataItem)&&n.children(e.dataItem).subscribe((function(t){return n.registerLookupItems(t,e)}))}))}},Object(a.__decorate)([Object(s.HostBinding)("class.k-treeview"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"classNames",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.role"),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"direction",null),Object(a.__decorate)([Object(s.ViewChild)("assetsContainer",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"assetsContainer",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"filterInputPlaceholder",void 0),Object(a.__decorate)([Object(s.Input)(),Object(s.HostBinding)("@.disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"animate",null),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"childrenLoaded",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"expand",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"collapse",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeDragStart",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeDrag",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterStateChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeDrop",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeDragEnd",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"addItem",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"removeItem",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"checkedChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"selectionChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeClick",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeDblClick",void 0),Object(a.__decorate)([Object(s.ContentChild)(ue,{static:!1}),Object(a.__metadata)("design:type",ue)],e.prototype,"nodeTemplateQuery",void 0),Object(a.__decorate)([Object(s.Input)("nodeTemplate"),Object(a.__metadata)("design:type",ue),Object(a.__metadata)("design:paramtypes",[ue])],e.prototype,"nodeTemplateRef",null),Object(a.__decorate)([Object(s.ContentChild)(he,{static:!1}),Object(a.__metadata)("design:type",he)],e.prototype,"loadMoreButtonTemplateQuery",void 0),Object(a.__decorate)([Object(s.Input)("loadMoreButtonTemplate"),Object(a.__metadata)("design:type",he),Object(a.__metadata)("design:paramtypes",[he])],e.prototype,"loadMoreButtonTemplateRef",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"trackBy",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"nodes",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"hasChildren",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isChecked",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isDisabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isExpanded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isSelected",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isVisible",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"navigable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"children",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"filter",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),e=Object(a.__decorate)([Object(s.Component)({changeDetection:s.ChangeDetectionStrategy.Default,exportAs:"kendoTreeView",providers:ye,selector:"kendo-treeview",template:'\n <span\n class="k-treeview-filter"\n *ngIf="filterable"\n >\n <kendo-textbox\n [size]="size"\n [value]="filter"\n [clearButton]="true"\n (valueChange)="filterChange.emit($event)"\n [placeholder]="filterInputPlaceholder"\n >\n <ng-template kendoTextBoxPrefixTemplate>\n <span class="k-input-icon k-icon k-i-search"></span>\n </ng-template>\n </kendo-textbox>\n </span>\n <ul class="k-treeview-lines"\n kendoTreeViewGroup\n role="group"\n [size]="size"\n [loadOnDemand]="loadOnDemand"\n [checkboxes]="checkboxes"\n [expandIcons]="expandIcons"\n [selectable]="selectable"\n [touchActions]="touchActions"\n [children]="children"\n [hasChildren]="hasChildren"\n [isChecked]="isChecked"\n [isDisabled]="isDisabled"\n [isExpanded]="isExpanded"\n [isSelected]="isSelected"\n [isVisible]="isVisible"\n [nodeTemplateRef]="nodeTemplateRef?.templateRef"\n [loadMoreButtonTemplateRef]="loadMoreButtonTemplateRef?.templateRef"\n [textField]="textField"\n [nodes]="fetchNodes"\n [loadMoreService]="loadMoreService"\n [trackBy]="trackBy"\n >\n </ul>\n <ng-container #assetsContainer></ng-container>\n '}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,s.ChangeDetectorRef,I,le,pe,me,ve,s.NgZone,s.Renderer2,O,u.LocalizationService])],e)}(),Oe=function(){function e(e,t,n,i,o,r,a,s){this.expandService=e,this.loadingService=t,this.indexBuilder=n,this.treeViewLookupService=i,this.navigationService=o,this.nodeChildrenService=r,this.dataChangeNotification=a,this.changeDetectorRef=s,this.kGroupClass=!0,this.role="group",this.loadOnDemand=!0,this.textField="",this.size="medium",this.initialNodesLoaded=!1,this.loadingMoreNodes=!1,this._data=[],this.singleRecordSubscriptions=new h.Subscription,this.isChecked=function(){return"none"},this.isDisabled=function(){return!1},this.isExpanded=function(){return!1},this.isVisible=function(){return!0},this.isSelected=function(){return!1},this.children=function(){return Object(h.of)([])},this.hasChildren=function(){return!1}}return Object.defineProperty(e.prototype,"moreNodesAvailable",{get:function(){return!(!z(this.loadMoreService)||0===this.data.length)&&this.pageSize<this.totalNodesCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageSize",{get:function(){return z(this.loadMoreService)?this.loadMoreService.getGroupSize(this.parentDataItem):null},set:function(e){this.loadMoreService.setGroupSize(this.parentDataItem,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){if(z(this.pageSize)){var e=this.pageSize>0?this.pageSize:0;return this._data.slice(0,e)}return this._data},set:function(e){this._data=e,this.registerLoadedNodes(this.data)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadMoreButtonIndex",{get:function(){return this.loadMoreService?this.nodeIndex(this.data.length):null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"totalNodesCount",{get:function(){return this.loadMoreService?this.loadMoreService.getTotalNodesCount(this.parentDataItem,this._data.length):this.data.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTemplate",{get:function(){return z(this.nodeTemplateRef)},enumerable:!0,configurable:!0}),e.prototype.expandNode=function(e,t,n){n?this.expandService.expand(e,t):this.expandService.collapse(e,t)},e.prototype.checkNode=function(e){this.navigationService.checkIndex(e),this.navigationService.activateIndex(e)},e.prototype.nodeIndex=function(e){return this.indexBuilder.nodeIndex(e.toString(),this.parentIndex)},e.prototype.nodeText=function(e){var t=F(this.textField)?this.textField[0]:this.textField;return Object(p.d)(t)(e)},e.prototype.ngOnDestroy=function(){z(this.nodesSubscription)&&this.nodesSubscription.unsubscribe(),z(this.loadMoreNodesSubscription)&&this.loadMoreNodesSubscription.unsubscribe(),this.singleRecordSubscriptions.unsubscribe()},e.prototype.ngOnInit=function(){var e=this;this.subscribeToNodesChange(),this.singleRecordSubscriptions.add(this.dataChangeNotification.changes.subscribe(this.subscribeToNodesChange.bind(this))),this.singleRecordSubscriptions.add(this.navigationService.loadMore.pipe(Object(b.filter)((function(t){return t===e.loadMoreButtonIndex}))).subscribe(this.loadMoreNodes.bind(this)))},e.prototype.ngOnChanges=function(e){e.parentIndex&&this.loadOnDemand&&this.setNodeChildren(this.mapToTreeItem(this.data))},e.prototype.fetchChildren=function(e,t){var n=this;return this.children(e).pipe(Object(b.catchError)((function(){return n.loadingService.notifyLoaded(t),h.EMPTY})),Object(b.tap)((function(){return n.loadingService.notifyLoaded(t)})))},Object.defineProperty(e.prototype,"nextFields",{get:function(){return F(this.textField)?this.textField.length>1?this.textField.slice(1):this.textField:[this.textField]},enumerable:!0,configurable:!0}),e.prototype.loadMoreNodes=function(){z(this.loadMoreService.loadMoreNodes)?this.fetchMoreNodes():this.loadMoreLocalNodes()},e.prototype.loadMoreLocalNodes=function(){var e=this.loadMoreButtonIndex;this.pageSize+=this.loadMoreService.getInitialPageSize(this.parentDataItem),this.registerLoadedNodes(this.data),this.changeDetectorRef.detectChanges(),this.reselectItemAt(e)},e.prototype.fetchMoreNodes=function(){var e=this;this.loadingMoreNodes||(this.loadingMoreNodes=!0,z(this.loadMoreNodesSubscription)&&this.loadMoreNodesSubscription.unsubscribe(),this.loadMoreNodesSubscription=this.loadMoreService.loadMoreNodes({dataItem:this.parentDataItem,skip:this.data.length,take:this.loadMoreService.getInitialPageSize(this.parentDataItem)}).pipe(Object(b.finalize)((function(){return e.loadingMoreNodes=!1}))).subscribe((function(t){if(Array.isArray(t)&&t.length>0){var n=e.loadMoreButtonIndex;e.pageSize+=t.length,e.data=e.data.concat(t),e.navigationService.isActive(n)&&(e.changeDetectorRef.detectChanges(),e.reselectItemAt(n))}})))},e.prototype.setNodeChildren=function(e){this.treeViewLookupService.registerChildren(this.parentIndex,e)},e.prototype.mapToTreeItem=function(e){var t=this;return this.parentIndex?e.map((function(e,n){return{dataItem:e,index:t.nodeIndex(n)}})):[]},e.prototype.emitChildrenLoaded=function(e){if(this.parentIndex){var t=e.filter((function(e){return e.dataItem}));this.nodeChildrenService.childrenLoaded({dataItem:this.parentDataItem,index:this.parentIndex},t)}},e.prototype.subscribeToNodesChange=function(){var e=this;this.nodesSubscription&&this.nodesSubscription.unsubscribe(),this.nodesSubscription=this.nodes(this.parentDataItem,this.parentIndex).subscribe((function(t){e.data=t,e.initialNodesLoaded=!0}))},e.prototype.reselectItemAt=function(e){z(e)&&(this.navigationService.deactivate(),this.navigationService.activateIndex(e))},e.prototype.registerLoadedNodes=function(e){void 0===e&&(e=[]);var t=this.mapToTreeItem(e);this.loadOnDemand&&this.setNodeChildren(t),this.emitChildrenLoaded(t)},Object(a.__decorate)([Object(s.HostBinding)("class.k-treeview-group"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"kGroupClass",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.role"),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"checkboxes",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"expandIcons",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"selectable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"touchActions",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"trackBy",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"nodes",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"parentDataItem",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"parentIndex",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"nodeTemplateRef",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"loadMoreButtonTemplateRef",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"loadMoreService",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"size",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isChecked",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isDisabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isExpanded",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isVisible",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isSelected",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"children",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"hasChildren",void 0),e=Object(a.__decorate)([Object(s.Component)({animations:[Object(m.trigger)("toggle",[Object(m.transition)("void => *",[Object(m.style)({height:0}),Object(m.animate)("0.1s ease-in",Object(m.style)({height:"*"}))]),Object(m.transition)("* => void",[Object(m.style)({height:"*"}),Object(m.animate)("0.1s ease-in",Object(m.style)({height:0}))])])],selector:"[kendoTreeViewGroup]",template:'\n <li\n *ngFor="let node of data; let index = index; trackBy: trackBy"\n class="k-treeview-item"\n [class.k-display-none]="!isVisible(node, nodeIndex(index))"\n kendoTreeViewItem\n [attr.aria-setsize]="totalNodesCount"\n [dataItem]="node"\n [index]="nodeIndex(index)"\n [parentDataItem]="parentDataItem"\n [parentIndex]="parentIndex"\n [loadOnDemand]="loadOnDemand"\n [checkable]="checkboxes"\n [isChecked]="isChecked(node, nodeIndex(index))"\n [isDisabled]="disabled || isDisabled(node, nodeIndex(index))"\n [isVisible]="isVisible(node, nodeIndex(index))"\n [expandable]="expandIcons && hasChildren(node)"\n [isExpanded]="isExpanded(node, nodeIndex(index))"\n [selectable]="selectable"\n [isSelected]="isSelected(node, nodeIndex(index))"\n [attr.data-treeindex]="nodeIndex(index)"\n >\n <div class="k-treeview-mid">\n <span\n class="k-treeview-toggle"\n [kendoTreeViewLoading]="nodeIndex(index)"\n (click)="expandNode(nodeIndex(index), node, !isExpanded(node, nodeIndex(index)))"\n *ngIf="expandIcons && hasChildren(node)"\n >\n <span\n class="k-icon"\n [class.k-i-collapse]="isExpanded(node, nodeIndex(index))"\n [class.k-i-expand]="!isExpanded(node, nodeIndex(index))"\n >\n </span>\n </span>\n <kendo-checkbox\n *ngIf="checkboxes"\n [size]="size"\n [node]="node"\n [index]="nodeIndex(index)"\n [isChecked]="isChecked"\n (checkStateChange)="checkNode(nodeIndex(index))"\n tabindex="-1"\n ></kendo-checkbox>\n <span kendoTreeViewItemContent\n [attr.data-treeindex]="nodeIndex(index)"\n [dataItem]="node"\n [index]="nodeIndex(index)"\n [initialSelection]="isSelected(node, nodeIndex(index))"\n [isSelected]="isSelected"\n class="k-treeview-leaf"\n [style.touch-action]="touchActions ? \'\' : \'none\'"\n >\n <span class="k-treeview-leaf-text">\n <ng-container [ngSwitch]="hasTemplate">\n <ng-container *ngSwitchCase="true">\n <ng-template\n [ngTemplateOutlet]="nodeTemplateRef"\n [ngTemplateOutletContext]="{\n $implicit: node,\n index: nodeIndex(index)\n }"\n >\n </ng-template>\n </ng-container>\n <ng-container *ngSwitchDefault>\n {{nodeText(node)}}\n </ng-container>\n </ng-container>\n </span>\n </span>\n </div>\n <ul\n *ngIf="isExpanded(node, nodeIndex(index)) && hasChildren(node)"\n kendoTreeViewGroup\n role="group"\n [nodes]="fetchChildren"\n [loadOnDemand]="loadOnDemand"\n [checkboxes]="checkboxes"\n [expandIcons]="expandIcons"\n [selectable]="selectable"\n [touchActions]="touchActions"\n [children]="children"\n [hasChildren]="hasChildren"\n [isChecked]="isChecked"\n [isDisabled]="isDisabled"\n [disabled]="disabled || isDisabled(node, nodeIndex(index))"\n [isExpanded]="isExpanded"\n [isSelected]="isSelected"\n [isVisible]="isVisible"\n [nodeTemplateRef]="nodeTemplateRef"\n [loadMoreButtonTemplateRef]="loadMoreButtonTemplateRef"\n [parentIndex]="nodeIndex(index)"\n [parentDataItem]="node"\n [textField]="nextFields"\n [loadMoreService]="loadMoreService"\n [@toggle]="true"\n [trackBy]="trackBy"\n >\n </ul>\n </li>\n <li\n *ngIf="initialNodesLoaded && moreNodesAvailable"\n class="k-treeview-item"\n [class.k-treeview-load-more-checkboxes-container]="checkboxes"\n kendoTreeViewItem\n role="button"\n [selectable]="false"\n [checkable]="false"\n [expandable]="false"\n [index]="loadMoreButtonIndex"\n [parentDataItem]="parentDataItem"\n [parentIndex]="parentIndex"\n [attr.data-treeindex]="loadMoreButtonIndex"\n >\n <div class="k-treeview-mid">\n <span\n *ngIf="loadingMoreNodes"\n class="k-icon k-i-loading k-i-expand"\n >\n </span>\n <span\n class="k-treeview-leaf k-treeview-load-more-button"\n [attr.data-treeindex]="loadMoreButtonIndex"\n kendoTreeViewItemContent\n [index]="loadMoreButtonIndex"\n >\n <span class="k-treeview-leaf-text">\n <ng-template\n *ngIf="loadMoreButtonTemplateRef"\n [ngTemplateOutlet]="loadMoreButtonTemplateRef"\n [ngTemplateOutletContext]="{\n index: loadMoreButtonIndex\n }"\n >\n </ng-template>\n <ng-container *ngIf="!loadMoreButtonTemplateRef">\n Load more\n </ng-container>\n </span>\n </span>\n </div>\n </li>\n '}),Object(a.__metadata)("design:paramtypes",[I,D,T,ve,le,pe,O,s.ChangeDetectorRef])],e)}(),je=function(){function e(e,t){var n=this;this.treeView=e,this.zone=t,this.checkedKeysChange=new s.EventEmitter,this.subscriptions=new h.Subscription,this.checkActions={multiple:function(e){return n.checkMultiple(e)},single:function(e){return n.checkSingle(e)}},this.state=new Set,this.subscriptions.add(this.treeView.checkedChange.subscribe((function(e){return n.check(e)})));var i=[];this.subscriptions.add(this.treeView.childrenLoaded.pipe(Object(b.filter)((function(){return n.options.checkChildren&&n.treeView.loadOnDemand})),Object(b.tap)((function(e){return i.push(e)})),Object(b.switchMap)((function(){return n.zone.onStable.pipe(Object(b.take)(1))}))).subscribe((function(){return n.addCheckedItemsChildren(i)}))),this.treeView.isChecked=this.isItemChecked.bind(this)}return Object.defineProperty(e.prototype,"isChecked",{set:function(e){this.treeView.isChecked=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var e={checkChildren:!0,checkParents:!0,enabled:!0,mode:"multiple"};if(!z(this.checkable)||"string"==typeof this.checkable)return e;var t=N(this.checkable)?{enabled:this.checkable}:this.checkable;return Object.assign(e,t)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){e.checkable&&(this.treeView.checkboxes=this.options.enabled,this.toggleCheckOnClick()),Object(c.isChanged)("checkedKeys",e,!1)&&e.checkedKeys.currentValue!==this.lastChange&&(this.state=new Set(e.checkedKeys.currentValue))},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe(),this.unsubscribeClick()},e.prototype.isItemChecked=function(e,t){return this.checkKey?this.state.has(this.itemKey({dataItem:e,index:t}))?"checked":"none":this.isIndexChecked(t)},e.prototype.isIndexChecked=function(e){var t=Array.from(this.state).filter(function(e){return function(t){return e===t||!!t.split&&t.split("_").reduce((function(t,n){var i=t.key,o=t.result;return e===(i+=n)||o?{result:!0}:{key:i+="_",result:!1}}),{key:"",result:!1}).result}}(e));if(function(e,t){return e.filter((function(e){return e===t})).length>0}(t,e))return"checked";var n=this.options,i=n.mode,o=n.checkParents;return"multiple"===i&&o&&t.length?"indeterminate":"none"},e.prototype.itemKey=function(e){return z(this.checkKey)?"string"==typeof this.checkKey&&z(e.dataItem)?e.dataItem[this.checkKey]:"function"==typeof this.checkKey?this.checkKey(e):void 0:e.index},e.prototype.check=function(e){var t=this.options,n=t.enabled,i=t.mode,o=this.checkActions[i]||M;n&&o(e)},e.prototype.checkSingle=function(e){var t=this.itemKey(e.item),n=this.state.has(t);this.state.clear(),n||this.state.add(t),this.notify()},e.prototype.checkMultiple=function(e){this.checkNode(e),this.options.checkParents&&this.checkParents(e.parent),this.notify()},e.prototype.toggleCheckOnClick=function(){var e=this;this.unsubscribeClick(),this.options.checkOnClick&&(this.clickSubscription=this.treeView.nodeClick.subscribe((function(t){if("click"===t.type){var n=e.treeView.itemLookup(t.item.index);e.check(n)}})))},e.prototype.unsubscribeClick=function(){this.clickSubscription&&(this.clickSubscription.unsubscribe(),this.clickSubscription=null)},e.prototype.checkNode=function(e){var t=this;if(z(e.item.dataItem)&&!this.treeView.isDisabled(e.item.dataItem,e.item.index)){var n=this.itemKey(e.item);if(z(n)){var i=[n];if(this.options.checkChildren){var o=ie(e,(function(e){var n=e.item;return t.treeView.isVisible(n.dataItem,n.index)&&!t.treeView.isDisabled(n.dataItem,n.index)})).map((function(e){var n=e.item;return t.itemKey(n)}));i.push.apply(i,o)}var r=!this.state.has(n);i.forEach((function(e){r?t.state.add(e):t.state.delete(e)}))}}},e.prototype.checkParents=function(e){var t=this;if(z(e))for(var n=e;n;){var i=this.itemKey(n.item);n.children.every((function(e){return t.state.has(t.itemKey(e))}))?this.state.add(i):this.state.delete(i),n=n.parent}},e.prototype.notify=function(){this.lastChange=Array.from(this.state),this.checkedKeysChange.emit(this.lastChange)},e.prototype.addCheckedItemsChildren=function(e){var t=this;if(z(e)&&0!==e.length){var n=this.state.size;e.forEach((function(e){var n=t.itemKey(e.item);t.state.has(n)&&e.children.forEach((function(n){t.treeView.isDisabled(e.item.dataItem,e.item.index)||t.treeView.isDisabled(n.dataItem,n.index)||t.state.add(t.itemKey(n))}))})),n!==this.state.size&&this.zone.run((function(){return t.notify()}))}},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isChecked",null),Object(a.__decorate)([Object(s.Input)("checkBy"),Object(a.__metadata)("design:type",Object)],e.prototype,"checkKey",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"checkedKeys",void 0),Object(a.__decorate)([Object(s.Input)("kendoTreeViewCheckable"),Object(a.__metadata)("design:type",Object)],e.prototype,"checkable",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"checkedKeysChange",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewCheckable]"}),Object(a.__metadata)("design:paramtypes",[_e,s.NgZone])],e)}(),Ce=function(){function e(e,t){var n=this;this.treeView=e,this.cdr=t,this.disabledKeys=[],this.treeView.isDisabled=function(e,t){return n.disabledKeys.indexOf(n.itemKey({dataItem:e,index:t}))>-1}}return Object.defineProperty(e.prototype,"isDisabled",{set:function(e){this.treeView.isDisabled=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){void 0===e&&(e={});var t=e.disabledKeys;t&&!t.firstChange&&this.cdr.markForCheck()},e.prototype.itemKey=function(e){return this.disableKey?"string"==typeof this.disableKey?e.dataItem[this.disableKey]:"function"==typeof this.disableKey?this.disableKey(e):void 0:e.index},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.Input)("kendoTreeViewDisable"),Object(a.__metadata)("design:type",Object)],e.prototype,"disableKey",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"disabledKeys",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewDisable]"}),Object(a.__metadata)("design:paramtypes",[_e,s.ChangeDetectorRef])],e)}(),ke={maxAutoExpandResults:-1,expandMatches:!1,expandedOnClear:"none"},we=function(){function e(e){var t=this;this.component=e,this.expandOnFilter=!1,this.expandedKeysChange=new s.EventEmitter,this.subscriptions=new h.Subscription,this.state=new Set,this.originalExpandedKeys=new Set,this.isFiltered=!1,this.updateExpandedNodes=function(e,n,i){(n.containsMatches||n.isMatch&&i&&J(n.children))&&e.push(t.itemKey({dataItem:n.dataItem,index:n.index})),J(n.children)&&n.children.forEach((function(n){t.updateExpandedNodes(e,n,i)}))},this.getEveryExpandKey=function(e,n){J(n.children)&&e.push(t.itemKey({dataItem:n.dataItem,index:n.index})),J(n.children)&&n.children.forEach((function(n){t.getEveryExpandKey(e,n)}))},this.subscriptions.add(Object(h.merge)(this.component.expand.pipe(Object(b.map)((function(e){return Object(a.__assign)({expand:!0},e)}))),this.component.collapse.pipe(Object(b.map)((function(e){return Object(a.__assign)({expand:!1},e)})))).subscribe(this.toggleExpand.bind(this))),this.component.filterStateChange&&this.subscriptions.add(this.component.filterStateChange.subscribe(this.handleAutoExpand.bind(this))),this.component.isExpanded=function(e,n){return t.state.has(t.itemKey({dataItem:e,index:n}))}}return Object.defineProperty(e.prototype,"isExpanded",{set:function(e){this.component.isExpanded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterExpandSettings",{get:function(){var e=N(this.expandOnFilter)?{enabled:this.expandOnFilter}:Object(a.__assign)({},this.expandOnFilter,{enabled:!0});return Object.assign({},ke,e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){Object(c.isChanged)("expandedKeys",e,!1)&&e.expandedKeys.currentValue!==this.lastChange&&(this.state=new Set(e.expandedKeys.currentValue))},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.itemKey=function(e){if(this.expandKey){if("string"==typeof this.expandKey)return e.dataItem[this.expandKey];if("function"==typeof this.expandKey)return this.expandKey(e)}return e.index},e.prototype.toggleExpand=function(e){var t=e.index,n=e.dataItem,i=e.expand,o=this.itemKey({index:t,dataItem:n}),r=this.state.has(o),a=!1;r&&!i?(this.state.delete(o),a=!0):!r&&i&&(this.state.add(o),a=!0),a&&this.notify()},e.prototype.handleAutoExpand=function(e){var t=this,n=e.nodes,i=e.matchCount,o=e.term;if(this.filterExpandSettings.enabled){var r=this.filterExpandSettings,a=r.maxAutoExpandResults,s=r.expandMatches,c=r.expandedOnClear;if(this.isFiltered||(this.originalExpandedKeys=new Set(this.state)),this.isFiltered&&!o||-1!==a&&i>a){switch(c){case"initial":oe(this.state,this.originalExpandedKeys)||(this.state=this.originalExpandedKeys,this.notify());break;case"all":this.state=new Set(n.reduce((function(e,n){return t.getEveryExpandKey(e,n),e}),[])),this.notify();break;case"unchanged":break;case"none":default:0!==this.state.size&&(this.state.clear(),this.notify())}this.isFiltered=!1}else{var d=new Set(n.reduce((function(e,n){return t.updateExpandedNodes(e,n,s),e}),[]));oe(this.state,d)||(this.state=d,this.notify()),this.isFiltered=!0}}},e.prototype.notify=function(){this.lastChange=Array.from(this.state),this.expandedKeysChange.emit(this.lastChange)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isExpanded",null),Object(a.__decorate)([Object(s.Input)("expandBy"),Object(a.__metadata)("design:type",Object)],e.prototype,"expandKey",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"expandOnFilter",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"expandedKeysChange",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"expandedKeys",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewExpandable]"}),Object(a.__metadata)("design:paramtypes",[be])],e)}(),Se=function(){function e(e){var t=this;this.treeView=e,this.selectedKeysChange=new s.EventEmitter,this.subscriptions=new h.Subscription,this.selectActions={multiple:function(e){return t.selectMultiple(e)},single:function(e){return t.selectSingle(e)}},this.state=new Set,this.subscriptions.add(this.treeView.selectionChange.subscribe(this.select.bind(this))),this.treeView.isSelected=function(e,n){return t.state.has(t.itemKey({dataItem:e,index:n}))}}return Object.defineProperty(e.prototype,"isSelected",{set:function(e){this.treeView.isSelected=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"getAriaMultiselectable",{get:function(){return"multiple"===this.options.mode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){var e={enabled:!0,mode:"single"};if(!z(this.selection)||"string"==typeof this.selection)return e;var t=N(this.selection)?{enabled:this.selection}:this.selection;return Object.assign(e,t)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){Object(c.isChanged)("selectedKeys",e,!1)&&e.selectedKeys.currentValue!==this.lastChange&&(this.state=new Set(e.selectedKeys.currentValue))},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.itemKey=function(e){return this.selectKey?"string"==typeof this.selectKey?e.dataItem[this.selectKey]:"function"==typeof this.selectKey?this.selectKey(e):void 0:e.index},e.prototype.select=function(e){var t=this.options,n=t.enabled,i=t.mode,o=this.selectActions[i]||M;n&&o(e)},e.prototype.selectSingle=function(e){var t=this.itemKey(e);this.state.has(t)||(this.state.clear(),this.state.add(t),this.notify())},e.prototype.selectMultiple=function(e){var t=this.itemKey(e),n=this.state.has(t);z(t)&&(n?this.state.delete(t):this.state.add(t),this.notify())},e.prototype.notify=function(){this.lastChange=Array.from(this.state),this.selectedKeysChange.emit(this.lastChange)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"isSelected",null),Object(a.__decorate)([Object(s.Input)("selectBy"),Object(a.__metadata)("design:type",Object)],e.prototype,"selectKey",void 0),Object(a.__decorate)([Object(s.Input)("kendoTreeViewSelectable"),Object(a.__metadata)("design:type",Object)],e.prototype,"selection",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"selectedKeys",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"selectedKeysChange",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-multiselectable"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"getAriaMultiselectable",null),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewSelectable]"}),Object(a.__metadata)("design:paramtypes",[_e])],e)}();!function(e){e[e.Add=0]="Add",e[e.InsertTop=1]="InsertTop",e[e.InsertBottom=2]="InsertBottom",e[e.InsertMiddle=3]="InsertMiddle",e[e.Invalid=4]="Invalid"}(i||(i={})),function(e){e[e.Over=0]="Over",e[e.Before=1]="Before",e[e.After=2]="After"}(o||(o={})),function(e){e[e.Up=-1]="Up",e[e.Down=1]="Down"}(r||(r={}));var xe,Ee,Ie,Te=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}(),De=function(e){function t(t,n){var i=e.call(this)||this;return i.isValid=!0,Object.assign(i,t),i.originalEvent=n,i}return Object(a.__extends)(t,e),t.prototype.setValid=function(e){this.isValid=e},t}(Te),Be=function(e){function t(t){var n=e.call(this)||this;return Object.assign(n,t),n}return Object(a.__extends)(t,e),t}(Te),Pe=(xe=function(){if(!Object(c.isDocumentAvailable)()||!z(document.body))return!1;var e=document.createElement("div");e.style.transform="matrix(10, 0, 0, 10, 0, 0)",e.innerHTML='<div style="position: fixed; top: 10px;">child</div>',document.body.appendChild(e);var t=10!==e.children[0].getBoundingClientRect().top;return document.body.removeChild(e),t},Ie=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Ie||(Ee=xe.apply(void 0,e),Ie=!0),Ee});var Ae,Me=function(e,t,n,i,r){if(z(e)&&z(t)&&z(i)&&z(r)){var a=A(t,".k-treeview-mid");if(z(a)){var s=function(e){if(!z(e))return null;var t=".k-treeview-leaf:not(.k-treeview-load-more-button)";return P(e,t)?e:e.querySelector(t)}(a),c=$(a,L(e));if(z(s)&&s!==e&&!c){var d=s.getBoundingClientRect(),l=d.height/(H(t)?4:2),p=n-r.top,u=d.top-r.top;return p<u+l?o.Before:p>=u+d.height-l?o.After:o.Over}}}},ze=function(e,t){if(!z(e)||!z(t))return null;var n=L(t),i=U(n),o=e.itemLookup(i);return z(o)&&z(o.item.dataItem)?o:null},Re=function(e,t,n){z(e)&&0===t.length&&n.isExpanded(e.item.dataItem,e.item.index)&&n.collapseNode(e.item.dataItem,e.item.index)},Fe=function(e,t){t.isExpanded(e.item.dataItem,e.item.index)||t.expandNode(e.item.dataItem,e.item.index)},Ne=function(e){return Object(c.isDocumentAvailable)()&&z(document.elementFromPoint)?document.elementFromPoint(e.clientX,e.clientY):e.target},Le=function(e,t){var n=e.split("_"),i=t.split("_");if(n.length<i.length)return e;var o=i.length-1,r=i.slice(0,o).join("_"),a=n.slice(0,o).join("_"),s=i.length-1,c=Number(i[s]),d=Number(n[s]);return r===a&&d>c?(n[s]=String(d-1),n.join("_")):e},Ve=new RegExp("(auto|scroll)"),He=function(e){return Math.floor(e.scrollTop)<=0},Ke=function(e){return Math.ceil(e.scrollTop)>=e.scrollHeight-e.clientHeight},$e=function(e,t,n){if(z(e)&&Object(c.isDocumentAvailable)())for(var i=e.scrollTop,o=t,a=0;i===e.scrollTop&&(n!==r.Up||!He(e))&&(n!==r.Down||!Ke(e))&&a<20;)e.scrollTop+=o*n,o+=1,a+=1},We=function(e,t,n){if(z(e.loadMoreService)){var i=e.getNodePageSize(t);e.setNodePageSize(n,i)}},Ue=function(e,t){if(z(e.loadMoreService)){var n=e.getNodePageSize(t);e.setNodePageSize(t,n+1)}},Ge=function(e,t){if(z(e.loadMoreService)){var n=e.getNodePageSize(t);e.setNodePageSize(t,n-1)}},Ze=function(){function e(e){this.hierarchyBinding=e}return e.prototype.add=function(e){var t=e.sourceItem,n=e.destinationItem,i=e.dropPosition,r=e.sourceTree,a=e.destinationTree,s=Object.assign({},q(t));if(i===o.Over){Fe(n,a);var c=this.childrenFor(q(n)),d=z(a.loadMoreService)?Math.min(a.loadMoreService.getGroupSize(q(n)),c.length):c.length;c.splice(d,0,s),Object(p.g)(this.hierarchyBinding.childrenField)(q(n),c),this.movedItemNewIndex=ne(n.item.index,d)}else{var l=this.getParentNodes(n,a),u=i===o.After?1:0;d=l.indexOf(q(n))+u;l.splice(d,0,s);var h=n.parent?n.parent.item.index:null;this.movedItemNewIndex=ne(h,d)}var f=i===o.Over?q(n):q(n.parent);Ue(a,f),We(a,q(t),s),r===a||a.loadOnDemand||a.preloadChildNodes(),r!==a&&(a.changeDetectorRef.detectChanges(),a.focus(this.movedItemNewIndex))},e.prototype.remove=function(e){var t=e.sourceItem,n=e.sourceTree,i=e.destinationTree,o=this.getParentNodes(t,n),r=o.indexOf(q(t));if(o.splice(r,1),Re(t.parent,o,n),Ge(n,q(t.parent)),n.loadOnDemand||n.preloadChildNodes(),n===i){i.changeDetectorRef.detectChanges();var a=Le(this.movedItemNewIndex,t.item.index);i.focus(a)}},e.prototype.getParentNodes=function(e,t){return z(e.parent)?this.childrenFor(q(e.parent)):t.nodes},e.prototype.childrenFor=function(e){return Object(p.d)(this.hierarchyBinding.childrenField)(e)||[]},e}(),qe=function(){function e(e){this.cdr=e,this.hostClasses=!0,this.posistionStyle="fixed"}return Object.defineProperty(e.prototype,"statusIconClass",{get:function(){switch(this.action){case i.Add:return"k-i-plus";case i.InsertTop:return"k-i-insert-up";case i.InsertBottom:return"k-i-insert-down";case i.InsertMiddle:return"k-i-insert-middle";case i.Invalid:default:return"k-i-cancel"}},enumerable:!0,configurable:!0}),e.prototype.detectChanges=function(){this.cdr.detectChanges()},Object(a.__decorate)([Object(s.HostBinding)("class.k-header"),Object(s.HostBinding)("class.k-drag-clue"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("style.position"),Object(a.__metadata)("design:type",String)],e.prototype,"posistionStyle",void 0),e=Object(a.__decorate)([Object(s.Component)({changeDetection:s.ChangeDetectionStrategy.OnPush,selector:"kendo-treeview-drag-clue",template:'\n <ng-container *ngIf="!template">\n <span class="k-icon {{statusIconClass}} k-drag-status"></span>\n <span>{{text}}</span>\n </ng-container>\n\n <ng-template\n *ngIf="template"\n [ngTemplateOutlet]="template"\n [ngTemplateOutletContext]="{\n text: text,\n action: action,\n sourceItem: sourceItem,\n destinationItem: destinationItem\n }"\n >\n </ng-template>\n '}),Object(a.__metadata)("design:paramtypes",[s.ChangeDetectorRef])],e)}(),Je=function(){function e(){}return Object.defineProperty(e.prototype,"componentRef",{get:function(){if(!z(this._componentRef))throw new Error("The `initalize` method must be called before calling other service methods.");return this._componentRef},set:function(e){this._componentRef=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this.componentRef.location.nativeElement},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){z(this._componentRef)&&(this.element.parentElement.removeChild(this.element),this.componentRef.destroy(),this.componentRef=null)},e.prototype.show=function(){this.element.style.display=""},e.prototype.hide=function(){this.element.style.display="none"},e.prototype.move=function(e,t,n){void 0===n&&(n=0),this.element.style.left=e+n+"px",this.element.style.top=t+n+"px"},e}(),Xe=function(e){function t(t){var n=e.call(this)||this;return n.componentFactoryResolver=t,n}return Object(a.__extends)(t,e),t.prototype.initialize=function(e,t){z(this._componentRef)&&this.ngOnDestroy();var n=this.componentFactoryResolver.resolveComponentFactory(qe);this.componentRef=e.createComponent(n),this.hide(),this.componentRef.instance.template=t,this.componentRef.changeDetectorRef.detectChanges()},t.prototype.ngOnDestroy=function(){this.cancelReturnAnimation(),this.cancelScroll(),e.prototype.ngOnDestroy.call(this)},t.prototype.move=function(t,n){e.prototype.move.call(this,t,n,10)},t.prototype.animateDragClueToElementPosition=function(e){var t=this;if(z(e)&&z(this.element.animate)){var n=e.getBoundingClientRect(),i=this.element.getBoundingClientRect();this.returnAnimation=this.element.animate([{transform:"translate(0, 0)"},{transform:"translate("+(n.left-i.left)+"px, "+(n.top-i.top)+"px)"}],200),this.returnAnimation.onfinish=function(){return t.hide()}}else this.hide()},t.prototype.cancelReturnAnimation=function(){z(this.returnAnimation)&&(this.returnAnimation.cancel(),this.returnAnimation=null)},t.prototype.updateDragClueData=function(e,t,n){var i=this.componentRef.instance;e===i.action&&Z(t,i.sourceItem)&&Z(n,i.destinationItem)||(i.action=e,i.sourceItem=t,i.destinationItem=n,i.detectChanges())},t.prototype.updateText=function(e){e!==this.componentRef.instance.text&&(this.componentRef.instance.text=e,this.componentRef.instance.detectChanges())},t.prototype.scrollIntoView=function(e){var t=e.step,n=e.interval;this.cancelScroll();var i=function(e){for(;z(e)&&"HTML"!==e.nodeName;){var t=e.scrollHeight>e.clientHeight,n=Ve.test(getComputedStyle(e).overflowY);if(t&&n)return e;e=e.parentNode}return e}(this.element);if(z(i)){var o=i.getBoundingClientRect(),a=this.element.getBoundingClientRect(),s=Math.max(o.top,0),c=s+a.height,d=s+Math.min(o.bottom,i.clientHeight);a.top<c?this.scrollInterval=setInterval((function(){return $e(i,t,r.Up)}),n):a.bottom>d&&(this.scrollInterval=setInterval((function(){return $e(i,t,r.Down)}),n))}},t.prototype.cancelScroll=function(){z(this.scrollInterval)&&(clearInterval(this.scrollInterval),this.scrollInterval=null)},t=Object(a.__decorate)([Object(s.Injectable)(),Object(a.__metadata)("design:paramtypes",[s.ComponentFactoryResolver])],t)}(Je),Ye=function(){function e(e){this.changeDetectorRef=e,this.hostClass=!0,this.position="fixed",this.pointerEvents="none"}return e.prototype.detectChanges=function(){this.changeDetectorRef.detectChanges()},Object(a.__decorate)([Object(s.HostBinding)("class.k-drop-hint-container"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClass",void 0),Object(a.__decorate)([Object(s.HostBinding)("style.position"),Object(a.__metadata)("design:type",String)],e.prototype,"position",void 0),Object(a.__decorate)([Object(s.HostBinding)("style.pointer-events"),Object(a.__metadata)("design:type",String)],e.prototype,"pointerEvents",void 0),e=Object(a.__decorate)([Object(s.Component)({changeDetection:s.ChangeDetectionStrategy.OnPush,selector:"kendo-treeview-drop-hint",template:'\n <div\n *ngIf="!template"\n class="k-drop-hint k-drop-hint-h"\n >\n <div class=\'k-drop-hint-start\'></div>\n <div class=\'k-drop-hint-line\'></div>\n </div>\n\n <ng-template\n *ngIf="template"\n [ngTemplateOutlet]="template"\n [ngTemplateOutletContext]="{\n action: action,\n sourceItem: sourceItem,\n destinationItem: destinationItem\n }"\n >\n <ng-template>\n '}),Object(a.__metadata)("design:paramtypes",[s.ChangeDetectorRef])],e)}(),Qe=function(e){function t(t){var n=e.call(this)||this;return n.componentFactoryResolver=t,n}return Object(a.__extends)(t,e),t.prototype.initialize=function(e,t){z(this._componentRef)&&this.ngOnDestroy();var n=this.componentFactoryResolver.resolveComponentFactory(Ye);this.componentRef=e.createComponent(n),this.hide(),this.componentRef.instance.template=t,this.componentRef.changeDetectorRef.detectChanges()},t.prototype.updateDropHintData=function(e,t,n){var i=this.componentRef.instance;e===i.action&&Z(t,i.sourceItem)&&Z(n,i.destinationItem)||(i.action=e,i.sourceItem=t,i.destinationItem=n,i.detectChanges())},t=Object(a.__decorate)([Object(s.Injectable)(),Object(a.__metadata)("design:paramtypes",[s.ComponentFactoryResolver])],t)}(Je),et=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewDragClueTemplate]"}),Object(a.__param)(0,Object(s.Optional)()),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),tt=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewDropHintTemplate]"}),Object(a.__param)(0,Object(s.Optional)()),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),nt={enabled:!0,step:1,interval:1},it=function(){function e(e,t,n,i,o){this.element=e,this.zone=t,this.treeview=n,this.dragClueService=i,this.dropHintService=o,this.allowCopy=!1,this.dropZoneTreeViews=[],this.startDragAfter=5,this.autoScroll=!0,this.userSelectStyle="none",this.containerOffset={top:0,left:0},this.treeview.touchActions=!1}return Object.defineProperty(e.prototype,"scrollSettings",{get:function(){var e="boolean"==typeof this.autoScroll?{enabled:this.autoScroll}:this.autoScroll;return Object.assign({},nt,e)},enumerable:!0,configurable:!0}),e.prototype.ngAfterContentInit=function(){this.initalizeDraggable(),this.dragClueService.initialize(this.treeview.assetsContainer,this.dragClueTemplate&&this.dragClueTemplate.templateRef),this.dropHintService.initialize(this.treeview.assetsContainer,this.dropHintTemplate&&this.dropHintTemplate.templateRef)},e.prototype.ngOnDestroy=function(){this.draggable.destroy()},e.prototype.handlePress=function(e){var t=e.originalEvent;H(t.target)&&(this.draggedItem=A(t.target,".k-treeview-leaf"),this.pendingDragStartEvent=t)},e.prototype.handleDrag=function(e){var t=this,n=e.originalEvent,r=e.clientX,a=e.clientY;if(this.shouldInitiateDragStart({clientX:r,clientY:a})&&this.initiateDragStart(),z(this.draggedItem)&&!z(this.pendingDragStartEvent)){var s=Ne(n);Object(c.hasObservers)(this.treeview.nodeDrag)&&this.zone.run((function(){return t.notifyDrag(n,s)}));var d=this.getTargetTreeView(s),l=Me(this.draggedItem,s,a,d,this.containerOffset),p=A(s,".k-treeview-mid"),u=function(e,t){if(!z(e)||!z(t))return i.Invalid;switch(e){case o.Over:return i.Add;case o.Before:return z(L(t).previousElementSibling)?i.InsertMiddle:i.InsertTop;case o.After:return z(L(t).nextElementSibling)?i.InsertMiddle:i.InsertBottom;default:return i.Invalid}}(l,s),h=ze(this.treeview,this.draggedItem),f=ze(d,s);this.updateDropHintState(l,p,u,h,f),this.updateDragClueState(u,r,a,h,f),this.scrollSettings.enabled&&this.dragClueService.scrollIntoView(this.scrollSettings)}},e.prototype.handleRelease=function(e){var t=this,n=e.originalEvent,i=e.clientY;if(this.scrollSettings.enabled&&this.dragClueService.cancelScroll(),!z(this.draggedItem)||z(this.pendingDragStartEvent))return this.pendingDragStartEvent=null,void(this.draggedItem=null);var o=Ne(n),r=this.treeview,a=this.getTargetTreeView(o),s=Me(this.draggedItem,o,i,this.getTargetTreeView(o),this.containerOffset),d=ze(r,this.draggedItem),l=ze(a,o);z(l)&&z(s)?this.zone.run((function(){return t.notifyDrop({sourceItem:d,destinationItem:l,dropPosition:s,sourceTree:r,destinationTree:a},n)})):this.dragClueService.animateDragClueToElementPosition(this.draggedItem),Object(c.hasObservers)(this.treeview.nodeDragEnd)&&this.zone.run((function(){return t.notifyDragEnd({sourceItem:d,destinationItem:l,originalEvent:n})})),this.dropHintService.hide(),this.draggedItem=null},e.prototype.updateDropHintState=function(e,t,n,i,r){if(z(t)&&e!==o.Over&&z(e)){var a=t.getBoundingClientRect(),s=e===o.Before?a.top:a.top+a.height;this.dropHintService.updateDropHintData(n,i,r),this.dropHintService.move(a.left-this.containerOffset.left,s-this.containerOffset.top),this.dropHintService.show()}else this.dropHintService.hide()},e.prototype.updateDragClueState=function(e,t,n,i,o){this.dragClueService.move(t-this.containerOffset.left,n-this.containerOffset.top),this.dragClueService.updateDragClueData(e,i,o),this.dragClueService.show()},e.prototype.initalizeDraggable=function(){var e=this;this.draggable=new v.a({press:this.handlePress.bind(this),drag:this.handleDrag.bind(this),release:this.handleRelease.bind(this)}),this.zone.runOutsideAngular((function(){return e.draggable.bindTo(e.element.nativeElement)}))},e.prototype.notifyDragStart=function(e,t){var n=ze(this.treeview,t),i=new Be({sourceItem:n,originalEvent:e});return this.treeview.nodeDragStart.emit(i),i},e.prototype.notifyDrag=function(e,t){var n={sourceItem:ze(this.treeview,this.draggedItem),destinationItem:ze(this.getTargetTreeView(t),t),originalEvent:e};this.treeview.nodeDrag.emit(n)},e.prototype.notifyDrop=function(e,t){var n=new De(e,t);e.destinationTree.nodeDrop.emit(n),this.disableAnimationsForNextTick(e.destinationTree),e.sourceTree!==e.destinationTree&&this.disableAnimationsForNextTick(e.sourceTree),!n.isDefaultPrevented()&&n.isValid?(this.dragClueService.hide(),e.destinationTree.addItem.emit(e),t.ctrlKey&&this.allowCopy||e.sourceTree.removeItem.emit(e)):n.isDefaultPrevented()?this.dragClueService.hide():n.isValid||this.dragClueService.animateDragClueToElementPosition(this.draggedItem)},e.prototype.notifyDragEnd=function(e){this.treeview.nodeDragEnd.emit(e)},e.prototype.getTargetTreeView=function(e){var t=this.treeview.element.nativeElement.tagName,n=A(e,t);return[this.treeview].concat(this.dropZoneTreeViews).find((function(e){return z(e)&&e.element.nativeElement===n}))},e.prototype.disableAnimationsForNextTick=function(e){e.animate||(e.animate=!1,this.zone.runOutsideAngular((function(){return setTimeout((function(){return e.animate=!0}))})))},e.prototype.shouldInitiateDragStart=function(e){return!!z(this.pendingDragStartEvent)&&Math.sqrt(Math.pow(this.pendingDragStartEvent.clientX-e.clientX,2)+Math.pow(this.pendingDragStartEvent.clientY-e.clientY,2))>=this.startDragAfter},e.prototype.initiateDragStart=function(){var e=this;if(Object(c.hasObservers)(this.treeview.nodeDragStart)&&this.zone.run((function(){return e.notifyDragStart(e.pendingDragStartEvent,Ne(e.pendingDragStartEvent))})).isDefaultPrevented())return this.pendingDragStartEvent=null,void(this.draggedItem=null);this.dragClueService.cancelReturnAnimation(),this.dragClueService.updateText(this.draggedItem.innerText),this.containerOffset=function(e){if(!e||!Pe())return{left:0,top:0};for(var t=e.parentElement;t&&"none"===window.getComputedStyle(t).transform;)t=t.parentElement;if(t){var n=t.getBoundingClientRect();return{left:n.left-t.scrollLeft,top:n.top-t.scrollTop}}return{left:0,top:0}}(this.draggedItem),this.pendingDragStartEvent=null},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"allowCopy",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"dropZoneTreeViews",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"startDragAfter",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"autoScroll",void 0),Object(a.__decorate)([Object(s.ContentChild)(et,{static:!1}),Object(a.__metadata)("design:type",et)],e.prototype,"dragClueTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(tt,{static:!1}),Object(a.__metadata)("design:type",tt)],e.prototype,"dropHintTemplate",void 0),Object(a.__decorate)([Object(s.HostBinding)("style.user-select"),Object(s.HostBinding)("style.-ms-user-select"),Object(s.HostBinding)("style.-moz-user-select"),Object(s.HostBinding)("style.-webkit-user-select"),Object(a.__metadata)("design:type",String)],e.prototype,"userSelectStyle",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewDragAndDrop]",providers:[Xe,Qe]}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,s.NgZone,_e,Xe,Qe])],e)}(),ot={operator:"contains",ignoreCase:!0,mode:"lenient"},rt=function(){function e(e){this.component=e,this.visibleNodes=new Set,this._filterSettings=ot}return Object.defineProperty(e.prototype,"filterSettings",{get:function(){return this._filterSettings},set:function(e){this._filterSettings=Object(a.__assign)({},ot,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filter",{set:function(e){this.handleFilterChange(e)},enumerable:!0,configurable:!0}),e.prototype.handleFilterChange=function(e){this.filterData&&(this.resetNodesVisibility(this.filterData),e&&X(this.filterData,e,this.filterSettings,this.component.textField),this.updateVisibleNodes(this.filterData),z(this.component.filterStateChange)&&this.component.filterStateChange.emit({nodes:this.filterData,matchCount:this.visibleNodes.size,term:e,filterSettings:this.filterSettings}))},e.prototype.updateVisibleNodes=function(e){var t=this;e.forEach((function(e){e.visible&&t.visibleNodes.add(e.dataItem),e.children&&t.updateVisibleNodes(e.children)}))},e.prototype.resetNodesVisibility=function(e){var t=this;this.visibleNodes.clear(),e.forEach((function(e){e.visible=!0,e.children&&t.resetNodesVisibility(e.children)}))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"filterSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"filter",null),e}(),at=new T,st=function(e,t,n,i){return void 0===n&&(n=null),void 0===i&&(i=""),J(e)?e.map((function(e,o){var r=at.nodeIndex(o.toString(),i),a={dataItem:e,index:r,parent:n,visible:!0};return a.children=st(Object(p.d)(t)(e),t,a,r),a})):[]},ct=function(e){function t(t,n){var i=e.call(this,t)||this;i.component=t,i.dragAndDropDirective=n,i.loadOnDemand=!0,i.originalData=[];var o=!z(i.dragAndDropDirective);return i.component.isVisible=o?function(e){return i.visibleNodes.has(e)}:x,i}return Object(a.__extends)(t,e),Object.defineProperty(t.prototype,"childrenField",{get:function(){return this._childrenField},set:function(e){if(!e)throw new Error("'childrenField' cannot be empty");this._childrenField=e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"nodes",{set:function(e){this.originalData=e||[],this.filterData=st(e,this.childrenField)||[],this.updateVisibleNodes(this.filterData)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{set:function(e){this.component.isVisible=e},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;z(this.childrenField)&&(this.component.children=function(t){return Object(h.of)(Object(p.d)(e.childrenField)(t))},this.component.hasChildren=function(t){var n=Object(p.d)(e.childrenField)(t);return Boolean(n&&n.length)},this.component.editService=new Ze(this),this.component.filterChange.subscribe(this.handleFilterChange.bind(this)),this.component.filter&&this.handleFilterChange(this.component.filter),!this.loadOnDemand&&z(this.component.preloadChildNodes)&&this.component.preloadChildNodes())},t.prototype.ngOnChanges=function(e){Object(c.isChanged)("childrenField",e,!1)&&(this.nodes=this.originalData),Object(c.anyChanged)(["nodes","loadOnDemand"],e)&&!this.loadOnDemand&&z(this.component.preloadChildNodes)&&this.component.preloadChildNodes()},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],t.prototype,"childrenField",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],t.prototype,"nodes",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],t.prototype,"isVisible",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],t.prototype,"loadOnDemand",void 0),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewHierarchyBinding]"}),Object(a.__param)(1,Object(s.Optional)()),Object(a.__param)(1,Object(s.Host)()),Object(a.__metadata)("design:paramtypes",[fe,it])],t)}(rt),dt=function(){function e(e,t,n){this.expandService=e,this.loadingService=t,this.cd=n,this._loading=!1}return Object.defineProperty(e.prototype,"loading",{get:function(){return this._loading},set:function(e){this._loading=e,this.cd.markForCheck()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this,t=this.loadingService.changes.pipe(Object(b.filter)((function(t){return t===e.index})));this.subscription=this.expandService.changes.pipe(Object(b.filter)((function(t){return t.index===e.index})),Object(b.tap)((function(t){!t.expand&&e.loading&&(e.loading=!1)})),Object(b.filter)((function(e){return e.expand})),Object(b.switchMap)((function(e){return Object(h.of)(e).pipe(Object(b.delay)(100),Object(b.takeUntil)(t))}))).subscribe((function(){return e.loading=!0})),this.subscription.add(t.subscribe((function(){return e.loading=!1})))},e.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe()},Object(a.__decorate)([Object(s.HostBinding)("class.k-i-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"loading",null),Object(a.__decorate)([Object(s.Input)("kendoTreeViewLoading"),Object(a.__metadata)("design:type",String)],e.prototype,"index",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewLoading]"}),Object(a.__metadata)("design:paramtypes",[I,D,s.ChangeDetectorRef])],e)}(),lt=function(){function e(e){this.flatBinding=e}return e.prototype.add=function(e){var t=e.sourceItem,n=e.destinationItem,i=e.dropPosition,r=e.sourceTree,a=e.destinationTree,s=Object.assign({},q(t));if(i===o.Over){Fe(n,a);var c=Object(p.d)(this.flatBinding.idField)(q(n));Object(p.g)(this.flatBinding.parentIdField)(s,c);var d=this.getLastVisibleChildNodeIndex(a,this.flatBinding.originalData,q(n))+1;this.flatBinding.originalData.splice(d,0,s),this.rebindData();var l=this.fetchChildNodes(q(n),a).indexOf(s);this.movedItemNewIndex=ne(n.item.index,l)}else{var u=i===o.After?1:0;d=this.flatBinding.originalData.indexOf(q(n))+u;this.flatBinding.originalData.splice(d,0,s);var h=Object(p.d)(this.flatBinding.parentIdField)(q(n));Object(p.g)(this.flatBinding.parentIdField)(s,h),this.rebindData();var f=n.parent?n.parent.item.index:null;l=(n.parent?this.fetchChildNodes(q(n.parent),a):a.nodes).indexOf(s);this.movedItemNewIndex=ne(f,l)}r!==a&&this.addChildNodes(s,r);var b=i===o.Over?q(n):q(n.parent);Ue(a,b),We(a,q(t),s),r===a||a.loadOnDemand||a.preloadChildNodes(),r!==a&&(a.changeDetectorRef.detectChanges(),a.focus(this.movedItemNewIndex))},e.prototype.remove=function(e){var t=e.sourceItem,n=e.sourceTree,i=e.destinationTree,o=q(t),r=this.flatBinding.originalData.indexOf(o);this.flatBinding.originalData.splice(r,1),n!==i&&this.removeChildNodes(o,n),this.rebindData();var a=t.parent?t.parent.children:[];if(Re(t.parent,a,n),Ge(n,q(t.parent)),n.loadOnDemand||n.preloadChildNodes(),n===i){i.changeDetectorRef.detectChanges();var s=Le(this.movedItemNewIndex,t.item.index);i.focus(s)}},e.prototype.addChildNodes=function(e,t){var n,i=this.fetchAllDescendantNodes(e,t);(n=this.flatBinding.originalData).push.apply(n,i)},e.prototype.removeChildNodes=function(e,t){var n=this;this.fetchAllDescendantNodes(e,t).forEach((function(e){var t=n.flatBinding.originalData.indexOf(e);n.flatBinding.originalData.splice(t,1)}))},e.prototype.fetchAllDescendantNodes=function(e,t){var n=this,i=this.fetchChildNodes(e,t);return i.forEach((function(e){return i=i.concat(n.fetchAllDescendantNodes(e,t)||[])})),i},e.prototype.fetchChildNodes=function(e,t){if(!e)return[];var n=[];return t.children(e).pipe(Object(b.take)(1)).subscribe((function(e){return n=n.concat(e||[])})),n},e.prototype.getLastVisibleChildNodeIndex=function(e,t,n){if(!z(e.loadMoreService)||!e.hasChildren(n))return t.length;var i=e.loadMoreService.getGroupSize(n),o=this.fetchChildNodes(n,e).slice(0,i),r=o[o.length-1];return t.indexOf(r)},e.prototype.rebindData=function(){this.flatBinding.nodes=this.flatBinding.originalData},e}(),pt=function(e,t,n){return t.filter((function(t){return e(t)===n}))},ut=new T,ht=function(e,t,n,i,o,r){return void 0===o&&(o=null),void 0===r&&(r=""),J(e)?e.map((function(e,a){var s=ut.nodeIndex(a.toString(),r),c={dataItem:e,index:s,parent:o,visible:!0};return c.children=ht(pt(Object(p.d)(n),t||[],Object(p.d)(i)(e)),t,n,i,c,s),c})):[]},ft=function(e){function t(t){var n=e.call(this,t)||this;return n.component=t,n.loadOnDemand=!0,n.originalData=[],n.component.isVisible=function(e){return n.visibleNodes.has(e)},n}return Object(a.__extends)(t,e),Object.defineProperty(t.prototype,"nodes",{set:function(e){if(this.originalData=e||[],n=this.parentIdField,R(n)||0===n.trim().length)this.component.nodes=this.originalData.slice(0);else{var t=Object(p.d)(this.parentIdField);this.component.nodes=this.originalData.filter(function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){return e.reduceRight((function(e,t){return t(e)}),t)}}(R,t)),this.filterData=ht(this.component.nodes,this.originalData,this.parentIdField,this.idField),this.updateVisibleNodes(this.filterData)}var n},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{set:function(e){this.component.isVisible=e},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;if(z(this.parentIdField)&&z(this.idField)){var t=function(t){return pt(Object(p.d)(e.parentIdField),e.originalData||[],Object(p.d)(e.idField)(t))};this.component.hasChildren=function(e){return t(e).length>0},this.component.children=function(e){return Object(h.of)(t(e))},this.component.editService=new lt(this),this.component.filterChange.subscribe(this.handleFilterChange.bind(this)),this.component.filter&&this.handleFilterChange(this.component.filter),!this.loadOnDemand&&z(this.component.preloadChildNodes)&&this.component.preloadChildNodes()}},t.prototype.ngOnChanges=function(e){Object(c.isChanged)("parentIdField",e,!1)&&(this.nodes=this.originalData),Object(c.anyChanged)(["nodes","loadOnDemand"],e)&&!this.loadOnDemand&&z(this.component.preloadChildNodes)&&this.component.preloadChildNodes()},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],t.prototype,"nodes",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"parentIdField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"idField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],t.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],t.prototype,"isVisible",null),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewFlatDataBinding]"}),Object(a.__metadata)("design:paramtypes",[fe])],t)}(rt),bt=function(e,t){return{dataItem:t,index:e}},mt=0,gt=function(){function e(e,t,n,i,o,r,a){this.element=e,this.expandService=t,this.navigationService=n,this.selectionService=i,this.lookupService=o,this.renderer=r,this.ib=a,this.role="treeitem",this.loadOnDemand=!0,this.isDisabled=!1,this.isVisible=!0,this.ariaChecked="false",this.id=mt++,this.isInitialized=!1,this.subscriptions=[],this.subscribe()}return Object.defineProperty(e.prototype,"isChecked",{set:function(e){this.ariaChecked="checked"===e?"true":"indeterminate"===e?"mixed":"false"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this._isExpanded||!1},set:function(e){this._isExpanded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isSelected",{get:function(){return this._isSelected||!1},set:function(e){this._isSelected=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isButton",{get:function(){return"button"===this.role},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"treeItem",{get:function(){return bt(this.index,this.dataItem)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentTreeItem",{get:function(){return this.parentDataItem?bt(this.parentIndex,this.parentDataItem):null},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.loadOnDemand&&!this.isButton&&this.lookupService.registerItem(this.treeItem,this.parentTreeItem),this.registerNavigationItem(),this.isInitialized=!0,this.setAttribute("role",this.role),this.setAriaAttributes(),this.setDisabledClass(),this.updateTabIndex()},e.prototype.ngOnChanges=function(e){var t=e.index,n=e.isDisabled;Object(c.anyChanged)(["index","checkable","isChecked","expandable","isExpanded","selectable","isSelected"],e)&&this.setAriaAttributes(),n&&this.setDisabledClass(),this.loadOnDemand&&!this.isButton&&this.moveLookupItem(e),this.moveNavigationItem(t),Object(c.anyChanged)(["isDisabled","isVisible"],e)&&this.updateNodeAvailability()},e.prototype.ngOnDestroy=function(){this.navigationService.unregisterItem(this.id,this.index),this.loadOnDemand&&!this.isButton&&this.lookupService.unregisterItem(this.index,this.dataItem),this.subscriptions=this.subscriptions.reduce((function(e,t){return t.unsubscribe(),e}),[])},e.prototype.subscribe=function(){var e=this;this.subscriptions=[this.navigationService.moves.subscribe((function(t){e.updateTabIndex(),e.focusItem(t.shouldScroll)})),this.navigationService.expands.pipe(Object(b.filter)((function(t){return t.index===e.index&&!e.isDisabled}))).subscribe((function(t){var n=t.expand;return e.expand(n)}))]},e.prototype.registerNavigationItem=function(){this.navigationService.registerItem(this.id,this.index,this.isDisabled,this.isButton,this.isVisible),this.activateItem()},e.prototype.activateItem=function(){if(!this.isDisabled){var e=this.navigationService,t=this.selectionService,n=this.index;t.setFirstSelected(n,this.isSelected),!e.isActive(n)&&t.isFirstSelected(n)&&e.activateIndex(n)}},e.prototype.expand=function(e){this.expandService[e?"expand":"collapse"](this.index,this.dataItem)},e.prototype.isFocusable=function(){return!this.isDisabled&&this.navigationService.isFocusable(this.index)},e.prototype.focusItem=function(e){void 0===e&&(e=!1),this.isInitialized&&this.navigationService.isActive(this.index)&&this.element.nativeElement.focus({preventScroll:!e})},e.prototype.moveLookupItem=function(e){void 0===e&&(e={});var t=e.dataItem,n=e.index,i=e.parentDataItem,o=e.parentIndex;if((!n||!n.firstChange)&&(t||n||i||o)){var r=(n||{}).previousValue||this.index;this.lookupService.replaceItem(r,this.treeItem,this.parentTreeItem)}},e.prototype.moveNavigationItem=function(e){void 0===e&&(e={});var t=e.currentValue,n=e.firstChange,i=e.previousValue;!n&&z(t)&&z(i)&&(this.navigationService.unregisterItem(this.id,i),this.navigationService.registerItem(this.id,t,this.isDisabled,this.isButton))},e.prototype.updateNodeAvailability=function(){var e=this.navigationService;this.isDisabled||!this.isVisible?e.activateClosest(this.index):e.activateFocusable(),e.unregisterItem(this.id,this.index),e.registerItem(this.id,this.index,this.isDisabled,this.isButton,this.isVisible)},e.prototype.setAriaAttributes=function(){this.setAttribute("aria-level",this.ib.level(this.index).toString()),this.setAttribute("aria-expanded",this.expandable?this.isExpanded.toString():null),this.setAttribute("aria-selected",this.selectable?this.isSelected.toString():null),this.setAttribute("aria-checked",this.checkable?this.ariaChecked:null)},e.prototype.setDisabledClass=function(){this.setClass("k-disabled",this.isDisabled)},e.prototype.setClass=function(e,t){var n=t?"addClass":"removeClass";this.renderer[n](this.element.nativeElement,e)},e.prototype.updateTabIndex=function(){this.setAttribute("tabIndex",this.isFocusable()?"0":"-1")},e.prototype.setAttribute=function(e,t){z(t)?this.renderer.setAttribute(this.element.nativeElement,e,t):this.renderer.removeAttribute(this.element.nativeElement,e)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"dataItem",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"index",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"parentDataItem",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"parentIndex",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"checkable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"selectable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"expandable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"isChecked",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"isDisabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"isVisible",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"isExpanded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"isSelected",null),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewItem]"}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,I,le,me,ve,s.Renderer2,T])],e)}(),vt=function(){function e(e,t,n,i){var o=this;this.element=e,this.navigationService=t,this.selectionService=n,this.renderer=i,this.initialSelection=!1,this.isSelected=S,this.subscriptions=new h.Subscription,this.subscriptions.add(this.navigationService.moves.subscribe(this.updateFocusClass.bind(this))),this.subscriptions.add(this.navigationService.selects.pipe(Object(b.filter)((function(e){return e===o.index}))).subscribe((function(e){return o.selectionService.select(e,o.dataItem)}))),this.subscriptions.add(this.selectionService.changes.subscribe((function(){o.updateSelectionClass(o.isSelected(o.dataItem,o.index))})))}return e.prototype.ngOnChanges=function(e){e.initialSelection&&this.updateSelectionClass(this.initialSelection),e.index&&this.updateFocusClass()},e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.updateFocusClass=function(){this.render(this.navigationService.isActive(this.index),"k-focus")},e.prototype.updateSelectionClass=function(e){this.render(e,"k-selected")},e.prototype.render=function(e,t){var n=e?"addClass":"removeClass";this.renderer[n](this.element.nativeElement,t)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"dataItem",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"index",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"initialSelection",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isSelected",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewItemContent]"}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,le,me,s.Renderer2])],e)}(),yt=[function(){function e(e,t,n){this.element=e,this.renderer=t,this.changeDetector=n,this.id="_"+Object(c.guid)(),this.tabindex=0,this.size="medium",this.checkStateChange=new s.EventEmitter,this.checkState="none"}return Object.defineProperty(e.prototype,"classWrapper",{get:function(){return!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indeterminate",{get:function(){return"indeterminate"===this.checkState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return"checked"===this.checkState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkBoxClasses",{get:function(){return"k-checkbox "+(this.size?re("checkbox",this.size):"")+" k-rounded-md"},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.renderer.removeAttribute(this.element.nativeElement,"tabindex")},e.prototype.ngDoCheck=function(){this.checkState=this.isChecked(this.node,this.index)},e.prototype.handleChange=function(e){var t=e.target.checked?"checked":"none";this.checkState=t,this.changeDetector.detectChanges(),this.checkStateChange.emit(t)},Object(a.__decorate)([Object(s.HostBinding)("class.k-checkbox-wrapper"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"classWrapper",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"isChecked",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"node",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"index",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"labelText",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"size",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"checkStateChange",void 0),e=Object(a.__decorate)([Object(s.Component)({selector:"kendo-checkbox",template:'\n <input\n type="checkbox"\n [class]="checkBoxClasses"\n [id]="id"\n [checked]="checked"\n [indeterminate]="indeterminate"\n [tabindex]="tabindex"\n (change)="handleChange($event)"\n />\n <label\n class="k-checkbox-label"\n tabindex="-1"\n [for]="id"\n >{{labelText}}</label>\n '}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,s.Renderer2,s.ChangeDetectorRef])],e)}()],_t=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[yt],exports:[yt]})],e)}(),Ot=function(){function e(e){this.treeview=e,this.subscriptions=new h.Subscription,this.subscriptions.add(this.treeview.addItem.subscribe(this.handleAdd.bind(this))),this.subscriptions.add(this.treeview.removeItem.subscribe(this.handleRemove.bind(this)))}return Object.defineProperty(e.prototype,"editService",{set:function(e){this.treeview.editService=e},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe()},e.prototype.handleAdd=function(e){if(!z(this.treeview.editService))throw new Error("No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).");this.treeview.editService.add(e)},e.prototype.handleRemove=function(e){if(!z(this.treeview.editService))throw new Error("No `editService` provided. Either provide your own implementation or use this directive in combination with one of the data binding directives (`kendoTreeViewHierarchyBinding` or `kendoTreeViewFlatDataBinding`).");this.treeview.editService.remove(e)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"editService",null),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewDragAndDropEditing]"}),Object(a.__metadata)("design:paramtypes",[_e])],e)}(),jt="http://www.telerik.com/kendo-angular-ui/components/treeview/load-more-button/",Ct=function(){function e(e){this.treeview=e,this.pageSizes=new Map,this.rootLevelId=Object(c.guid)(),this.treeview.loadMoreService={getInitialPageSize:this.getInitalPageSize.bind(this),getGroupSize:this.getGroupSize.bind(this),setGroupSize:this.setGroupSize.bind(this),getTotalNodesCount:this.getTotalNodesCount.bind(this)}}return Object.defineProperty(e.prototype,"loadMoreNodes",{set:function(e){"string"!=typeof e&&(this.treeview.loadMoreService.loadMoreNodes=e)},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){this.verifySettings()},e.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(!z(this.pageSize))throw new Error("To use the TreeView `kendoTreeViewLoadMore` directive, you need to assign a `pageSize` value. See "+jt+".");var e=this.treeview.loadMoreService.loadMoreNodes;if(z(e)&&"function"!=typeof e)throw new Error("The passed value to the `kendoTreeViewLoadMore` directive must be a function that retrieves additional nodes. See "+jt+".");if(z(e)&&!z(this.totalField))throw new Error("When a function to fetch additional nodes is provided to the `kendoTreeViewLoadMore` directive, the `totalField` and `totalRootNodes` values must also be provided. See "+jt+".")}},e.prototype.getGroupSize=function(e){var t=e||this.rootLevelId;return this.pageSizes.has(t)?this.pageSizes.get(t):this.pageSize},e.prototype.setGroupSize=function(e,t){var n=e||this.rootLevelId,i=t>0?t:0;this.pageSizes.set(n,i)},e.prototype.getTotalNodesCount=function(e,t){return z(e)&&z(this.totalField)?e[this.totalField]:!z(e)&&z(this.totalRootNodes)?this.totalRootNodes:t},e.prototype.getInitalPageSize=function(){return this.pageSize},Object(a.__decorate)([Object(s.Input)("kendoTreeViewLoadMore"),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"loadMoreNodes",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"pageSize",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"totalRootNodes",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"totalField",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoTreeViewLoadMore]"}),Object(a.__metadata)("design:paramtypes",[_e])],e)}(),kt=[_e,Oe,gt,vt,ue,je,Ce,we,Se,ct,dt,ft,it,et,qe,tt,Ye,Ot,Ct,he],wt=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[kt],exports:[kt],imports:[g.CommonModule,_t,y.InputsModule],entryComponents:[qe,Ye]})],e)}(),St=[_e,ue,je,Ce,we,Se,ct,ft,it,et,tt,Ot,Ct,he],xt=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({exports:[St],imports:[wt]})],e)}(),Et={name:"@progress/kendo-angular-dropdowns",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1642685068,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"},It=function(e){return null!=e},Tt=function(){var e,t,n="";for(e=0;e<32;e++)t=16*Math.random()|0,8!==e&&12!==e&&16!==e&&20!==e||(n+="-"),n+=(12===e?4:16===e?3&t|8:t).toString(16);return n},Dt=function(e){return Array.isArray(e)},Bt=function(e){return It(e)&&"object"==typeof e},Pt=function(e){return"string"==typeof e&&0===e.length},At=function(e,t,n){var i=function(e,t){return Dt(e)&&e.filter((function(e){return Bt(e)&&It(Rt(e,t))}))}(e,n)||[];return(function(e,t,n){return void 0===t&&(t=[]),e.map((function(e){return t.find((function(t){return Rt(t,n)===e}))})).filter((function(e){return void 0!==e}))}(e,t,n)||[]).concat(i)},Mt=function(e){return Dt(e)&&e.every((function(e){return Bt(e)}))},zt=function(e,t,n){var i=t.map((function(e){return It(e)&&It(Rt(e,n))?Rt(e,n):e}));return e.reduce((function(e,t){var o=It(t)&&It(Rt(t,n))?Rt(t,n):t,r=i.indexOf(o);return-1!==r&&e.push(r),e}),[])},Rt=function(e,t){return It(e)?It(t)&&Bt(e)?Object(p.d)(t)(e):e:null},Ft=function(e,t,n){if(!It(e))return!1;var i=String(e);return n&&(i=i.toLowerCase()),0===i.indexOf(t)},Nt=function(e,t){return!!It(e)&&t.every((function(t){return e.hasOwnProperty(t)}))},Lt=function(e){return e.className.includes("ng-untouched")},Vt=function(e){},Ht=function(e,t){var n=e.matches||e.msMatchesSelector||e.webkitMatchesSelector;return!!n&&n.call(e,t)},Kt=function(e,t){void 0===t&&(t=0);var n=Number(e);return isNaN(n)?t:n},$t=function(e,t,n){return e.nativeElement.contains(t)||n&&n.popupElement.contains(t)},Wt=function(e){return(e||"").split("_").length-1},Ut=function(e,t){if(!It(e)||0===e.children.length)return[];var n=e.children;return It(t)&&(n=n.filter((function(e){return t(e.item)}))),n.forEach((function(e){return n=n.concat(Ut(e,t))})),n},Gt=function(e,t){var n=e.dataItem,i=e.index,o=e.level,r=Array.isArray(t)?t:[t],a=It(o)?o:Wt(i),s=r[Math.min(a,r.length-1)];return Object(p.d)(s)(n)},Zt=function(e,t){return{small:"k-"+e+"-sm",medium:"k-"+e+"-md",large:"k-"+e+"-lg"}[t]},qt=function(e){return{small:"k-rounded-sm",medium:"k-rounded-md",large:"k-rounded-lg",full:"k-rounded-full"}[e]},Jt=function(e,t){return{solid:"k-"+e+"-solid",flat:"k-"+e+"-flat",outline:"k-"+e+"-outline"}[t]},Xt=function(){function e(e,t){this.localization=e,this.valueChange=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onClick=new s.EventEmitter,this.onNavigate=new s.EventEmitter,this.searchBarClass=!0,this._userInput="",this._previousValue="",this._placeholder="",this.direction=e.rtl?"rtl":"ltr",this.renderer=t}return Object.defineProperty(e.prototype,"userInput",{get:function(){return this._userInput},set:function(e){this._userInput=e||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.input.nativeElement.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this._placeholder},set:function(e){this._placeholder=e||"",this.setInputSize()},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.localizationChangeSubscription=this.localization.changes.subscribe((function(t){var n=t.rtl;return e.direction=n?"rtl":"ltr"}))},e.prototype.ngOnChanges=function(e){var t,n,i;if(this.input&&(e.userInput||e.suggestedText)){t=e.userInput&&e.userInput.previousValue?this._previousValue===e.userInput.previousValue?this._previousValue:e.userInput.currentValue||"":this._previousValue;var o=this.input.nativeElement.selectionStart,r=t.length===o;this.writeInputValue(this.suggestedText?(n=this.userInput,i=this.suggestedText,n.concat(i.substr(i.toLowerCase().indexOf(n.toLowerCase())+n.length))):this.userInput),this.suggestedText?this.setInputSelection(this.userInput.length,this.suggestedText.length):r?this.setInputSelection(this.userInput.length,this.userInput.length):this.setInputSelection(o,o),this._previousValue=this.userInput}},e.prototype.ngOnDestroy=function(){this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe()},e.prototype.writeInputValue=function(e){Object(c.isDocumentAvailable)()&&this.renderer.setProperty(this.input.nativeElement,"value",e)},e.prototype.setInputSelection=function(e,t){if(Object(c.isDocumentAvailable)()&&this.input.nativeElement===document.activeElement)try{this.input.nativeElement.setSelectionRange(e,t)}catch(e){}},e.prototype.handleInput=function(e){var t=e.target.value;t!==this.userInput&&(this._previousValue=t,this.valueChange.emit(t))},e.prototype.handleFocus=function(e){this.onFocus.emit(e)},e.prototype.handleBlur=function(e){this.onBlur.emit(e)},e.prototype.handleKeydown=function(e){var t=e.keyCode;[c.Keys.ArrowUp,c.Keys.ArrowDown,c.Keys.ArrowLeft,c.Keys.ArrowRight,c.Keys.Enter,c.Keys.Escape,c.Keys.Delete,c.Keys.Backspace,c.Keys.Home,c.Keys.End].indexOf(t)>-1&&this.onNavigate.emit(e)},e.prototype.focus=function(){Object(c.isDocumentAvailable)()&&this.input.nativeElement.focus()},e.prototype.blur=function(){Object(c.isDocumentAvailable)()&&this.input.nativeElement.blur()},e.prototype.setInputSize=function(){var e=function(e){return e?e.length:0},t=this.input.nativeElement,n=e(this.placeholder),i=e(this.value),o=Math.max(n,i,1);this.renderer.setAttribute(t,"size",o.toString())},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"listId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"tagListId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"activeDescendant",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"noDataLabel",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabIndex",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"popupOpen",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"userInput",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"suggestedText",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onClick",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onNavigate",void 0),Object(a.__decorate)([Object(s.ViewChild)("input",{static:!0}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"input",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-searchbar"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"searchBarClass",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"placeholder",null),e=Object(a.__decorate)([Object(s.Component)({selector:"kendo-searchbar",template:'\n <input #input\n autocomplete="off"\n [id]="id"\n [disabled]="disabled"\n [readonly]="readonly"\n [placeholder]="placeholder"\n [class]="\'k-input-inner\'"\n (input)="handleInput($event)"\n (keydown)="handleKeydown($event)"\n [kendoEventsOutsideAngular]="{\n focus: handleFocus,\n blur: handleBlur\n }"\n [scope]="this"\n [attr.tabIndex]="tabIndex"\n [attr.dir]="direction"\n [attr.role]="role"\n [attr.aria-disabled]="disabled"\n [attr.aria-readonly]="readonly"\n aria-haspopup="listbox"\n [attr.aria-expanded]="popupOpen"\n [attr.aria-owns]="listId"\n [attr.aria-describedby]="tagListId"\n [attr.aria-activedescendant]="activeDescendant"\n [attr.aria-label]="noDataLabel"\n />\n '}),Object(a.__metadata)("design:paramtypes",[u.LocalizationService,s.Renderer2])],e)}(),Yt=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),Qt=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoDropDownTreeHeaderTemplate],[kendoMultiColumnComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate],[kendoMultiSelectTreeHeaderTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),en=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListFooterTemplate],[kendoComboBoxFooterTemplate],[kendoDropDownTreeFooterTemplate],[kendoMultiColumnComboBoxFooterTemplate],[kendoAutoCompleteFooterTemplate],[kendoMultiSelectFooterTemplate],[kendoMultiSelectTreeFooterTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),tn=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListGroupTemplate],[kendoComboBoxGroupTemplate],[kendoMultiColumnComboBoxGroupTemplate],[kendoAutoCompleteGroupTemplate],[kendoMultiSelectGroupTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),nn=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListFixedGroupTemplate],[kendoComboBoxFixedGroupTemplate],[kendoMultiColumnComboBoxFixedGroupTemplate],[kendoAutoCompleteFixedGroupTemplate],[kendoMultiSelectFixedGroupTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),on=function(){function e(){this.onSelect=new s.EventEmitter,this.onChange=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.total=0,this.selectedIndices=[]}return e.prototype.getTotal=function(){return this.total},e.prototype.isSelected=function(e){return It(this.selectedIndices.find((function(t){return t===e})))},e.prototype.isFocused=function(e){return e===this.focused},e.prototype.focus=function(e){this.isFocused(e)||(this.focused=e,this.onFocus.emit(e))},e.prototype.select=function(e){this.isSelected(e)||(this.selectedIndices=[e],this.focused=e,this.onSelect.emit({indices:[e],newSelection:It(e)}))},e.prototype.add=function(e){this.isSelected(e)||(this.selectedIndices.push(e),this.focused=e,this.onChange.emit({added:e,indices:this.selectedIndices.slice()}))},e.prototype.unselect=function(e){if(this.isSelected(e)){var t=this.selectedIndices.indexOf(e);this.selectedIndices.splice(t,1),this.focused=e,this.onChange.emit({indices:this.selectedIndices.slice(),removed:e})}},e.prototype.change=function(e){var t=It(e)&&!this.isSelected(e);this.selectedIndices=[e],this.focused=e,this.onChange.emit({indices:[e],newSelection:t})},e.prototype.resetSelection=function(e){this.selectedIndices=e instanceof Array?e:[e],this.focused=this.selectedIndices[this.selectedIndices.length-1]},Object.defineProperty(e.prototype,"selected",{get:function(){return this.selectedIndices.slice()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focused",{get:function(){return this.focusedIndex},set:function(e){this.focusedIndex!==e&&(this.focusedIndex=e,this.onFocus.emit(e))},enumerable:!0,configurable:!0}),e=Object(a.__decorate)([Object(s.Injectable)()],e)}();!function(e){e[e.Undefined=0]="Undefined",e[e.Open=1]="Open",e[e.Close=2]="Close",e[e.Enter=3]="Enter",e[e.Tab=4]="Tab",e[e.Esc=5]="Esc",e[e.Delete=6]="Delete",e[e.Backspace=7]="Backspace",e[e.Home=8]="Home",e[e.End=9]="End",e[e.Up=10]="Up",e[e.Down=11]="Down",e[e.Left=12]="Left",e[e.Right=13]="Right"}(Ae||(Ae={}));var rn,an=function(){function e(){this.grouped=!1,this.groupIndices=[]}return Object.defineProperty(e.prototype,"data",{get:function(){return this.grouped?this._flatData:this._data},set:function(e){this._data=e,this.grouped=this.isGrouped(e),this.grouped&&(this.groupIndices=this.getGroupIndices(e),this._flatData=this.flatten(e))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemsCount",{get:function(){return It(this.data)&&0!==this.data.length?(this.grouped?this._flatData.filter((function(e){return!e.header})):this.data).length:0},enumerable:!0,configurable:!0}),e.prototype.isGrouped=function(e){return It(e)&&0!==e.length&&It(e[0])&&Nt(e[0],["aggregates","field","items","value"])},e.prototype.getGroupIndices=function(e){for(var t=[],n=0;n<=e.length-1;n++)t[n]=(t[n-1]||0)+e[n].items.length;return t},e.prototype.filter=function(e){var t=[];if(this.isGrouped(this.data))for(var n=0;n<=this.groupIndices.length-1;n++){var i=this.data[n].items.filter(e);i&&(t=t.concat(i))}else t=this.data.filter(e);return t},e.prototype.indexOf=function(e,t){void 0===t&&(t=0);var n=function(t){return t===e};return this.grouped&&(n=function(t){return t.value===e}),this.findIndex(n,t)},e.prototype.findIndex=function(e,t){void 0===t&&(t=0);var n=-1;if(this.grouped){n=(i=this._flatData.filter((function(e){return!e.header&&e.offsetIndex>=t}))).findIndex(e),n=i[n]?i[n].offsetIndex:-1}else{var i,o=(i=this.data.slice(t)).findIndex(e);n=-1!==o?o+t:-1}return n},e.prototype.closestGroup=function(e){for(var t=e;t>=0;t--)if(this._flatData[t].header)return this._flatData[t]},e.prototype.find=function(e){var t=this.findIndex(e);return this.itemAt(t)},e.prototype.flatIndex=function(e){if(0===this.itemsCount)return-1;if(!this.grouped)return e;var t=this._flatData.find((function(t){return!t.header&&t.offsetIndex===e}));return t?t.index:-1},e.prototype.itemAt=function(e){var t;if(0===this.itemsCount)return t;if(this.grouped){var n=this._flatData.find((function(t){return!t.header&&t.offsetIndex===e}));n&&(t=n.value)}else t=this.data[e];return t},e.prototype.groupAt=function(e){if(0!==this.itemsCount&&this.isGrouped)return this._flatData.find((function(t){return t.header&&t.index===e}))},e.prototype.groupField=function(){return 0!==this.itemsCount&&this.isGrouped?this._data[0].field:null},e.prototype.itemGroup=function(e){if(e&&0!==this.itemsCount&&this.isGrouped){var t=this.groupField();return t?Rt(e,t):void 0}},e.prototype.flatten=function(e,t,n,i){void 0===t&&(t=void 0),void 0===n&&(n=0),void 0===i&&(i=0);var o=[];It(t)&&o.push({header:!0,index:i+n,offsetIndex:i,value:t});for(var r=0;r<e.length;r++){var a=[];e[r].items?(a=this.flatten(e[r].items,e[r].value,n,r),n+=e[r].items.length):a.push({header:!1,index:i+n+r+1,offsetIndex:n+r,value:e[r]}),o=o.concat(a)}return o},e=Object(a.__decorate)([Object(s.Injectable)()],e)}(),sn=function(){function e(e){this.dataService=e,this.itemDisabled=null}return e.prototype.isIndexDisabled=function(e){if(this.itemDisabled){var t=this.dataService.itemAt(e);if(It(t))return this.itemDisabled({dataItem:t,index:e});if(It(this.defaultItem))return this.itemDisabled({dataItem:this.defaultItem,index:-1})}},e.prototype.isItemDisabled=function(e){if(this.itemDisabled){var t=this.dataService.indexOf(e);if(-1!==t)return this.itemDisabled({dataItem:e,index:t});if(It(this.defaultItem))return this.itemDisabled({dataItem:this.defaultItem,index:-1})}},e=Object(a.__decorate)([Object(s.Injectable)(),Object(a.__metadata)("design:paramtypes",[an])],e)}(),cn=function(e,t){this.index=e,this.originalEvent=t},dn=function(){function e(e,t){this.disabledItemsService=e,this.selectionService=t,this.open=new s.EventEmitter,this.close=new s.EventEmitter,this.enter=new s.EventEmitter,this.tab=new s.EventEmitter,this.esc=new s.EventEmitter,this.up=new s.EventEmitter,this.right=new s.EventEmitter,this.down=new s.EventEmitter,this.left=new s.EventEmitter,this.delete=new s.EventEmitter,this.backspace=new s.EventEmitter,this.home=new s.EventEmitter,this.end=new s.EventEmitter}return e.prototype.process=function(e){var t,n=e.originalEvent.keyCode,i=e.originalEvent.altKey,o=Ae.Undefined;i&&n===c.Keys.ArrowDown?o=Ae.Open:i&&n===c.Keys.ArrowUp?o=Ae.Close:n===c.Keys.Enter?o=Ae.Enter:n===c.Keys.Escape?o=Ae.Esc:n===c.Keys.Tab?o=Ae.Tab:n===c.Keys.ArrowUp?(t=this.next({current:e.current,start:e.min,end:e.max,step:-1}),o=Ae.Up):n===c.Keys.ArrowLeft?(t=this.next({current:e.current,start:e.min,end:e.max,step:-1}),o=Ae.Left):n===c.Keys.ArrowDown?(t=this.next({current:e.current,start:e.min,end:e.max,step:1}),o=Ae.Down):n===c.Keys.ArrowRight?(t=this.next({current:e.current,start:e.min,end:e.max,step:1}),o=Ae.Right):n===c.Keys.Home?(t=this.isDisabled(0)?e.current:0,o=Ae.Home):n===c.Keys.End?(t=this.isDisabled(e.max)?e.current:e.max,o=Ae.End):n===c.Keys.Delete?o=Ae.Delete:n===c.Keys.Backspace&&(o=Ae.Backspace);var r=new cn(t,e.originalEvent);return o!==Ae.Undefined&&this[Ae[o].toLowerCase()].emit(r),o},e.prototype.next=function(e){var t=e.current,n=e.start,i=e.end,o=e.step,r=It(t)?this.clampIndex(t+o,n,i):n,a=this.firstFocusableIndex(r,n,i,o);if(It(a))return a;if(this.selectionService.isSelected(t)&&t>=n)return t;var s=-1*o;return this.firstFocusableIndex(r,n,i,s)},e.prototype.clampIndex=function(e,t,n){return!It(e)||e<t?t:e>n?n:e},e.prototype.firstFocusableIndex=function(e,t,n,i){for(;t<=e&&e<=n;){if(!this.isDisabled(e))return e;e+=i}},e.prototype.isDisabled=function(e){if(this.disabledItemsService)return this.disabledItemsService.isIndexDisabled(e)},e=Object(a.__decorate)([Object(s.Injectable)(),Object(a.__metadata)("design:paramtypes",[sn,on])],e)}(),ln=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListNoDataTemplate],[kendoDropDownTreeNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoMultiColumnComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate],[kendoMultiSelectTreeNoDataTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),pn=function(){function e(){this.prevented=!1}return e.prototype.preventDefault=function(){this.prevented=!0},e.prototype.isDefaultPrevented=function(){return this.prevented},e}(),un=function(){},hn=function(){function e(e){this.element=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:'"li[role=option], li[role=group]"'}),Object(a.__metadata)("design:paramtypes",[s.ElementRef])],e)}(),fn=function(){function e(e,t,n,i,o,r,a){var c=this;this.dataService=e,this.wrapper=t,this.selectionService=n,this.disabledItemsService=i,this.cdr=o,this.zone=r,this.renderer=a,this.selected=[],this.focused=-1,this.show=!0,this.multipleSelection=!1,this.type="list",this.checkboxes={enabled:!1},this.rounded="medium",this.onClick=new s.EventEmitter,this.pageChange=new s.EventEmitter,this.listResize=new s.EventEmitter,this.startFrom=0,this.lastLoaded=0,this.lastScrollTop=0,this.scrollToFocused=!1,this._size="medium",this.selectSubscription=Object(h.merge)(this.selectionService.onSelect.pipe(Object(b.map)((function(e){return e.indices[0]}))),this.selectionService.onFocus).pipe(Object(b.switchMap)((function(e){return c.zone.onStable.pipe(Object(b.take)(1),Object(b.map)((function(){return e})))}))).subscribe(this.scrollToItem.bind(this)),this.prepareClasses()}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e[0]&&e[0].header?e.slice(0):e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){"list"===this.type&&(this.renderer.removeClass(this.wrapper.nativeElement,Zt("list",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("list",e)),this._size=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pageSize",{get:function(){return this.virtual.pageSize?this.virtual.pageSize:Math.round(this.height/this.virtual.itemHeight)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrollHeight",{get:function(){return(this.dataService.grouped?this.virtual.total-1:this.virtual.total)*this.virtual.itemHeight},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"overflowY",{get:function(){if(It(this.virtual))return this.hasVirtualScrollbar()?"scroll":"hidden"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkboxClasses",{get:function(){return(this.size?Zt("checkbox",this.size):"")+" "+(this.rounded?qt(this.rounded):"")},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(e){Object(c.isChanged)("data",e,!1)&&(this.lastLoaded<=0&&(this.lastLoaded=this.data.length-1,this.scrollToFocused=!e.data.isFirstChange()),this.setOverflow()),Object(c.isChanged)("virtual",e,!1)&&this.setOverflow(),Object(c.isChanged)("type",e,!1)&&this.prepareClasses()},e.prototype.ngAfterViewInit=function(){var e=this;this.setComponentClasses(),this.zone.runOutsideAngular((function(){e.scrollSubscription=Object(h.fromEvent)(e.content.nativeElement,"scroll").pipe(Object(b.auditTime)(100),Object(b.tap)(e.prefetchData.bind(e)),Object(b.tap)(e.findCurrentGroup.bind(e))).subscribe((function(){e.lastScrollTop=e.content.nativeElement.scrollTop}))})),this.setOverflow()},e.prototype.ngAfterViewChecked=function(){if(this.virtual&&this.positionItems(),this.items&&this.scrollToFocused){this.scrollToFocused=!1;var e=this.items.length&&-1===this.selectionService.focused?0:this.selectionService.focused;this.scrollToItem(e)}this.dataService.grouped&&this.findCurrentGroup()},e.prototype.ngOnDestroy=function(){this.selectSubscription.unsubscribe(),this.scrollSubscription&&this.scrollSubscription.unsubscribe()},e.prototype.onCheckedChange=function(e,t){var n=e.target.checked;n&&!this.selectionService.isSelected(t)&&this.selectionService.add(t),!n&&this.selectionService.isSelected(t)&&this.selectionService.unselect(t)},e.prototype.prepareClasses=function(){"list"===this.type?(this.listContentClass="k-list-content",this.listClass="k-list-ul",this.listItemClass="k-list-item",this.listVirtualClass="k-virtual-list",this.listGroupStickyHeaderClass="k-list-group-sticky-header",this.listGroupStickyHeaderTextClass="k-list-header-text",this.listGroupItemClass="k-list-group-item",this.listGroupItemTextClass="k-list-item-text"):(this.listContentClass="k-table-body k-table-scroller",this.listClass="k-table k-table-list",this.listItemClass="k-table-row",this.listVirtualClass="k-virtual-table",this.listGroupStickyHeaderClass="k-table-group-sticky-header",this.listGroupStickyHeaderTextClass="k-table-th",this.listGroupItemClass="k-table-group-row",this.listGroupItemTextClass="k-table-th")},e.prototype.isChecked=function(e){var t=this.virtual?e+this.virtual.skip:e;return this.selectionService.isSelected(t)},e.prototype.firstVisibleItem=function(){var e=this,t=this.content.nativeElement,n=t.getBoundingClientRect(),i=Array.prototype.slice.call(t.querySelectorAll(".k-disabled"));i.forEach((function(t){return e.renderer.setStyle(t,"pointer-events","auto")}));var o=document.elementFromPoint(n.left+1,n.top+1);return i.forEach((function(t){return e.renderer.setStyle(t,"pointer-events","none")})),function(e,t){for(var n=e;null!==n&&1===n.nodeType;){if(Ht(n,t))return n;n=n.parentElement||n.parentNode}return null}(o,"li")},e.prototype.findCurrentGroup=function(){if(this.dataService.grouped){var e=this.firstVisibleItem();if(e){var t=void 0;"group"===e.getAttribute("role")?(t=parseInt(e.getAttribute("group-index"),10),this.currentGroup=this.dataService.groupAt(t).value):(t=parseInt(e.getAttribute("index"),10),this.currentGroup=this.dataService.itemGroup(this.dataService.itemAt(t)))}else this.currentGroup=void 0;this.cdr.detectChanges()}else this.currentGroup=void 0},e.prototype.prefetchData=function(){if(this.virtual){var e=Math.trunc(this.content.nativeElement.clientHeight/this.virtual.itemHeight),t=this.content.nativeElement.scrollTop,n=Math.trunc(t/this.virtual.itemHeight),i=t>this.lastScrollTop,o=n+e>=this.lastLoaded&&this.lastLoaded<this.virtual.total-1,r=this.pageSize-(this.lastLoaded-this.startFrom),a=this.lastLoaded-this.pageSize+e>=n-r;i&&o&&this.changePage(n),!i&&a&&this.changePage(n-this.pageSize+e+1)}},e.prototype.changePage=function(e){var t=this;this.zone.run((function(){var n=t.pageSize+e;n>t.virtual.total&&(e--,n=t.virtual.total),e<0&&(e=0),t.startFrom=e,t.lastLoaded=n,t.pageChange.emit({skip:e,take:t.pageSize})}))},e.prototype.index=function(e,t){return e>0?this.dataService.groupIndices[e-1]+t:t},e.prototype.getText=function(e){return Rt(e,this.textField)},e.prototype.getValue=function(e){return Rt(e,this.valueField)},e.prototype.isDisabled=function(e){return It(this.virtual)&&(e+=this.virtual.skip),this.disabledItemsService.isIndexDisabled(e)},e.prototype.isAltRow=function(e){return"dropdowngrid"===this.type&&e%2!=0},e.prototype.scrollToItem=function(e){var t=e;this.dataService.grouped&&(t=this.dataService.flatIndex(e),t+=this.firstGroupHeaderInTargetedPage(t)?-1:0);if(this.virtual&&t>-1)this.scrollToIndex(t);else{var n=this.items.toArray();It(n[t])&&-1!==t&&this.scroll(n[t].element)}},e.prototype.scrollToIndex=function(e){var t=this.content.nativeElement,n=t.scrollTop,i=e*this.virtual.itemHeight,o=this.virtual.itemHeight,r=t.clientHeight,a=i+o;n>i?n=i:a>n+r&&(n=a-r),t.scrollTop=n},e.prototype.scroll=function(e){if(e){var t=e.nativeElement,n=this.content.nativeElement,i=t.offsetTop,o=t.offsetHeight,r=n.scrollTop,a=n.clientHeight,s=i+o;r>i?r=i:s>r+a&&(r=s-a),n.scrollTop=r}},e.prototype.hasScrollbar=function(){return!!(It(this.items)&&this.items.length&&It(this.list)&&It(this.content))&&(It(this.virtual)&&this.hasVirtualScrollbar()||this.list.nativeElement.scrollHeight>this.content.nativeElement.offsetHeight)},e.prototype.setOverflow=function(){if(this.virtual){var e=this.hasVirtualScrollbar()?"scroll":"hidden";this.renderer.setStyle(this.content.nativeElement,"overflow-y",e)}},e.prototype.hasVirtualScrollbar=function(){var e=this.content.nativeElement.offsetHeight,t=this.virtualContainer&&this.virtualContainer.nativeElement.offsetHeight;return this.virtualContainer&&t>e},e.prototype.positionItems=function(){var e=this;this.items.forEach((function(t,n){var i=(n+e.startFrom)*e.virtual.itemHeight;e.renderer.setStyle(t.element.nativeElement,"transform","translateY("+i+"px")}))},e.prototype.firstGroupHeaderInTargetedPage=function(e){return!It(this.virtual)||0===this.virtual.skip&&this.virtual.pageSize>e},e.prototype.setComponentClasses=function(){"list"===this.type&&(this.renderer.addClass(this.wrapper.nativeElement,"k-list"),this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("list",this.size))),It(this.virtual)&&this.renderer.addClass(this.wrapper.nativeElement,this.listVirtualClass)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"selected",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"focused",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"height",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Yt)],e.prototype,"template",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",tn)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",nn)],e.prototype,"fixedGroupTemplate",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"show",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"optionPrefix",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"multipleSelection",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"virtual",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"type",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"checkboxes",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"rounded",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onClick",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"pageChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"listResize",void 0),Object(a.__decorate)([Object(s.ViewChildren)(hn),Object(a.__metadata)("design:type",s.QueryList)],e.prototype,"items",void 0),Object(a.__decorate)([Object(s.ViewChild)("content",{static:!0}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"content",void 0),Object(a.__decorate)([Object(s.ViewChild)("list",{static:!0}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"list",void 0),Object(a.__decorate)([Object(s.ViewChild)("virtualContainer",{static:!1}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"virtualContainer",void 0),e=Object(a.__decorate)([Object(s.Component)({selector:"kendo-list",template:'\n <div *ngIf="dataService.grouped"\n [class]="listGroupStickyHeaderClass"\n [ngStyle]="{\n \'height.px\': virtual?.itemHeight,\n \'minHeight.px\' : virtual?.itemHeight,\n \'boxSizing\' : virtual ? \'border-box\' : \'inherit\'}"\n >\n <ng-template *ngIf="fixedGroupTemplate"\n [templateContext]="{\n templateRef: fixedGroupTemplate.templateRef,\n $implicit: currentGroup\n }">\n </ng-template>\n <ng-template [ngIf]="!fixedGroupTemplate"><span [class]="listGroupStickyHeaderTextClass">{{ currentGroup }}</span></ng-template>\n </div>\n <div #content\n [class]="listContentClass"\n [style.overscrollBehavior]="\'none\'"\n [style.maxHeight.px]="height"\n unselectable="on">\n <ul #list\n role="listbox"\n [class]="listClass"\n [attr.id]="id"\n [attr.aria-hidden]="!show">\n <ng-template *ngIf="!dataService.grouped && show" ngFor let-dataItem let-itemIndex="index" [ngForOf]="data">\n <li\n role="option"\n kendoDropDownsSelectable\n [checkboxes]="checkboxes"\n [height]="virtual?.itemHeight"\n [index]="itemIndex + startFrom"\n [multipleSelection]="multipleSelection"\n [attr.id]="optionPrefix + \'-\' + getValue(dataItem)"\n [attr.tabIndex]="-1"\n [class]="listItemClass"\n [ngClass]="{\n \'k-disabled\': isDisabled(itemIndex),\n \'k-table-alt-row\': isAltRow(itemIndex)\n }"\n >\n <input\n *ngIf="checkboxes.enabled"\n type="checkbox"\n class="k-checkbox"\n [ngClass]="checkboxClasses"\n (change)="onCheckedChange($event, itemIndex)"\n [checked]="isChecked(itemIndex)"\n />\n <ng-template *ngIf="template"\n [templateContext]="{\n templateRef: template.templateRef,\n $implicit: dataItem\n }">\n </ng-template>\n <ng-template [ngIf]="!template"><span class="k-list-item-text">{{ getText(dataItem) }}</span></ng-template>\n </li>\n </ng-template>\n <ng-template *ngIf="dataService.grouped" ngFor let-dataItem let-itemIndex="index" [ngForOf]="data">\n <li\n *ngIf="dataItem.header && dataItem.index > 0"\n role="group"\n [class]="listGroupItemClass"\n [class.k-table-alt-row]="isAltRow(itemIndex - 1)"\n [ngStyle]="{\n \'height.px\': virtual?.itemHeight,\n \'minHeight.px\' : virtual?.itemHeight,\n \'boxSizing\' : virtual ? \'border-box\' : \'inherit\'}"\n [attr.group-index]="dataItem.index"\n [attr.id]="optionPrefix + \'-\' + getValue(dataItem.value)"\n [attr.tabIndex]="-1">\n <span [class]="listGroupItemTextClass">\n <ng-template *ngIf="groupTemplate"\n [templateContext]="{\n templateRef: groupTemplate.templateRef,\n $implicit: dataItem.value\n }">\n </ng-template>\n <ng-template [ngIf]="!groupTemplate">{{ dataItem.value }}</ng-template>\n </span>\n </li>\n <li\n *ngIf="!dataItem.header"\n role="option"\n kendoDropDownsSelectable\n [height]="virtual?.itemHeight"\n [index]="dataItem.offsetIndex"\n [multipleSelection]="multipleSelection"\n [attr.absolute-index]="dataItem.index"\n [attr.id]="optionPrefix + \'-\' + getValue(dataItem.value)"\n [attr.tabIndex]="-1"\n [class]="listItemClass"\n [ngClass]="{\n \'k-disabled\': isDisabled(dataItem.offsetIndex),\n \'k-table-alt-row\': isAltRow(itemIndex - 1)\n }"\n >\n <ng-template *ngIf="template"\n [templateContext]="{\n templateRef: template.templateRef,\n $implicit: dataItem.value\n }">\n </ng-template>\n <ng-template [ngIf]="!template"><span class="k-list-item-text">{{ getText(dataItem.value) }}</span></ng-template>\n </li>\n </ng-template>\n <kendo-resize-sensor\n *ngIf="!virtual"\n (resize)="listResize.emit()"\n >\n </kendo-resize-sensor>\n </ul>\n <div *ngIf="virtual" #virtualContainer class="k-height-container" role="presentation">\n <div [style.height.px]="scrollHeight">\n <kendo-resize-sensor (resize)="listResize.emit()"></kendo-resize-sensor>\n </div>\n </div>\n </div>\n '}),Object(a.__metadata)("design:paramtypes",[an,s.ElementRef,on,sn,s.ChangeDetectorRef,s.NgZone,s.Renderer2])],e)}(),bn={pageSize:50,itemHeight:28},mn=function(e,t){var n=Object.assign({},bn,t);return!0===e?n:e?Object(a.__assign)({pageSize:bn.pageSize},e):null},gn=new s.InjectionToken("dropdowns-touch-enabled"),vn={multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return yn}))},yn=function(){function e(e,t,n,i,o,r,a,c,d,p,u){this.localization=e,this.dataService=t,this.popupService=n,this.selectionService=i,this.navigationService=o,this.disabledItemsService=r,this._zone=a,this.cdr=c,this.renderer=d,this.hostElement=p,this.touchEnabled=u,this.highlightFirst=!0,this.focusableId="k-"+Tt(),this.placeholder="",this.listHeight=200,this.clearButton=!0,this.disabled=!1,this.readonly=!1,this.tabindex=0,this.filterable=!1,this.valueChange=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.widgetClasses=!0,this.listBoxId=Tt(),this.optionPrefix=Tt(),this.onChangeCallback=Vt,this.onTouchedCallback=Vt,this.popupMouseDownHandler=function(e){return e.preventDefault()},this._popupSettings={animate:!0},this._open=!1,this._value="",this.valueChangeSubject=new h.Subject,this._isFocused=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",Object(l.validatePackage)(Et),this.direction=e.rtl?"rtl":"ltr",this.wrapper=this.hostElement.nativeElement,this.data=[],this.subscribeEvents(),this.subscribeTouchEvents(),this.selectionService.resetSelection([-1])}var t;return t=e,Object.defineProperty(e.prototype,"width",{get:function(){var e=0;Object(c.isDocumentAvailable)()&&(e=this.wrapper.offsetWidth);var t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){var e=["k-list-container","k-reset"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suggestion",{get:function(){if(this.text&&this.suggestedText){var e=this.suggestedText.toLowerCase().startsWith(this.text.toLowerCase());return this.suggest&&!this.backspacePressed&&e?this.suggestedText:void 0}this.suggestedText=void 0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonVisiblity",{get:function(){if(this.touchEnabled)return"visible"},enumerable:!0,configurable:!0}),e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!t._open;t._toggle(n)}))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._open},enumerable:!0,configurable:!0}),e.prototype.togglePopup=function(e){var t=this.disabled||this.readonly,n=this.isOpen===e;t||n||(this.triggerPopupEvents(e)||this._toggle(e))},Object.defineProperty(e.prototype,"activeDescendant",{get:function(){if(!this.isOpen||!It(this.selectionService.focused)||-1===this.selectionService.focused)return null;var e=this.dataService.itemAt(this.selectionService.focused);return this.optionPrefix+"-"+Rt(e,this.valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noDataLabel",{get:function(){if(0===this.data.length)return this.noDataText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearTitle",{get:function(){return this.localization.get("clearTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){var e=this.virtual;if(e){var t=e.skip||0,n=t+e.pageSize;return e.total=this.dataService.data.length,this.dataService.data.slice(t,n)}return this.dataService.data},set:function(e){this.dataService.data=e||[],this.virtual&&(this.virtual.skip=0),this.filterable&&(this.selectionService.focused=this.isOpen&&this.data.length&&this.highlightFirst?this.firstFocusableIndex(0):-1),this.suggest&&this.dataService.itemsCount>0&&(this.suggestedText=Rt(this.dataService.itemAt(0),this.valueField))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value||""},set:function(e){this.verifySettings(e),this._value=e||"",this.text=this.value,this.cdr.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemDisabled",{set:function(e){if("function"!=typeof e)throw new Error("itemDisabled must be a function, but received "+JSON.stringify(e)+".");this.disabledItemsService.itemDisabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"virtual",{get:function(){return this._virtualSettings},set:function(e){this._virtualSettings=mn(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper,Zt("input",this.size)),e&&this.renderer.addClass(this.wrapper,Zt("input",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper,Jt("input",this.fillMode)),e&&this.renderer.addClass(this.wrapper,Jt("input",e)),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.renderer.removeAttribute(this.wrapper,"tabindex"),this.localizationChangeSubscription=this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.setMessages()})),this.setMessages(),this.setComponentClasses()},e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.unsubscribeEvents(),clearTimeout(this.messagesTimeout),this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe()},e.prototype.ngOnChanges=function(e){var t=this.virtual;t&&e.data&&e.data.isFirstChange()&&this.pageChange({skip:0,take:t.pageSize})},e.prototype.reset=function(){this.value=""},e.prototype.clearValue=function(e){e.stopImmediatePropagation(),this.focus(),this.change(""),this.filterable&&this.filterChange.emit(""),this.selectionService.resetSelection([])},e.prototype.writeValue=function(e){this.value=e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.focusItemAt=function(e){var t=e>=0&&e<this.data.length;It(e)&&t&&!this.disabledItemsService.isIndexDisabled(e)?this.selectionService.focus(e):this.selectionService.focus(-1)},e.prototype.focus=function(){this.disabled||this.searchbar.focus()},e.prototype.blur=function(){this.disabled||this.searchbar.blur()},e.prototype.onResize=function(){if(this._open){var e=this.popupRef.popupElement,t=this.width,n=t.min,i=t.max;e.style.minWidth=n,e.style.width=i}},e.prototype.emitChange=function(e){this.onChangeCallback(e),this.valueChange.emit(e)},e.prototype.verifySettings=function(e){if(Object(s.isDevMode)()&&It(e)&&"string"!=typeof e)throw new Error("Expected value of type string. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/autocomplete/value-binding/")},e.prototype.search=function(e,t){var n;void 0===t&&(t=0),n=e.length&&this.dataService.itemsCount?this.dataService.findIndex(this.findIndexPredicate(e),t):-1,this.disabledItemsService.isIndexDisabled(n)?n+1<this.dataService.itemsCount?this.search(e,n+1):this.selectionService.focus(-1):(this.selectionService.focus(n),this.suggest&&(this.suggestedText=Rt(this.dataService.itemAt(n),this.valueField)))},e.prototype.navigate=function(e){this.isOpen&&this.selectionService.focus(e)},e.prototype.handleNavigate=function(e){var t=isNaN(this.selectionService.focused)?this.firstFocusableIndex(0):this.selectionService.focused;if(!(this.disabled||this.readonly||isNaN(t))){var n=this.navigationService.process({current:t,max:this.dataService.itemsCount-1,min:0,originalEvent:e});n!==Ae.Undefined&&n!==Ae.Backspace&&n!==Ae.Delete&&n!==Ae.Home&&n!==Ae.End&&n!==Ae.Left&&n!==Ae.Right&&(n===Ae.Enter&&this.isOpen||n!==Ae.Enter)&&e.preventDefault()}},e.prototype.handleEnter=function(e){var t,n=this.selectionService.focused;if(this.isOpen&&e.originalEvent.preventDefault(),n>=0)t=Rt(this.dataService.itemAt(n),this.valueField);else{var i=this.suggest&&this.suggestedText&&this.data.length&&Rt(this.dataService.itemAt(0),this.valueField).toLowerCase()===this.searchbar.value.toLowerCase();t=this.isOpen&&i?this.suggestedText:this.searchbar.value}this.change(t)},e.prototype.handleEscape=function(){this.togglePopup(!1),this.selectionService.focused=-1,this.suggestedText=null},e.prototype.searchBarChange=function(e){var t=It(this.text)?this.text.length:0;this.backspacePressed=e.length<t,this.text=e,this.togglePopup(e.length>0),this.highlightFirst||(this.selectionService.focused=-1),this.filterable?this.filterChange.emit(e):this.highlightFirst&&this.search(e)},e.prototype.handleFocus=function(){var e=this;this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this._zone.run((function(){e.onFocus.emit()}))},e.prototype.handleBlur=function(){var e,t,n=this,i=this.filterable?this.selectionService.focused:-1;this.searchbar.input.nativeElement.scrollLeft=0,-1!==i?(e=this.dataService.itemAt(i),t=Rt(e,this.valueField)||""):t=this.searchbar.value;var o=t===this.searchbar.value,r=t.toLowerCase()===this.searchbar.value.toLowerCase();!o&&r&&this.selectionService.resetSelection([]),this.isFocused=!1;var a=this.value!==this.text;Object(c.hasObservers)(this.onBlur)||Object(c.hasObservers)(this.close)||Lt(this.wrapper)||a?this._zone.run((function(){a&&n.change(n.searchbar.value),n.onBlur.emit(),n.onTouchedCallback(),n.togglePopup(!1)})):this.togglePopup(!1)},e.prototype.pageChange=function(e){this.virtual.skip=e.skip},e.prototype.change=function(e){this.togglePopup(!1),this.valueChangeSubject.next(e)},e.prototype.subscribeEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.valueChangeSubscription=this.valueChangeSubject.subscribe((function(t){var n=e.value!==t;e.value=t,e.text=t,n&&e.emitChange(t)})),this.changeSubscription=this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)),this.focusSubscription=this.selectionService.onFocus.subscribe(this.handleItemFocus.bind(this)),this.navigationSubscription=Object(h.merge)(this.navigationService.up,this.navigationService.down).subscribe((function(t){return e.navigate(t.index)})),this.closeSubscription=this.navigationService.close.subscribe((function(){return e.togglePopup(!1)})),this.enterSubscription=this.navigationService.enter.subscribe(this.handleEnter.bind(this)),this.escSubscription=this.navigationService.esc.subscribe(this.handleEscape.bind(this)))},e.prototype.subscribeTouchEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&this.touchEnabled&&this._zone.runOutsideAngular((function(){return e.touchstartDisposeHandler=e.renderer.listen(document,"touchstart",(function(t){var n=t.target;e.isFocused&&!$t(e.hostElement,n,e.popupRef)&&e._zone.run((function(){return e.blur()}))}))}))},e.prototype.unsubscribeEvents=function(){Object(c.isDocumentAvailable)()&&(this.changeSubscription.unsubscribe(),this.navigationSubscription.unsubscribe(),this.closeSubscription.unsubscribe(),this.enterSubscription.unsubscribe(),this.escSubscription.unsubscribe(),this.valueChangeSubscription.unsubscribe(),this.focusSubscription.unsubscribe(),this.touchstartDisposeHandler&&this.touchstartDisposeHandler())},e.prototype.handleItemChange=function(e){var t=e.indices.length?e.indices[0]:void 0;if(this.selectionService.resetSelection([-1]),It(t)){var n=Rt(this.dataService.itemAt(t),this.valueField);this.change(n)}},e.prototype.handleItemFocus=function(e){var t=this.selectionService.focused;Boolean(this.suggest&&this.data&&this.data.length&&t>=0)&&(this.suggestedText=Rt(this.dataService.itemAt(t),this.valueField))},e.prototype.createPopup=function(){var e=this;this.virtual&&(this.virtual.skip=0);var t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupClass:this.listContainerClasses,positionMode:"absolute",popupAlign:i,anchorAlign:n});var o=this.popupRef.popupElement,r=this.width,a=r.min,s=r.max;o.addEventListener("mousedown",this.popupMouseDownHandler),o.style.minWidth=a,o.style.width=s,o.style.height=this.height,o.setAttribute("dir",this.direction),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.optionsList.scrollToItem(e.selectionService.focused),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()})),this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.togglePopup(!1)}))},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null)},e.prototype._toggle=function(e){this._open=e,this.destroyPopup(),this._open&&this.createPopup()},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype.firstFocusableIndex=function(e){var t=this.data.length-1;return this.disabledItemsService.isIndexDisabled(e)?e<t?this.firstFocusableIndex(e+1):void 0:e},e.prototype.findIndexPredicate=function(e){var t=this;return this.dataService.grouped?function(n){var i=Rt(n.value,t.valueField);return(i=It(i)?i.toString().toLowerCase():"").startsWith(e.toLowerCase())}:function(n){var i=Rt(n,t.valueField);return(i=It(i)?i.toString().toLowerCase():"").startsWith(e.toLowerCase())}},e.prototype.setMessages=function(){var e=this;this._zone.runOutsideAngular((function(){clearTimeout(e.messagesTimeout),e.messagesTimeout=setTimeout((function(){e.noDataText=e.localization.get("noDataText"),e.cdr.detectChanges()}))}))},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper,Zt("input",this.size)),this.rounded&&this.renderer.addClass(this.wrapper,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper,Jt("input",this.fillMode))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"highlightFirst",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"suggest",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"itemDisabled",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(a.__decorate)([Object(s.Input)("tabIndex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"virtual",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.ContentChild)(Yt,{static:!1}),Object(a.__metadata)("design:type",Yt)],e.prototype,"template",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(tn,{static:!1}),Object(a.__metadata)("design:type",tn)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(nn,{static:!1}),Object(a.__metadata)("design:type",nn)],e.prototype,"fixedGroupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)(Xt,{static:!0}),Object(a.__metadata)("design:type",Xt)],e.prototype,"searchbar",void 0),Object(a.__decorate)([Object(s.ViewChild)("optionsList",{static:!1}),Object(a.__metadata)("design:type",fn)],e.prototype,"optionsList",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-autocomplete"),Object(s.HostBinding)("class.k-input"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"widgetClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoAutoComplete",providers:[vn,an,on,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.autocomplete"},{provide:un,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-autocomplete",template:'\n <ng-container kendoAutoCompleteLocalizedMessages\n i18n-noDataText="kendo.autocomplete.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.autocomplete.clearTitle|The title of the clear button"\n clearTitle="clear"\n >\n </ng-container>\n <kendo-searchbar #searchbar\n [role]="\'combobox\'"\n [id]="focusableId"\n [listId]="listBoxId"\n [activeDescendant]="activeDescendant"\n [noDataLabel]="noDataLabel"\n [userInput]="text"\n [suggestedText]="suggestion"\n [disabled]="disabled"\n [readonly]="readonly"\n [tabIndex]="tabIndex"\n [popupOpen]="isOpen"\n [placeholder]="placeholder"\n (onNavigate)="handleNavigate($event)"\n (valueChange)="searchBarChange($event)"\n (onBlur)="handleBlur()"\n (onFocus)="handleFocus()"\n ></kendo-searchbar>\n <span\n *ngIf="!loading && !readonly && (clearButton && text?.length)"\n class="k-clear-value"\n [style.visibility]="clearButtonVisiblity"\n [attr.title]="clearTitle"\n role="button"\n tabindex="-1"\n (click)="clearValue($event)"\n (mousedown)="$event.preventDefault()"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n <span *ngIf="loading" class="k-icon k-i-loading"></span>\n <ng-template #popupTemplate>\n \x3c!--header template--\x3e\n <ng-template *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate.templateRef\n }">\n </ng-template>\n \x3c!--list--\x3e\n <kendo-list\n #optionsList\n [size]="size"\n [rounded]="rounded"\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="valueField"\n [valueField]="valueField"\n [template]="template"\n [groupTemplate]="groupTemplate"\n [fixedGroupTemplate]="fixedGroupTemplate"\n [height]="listHeight"\n [show]="isOpen"\n [virtual]="virtual"\n (pageChange)="pageChange($event)"\n >\n </kendo-list>\n \x3c!--no-data template--\x3e\n <div class="k-no-data" *ngIf="data.length === 0">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate?.templateRef\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n \x3c!--footer template--\x3e\n <ng-template *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]="isOpen">\n <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(a.__param)(10,Object(s.Optional)()),Object(a.__param)(10,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[u.LocalizationService,an,f.PopupService,on,dn,sn,s.NgZone,s.ChangeDetectorRef,s.Renderer2,s.ElementRef,Boolean])],e)}(),_n="Expected values of array type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection",On="Expected values of Object type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection",jn="Expected values of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#value-selection",Cn="Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#toc-bind-to-arrays-of-complex-data",kn="Expected values of array type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselecttree/#value-selection",wn="Expected values of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselecttree/value-binding/#toc-primitive-values",Sn="Expected values of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselecttree/value-binding/#toc-object-values",xn="Expected dataItems of type Object[] to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/MultiSelectTreeComponent/#toc-dataitems",En="Expected dataItems length to match the number of provided values. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/MultiSelectTreeComponent/#toc-dataitems",In="Expected textField and valueField options to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselecttree/value-binding",Tn="Expected valueDepth of type number[] to be set. See https://www.telerik.com/kendo-angular-ui-develop/components/dropdowns/api/MultiSelectTreeComponent/#toc-valuedepth",Dn="Expected valueDepth length to match the number of provided values. See https://www.telerik.com/kendo-angular-ui-develop/components/dropdowns/api/MultiSelectTreeComponent/#toc-valuedepth",Bn="Expected value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection",Pn="Expected value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection",An="Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-bind-to-arrays-of-complex-data",Mn="Expected virtual.itemHeight of type number.",zn="Provided data must consist only of objects. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/multicolumncombobox/data-binding/",Rn="Expected textField and valueField options to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/multicolumncombobox/data-binding/#toc-fields-configuration",Fn="defaultItem and data items must be of same type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownListComponent/#toc-defaultitem",Nn="Expected value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection",Ln="Expected value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection",Vn="Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-bind-to-arrays-of-complex-data",Hn="Expected value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdowntree/value-binding/#toc-primitive-values",Kn="Expected value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdowntree/value-binding/#toc-object-values",$n="Expected dataItem of type Object to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownTreeComponent/#toc-dataitem",Wn="Expected textField and valueField options to be set. See https://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdowntree/value-binding",Un="Expected valueDepth to be set. See https://www.telerik.com/kendo-angular-ui-develop/components/dropdowns/api/DropDownTreeComponent/#toc-valuedepth",Gn={multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return Zn}))},Zn=function(){function e(e,t,n,i,o,r,a,c,d,p,u){this.wrapper=e,this.localization=t,this.popupService=n,this.selectionService=i,this.navigationService=o,this.disabledItemsService=r,this.dataService=a,this.zone=c,this.cdr=d,this.renderer=p,this.touchEnabled=u,this.selected=[],this.focusableId="k-"+Tt(),this.allowCustom=!1,this.valueNormalizer=function(e){return e.pipe(Object(b.map)((function(e){return e})))},this.placeholder="",this.listHeight=200,this.suggest=!1,this.clearButton=!0,this.disabled=!1,this.readonly=!1,this.tabindex=0,this.filterable=!1,this.valueChange=new s.EventEmitter,this.selectionChange=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.widgetClasses=!0,this._isFocused=!1,this.listBoxId=Tt(),this.optionPrefix=Tt(),this.onChangeCallback=function(e){},this.onTouchedCallback=function(e){},this.defaultVirtualItemHeight=28,this.defaultVirtualPageSize=50,this._filtering=!1,this._text="",this.filterText="",this._open=!1,this._popupSettings={animate:!0},this.popupMouseDownHandler=function(e){return e.preventDefault()},this.customValueSubject=new h.Subject,this.valueSubject=new h.Subject,this.clearValueSubject=new h.Subject,this.subs=new h.Subscription,this._size="medium",this._rounded="medium",this._fillMode="solid",Object(l.validatePackage)(Et),this.direction=t.rtl?"rtl":"ltr",this.data=[]}var t;return t=e,Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(e){this._text=It(e)?e.toString():""},enumerable:!0,configurable:!0}),e.prototype.togglePopup=function(e){var t=this.disabled||this.readonly,n=this.isOpen===e;t||n||(this.triggerPopupEvents(e)||this._toggle(e))},Object.defineProperty(e.prototype,"activeDescendant",{get:function(){if(!this.isOpen||!It(this.selectionService.focused)||-1===this.selectionService.focused)return null;var e=this.dataService.itemAt(this.selectionService.focused);return this.optionPrefix+"-"+(e?Rt(e,this.valueField):"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noDataLabel",{get:function(){if(0===this.data.length)return this.noDataText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearTitle",{get:function(){return this.localization.get("clearTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){var e=this.virtual;if(e){var t=e.skip||0,n=t+e.pageSize;return e.total=this.dataService.data.length,this.dataService.data.slice(t,n)}return this.dataService.data},set:function(e){if(this.dataService.data=e||[],this.virtual&&(this.virtual.skip=0),this.setState(),this._filtering){var t=this.text.length>0&&this.dataService.itemsCount>0?this.firstFocusableIndex(0):-1;this.selectionService.focused=t}this.suggest&&this.dataService.itemsCount&&this.text&&(this.suggestedText=Rt(this.dataService.itemAt(0),this.textField))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this.setState(),this.cdr.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valuePrimitive",{get:function(){return It(this._valuePrimitive)?this._valuePrimitive:!It(this.valueField)},set:function(e){this._valuePrimitive=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemDisabled",{set:function(e){if("function"!=typeof e)throw new Error("itemDisabled must be a function, but received "+JSON.stringify(e)+".");this.disabledItemsService.itemDisabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"virtual",{get:function(){return this._virtualSettings},set:function(e){this._virtualSettings=mn(e,{itemHeight:this.defaultVirtualItemHeight,pageSize:this.defaultVirtualPageSize})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Zt("input",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper.nativeElement,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Jt("input",this.fillMode)),e&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",e)),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper.nativeElement,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonVisiblity",{get:function(){if(this.touchEnabled)return"visible"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupWidth",{get:function(){var e=0;Object(c.isDocumentAvailable)()&&(e=this.wrapper.nativeElement.offsetWidth);var t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupHeight",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.renderer.removeAttribute(this.wrapper.nativeElement,"tabindex"),this.attachStreams(),this.createValueStream(),this.subscribeTouchEvents(),this.attachSelectClickHandler(),this.setMessages(),this.setComponentClasses()},e.prototype.createValueStream=function(){var e=this,t=this.valueSubject.pipe(Object(b.filter)((function(t){var n=Rt(e.value,e.valueField),i=Rt(t,e.valueField),o=Rt(t,e.textField);return!(!It(e.value)&&!It(i))&&(It(o)&&(o=o.toString()),n!==i||e.text!==o||(e.clearFilter(),!1))})),Object(b.map)((function(t){var n=Rt(t,e.valueField);return{dataItem:t,text:Rt(t,e.textField),value:e.valuePrimitive?n:t}}))),n=Object(b.partition)((function(){return e.allowCustom}))(this.customValueSubject.pipe(Object(b.throttleTime)(300))),i=n[0].pipe(Object(b.tap)((function(){e.loading=!0,e.disabled=!0,e.cdr.detectChanges()})),Object(b.filter)((function(){var t=e.text!==Rt(e.value,e.valueField);return e.loading=t,e.disabled=t,t||e.clearFilter(),t})),this.valueNormalizer,Object(b.map)((function(t){return{custom:!0,dataItem:t,text:e.text,value:t}}))),o=n[1].pipe(Object(b.map)((function(){return{custom:!0,dataItem:void 0,text:void 0,value:void 0}}))),r=this.clearValueSubject.pipe(Object(b.map)((function(){return{dataItem:void 0,text:void 0,value:void 0}})));this.valueSubscription&&this.valueSubscription.unsubscribe();var a=Object(h.merge)(t,i,o,r);this.valueSubscription=a.pipe(Object(b.catchError)((function(){var t=void 0!==Rt(e.dataItem,e.valueField);return e.dataItem=void 0,e.value=void 0,e.text=void 0,e.loading=!1,e.disabled=!1,t&&e.selectionChange.emit(void 0),e.emitValueChange(),e.createValueStream(),Object(h.of)(null)}))).subscribe((function(t){var n=Rt(e.dataItem,e.valueField)!==Rt(t.dataItem,e.valueField);if(e.dataItem=t.dataItem,e.value=t.value,e.text=t.text,e.loading=!1,e.disabled=!1,e.clearFilter(),t.custom&&(e.selectionService.focused=-1),n){var i=t.custom?void 0:e.dataItem;e.selectionChange.emit(i)}e.emitValueChange()}))},e.prototype.attachStreams=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.subs.add(this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.setMessages()}))),this.subs.add(Object(h.merge)(this.navigationService.up,this.navigationService.down,this.navigationService.home,this.navigationService.end).pipe(Object(b.filter)((function(e){return It(e.index)}))).subscribe((function(t){return e.navigate(t.index)}))),this.subs.add(this.navigationService.open.subscribe(this.handleNavigationOpen.bind(this))),this.subs.add(this.navigationService.close.subscribe((function(){return e.togglePopup(!1)}))),this.subs.add(this.navigationService.esc.subscribe(this.handleEscape.bind(this))),this.subs.add(this.navigationService.enter.pipe(Object(b.tap)((function(t){e.isOpen&&t.originalEvent.preventDefault()}))).subscribe(this.handleEnter.bind(this))),this.subs.add(Object(h.merge)(this.selectionService.onChange,this.selectionService.onSelect.pipe(Object(b.filter)((function(t){return!e.isOpen})))).pipe(Object(b.tap)((function(t){e._filtering=!1,e.togglePopup(!1)})),Object(b.map)((function(t){return e.dataService.itemAt(t.indices[0])}))).subscribe((function(t){e.change(t)}))),this.subs.add(this.selectionService.onSelect.pipe(Object(b.filter)((function(t){return e.isOpen})),Object(b.tap)((function(t){return e._filtering=!1})),Object(b.map)((function(t){return e.dataService.itemAt(t.indices[0])}))).subscribe((function(t){var n=Rt(t,e.valueField)!==Rt(e.dataItem,e.valueField);e.updateState({dataItem:t}),n&&e.selectionChange.emit(t)}))))},e.prototype.ngOnDestroy=function(){this.destroyPopup(),clearTimeout(this.messagesTimeout),this.subs.unsubscribe(),It(this.valueSubscription)&&this.valueSubscription.unsubscribe(),this.touchstartDisposeHandler&&this.touchstartDisposeHandler(),this.selectClickDisposeHandler&&this.selectClickDisposeHandler()},e.prototype.ngOnChanges=function(e){var t=this.virtual;t&&e.data&&e.data.isFirstChange()&&this.pageChange({skip:0,take:t.pageSize}),Object(c.isChanged)("valueNormalizer",e)&&this.createValueStream(),Object(c.anyChanged)(["textField","valueField","valuePrimitive"],e,!1)&&this.setState()},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.focusItemAt=function(e){var t=e>=0&&e<this.data.length;It(e)&&t&&!this.disabledItemsService.isIndexDisabled(e)?this.selectionService.focus(e):this.selectionService.focus(-1)},e.prototype.focus=function(){this.disabled||this.searchbar.focus()},e.prototype.blur=function(){this.disabled||this.searchbar.blur()},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!t._open;t._toggle(n),t.cdr.markForCheck()}))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._open},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.value=void 0,this.clearState(),this.resetSelection()},e.prototype.isEmpty=function(){var e=!It(this.text)||Pt(this.text),t=!It(this.value)||Pt(this.value);return e&&t},e.prototype.clearValue=function(e){e.stopImmediatePropagation(),this.focus(),this._filtering=!0,this._previousDataItem=void 0,this.selectionService.resetSelection([]),this.clearValueSubject.next(),this._filtering=!1},e.prototype.writeValue=function(e){this.value=null===e?void 0:e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},Object.defineProperty(e.prototype,"buttonClasses",{get:function(){return this.loading?"k-i-loading":this.iconClass||"k-i-arrow-s"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButtonClasses",{get:function(){return(this.size?Zt("button",this.size):"")+" "+(this.fillMode?"k-button-"+this.fillMode:"")+" "+(this.fillMode?"k-button-"+this.fillMode+"-base":"")+"\n "},enumerable:!0,configurable:!0}),e.prototype.onResize=function(){if(this.isOpen){var e=this.popupRef.popupElement,t=this.popupWidth,n=t.min,i=t.max;e.style.minWidth=n,e.style.width=i}},e.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(!0===this.valuePrimitive&&It(this.value)&&"object"==typeof this.value)throw new Error(Pn);if(!1===this.valuePrimitive&&It(this.value)&&"object"!=typeof this.value)throw new Error(Bn);if(!It(this.valueField)!=!It(this.textField))throw new Error(An);if(this.virtual&&isNaN(this.virtual.itemHeight))throw new Error(Mn)}},e.prototype.setState=function(){if(!this._filtering){var e=this.value,t=this.valueField,n=this.findDataItem({valueField:t,value:e});It(n.index)&&-1!==n.index?(this.updateState({dataItem:n.dataItem,confirm:!0}),this.resetSelection(n.index)):It(e)&&this.allowCustom?(this.updateState({dataItem:e}),this.resetSelection(-1)):this._previousDataItem&&this.value?(this.updateState({dataItem:this._previousDataItem}),this.resetSelection()):(this.clearState(),this.resetSelection(-1))}},e.prototype.updateState=function(e){var t=e.dataItem,n=e.confirm,i=void 0!==n&&n;this.dataItem=t,this.text=Rt(t,this.textField),i&&(this._previousDataItem=t)},e.prototype.clearState=function(){this.text=void 0,this.dataItem=void 0},e.prototype.resetSelection=function(e){var t=!It(e)||e<0;this.selectionService.resetSelection(t?[]:[e]),this.selectionService.focused=e},e.prototype.firstFocusableIndex=function(e){var t=this.data.length-1;return this.disabledItemsService.isIndexDisabled(e)?e<t?this.firstFocusableIndex(e+1):void 0:e},e.prototype.findIndexPredicate=function(e){var t=this;return this.dataService.grouped?function(n){var i=Rt(n.value,t.textField);return(i=It(i)?i.toString().toLowerCase():"").startsWith(e.toLowerCase())}:function(n){var i=Rt(n,t.textField);return(i=It(i)?i.toString().toLowerCase():"").startsWith(e.toLowerCase())}},e.prototype.findDataItem=function(e){var t=this,n=e.valueField,i=e.value,o={dataItem:null,index:-1},r=this.dataService.findIndex((function(e){var o=t.dataService.grouped?e.value:e;return Rt(o,n)===Rt(i,n)}));return o.dataItem=this.dataService.itemAt(r),o.index=r,o},e.prototype.search=function(e,t){var n;void 0===t&&(t=0),n=e.length&&this.dataService.itemsCount?this.dataService.findIndex(this.findIndexPredicate(e),t):-1,this.disabledItemsService.isIndexDisabled(n)?n+1<this.dataService.itemsCount?this.search(e,n+1):this.selectionService.focus(-1):(this.selectionService.focus(n),this.suggest&&(this.suggestedText=Rt(this.dataService.itemAt(n),this.textField)))},e.prototype.getSuggestion=function(){var e=!!this.selectionService.selected.length,t=this.suggest&&!this.backspacePressed&&this.suggestedText&&this.text;if(!e&&t&&this.suggestedText.toLowerCase().startsWith(this.text.toLowerCase()))return this.suggestedText;this.suggestedText=void 0},e.prototype.navigate=function(e){0!==this.dataService.itemsCount&&(this.text=Rt(this.dataService.itemAt(e),this.textField),this.selectionService.select(e))},e.prototype.handleNavigate=function(e){var t=It(this.selectionService.selected[0]),n=isNaN(this.selectionService.focused)?this.firstFocusableIndex(0):this.selectionService.focused,i=0;if(!this.disabled&&!this.readonly&&e.keyCode!==c.Keys.Home&&e.keyCode!==c.Keys.End){t||(e.keyCode===c.Keys.ArrowDown?i=-1:e.keyCode===c.Keys.ArrowUp&&(i=1));var o=this.navigationService.process({current:i+n,max:this.dataService.itemsCount-1,min:0,originalEvent:e});o!==Ae.Undefined&&o!==Ae.Left&&o!==Ae.Right&&o!==Ae.Backspace&&o!==Ae.Delete&&(o===Ae.Enter&&this.isOpen||o!==Ae.Enter)&&e.preventDefault()}},e.prototype.handleEnter=function(){var e=this.text,t=this.selectionService.focused,n=It(t)&&-1!==t,i=Rt(this._previousDataItem,this.textField)||"",o=Rt(this.dataService.itemAt(t),this.textField),r=e!==i;this.togglePopup(!1),this._filtering=!1,this.allowCustom&&r&&(e===o||this.useSuggestion()?this.selectionService.change(t):this.change(e,!0)),this.allowCustom||(n?this.selectionService.change(t):r&&this.change(e,!0))},e.prototype.handleBlur=function(){var e=this;this._filtering=!1,this.searchbar.input.nativeElement.scrollLeft=0,this.isFocused=!1;var t=Rt(this.dataItem,this.valueField)!==Rt(this.value,this.valueField),n=this.searchbar.value,i=n!==(Rt(this.dataItem,this.textField)||""),o=t||i;o||Object(c.hasObservers)(this.onBlur)||Object(c.hasObservers)(this.close)||Lt(this.wrapper.nativeElement)?this.zone.run((function(){o&&(It(e.focusedItemText)&&e.focusedItemText.toLowerCase()===n.toLowerCase()||t?e.selectionService.change(e.selectionService.focused):e.change(n,!0));e.onBlur.emit(),e.onTouchedCallback(),e.togglePopup(!1)})):this.togglePopup(!1)},e.prototype.handleEscape=function(){this.togglePopup(!1),this.selectionService.selected.length>0||(this.suggestedText=null,this.selectionService.focused=-1)},e.prototype.handleNavigationOpen=function(){this.restoreItemFocus(),this.togglePopup(!0)},e.prototype.searchBarChange=function(e){var t=this.text?this.text.length:0;this.backspacePressed=e.length<t,this.text=e,this.selectionService.resetSelection([]),this.togglePopup(!0),this._filtering=!0,this.filterable&&this.filterText!==e?(this.filterText=e,this.filterChange.emit(e)):this.search(e)},e.prototype.handleFocus=function(){var e=this;this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this.zone.run((function(){return e.onFocus.emit()}))},e.prototype.pageChange=function(e){this.virtual.skip=e.skip},e.prototype.change=function(e,t){void 0===t&&(t=!1),t?this.customValueSubject.next(e):this.valueSubject.next(e)},e.prototype.emitValueChange=function(){this.onChangeCallback(this.value),this.valueChange.emit(this.value),this._previousDataItem=this.dataItem},e.prototype.selectClick=function(){this.touchEnabled||this.searchbar.focus(),this.isOpen||this.restoreItemFocus(),this.togglePopup(!this.isOpen)},Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){return["k-list-container","k-reset"].concat(this.popupSettings.popupClass||[])},enumerable:!0,configurable:!0}),e.prototype.preventEventDefault=function(e){e.preventDefault()},Object.defineProperty(e.prototype,"focusedItemText",{get:function(){var e=this.selectionService.focused;if(!It(e)||-1===e)return null;var t=Rt(this.dataService.itemAt(e),this.textField);return It(t)?t.toString():""},enumerable:!0,configurable:!0}),e.prototype.restoreItemFocus=function(){!(It(this.selectionService.focused)&&this.selectionService.focused>-1)&&this.text&&this.dataService.itemsCount&&(this.filterable?this.selectionService.focused=this.firstFocusableIndex(0):this.search(this.text))},e.prototype.useSuggestion=function(){if(!this.suggest||!It(this.searchbar.value))return!1;var e=this.dataService.itemAt(this.selectionService.focused),t=Rt(e,this.textField);return!!It(t)&&this.searchbar.value.toLowerCase()===t.toLowerCase()},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null)},e.prototype.createPopup=function(){var e=this;this.virtual&&(this.virtual.skip=0);var t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupClass:this.listContainerClasses,positionMode:"absolute",anchorAlign:n,popupAlign:i});var o=this.popupRef.popupElement,r=this.popupWidth,a=r.min,s=r.max;o.addEventListener("mousedown",this.popupMouseDownHandler),o.style.minWidth=a,o.style.width=s,o.style.height=this.popupHeight,o.setAttribute("dir",this.direction),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.optionsList.scrollToItem(e.selectionService.focused),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()})),this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.togglePopup(!1)}))},e.prototype._toggle=function(e){this._open=e,this.destroyPopup(),this._open&&this.createPopup()},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype.clearFilter=function(){this.filterable&&this.filterText&&(this.filterText="",this.filterChange.emit(this.filterText))},e.prototype.setMessages=function(){var e=this;this.zone.runOutsideAngular((function(){clearTimeout(e.messagesTimeout),e.messagesTimeout=setTimeout((function(){e.noDataText=e.localization.get("noDataText"),e.cdr.detectChanges()}))}))},e.prototype.subscribeTouchEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&this.touchEnabled&&this.zone.runOutsideAngular((function(){return e.touchstartDisposeHandler=e.renderer.listen(document,"touchstart",(function(t){var n=t.target,i=$t(e.wrapper,n,e.popupRef);e.isFocused&&!i?e.zone.run((function(){return e.blur()})):e.isOpen&&!i&&e.zone.run((function(){return e.togglePopup(!1)}))}))}))},e.prototype.attachSelectClickHandler=function(){var e=this.select.nativeElement,t=p.f?"pointerdown":"click";this.selectClickDisposeHandler=this.renderer.listen(e,t,this.selectClick.bind(this))},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",this.size)),this.rounded&&this.renderer.addClass(this.wrapper.nativeElement,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",this.fillMode))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"allowCustom",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"valuePrimitive",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"valueNormalizer",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"iconClass",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"suggest",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"itemDisabled",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(a.__decorate)([Object(s.Input)("tabIndex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"virtual",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"selectionChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.ContentChild)(Yt,{static:!1}),Object(a.__metadata)("design:type",Yt)],e.prototype,"template",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(tn,{static:!1}),Object(a.__metadata)("design:type",tn)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(nn,{static:!1}),Object(a.__metadata)("design:type",nn)],e.prototype,"fixedGroupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)(Xt,{static:!0}),Object(a.__metadata)("design:type",Xt)],e.prototype,"searchbar",void 0),Object(a.__decorate)([Object(s.ViewChild)("optionsList",{static:!1}),Object(a.__metadata)("design:type",fn)],e.prototype,"optionsList",void 0),Object(a.__decorate)([Object(s.ViewChild)("select",{static:!0}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"select",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-combobox"),Object(s.HostBinding)("class.k-input"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"widgetClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoComboBox",providers:[Gn,an,on,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.combobox"},{provide:un,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-combobox",template:'\n <ng-container kendoComboBoxLocalizedMessages\n i18n-noDataText="kendo.combobox.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.combobox.clearTitle|The title of the clear button"\n clearTitle="clear"\n >\n </ng-container>\n <kendo-searchbar #searchbar\n [role]="\'combobox\'"\n [id]="focusableId"\n [listId]="listBoxId"\n [activeDescendant]="activeDescendant"\n [noDataLabel]="noDataLabel"\n [userInput]="text"\n [suggestedText]="getSuggestion()"\n [disabled]="disabled"\n [readonly]="readonly"\n [tabIndex]="tabIndex"\n [popupOpen]="isOpen"\n [placeholder]="placeholder"\n (onNavigate)="handleNavigate($event)"\n (valueChange)="searchBarChange($event)"\n (onBlur)="handleBlur()"\n (onFocus)="handleFocus()"\n ></kendo-searchbar>\n <span\n *ngIf="clearButton && !loading && !disabled && !readonly && text?.length"\n class="k-clear-value"\n [style.visibility]="clearButtonVisiblity"\n aria-hidden="true"\n [attr.title]="clearTitle"\n (click)="clearValue($event)"\n [kendoEventsOutsideAngular]="{\n mousedown: preventEventDefault\n }"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n <button\n #select\n aria-hidden="true"\n unselectable="on"\n type="button"\n class="k-input-button k-button k-icon-button"\n [ngClass]="selectButtonClasses"\n [kendoEventsOutsideAngular]="{\n mousedown: preventEventDefault\n }"\n >\n <span class="k-button-icon k-icon" [ngClass]="buttonClasses"></span>\n </button>\n <ng-template #popupTemplate>\n \x3c!--header template--\x3e\n <ng-template *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate.templateRef\n }">\n </ng-template>\n \x3c!--list--\x3e\n <kendo-list\n #optionsList\n [size]="size"\n [rounded]="rounded"\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="textField"\n [valueField]="valueField"\n [template]="template"\n [groupTemplate]="groupTemplate"\n [fixedGroupTemplate]="fixedGroupTemplate"\n [height]="listHeight"\n [show]="isOpen"\n [virtual]="virtual"\n (pageChange)="pageChange($event)"\n >\n </kendo-list>\n \x3c!--no-data template--\x3e\n <div class="k-no-data" *ngIf="data.length === 0">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n \x3c!--footer template--\x3e\n <ng-template *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]="isOpen">\n <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(a.__param)(10,Object(s.Optional)()),Object(a.__param)(10,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[s.ElementRef,u.LocalizationService,f.PopupService,on,dn,sn,an,s.NgZone,s.ChangeDetectorRef,s.Renderer2,Boolean])],e)}(),qn=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownListValueTemplate],[kendoDropDownTreeValueTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),Jn={multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return Xn}))},Xn=function(){function e(e,t,n,i,o,r,a,c,d,p,u){this.wrapper=e,this.localization=t,this.popupService=n,this.selectionService=i,this.navigationService=o,this.disabledItemsService=r,this.dataService=a,this._zone=c,this.renderer=d,this.cdr=p,this.touchEnabled=u,this.listHeight=200,this.disabled=!1,this.readonly=!1,this.filterable=!1,this.ignoreCase=!0,this.delay=500,this.tabindex=0,this.valueChange=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.selectionChange=new s.EventEmitter,this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.hostClasses=!0,this.focusableId="k-"+Tt(),this.role="listbox",this.groupIndices=[],this.listBoxId=Tt(),this.optionPrefix=Tt(),this.filterText="",this._isFocused=!1,this.onTouchedCallback=function(e){},this.onChangeCallback=function(e){},this.word="",this.last="",this.filterFocused=new s.EventEmitter,this.filterBlurred=new s.EventEmitter,this.hostElementFocused=new s.EventEmitter,this.hostElementBlurred=new s.EventEmitter,this.selectionSubscription=new h.Subscription,this._open=!1,this._popupSettings={animate:!0},this._size="medium",this._rounded="medium",this._fillMode="solid",Object(l.validatePackage)(Et),this.direction=t.rtl?"rtl":"ltr",this.data=[],this.subscribeEvents(),this.subscribeTouchEvents(),this.subscribeFocusEvents(),this.popupMouseDownHandler=this.onMouseDown.bind(this)}var t;return t=e,Object.defineProperty(e.prototype,"width",{get:function(){var e=Object(c.isDocumentAvailable)()?this.wrapper.nativeElement.offsetWidth:0,t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"widgetTabIndex",{get:function(){if(!this.disabled){var e=Number(this.tabIndex);return isNaN(e)?0:e}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaExpanded",{get:function(){return this.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaOwns",{get:function(){if(this.isOpen)return this.listBoxId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaActivedescendant",{get:function(){if(It(this.dataItem))return this.optionPrefix+"-"+Rt(this.dataItem,this.valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noDataLabel",{get:function(){if(0===this.dataService.itemsCount)return this.noDataText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){var e=this.virtual;if(e){var t=e.skip||0,n=t+e.pageSize;return e.total=this.dataService.data.length,this.dataService.data.slice(t,n)}return this.dataService.data},set:function(e){this.dataService.data=e||[],this.virtual&&(this.virtual.skip=0),this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){It(e)||(this._previousDataItem=void 0),this._value=e,this.setState(),this.cdr.markForCheck()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemDisabled",{set:function(e){if("function"!=typeof e)throw new Error("itemDisabled must be a function, but received "+JSON.stringify(e)+".");this.disabledItemsService.itemDisabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"virtual",{get:function(){return this._virtualSettings},set:function(e){this._virtualSettings=mn(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valuePrimitive",{get:function(){return It(this._valuePrimitive)?this._valuePrimitive:!It(this.valueField)},set:function(e){this._valuePrimitive=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Zt("picker",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("picker",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper.nativeElement,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Jt("picker",this.fillMode)),e&&this.renderer.addClass(this.wrapper.nativeElement,Jt("picker",e)),this._fillMode=e},enumerable:!0,configurable:!0}),e.prototype.blurComponent=function(e){e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.hostElementBlurred.emit())},e.prototype.blurFilterInput=function(){this.filterBlurred.emit()},e.prototype.focusComponent=function(e){var t=this;e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.hostElementFocused.emit(),this.isFocused||(this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this._zone.run((function(){t.onFocus.emit()}))))},e.prototype.onResize=function(){if(this._open){var e=this.popupRef.popupElement,t=this.width,n=t.min,i=t.max;e.style.minWidth=n,e.style.width=i}},Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabIndex",{get:function(){return this.widgetTabIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAriaExpanded",{get:function(){return this.ariaExpanded},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostAriaOwns",{get:function(){return this.ariaOwns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostAriaActivedescendant",{get:function(){return this.ariaActivedescendant},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostNoDataLabel",{get:function(){return this.noDataLabel},enumerable:!0,configurable:!0}),e.prototype.keydown=function(e){var t=It(this.defaultItem)?-1:0,n=isNaN(this.selectionService.focused)?this.firstFocusableIndex(t):this.selectionService.focused,i=0;if(!this.disabled&&!this.readonly){var o=e.keyCode===c.Keys.Home||e.keyCode===c.Keys.End;if(!(this.filterable&&this.isFocused&&this.isOpen)||!o){var r=It(this.selectionService.selected[0]),a=It(this.selectionService.focused)&&!this.selectionService.isSelected(this.selectionService.focused);r&&!a||(e.keyCode===c.Keys.ArrowDown||e.keyCode===c.Keys.ArrowRight?i=-1:e.keyCode!==c.Keys.ArrowUp&&e.keyCode!==c.Keys.ArrowLeft||(i=1));var s=e,d=this.navigationService.process({current:n+i,max:this.dataService.itemsCount-1,min:this.defaultItem?-1:0,originalEvent:s}),l=d===Ae.Left||d===Ae.Right;d===Ae.Undefined||d===Ae.Tab||d===Ae.Backspace||d===Ae.Delete||l&&this.filterable||d===Ae.Enter||s.preventDefault()}}},e.prototype.keypress=function(e){this.disabled||this.readonly||this.filterable||this.onKeyPress(e)},e.prototype.click=function(e){e.preventDefault(),this.focus(),this.togglePopup(!this.isOpen)},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper.nativeElement,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.renderer.removeAttribute(this.wrapper.nativeElement,"tabindex"),this.localizationChangesSubscription=this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.setMessages()})),this.setMessages(),this.assignAriaDescribedBy(),this.setComponentClasses()},e.prototype.isEmpty=function(){var e=this.value;return!(0===e||!1===e||e||this.defaultItem)},e.prototype.onFilterFocus=function(){this.filterFocused.emit()},e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.unsubscribeEvents(),clearTimeout(this.messagesTimeout),this.localizationChangesSubscription&&this.localizationChangesSubscription.unsubscribe()},e.prototype.ngOnChanges=function(e){var t=this.virtual;t&&e.data&&e.data.isFirstChange()&&this.pageChange({skip:0,take:t.pageSize}),Object(c.isChanged)("defaultItem",e,!1)&&(this.disabledItemsService.defaultItem=this.defaultItem),Object(c.anyChanged)(["textField","valueField","valuePrimitive","defaultItem","itemDisabled"],e,!1)&&this.setState()},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.focusItemAt=function(e){var t=(It(this.defaultItem)?-1:0)<=e&&e<this.data.length;It(e)&&t&&!this.disabledItemsService.isIndexDisabled(e)?this.selectionService.focus(e):this.selectionService.focus(null)},e.prototype.focus=function(){this.disabled||this.wrapper.nativeElement.focus()},e.prototype.blur=function(){this.disabled||this.wrapper.nativeElement.blur()},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!t._open;t._toggle(n)}))},e.prototype._toggle=function(e){this._open=e,this.destroyPopup(),this._open&&this.createPopup()},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype.togglePopup=function(e){var t=this.disabled||this.readonly,n=this.isOpen===e;t||n||(this.triggerPopupEvents(e)||(!e&&this.filterable&&this.isFocused&&this.focus(),this._toggle(e)))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._open},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.value=void 0},e.prototype.writeValue=function(e){this.value=null===e?void 0:e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},Object.defineProperty(e.prototype,"buttonClasses",{get:function(){return this.loading?"k-i-loading":this.iconClass||"k-i-arrow-s"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButtonClasses",{get:function(){return(this.size?Zt("button",this.size):"")+" "+(this.fillMode?"k-button-"+this.fillMode:"")+" "+(this.fillMode?"k-button-"+this.fillMode+"-base":"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterInputClasses",{get:function(){return(this.size?Zt("input",this.size):"")+" "+(this.fillMode?"k-input-"+this.fillMode:"")+" "+(this.rounded?qt(this.rounded):"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"optionLabelSizeClass",{get:function(){return""+(this.size?Zt("list",this.size):"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){var e=["k-list-container","k-reset"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisabledDefaultItem",{get:function(){return this.disabledItemsService.isItemDisabled(this.defaultItem)},enumerable:!0,configurable:!0}),e.prototype.getText=function(){return this.text},e.prototype.getDefaultItemText=function(){return Rt(this.defaultItem,this.textField)},e.prototype.createPopup=function(){var e=this;this.virtual&&(this.virtual.skip=0);var t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,anchorAlign:n,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupAlign:i,popupClass:this.listContainerClasses,positionMode:"absolute"});var o=this.popupRef.popupElement,r=this.width,a=r.min,s=r.max;o.addEventListener("mousedown",this.popupMouseDownHandler),o.style.minWidth=a,o.style.width=s,o.style.height=this.height,o.setAttribute("dir",this.direction),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.optionsList.scrollToItem(e.selectionService.focused),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()})),this.filterable||this.popupRef.popupAnchorViewportLeave.subscribe((function(){return e.togglePopup(!1)}))},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null)},e.prototype.updateState=function(e){var t=e.dataItem,n=e.confirm,i=void 0!==n&&n;this.dataItem=t,this.text=Rt(t,this.textField),i&&(this._previousDataItem=t)},e.prototype.clearState=function(){this.text=void 0,this.dataItem=void 0},e.prototype.resetSelection=function(e){var t=!It(e);this.selectionService.resetSelection(t?[]:[e]),this.selectionService.focused=t?this.firstFocusableIndex(0):e},e.prototype.onSelectionChange=function(e){var t=e.dataItem;this.updateState({dataItem:t}),this.selectionChange.emit(t),this.assignAriaDescribedBy()},e.prototype.subscribeEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.selectionSubscription.add(this.selectionService.onSelect.pipe(Object(b.filter)((function(t){return e.isOpen})),Object(b.map)(this.itemFromEvent.bind(this))).subscribe(this.onSelectionChange.bind(this))),this.selectionSubscription.add(Object(h.merge)(this.selectionService.onSelect.pipe(Object(b.filter)((function(t){return!e.isOpen}))),this.selectionService.onChange).pipe(Object(b.map)(this.itemFromEvent.bind(this)),Object(b.tap)((function(t){return e.togglePopup(!1)}))).subscribe((function(t){var n=t.dataItem,i=t.value;t.newSelection&&e.onSelectionChange({dataItem:n});var o=!It(n)&&e._previousDataItem,r=i!==Rt(e.value,e.valueField);o?(e.updateState({dataItem:e._previousDataItem}),e.resetSelection()):r&&(e.value=e.valuePrimitive?i:n,e._previousDataItem=n,e.emitChange(e.value)),e.clearFilter()}))),this.navigationSubscription=Object(h.merge)(this.navigationService.up,this.navigationService.down,this.navigationService.left.pipe(Object(b.skipWhile)((function(){return e.filterable}))),this.navigationService.right.pipe(Object(b.skipWhile)((function(){return e.filterable}))),this.navigationService.home,this.navigationService.end).pipe(Object(b.filter)((function(e){return!isNaN(e.index)}))).subscribe((function(t){return e.selectionService.select(t.index)})),this.openSubscription=this.navigationService.open.subscribe((function(){return e.togglePopup(!0)})),this.closeSubscription=this.navigationService.close.subscribe((function(){e.togglePopup(!1),e.focus()})),this.enterSubscription=this.navigationService.enter.pipe(Object(b.tap)((function(e){return e.originalEvent.preventDefault()}))).subscribe(this.handleEnter.bind(this)),this.escSubscription=this.navigationService.esc.subscribe(this.handleEscape.bind(this)),this.filterBlurredSubscription=this.filterBlurred.pipe(Object(b.concatMap)((function(){return Object(h.interval)(10).pipe(Object(b.take)(1),Object(b.takeUntil)(e.hostElementFocused))}))).subscribe((function(){e.hostElementBlurred.emit()})),this._zone.runOutsideAngular((function(){e.componentBlurredSubscription=Object(h.merge)(e.hostElementBlurred.pipe(Object(b.concatMap)((function(){return Object(h.interval)(10).pipe(Object(b.take)(1),Object(b.takeUntil)(e.filterFocused))}))),e.navigationService.tab).pipe(Object(b.tap)((function(t){return t instanceof cn&&e.focus()})),Object(b.filter)((function(){return e.isFocused}))).subscribe((function(){return e.componentBlur()}))})))},e.prototype.subscribeTouchEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&this.touchEnabled&&this._zone.runOutsideAngular((function(){return e.touchstartDisposeHandler=e.renderer.listen(document,"touchstart",(function(t){var n=t.target;e.isFocused&&!$t(e.wrapper,n,e.popupRef)&&e._zone.run((function(){e.filterFocused&&e.togglePopup(!1),e.blur()}))}))}))},e.prototype.subscribeFocusEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.focusComponent=this.focusComponent.bind(this),this.blurComponent=this.blurComponent.bind(this),this._zone.runOutsideAngular((function(){document.addEventListener("focus",e.focusComponent,!0),document.addEventListener("blur",e.blurComponent,!0)})))},e.prototype.unSubscribeFocusEvents=function(){if(Object(c.isDocumentAvailable)()){document.removeEventListener("focus",this.focusComponent,!0),document.removeEventListener("blur",this.blurComponent,!0)}},e.prototype.unsubscribeEvents=function(){Object(c.isDocumentAvailable)()&&(this.navigationSubscription.unsubscribe(),this.openSubscription.unsubscribe(),this.closeSubscription.unsubscribe(),this.enterSubscription.unsubscribe(),this.escSubscription.unsubscribe(),this.componentBlurredSubscription.unsubscribe(),this.filterBlurredSubscription.unsubscribe(),this.unSubscribeFocusEvents(),this.touchstartDisposeHandler&&this.touchstartDisposeHandler(),this.selectionSubscription&&this.selectionSubscription.unsubscribe())},e.prototype.itemFromEvent=function(e){var t=e.indices[0],n=this.dataService.itemAt(t);n=It(n)?n:this.currentOrDefault(t);var i=Rt(n,this.valueField);return{dataItem:n,index:t,newSelection:e.newSelection,value:i}},e.prototype.currentOrDefault=function(e){return It(this.dataItem)&&-1!==e?this.dataItem:this.defaultItem},e.prototype.firstFocusableIndex=function(e){var t=this.dataService.itemsCount-1;return this.disabledItemsService.isIndexDisabled(e)?e<t?this.firstFocusableIndex(e+1):void 0:e},e.prototype.handleEnter=function(){this.isOpen?(this.selectionService.change(this.selectionService.focused),this.focus()):this.togglePopup(!0)},e.prototype.handleEscape=function(){It(this.selectionService.selected[0])?this.selectionService.change(this.selectionService.selected[0]):(this.togglePopup(!1),this.clearFilter()),this.focus()},e.prototype.clearFilter=function(){this.filterable&&this.filterText&&(this.filterText="",this.cdr.markForCheck(),this.filterChange.emit(this.filterText))},e.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(this.defaultItem&&this.valueField&&"object"!=typeof this.defaultItem)throw new Error(Fn);if(!0===this.valuePrimitive&&It(this.value)&&"object"==typeof this.value)throw new Error(Ln);if(!1===this.valuePrimitive&&It(this.value)&&"object"!=typeof this.value)throw new Error(Nn);if(!It(this.valueField)!=!It(this.textField))throw new Error(Vn)}},e.prototype.componentBlur=function(){var e=this;this.isFocused=!1;var t=It(this.selectionService.selected[0])&&Rt(this.value,this.valueField)!==Rt(this.dataService.itemAt(this.selectionService.selected[0]),this.valueField);t||Object(c.hasObservers)(this.close)||Object(c.hasObservers)(this.onBlur)||Object(c.hasObservers)(this.filterChange)||Lt(this.wrapper.nativeElement)?this._zone.run((function(){t&&e.selectionService.change(e.selectionService.selected[0]),e.togglePopup(!1),e.clearFilter(),e.onBlur.emit(),e.onTouchedCallback()})):this.togglePopup(!1)},e.prototype.onMouseDown=function(e){"input"!==e.target.tagName.toLowerCase()&&e.preventDefault()},e.prototype.onKeyPress=function(e){if(0!==e.which&&e.keyCode!==c.Keys.Enter){var t=String.fromCharCode(e.charCode||e.keyCode);this.ignoreCase&&(t=t.toLowerCase())," "===t&&e.preventDefault(),this.word+=t,this.last=t,this.search()}},e.prototype.search=function(){var e=this;clearTimeout(this.typingTimeout),this.filterable||(this.typingTimeout=setTimeout((function(){e.word=""}),this.delay),this.selectNext())},e.prototype.selectNext=function(){var e,t,n,i=this,o=this.dataService.filter((function(e){return It(e)&&!e.header&&!i.disabledItemsService.isItemDisabled(e)})).map((function(e){return i.dataService.grouped?{item:e.value,itemIndex:e.offsetIndex}:{item:e,itemIndex:i.dataService.indexOf(e)}})),r=function(e,t){for(var n=0;n<e.length;n++)if(e.charAt(n)!==t)return!1;return!0}(this.word,this.last),a=o.length,s=!isNaN(this.selectionService.selected[0]),c=s?this.selectionService.selected[0]:0;for(this.defaultItem&&!this.disabledItemsService.isItemDisabled(this.defaultItem)&&(n={item:this.defaultItem,itemIndex:-1},a+=1,c+=1),o=function(e,t,n){var i=e;return n&&(i=[n].concat(i)),i.slice(t).concat(i.slice(0,t))}(o,c+=r&&s?1:0,n),t=0;t<a;t++){e=Rt(o[t].item,this.textField);var d=Boolean(r&&Ft(e,this.last,this.ignoreCase)),l=Boolean(Ft(e,this.word,this.ignoreCase));if(d||l){t=o[t].itemIndex;break}}t!==a&&this.navigate(t)},e.prototype.emitChange=function(e){this.onChangeCallback(e),this.valueChange.emit(e)},e.prototype.navigate=function(e){this.selectionService.select(e)},e.prototype.findDataItem=function(e){var t,n=e.valueField,i=e.value,o={dataItem:null,index:-1},r=function(e){return Rt(e,n)};t=this.dataService.grouped?function(e){return r(e.value)===r(i)}:function(e){return r(e)===r(i)};var a=this.dataService.findIndex(t);return o.dataItem=this.dataService.itemAt(a),o.index=a,o},e.prototype.setState=function(){var e=this.value,t=this.valueField,n=this.textField,i=this.valuePrimitive;if(this.defaultItem){var o=Rt(this.defaultItem,t),r=Rt(e,t);if(!It(e)||r===o)return this.updateState({dataItem:this.defaultItem,confirm:!0}),this.resetSelection(-1),void(this.filterable&&this.filterText&&this.dataService.itemsCount&&(this.selectionService.focused=this.firstFocusableIndex(0)))}var a=this.findDataItem({valueField:t,value:e}),s=!(i&&n);a.dataItem?(this.updateState({dataItem:a.dataItem,confirm:!0}),this.resetSelection(a.index)):It(e)&&s?(this.updateState({dataItem:e}),this.resetSelection()):this._previousDataItem?(this.updateState({dataItem:this._previousDataItem}),this.resetSelection()):(this.clearState(),this.resetSelection())},e.prototype.handleFilter=function(e){this.filterChange.emit(e.target.value)},e.prototype.pageChange=function(e){this.virtual.skip=e.skip},e.prototype.setMessages=function(){var e=this;this._zone.runOutsideAngular((function(){clearTimeout(e.messagesTimeout),e.messagesTimeout=setTimeout((function(){e.noDataText=e.localization.get("noDataText"),e.cdr.detectChanges()}))}))},e.prototype.assignAriaDescribedBy=function(){var e=(this.wrapper.nativeElement.getAttribute("aria-describedby")||"").replace(this.valueLabelId,"").trim();this.valueLabelId=Tt();var t=(this.valueLabelId+" "+e).trim();this.renderer.setAttribute(this.wrapper.nativeElement,"aria-describedby",t)},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("picker",this.size)),this.rounded&&this.renderer.addClass(this.wrapper.nativeElement,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper.nativeElement,Jt("picker",this.fillMode))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"iconClass",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"defaultItem",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"itemDisabled",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"virtual",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"ignoreCase",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"delay",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"valuePrimitive",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(a.__decorate)([Object(s.Input)("tabIndex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"selectionChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.ContentChild)(Yt,{static:!1}),Object(a.__metadata)("design:type",Yt)],e.prototype,"itemTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(tn,{static:!1}),Object(a.__metadata)("design:type",tn)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(nn,{static:!1}),Object(a.__metadata)("design:type",nn)],e.prototype,"fixedGroupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(qn,{static:!1}),Object(a.__metadata)("design:type",qn)],e.prototype,"valueTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("optionsList",{static:!1}),Object(a.__metadata)("design:type",fn)],e.prototype,"optionsList",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-dropdownlist"),Object(s.HostBinding)("class.k-picker"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(s.HostBinding)("attr.aria-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.Input)("id"),Object(s.HostBinding)("attr.id"),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),Object(a.__decorate)([Object(s.HostBinding)("attr.tabindex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostTabIndex",null),Object(a.__decorate)([Object(s.HostBinding)("attr.readonly"),Object(s.HostBinding)("attr.aria-readonly"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isReadonly",null),Object(a.__decorate)([Object(s.HostBinding)("attr.role"),Object(s.HostBinding)("attr.aria-haspopup"),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-expanded"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isAriaExpanded",null),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-owns"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostAriaOwns",null),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-activedescendant"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostAriaActivedescendant",null),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-label"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostNoDataLabel",null),Object(a.__decorate)([Object(s.HostListener)("keydown",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"keydown",null),Object(a.__decorate)([Object(s.HostListener)("keypress",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"keypress",null),Object(a.__decorate)([Object(s.HostListener)("click",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"click",null),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoDropDownList",providers:[Jn,an,on,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.dropdownlist"},{provide:un,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-dropdownlist",template:'\n <ng-container kendoDropDownListLocalizedMessages\n i18n-noDataText="kendo.dropdownlist.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n >\n </ng-container>\n <span class="k-input-inner" unselectable="on" [id]="valueLabelId">\n <span class="k-input-value-text">\n <ng-template *ngIf="valueTemplate"\n [templateContext]="{\n templateRef: valueTemplate.templateRef,\n $implicit: dataItem\n }">\n </ng-template>\n <ng-template [ngIf]="!valueTemplate">{{ getText() }}</ng-template>\n </span>\n </span>\n <button\n tabindex="-1"\n unselectable="on"\n type="button"\n class="k-input-button k-button k-icon-button"\n [ngClass]="selectButtonClasses"\n [kendoEventsOutsideAngular]="{\n mousedown: onMouseDown\n }"\n >\n <span\n class="k-button-icon k-icon"\n unselectable="on"\n [ngClass]="buttonClasses"\n ></span>\n </button>\n <ng-template #popupTemplate>\n \x3c!--filterable--\x3e\n\n <ng-template [ngIf]="filterable">\n <div class="k-list-filter" (click)="$event.stopImmediatePropagation()">\n <span\n class="k-searchbox k-input"\n [ngClass]="filterInputClasses"\n >\n <span class="k-input-icon k-icon k-i-search" unselectable="on"></span>\n <input\n [attr.aria-owns]="ariaOwns"\n [attr.aria-activedescendant]="ariaActivedescendant"\n [attr.aria-label]="noDataLabel"\n tabindex="-1"\n [filterInput]="isFocused && !touchEnabled"\n [dir]="direction"\n [(ngModel)]="filterText"\n class="k-input-inner"\n (keydown)="keydown($event)"\n (input)="handleFilter($event)"\n (focus)="onFilterFocus()"\n (blur)="blurFilterInput()" />\n </span>\n </div>\n </ng-template>\n \x3c!--default item--\x3e\n <ng-template [ngIf]="defaultItem && !itemTemplate">\n <div\n class="k-list"\n [ngClass]="optionLabelSizeClass"\n >\n <div class="k-list-optionlabel k-list-item" [ngClass]="{ \'k-disabled\': isDisabledDefaultItem }" kendoDropDownsSelectable [index]="-1">\n {{ getDefaultItemText() }}\n </div>\n </div>\n </ng-template>\n <ng-template [ngIf]="defaultItem && itemTemplate">\n <div\n class="k-list"\n [ngClass]="optionLabelSizeClass"\n >\n <div class="k-list-optionlabel k-list-item" [ngClass]="{ \'k-disabled\': isDisabledDefaultItem }" kendoDropDownsSelectable [index]="-1">\n <ng-template\n [templateContext]="{\n templateRef: itemTemplate.templateRef,\n $implicit: defaultItem\n }">\n </ng-template>\n </div>\n </div>\n </ng-template>\n \x3c!--header template--\x3e\n <ng-template *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate.templateRef\n }">\n </ng-template>\n \x3c!--list--\x3e\n <kendo-list\n #optionsList\n [size]="size"\n [rounded]="rounded"\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="textField"\n [valueField]="valueField"\n [template]="itemTemplate"\n [groupTemplate]="groupTemplate"\n [fixedGroupTemplate]="fixedGroupTemplate"\n [height]="listHeight"\n [show]="isOpen"\n [virtual]="virtual"\n (pageChange)="pageChange($event)"\n >\n </kendo-list>\n \x3c!--no-data template--\x3e\n <div class="k-no-data" *ngIf="data.length === 0">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n \x3c!--footer template--\x3e\n <ng-template *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]="isOpen">\n <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(a.__param)(10,Object(s.Optional)()),Object(a.__param)(10,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[s.ElementRef,u.LocalizationService,f.PopupService,on,dn,sn,an,s.NgZone,s.Renderer2,s.ChangeDetectorRef,Boolean])],e)}(),Yn=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectCustomItemTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),Qn=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectTagTemplate],[kendoMultiSelectTreeTagTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),ei=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectGroupTagTemplate],[kendoMultiSelectTreeGroupTagTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),ti=function(e){function t(t){var n=e.call(this)||this;return n.dataItem=t,n}return Object(a.__extends)(t,e),t}(pn),ni={multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return ii}))},ii=function(){function e(e,t,n,i,o,r,a,c,d,p,u,f){var m=this;this.wrapper=e,this.localization=t,this.popupService=n,this.dataService=i,this.selectionService=o,this.navigationService=r,this.disabledItemsService=a,this.cdr=c,this.differs=d,this.renderer=p,this._zone=u,this.touchEnabled=f,this.listBoxId=Tt(),this.tagListId=Tt(),this.tagPrefix="tag-"+Tt(),this.optionPrefix="option-"+Tt(),this.focusedTagIndex=void 0,this.focusableId="k-"+Tt(),this.autoClose=!0,this.tabindex=0,this.disabled=!1,this.readonly=!1,this.filterable=!1,this.listHeight=200,this.clearButton=!0,this.tagMapper=function(e){return e||[]},this.allowCustom=!1,this.valueNormalizer=function(e){return e.pipe(Object(b.map)((function(e){var t=function(t){return"string"==typeof t&&e.toLowerCase()===t.toLowerCase()},n=m.value.find(t);if(n)return n;var i=m.dataService.find(t);return i||e})))},this.filterChange=new s.EventEmitter,this.valueChange=new s.EventEmitter,this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.removeTag=new s.EventEmitter,this.hostClasses=!0,this.initialized=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",this.onChangeCallback=function(e){},this.onTouchedCallback=function(e){},this._placeholder="",this._open=!1,this._value=[],this._popupSettings={animate:!0},this._checkboxes={enabled:!1},this._isFocused=!1,this.selectedDataItems=[],this.customValueSubject=new h.Subject,this.observableSubscriptions=new h.Subscription,Object(l.validatePackage)(Et),this.popupMouseDownHandler=this.onMouseDown.bind(this),this.data=[],this.direction=this.localization.rtl?"rtl":"ltr",this.subscribeEvents(),this.subscribeTouchEvents()}var t;return t=e,e.prototype.focusItemAt=function(e){var t=(this.allowCustom?-1:0)<=0&&e<this.data.length;It(e)&&t&&!this.disabledItemsService.isIndexDisabled(e)?this.selectionService.focus(e):this.selectionService.focus(null)},e.prototype.focus=function(){this.disabled||this.searchbar.focus()},e.prototype.onSearchBarFocus=function(){var e=this;this.isFocused||(this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this._zone.run((function(){e.onFocus.emit()})))},e.prototype.blur=function(){this.disabled||this.searchbar.blur()},e.prototype.onSearchBarBlur=function(){var e=this;this.isFocused&&(this.isFocused=!1,Object(c.hasObservers)(this.onBlur)||Object(c.hasObservers)(this.filterChange)||Object(c.hasObservers)(this.close)||Lt(this.wrapper.nativeElement)?this._zone.run((function(){e.closePopup(),e.isOpen&&e.allowCustom||e.clearFilter(),e.onBlur.emit(),e.onTouchedCallback()})):(this.allowCustom||this.clearFilter(),this.closePopup()))},e.prototype.onMouseDown=function(e){e.preventDefault()},e.prototype.onResize=function(){if(this._open){var e=this.popupRef.popupElement,t=this.width,n=t.min,i=t.max;e.style.minWidth=n,e.style.width=i}},Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){var e=this.virtual;if(e){var t=e.skip||0,n=t+e.pageSize;return e.total=this.dataService.data.length,this.dataService.data.slice(t,n)}return this.dataService.data},set:function(e){this.dataService.data=e||[],this.virtual&&(this.virtual.skip=0),this.initialized&&this.setState(this.value)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e||[],!this.differ&&this.value&&(this.differ=this.differs.find(this.value).create()),this.valueChangeDetected=!0,this.initialized&&this.setState(this.value)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabIndex",{get:function(){return this.tabindex},set:function(e){this.tabindex=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Zt("input",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper.nativeElement,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Jt("input",this.fillMode)),e&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",e)),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"placeholder",{get:function(){return this.selectedDataItems.length?"":this._placeholder},set:function(e){this._placeholder=e||""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemDisabled",{set:function(e){if("function"!=typeof e)throw new Error("itemDisabled must be a function, but received "+JSON.stringify(e)+".");this.disabledItemsService.itemDisabled=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkboxes",{get:function(){return this._checkboxes},set:function(e){this._checkboxes=function(e){if(Bt(e)){return Object.assign({},{enabled:!0,checkOnClick:!0},e)}return{enabled:Boolean(e),checkOnClick:!0}}(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"virtual",{get:function(){return this._virtualSettings},set:function(e){this._virtualSettings=mn(e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({animate:!0},e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valuePrimitive",{get:function(){return It(this._valuePrimitive)?this._valuePrimitive:!It(this.valueField)},set:function(e){this._valuePrimitive=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dir",{get:function(){return this.direction},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabledClass",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),e.prototype.hostMousedown=function(e){var t=this.searchbar.input.nativeElement;if(0===e.button){if(this.isFocused&&this.isOpen&&e.target===t)return;(!this.touchEnabled||this.touchEnabled&&"SPAN"!==e.target.tagName)&&this.searchbar.focus(),this.togglePopup(!this.isOpen),e.preventDefault()}},Object.defineProperty(e.prototype,"listContainerClasses",{get:function(){var e=["k-list-container","k-reset"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"customItemSizeClass",{get:function(){return""+(this.size?Zt("list",this.size):"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var e=0;Object(c.isDocumentAvailable)()&&(e=this.wrapper.nativeElement.offsetWidth);var t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"activeDescendant",{get:function(){var e,t,n=this.focusedTagIndex,i=this.selectionService.focused;if(It(n)&&!this.isOpen)t=this.tags[n],e=this.tagPrefix;else{if(!It(i)||-1===i||!this.isOpen)return null;t=this.dataService.itemAt(i),e=this.optionPrefix}return e+"-"+Rt(t,this.valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noDataLabel",{get:function(){if(0===this.dataService.itemsCount)return this.noDataText},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearTitle",{get:function(){return this.localization.get("clearTitle")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonVisiblity",{get:function(){if(this.touchEnabled)return"visible"},enumerable:!0,configurable:!0}),e.prototype.verifySettings=function(){if(Object(s.isDevMode)()&&0!==this.value.length){if(!Dt(this.value))throw new Error(_n);if(!0===this.valuePrimitive&&Mt(this.value))throw new Error(jn);if(!1===this.valuePrimitive&&!Mt(this.value))throw new Error(On);if(!It(this.valueField)!=!It(this.textField))throw new Error(Cn)}},e.prototype.change=function(e){var t=this;if((It(e.added)||It(e.removed))&&(-1===e.added||-1===e.removed))this.addCustomValue(this.text);else{if(It(e.added)){var n=this.dataService.itemAt(e.added),i=this.valuePrimitive&&It(n)&&It(n[this.valueField])?n[this.valueField]:n;this.value=this.value.concat([i])}if(It(e.removed)){var o=this.dataService.itemAt(e.removed);this.value=this.value.filter((function(e){return Rt(e,t.valueField)!==Rt(o,t.valueField)})),this.selectionService.focused=e.removed,this.cdr.detectChanges()}this.emitValueChange()}},e.prototype.setState=function(e){var t=this,n=this.dataService.data;this.dataService.grouped&&(n=n.filter((function(e){return!e.header})).map((function(e){return e.value})));var i=zt(this.value,n,this.valueField);this.selectionService.resetSelection(i),this.disabledItemsService.isIndexDisabled(this.selectionService.focused)&&(this.selectionService.focused=this.firstFocusableIndex(0)),this.isOpen&&void 0===this.selectionService.focused&&(this.dataService.itemsCount>0?this.selectionService.focused=this.firstFocusableIndex(0):this.allowCustom&&(this.selectionService.focused=-1)),this.valuePrimitive&&!this.valueField&&(this.selectedDataItems=e.slice()),(Mt(e)||this.valuePrimitive&&this.valueField)&&(this.selectedDataItems=At(e,n,this.valueField)),this.selectedDataItems.length<e.length&&(this.selectedDataItems=e.map((function(e){var n=t.selectedDataItems.find((function(n){return Rt(n,t.valueField)===Rt(e,t.valueField)}));return It(n)?n:t.resolveDataItemFromTags(e)})).filter((function(e){return It(e)}))),this.tags=this.tagMapper(this.selectedDataItems.slice(0)),this.disabledIndices=this.disabledItemsMapper(),this.cdr.markForCheck()},e.prototype.handleFilter=function(e){this.text=e,e&&!this.isOpen&&this.openPopup(),this.filterable?this.filterChange.emit(e):this.searchTextAndFocus(e),this.searchbar.setInputSize()},e.prototype.pageChange=function(e){this.virtual.skip=e.skip},e.prototype.clearFilter=function(){this.filterable&&this.text&&this.filterChange.emit(""),this.text="",this.searchbar.input.nativeElement.value="",this.searchbar.setInputSize()},e.prototype.handleNavigate=function(e){var t=this.text&&e.keyCode!==c.Keys.ArrowDown&&e.keyCode!==c.Keys.ArrowUp,n=this.text&&e.keyCode===c.Keys.Enter||e.keyCode===c.Keys.Escape;if(!this.text&&e.keyCode===c.Keys.Backspace&&this.tags.length>0)this.handleBackspace();else if(!(this.disabled||t&&!n)){var i=e,o=isNaN(this.selectionService.focused)?-1:this.selectionService.focused,r=this.navigationService.process({current:o,max:this.dataService.itemsCount-1,min:this.allowCustom&&this.text?-1:0,open:this.isOpen,originalEvent:i});r!==Ae.Undefined&&(r===Ae.Enter&&this.isOpen||r!==Ae.Enter)&&e.preventDefault()}},e.prototype.handleRemoveTag=function(e){var t=e.tag,n=new ti(t);this.disabled||this.readonly||(this.focus(),this.removeTag.emit(n),n.isDefaultPrevented()||(t instanceof Array?this.removeGroupTag(t):this.removeSingleTag(t),this.cdr.detectChanges()))},e.prototype.clearAll=function(e){var t=this;e.stopImmediatePropagation(),e.preventDefault(),this.focus(),this.clearFilter();var n=this.selectionService.selected;this.value=this.value.filter((function(e,i){return t.disabledItemsService.isIndexDisabled(n[i])})),this.emitValueChange()},e.prototype.addCustomValue=function(e){this.customValueSubject.next(e)},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.ngDoCheck=function(){this.differ&&this.differ.diff(this.value)&&!this.valueChangeDetected&&this.setState(this.value),this.valueChangeDetected=!1},e.prototype.ngOnInit=function(){var e=this;this.renderer.removeAttribute(this.wrapper.nativeElement,"tabindex"),this.createCustomValueStream(),this.localizationChangeSubscription=this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.setMessages()})),this.setMessages(),this.setState(this.value),this.setComponentClasses(),this.initialized=!0},e.prototype.ngOnChanges=function(e){var t=this.virtual;t&&e.data&&e.data.isFirstChange()&&this.pageChange({skip:0,take:t.pageSize}),Object(c.isChanged)("valueNormalizer",e)&&this.createCustomValueStream(),Object(c.anyChanged)(["textField","valueField","valuePrimitive"],e)&&this.setState(this.value)},e.prototype.ngAfterViewInit=function(){this.searchbar.setInputSize()},e.prototype.ngOnDestroy=function(){this._toggle(!1),this.unsubscribeEvents(),clearTimeout(this.messagesTimeout)},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!t._open;t._toggle(n),t.cdr.markForCheck()}))},Object.defineProperty(e.prototype,"isOpen",{get:function(){return this._open},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.text="",this.value=[]},e.prototype.writeValue=function(e){this.value=e||[]},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e},e.prototype.onTagMapperChange=function(){this.tags=this.tagMapper(this.selectedDataItems.slice(0)),this.cdr.markForCheck()},Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper.nativeElement,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),e.prototype.subscribeEvents=function(){var e=this;if(Object(c.isDocumentAvailable)()){var t=function(){return e.isOpen},n=function(){return!e.isOpen},i=function(){return!e.isOpen&&void 0!==e.focusedTagIndex};[this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)),this.navigationService.esc.subscribe(this.closePopup.bind(this)),this.navigationService.enter.pipe(Object(b.filter)(t)).subscribe(this.handleEnter.bind(this)),this.navigationService.open.subscribe(this.openPopup.bind(this)),this.navigationService.close.subscribe(this.handleClose.bind(this)),this.navigationService.up.pipe(Object(b.filter)(t)).subscribe((function(t){return e.handleUp(t.index)})),this.navigationService.home.pipe(Object(b.filter)((function(){return n}))).subscribe(this.handleHome.bind(this)),this.navigationService.end.pipe(Object(b.filter)((function(){return n}))).subscribe(this.handleEnd.bind(this)),this.navigationService.backspace.pipe(Object(b.filter)(i)).subscribe(this.handleBackspace.bind(this)),this.navigationService.delete.pipe(Object(b.filter)(i)).subscribe(this.handleDelete.bind(this)),this.navigationService.left.subscribe("rtl"===this.direction?this.handleRightKey.bind(this):this.handleLeftKey.bind(this)),this.navigationService.right.subscribe("rtl"===this.direction?this.handleLeftKey.bind(this):this.handleRightKey.bind(this)),this.navigationService.down.subscribe((function(t){return e.handleDownKey(t.index)}))].forEach((function(t){return e.observableSubscriptions.add(t)}))}},e.prototype.subscribeTouchEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&this.touchEnabled&&this._zone.runOutsideAngular((function(){return e.touchstartDisposeHandler=e.renderer.listen(document,"touchstart",(function(t){var n=t.target;!e.isFocused&&!e.isOpen||$t(e.wrapper,n,e.popupRef)||e._zone.run((function(){e.blur(),e.isOpen&&e.togglePopup(!1)}))}))}))},e.prototype.unsubscribeEvents=function(){Object(c.isDocumentAvailable)()&&(this.observableSubscriptions.unsubscribe(),this.customValueSubscription&&this.customValueSubscription.unsubscribe(),this.localizationChangeSubscription&&this.localizationChangeSubscription.unsubscribe(),this.touchstartDisposeHandler&&this.touchstartDisposeHandler())},e.prototype.removeGroupTag=function(e){var t=this,n=this.dataService.data;this.dataService.grouped&&(n=n.filter((function(e){return!e.header})).map((function(e){return e.value})));var i=new Set(e.map((function(e){return Rt(e,t.valueField)})));this.value=this.value.filter((function(e){var o=zt([e],n,t.valueField)[0],r=t.disabledItemsService.isIndexDisabled(o);return!i.has(Rt(e,t.valueField))||r})),this.emitValueChange()},e.prototype.removeSingleTag=function(e){var t=this,n=this.dataService.data;this.dataService.grouped&&(n=n.filter((function(e){return!e.header})).map((function(e){return e.value})));var i=zt([e],n,this.valueField)[0];if(!this.disabledItemsService.isIndexDisabled(i))if(isNaN(i)){this.value=this.value.filter((function(n){return Rt(n,t.valueField)!==Rt(e,t.valueField)})),this.emitValueChange()}else this.selectionService.unselect(i),this.selectionService.focused=i,this.togglePopup(!1)},e.prototype.disabledItemsMapper=function(){var e=this,t=this.selectionService.selected;return new Set(this.selectedDataItems.reduce((function(n,i,o){return e.disabledItemsService.isIndexDisabled(t[o])&&n.push(o),n}),[]))},e.prototype.createCustomValueStream=function(){var e=this;this.customValueSubscription&&this.customValueSubscription.unsubscribe(),this.customValueSubscription=this.customValueSubject.pipe(Object(b.tap)((function(){e.loading=!0,e.disabled=!0,e.cdr.detectChanges()})),this.valueNormalizer,Object(b.catchError)((function(){return e.loading=!1,e.disabled=!1,e.autoClose&&e.togglePopup(!1),!e.autoClose&&e.filterable||e.clearFilter(),e.nextTick((function(){e.searchbar.focus()})),e.createCustomValueStream(),Object(h.of)(null)}))).subscribe((function(t){if(e.loading=!1,e.disabled=!1,It(t)){var n=e.valuePrimitive?Rt(t,e.valueField):t,i=e.dataService.indexOf(n),o=-1===i;-1===e.value.indexOf(n)?(e.tags=e.tagMapper(e.selectedDataItems.concat([t])),o?e.value=e.value.concat([n]):e.selectionService.add(i)):!o&&e.selectionService.isSelected(i)?(e.selectionService.unselect(i),e.selectionService.focused=i):e.value=e.value.filter((function(t){return Rt(t,e.valueField)!==n})),e.emitValueChange()}e.autoClose&&e.togglePopup(!1),!e.autoClose&&e.filterable||e.clearFilter(),e.nextTick((function(){e.searchbar.focus()}))}))},e.prototype.handleItemChange=function(e){this.change(e),this.autoClose&&this.togglePopup(!1),!this.autoClose&&this.filterable||this.clearFilter()},e.prototype.handleEnter=function(e){var t=this.selectionService,n=this.selectionService.focused;this.isOpen&&e.originalEvent.preventDefault(),-1!==n?(t.isSelected(n)?(t.unselect(n),t.focused=n):t.add(n),this.autoClose&&this.togglePopup(!1),!this.autoClose&&this.filterable||this.clearFilter()):this.allowCustom&&this.text&&this.addCustomValue(this.text)},e.prototype.handleClose=function(){this.closePopup(),this.searchbar.focus()},e.prototype.handleEnd=function(){this.focusedTagIndex=this.tags.length-1},e.prototype.handleHome=function(){this.focusedTagIndex=0},e.prototype.handleUp=function(e){this.selectionService.focused=e},e.prototype.handleBackspace=function(){void 0!==this.focusedTagIndex?this.handleDelete():(this.handleRemoveTag({tag:this.tags[this.tags.length-1]}),this.searchbar.focus())},e.prototype.handleDelete=function(){this.handleRemoveTag({tag:this.tags[this.focusedTagIndex]}),this.focusedTagIndex===this.tags.length&&(this.focusedTagIndex=void 0)},e.prototype.handleLeftKey=function(){void 0===this.focusedTagIndex||this.focusedTagIndex<0?this.focusedTagIndex=this.tags.length-1:0!==this.focusedTagIndex&&this.focusedTagIndex--},e.prototype.handleDownKey=function(e){this.isOpen?this.selectionService.focused=e||this.firstFocusableIndex(0):this.openPopup()},e.prototype.handleRightKey=function(){var e=this.tags.length-1;this.focusedTagIndex===e?this.focusedTagIndex=void 0:this.focusedTagIndex<e&&this.focusedTagIndex++},e.prototype.findIndex=function(e,t){var n,i=this;void 0===t&&(t=0),e=e.toLowerCase();var o=this.dataService.findIndex((function(t){return n=i.dataService.grouped?Rt(t.value,i.textField):Rt(t,i.textField),n=It(n)?n.toString().toLowerCase():"",e&&n.startsWith(e)}),t);return this.disabledItemsService.isIndexDisabled(o)?o+1>this.dataService.itemsCount?-1:this.findIndex(e,o+1):o},e.prototype.searchTextAndFocus=function(e){var t=this.findIndex(e);this.selectionService.focused=t},e.prototype.closePopup=function(){this.togglePopup(!1),this.focusedTagIndex=void 0},e.prototype.openPopup=function(){this.togglePopup(!0),this.focusedTagIndex=void 0},e.prototype.togglePopup=function(e){var t=this.disabled||this.readonly,n=this.isOpen===e;t||n||(this.triggerPopupEvents(e)||this._toggle(e))},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype._toggle=function(e){this._open=e,this.destroyPopup(),this._open&&this.createPopup()},e.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.popupElement.removeEventListener("mousedown",this.popupMouseDownHandler),this.popupRef.close(),this.popupRef=null)},e.prototype.createPopup=function(){var e=this;this.virtual&&(this.virtual.skip=0);var t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,anchorAlign:n,animate:this.popupSettings.animate,appendTo:this.appendTo,content:this.popupTemplate,popupAlign:i,popupClass:this.listContainerClasses,positionMode:"absolute"});var o=this.popupRef.popupElement,r=this.width,a=r.min,s=r.max;o.addEventListener("mousedown",this.popupMouseDownHandler),o.style.minWidth=a,o.style.width=s,o.style.height=this.height,o.setAttribute("dir",this.direction),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.optionsList.scrollToItem(e.selectionService.focused),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()})),this.popupRef.popupAnchorViewportLeave.subscribe((function(){e.togglePopup(!1)}))},e.prototype.emitValueChange=function(){this.onChangeCallback(this.value),this.valueChange.emit(this.value)},e.prototype.resolveDataItemFromTags=function(e){var t=this;if(this.tags&&this.tags.length&&It(e))return this.tags.reduce((function(e,t){var n=Dt(t)?t:[t];return e.push.apply(e,n),e}),[]).find((function(n){return Rt(n,t.valueField)===Rt(e,t.valueField)}))},e.prototype.firstFocusableIndex=function(e){var t=this.dataService.itemsCount;if(this.disabledItemsService.isIndexDisabled(e)){var n=e+1;return n<t?this.firstFocusableIndex(n):void 0}return e},e.prototype.nextTick=function(e){var t=this;this._zone.runOutsideAngular((function(){setTimeout((function(){return t._zone.run(e)}))}))},e.prototype.setMessages=function(){var e=this;this._zone.runOutsideAngular((function(){clearTimeout(e.messagesTimeout),e.messagesTimeout=setTimeout((function(){e.noDataText=e.localization.get("noDataText"),e.cdr.detectChanges()}))}))},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",this.size)),this.rounded&&this.renderer.addClass(this.wrapper.nativeElement,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",this.fillMode))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"autoClose",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"tabindex",void 0),Object(a.__decorate)([Object(s.Input)("tabIndex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabIndex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"placeholder",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Function])],e.prototype,"itemDisabled",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"checkboxes",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"virtual",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[Boolean])],e.prototype,"valuePrimitive",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"tagMapper",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"allowCustom",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"valueNormalizer",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"removeTag",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)(Xt,{static:!0}),Object(a.__metadata)("design:type",Xt)],e.prototype,"searchbar",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("optionsList",{static:!1}),Object(a.__metadata)("design:type",fn)],e.prototype,"optionsList",void 0),Object(a.__decorate)([Object(s.ContentChild)(Yt,{static:!1}),Object(a.__metadata)("design:type",Yt)],e.prototype,"template",void 0),Object(a.__decorate)([Object(s.ContentChild)(Yn,{static:!1}),Object(a.__metadata)("design:type",Yn)],e.prototype,"customItemTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(tn,{static:!1}),Object(a.__metadata)("design:type",tn)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(nn,{static:!1}),Object(a.__metadata)("design:type",nn)],e.prototype,"fixedGroupTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qn,{static:!1}),Object(a.__metadata)("design:type",Qn)],e.prototype,"tagTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ei,{static:!1}),Object(a.__metadata)("design:type",ei)],e.prototype,"groupTagTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-multiselect"),Object(s.HostBinding)("class.k-input"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"dir",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"disabledClass",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.HostListener)("mousedown",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"hostMousedown",null),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoMultiSelect",providers:[ni,an,on,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.multiselect"},{provide:un,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-multiselect",template:'\n <ng-container kendoMultiSelectLocalizedMessages\n i18n-noDataText="kendo.multiselect.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.combobox.clearTitle|The title of the clear button"\n clearTitle="clear"\n >\n </ng-container>\n <kendo-taglist\n [size]="size"\n [rounded]="rounded"\n [fillMode]="fillMode"\n [id]="tagListId"\n [tags]="tags"\n [textField]="textField"\n [valueField]="valueField"\n [focused]="focusedTagIndex"\n [disabled]="disabled"\n [template]="tagTemplate"\n [groupTemplate]="groupTagTemplate"\n [tagPrefix]="tagPrefix"\n [disabledIndices]="disabledIndices"\n (removeTag)="handleRemoveTag($event)"\n >\n <kendo-searchbar\n #searchbar\n [id]="focusableId"\n [role]="\'listbox\'"\n [tagListId]="tagListId"\n [activeDescendant]="activeDescendant"\n [noDataLabel]="noDataLabel"\n [userInput]="text"\n [disabled]="disabled"\n [readonly]="readonly"\n [tabIndex]="tabIndex"\n [popupOpen]="isOpen"\n [placeholder]="placeholder"\n (onNavigate)="handleNavigate($event)"\n (valueChange)="handleFilter($event)"\n (onBlur)="onSearchBarBlur()"\n (onFocus)="onSearchBarFocus()"\n >\n </kendo-searchbar>\n </kendo-taglist>\n\n <span\n *ngIf="!loading && !readonly && clearButton && (tags?.length || text?.length)"\n class="k-clear-value"\n [style.visibility]="clearButtonVisiblity"\n [attr.title]="clearTitle"\n role="button"\n tabindex="-1"\n (mousedown)="clearAll($event)"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n <span\n *ngIf="loading"\n class="k-icon k-i-loading"\n >\n </span>\n <ng-template #popupTemplate>\n \x3c!--header template--\x3e\n <ng-template *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate.templateRef\n }">\n </ng-template>\n \x3c!--custom item template--\x3e\n <div\n *ngIf="allowCustom && text"\n class="k-list"\n [ngClass]="customItemSizeClass"\n >\n <div class="k-list-item k-custom-item" kendoDropDownsSelectable [multipleSelection]="true" [index]="-1">\n <ng-template *ngIf="customItemTemplate;else default_custom_item_template"\n [templateContext]="{\n templateRef: customItemTemplate.templateRef,\n $implicit: text\n }">\n </ng-template>\n <ng-template #default_custom_item_template>{{ text }}</ng-template>\n <span class="k-icon k-i-plus" style="float: right"></span>\n </div>\n </div>\n \x3c!--list--\x3e\n <kendo-list\n #optionsList\n [size]="size"\n [rounded]="rounded"\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="textField"\n [valueField]="valueField"\n [height]="listHeight"\n [template]="template"\n [groupTemplate]="groupTemplate"\n [fixedGroupTemplate]="fixedGroupTemplate"\n [show]="isOpen"\n [multipleSelection]="true"\n [virtual]="virtual"\n (pageChange)="pageChange($event)"\n [checkboxes]="checkboxes"\n >\n </kendo-list>\n \x3c!--no data template--\x3e\n <div class="k-no-data" *ngIf="data.length === 0">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate ? noDataTemplate.templateRef : undefined\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n \x3c!--footer template--\x3e\n <ng-template *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }">\n </ng-template>\n </ng-template>\n <ng-template [ngIf]="isOpen">\n <kendo-resize-sensor (resize)="onResize()"></kendo-resize-sensor>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(a.__param)(11,Object(s.Optional)()),Object(a.__param)(11,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[s.ElementRef,u.LocalizationService,f.PopupService,an,on,dn,sn,s.ChangeDetectorRef,s.KeyValueDiffers,s.Renderer2,s.NgZone,Boolean])],e)}(),oi=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiColumnComboBoxColumnCellTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),ri=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiColumnComboBoxColumnHeaderTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),ai=function(){function e(){this.hidden=!1,this.matchesMedia=!0}return Object(a.__decorate)([Object(s.ContentChild)(oi,{static:!1}),Object(a.__metadata)("design:type",oi)],e.prototype,"cellTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ri,{static:!1}),Object(a.__metadata)("design:type",ri)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"field",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"title",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"width",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hidden",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"style",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"headerStyle",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"class",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"headerClass",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"media",void 0),e=Object(a.__decorate)([Object(s.Component)({selector:"kendo-combobox-column",template:""})],e)}(),si=function(){if(isNaN(rn)){var e=document.createElement("div");e.style.cssText="overflow: scroll; overflow-x: hidden; zoom: 1; clear: both; display: block;",e.innerHTML=" ",document.body.appendChild(e),rn=e.offsetWidth-e.scrollWidth,document.body.removeChild(e)}return rn},ci=function(e){if(!function(e){return!(!It(e)||0===e.length)&&e.toArray().every((function(e){return!isNaN(e.width)&&e.width>0}))}(e))return null;var t=si()+2;return e.reduce((function(e,t){return!t.hidden&&t.matchesMedia&&(e+=parseInt(t.width,10)),e}),t)},di=function(e){function t(t,n,i,o,r,a,s,c,d,l,p){var u=e.call(this,l,t,n,i,o,r,a,s,c,d,p)||this;return u.hostClasses=!0,u.removeWindowResizeListener=Vt,u.defaultVirtualItemHeight=36,u.defaultVirtualPageSize=30,u}var n;return Object(a.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"header",{set:function(e){this.updateHeaderPadding(e&&e.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"popupWidth",{get:function(){var e=this.wrapper.nativeElement.offsetWidth,t=e+"px",n=this.popupSettings.width||ci(this.columns)||e;return{min:t,max:isNaN(n)?n:n+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"tableSizeClass",{get:function(){return""+(this.size?Zt("table",this.size):"")},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"listContainerClasses",{get:function(){return["k-popup","k-dropdowngrid-popup"].concat(this.popupSettings.popupClass||[])},enumerable:!0,configurable:!0}),t.prototype.ngAfterViewInit=function(){this.updateColumnsMediaState(),this.addWindowResizeListener()},t.prototype.ngOnDestroy=function(){e.prototype.ngOnDestroy.call(this),this.removeWindowResizeListener()},t.prototype.textFrom=function(e,t){return Rt(e,t)},t.prototype.updateHeaderPadding=function(e){if(It(e)){var t=this.localization.rtl?"padding-left":"padding-right";this.optionsList.hasScrollbar()&&si()>0?this.renderer.setStyle(e,t,si()+"px"):this.renderer.removeStyle(e,t)}},t.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(It(this.data)&&this.data.length>0&&this.data.some((function(e){return!Bt(e)})))throw new Error(zn);if(!It(this.valueField)||!It(this.textField))throw new Error(Rn);e.prototype.verifySettings.call(this)}},t.prototype.addWindowResizeListener=function(){var e=this;Object(c.isDocumentAvailable)()&&this.zone.runOutsideAngular((function(){return e.removeWindowResizeListener=e.renderer.listen(window,"resize",e.updateColumnsMediaState.bind(e))}))},t.prototype.updateColumnsMediaState=function(){var e=this;It(this.columns)&&Object(c.isDocumentAvailable)()&&this.columns.forEach((function(t){var n=!t.media||window.matchMedia(t.media).matches;t.matchesMedia!==n&&(t.matchesMedia=n,e.isOpen&&e.zone.run((function(){return e.popupRef.popupElement.style.width=e.popupWidth.max})))}))},Object(a.__decorate)([Object(s.HostBinding)("class.k-dropdowngrid"),Object(a.__metadata)("design:type",Boolean)],t.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],t.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.ContentChildren)(ai),Object(a.__metadata)("design:type",s.QueryList)],t.prototype,"columns",void 0),Object(a.__decorate)([Object(s.ViewChild)("header",{static:!1}),Object(a.__metadata)("design:type",s.ElementRef),Object(a.__metadata)("design:paramtypes",[s.ElementRef])],t.prototype,"header",null),t=n=Object(a.__decorate)([Object(s.Component)({providers:[on,an,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.multicolumncombobox"},{multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return n}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return n}))},{provide:un,useExisting:Object(s.forwardRef)((function(){return n}))}],selector:"kendo-multicolumncombobox",template:'\n <ng-container\n kendoMultiColumnComboBoxLocalizedMessages\n\n i18n-noDataText="kendo.multicolumncombobox.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.multicolumncombobox.clearTitle|The title of the clear button"\n clearTitle="clear"\n >\n </ng-container>\n <kendo-searchbar\n #searchbar\n [role]="\'combobox\'"\n [id]="focusableId"\n [listId]="listBoxId"\n [activeDescendant]="activeDescendant"\n [noDataLabel]="noDataLabel"\n [userInput]="text"\n [suggestedText]="getSuggestion()"\n [disabled]="disabled"\n [readonly]="readonly"\n [tabIndex]="tabIndex"\n [popupOpen]="isOpen"\n [placeholder]="placeholder"\n (onNavigate)="handleNavigate($event)"\n (valueChange)="searchBarChange($event)"\n (onBlur)="handleBlur()"\n (onFocus)="handleFocus()"\n >\n </kendo-searchbar>\n\n <span\n *ngIf="clearButton && !loading && !disabled && !readonly && text?.length"\n class="k-clear-value"\n [style.visibility]="clearButtonVisiblity"\n aria-hidden="true"\n [attr.title]="clearTitle"\n (click)="clearValue($event)"\n [kendoEventsOutsideAngular]="{\n mousedown: preventEventDefault\n }"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n\n <button\n #select\n tabindex="-1"\n aria-hidden="true"\n unselectable="on"\n type="button"\n class="k-input-button k-button k-icon-button"\n [ngClass]="selectButtonClasses"\n [kendoEventsOutsideAngular]="{\n mousedown: preventEventDefault\n }"\n >\n <span class="k-button-icon k-icon" [ngClass]="buttonClasses"></span>\n </button>\n\n <ng-template #popupTemplate>\n \x3c!--user-defined header template --\x3e\n <ng-template\n *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate?.templateRef\n }"\n >\n </ng-template>\n\n \x3c!--data table--\x3e\n <div class="k-data-table" [ngClass]="tableSizeClass">\n\n \x3c!--grid header--\x3e\n <div\n #header\n class="k-table-header"\n >\n <div class="k-table-header-wrap">\n <table class="k-table" role="presentation">\n <colgroup>\n <ng-container *ngFor="let column of columns">\n <col\n *ngIf="!column.hidden && column.matchesMedia"\n [style.width.px]="column.width"\n />\n </ng-container>\n </colgroup>\n <thead class="k-table-thead">\n <tr class="k-table-row">\n <ng-container *ngFor="let column of columns">\n <th\n *ngIf="!column.hidden && column.matchesMedia"\n class="k-table-th"\n [ngStyle]="column.headerStyle"\n [ngClass]="column.headerClass"\n >\n <ng-container *ngIf="!column.headerTemplate">\n {{ column.title || column.field }}\n </ng-container>\n <ng-template\n *ngIf="column.headerTemplate"\n [templateContext]="{\n templateRef: column.headerTemplate?.templateRef,\n $implicit: column,\n column: column\n }"\n >\n </ng-template>\n </th>\n </ng-container>\n </tr>\n </thead>\n </table>\n </div>\n </div>\n\n \x3c!-- item template --\x3e\n <ng-template #rowTemplate let-dataItem>\n <ng-container *ngFor="let column of columns">\n <span\n *ngIf="!column.hidden && column.matchesMedia"\n class="k-table-td"\n [ngClass]="column.class"\n [style.width.px]="column.width"\n [ngStyle]="column.style"\n >\n <ng-container *ngIf="!column.cellTemplate">\n {{ textFrom(dataItem, column.field) }}\n </ng-container>\n <ng-template\n *ngIf="column.cellTemplate"\n [templateContext]="{\n templateRef: column.cellTemplate?.templateRef,\n $implicit: dataItem,\n dataItem: dataItem,\n column: column\n }"\n >\n </ng-template>\n </span>\n </ng-container>\n </ng-template>\n\n \x3c!--list--\x3e\n <kendo-list\n #optionsList\n [id]="listBoxId"\n [optionPrefix]="optionPrefix"\n [data]="data"\n [textField]="textField"\n [valueField]="valueField"\n [template]="{ templateRef: rowTemplate }"\n [groupTemplate]="groupTemplate"\n [fixedGroupTemplate]="fixedGroupTemplate"\n [height]="listHeight"\n [show]="isOpen"\n [virtual]="virtual"\n [type]="\'dropdowngrid\'"\n (pageChange)="pageChange($event)"\n (listResize)="updateHeaderPadding(header)"\n >\n </kendo-list>\n\n \x3c!--no-data template--\x3e\n <div\n class="k-no-data"\n *ngIf="data.length === 0"\n >\n <ng-template\n [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate?.templateRef\n }"\n >\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ noDataText }}</div>\n </ng-template>\n </div>\n\n \x3c!--user-defined footer template--\x3e\n <ng-container *ngIf="footerTemplate">\n <div class="k-table-footer">\n <table class="k-table">\n <tfoot class="k-table-tfoot">\n <tr class="k-table-row">\n <td class="k-table-td">\n <ng-template\n [templateContext]="{\n templateRef: footerTemplate.templateRef\n }"\n >\n </ng-template>\n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n </ng-container>\n\n </div>\n\n </ng-template>\n\n <kendo-resize-sensor\n *ngIf="isOpen"\n (resize)="onResize()"\n >\n </kendo-resize-sensor>\n\n \x3c!-- when the popupSettings.appendTo value is set to \'component\', this container is used --\x3e\n <ng-container #container></ng-container>\n '}),Object(a.__param)(10,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[u.LocalizationService,f.PopupService,on,dn,sn,an,s.NgZone,s.ChangeDetectorRef,s.Renderer2,s.ElementRef,Boolean])],t)}(Zn),li=function(){function e(e){this.templateRef=e}return e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownTreeNodeTemplate], [kendoMultiSelectTreeNodeTemplate]"}),Object(a.__metadata)("design:paramtypes",[s.TemplateRef])],e)}(),pi={animate:!0},ui=function(){return!1},hi=function(){return Object(h.of)([])},fi=function(){return!1},bi=function(){return!0},mi=function(){function e(e,t,n,i,o,r,a,d){this.wrapper=e,this.popupService=t,this.navigationService=n,this.renderer=i,this._zone=o,this.cdr=r,this.localization=a,this.touchEnabled=d,this.hostClasses=!0,this.role="listbox",this.ariaHasPopup="tree",this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.nodeExpand=new s.EventEmitter,this.nodeCollapse=new s.EventEmitter,this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.valueChange=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.clearButton=!0,this.hasChildren=ui,this.fetchChildren=hi,this.placeholder="",this.listHeight=200,this.disabled=!1,this.readonly=!1,this.valuePrimitive=!1,this.itemDisabled=fi,this.isNodeVisible=bi,this.loadOnDemand=!0,this.filterable=!1,this.filter="",this.focusableId="k-"+Object(c.guid)(),this.selectedKeys=[],this.filterStateChange=new s.EventEmitter,this.allNodesHidden=!1,this.valueLabelId="k-"+Object(c.guid)(),this._popupSettings=pi,this._tabindex=0,this._isFocused=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",this.subscriptions=[],this.onTouchedCallback=Vt,this.onChangeCallback=Vt,this.direction=a.rtl?"rtl":"ltr",this.subscribeEvents(),this.subscribeTouchEvents(),this.subscribeFocusEvents()}var t;return t=e,Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.focusableId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabIndex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAriaExpanded",{get:function(){return this.isOpen},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),e.prototype.handleClick=function(){this.togglePopup(!this.isOpen)},e.prototype.handleKeydown=function(e){if(!this.disabled&&!this.readonly){var t=e;this.navigationService.process({originalEvent:t})}},Object.defineProperty(e.prototype,"treeview",{get:function(){return this._treeview},set:function(e){e&&((this.isFocused&&!this.filterable||this.touchEnabled)&&e.focus(),e.animate=!0,this._treeview=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._nodes},set:function(e){this._nodes=e,this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e,this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({},pi,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataItem",{get:function(){return this._dataItem?this._dataItem:this.value},set:function(e){this._dataItem=e,this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?-1:this._tabindex},set:function(e){var t=Number(e);this._tabindex=isNaN(t)?0:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Zt("picker",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("picker",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper.nativeElement,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Jt("picker",this.fillMode)),e&&this.renderer.addClass(this.wrapper.nativeElement,Jt("picker",e)),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper.nativeElement,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var e=this.wrapper.nativeElement.offsetWidth,t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return It(this.popupRef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearButtonVisiblity",{get:function(){if(this.touchEnabled)return"visible"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this.isNodeExpanded},set:function(e){this.isNodeExpanded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expand",{get:function(){return this.nodeExpand},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collapse",{get:function(){return this.nodeCollapse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nodes",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.fetchChildren},set:function(e){this.fetchChildren=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.isNodeVisible},set:function(e){this.isNodeVisible=e},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.renderer.removeAttribute(this.wrapper.nativeElement,"tabindex"),this.assignAriaDescribedBy(),this.subscriptions.push(this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.cdr.markForCheck()}))),this.setComponentClasses()},e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.unsubscribeEvents()},e.prototype.ngOnChanges=function(e){Object(c.anyChanged)(["textField","valueField","valuePrimitive"],e,!1)&&this.setState()},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.isEmpty=function(){return!this.text&&!this.placeholder},e.prototype.togglePopup=function(e){var t=this.disabled||this.readonly,n=this.isOpen===e;t||n||(this.triggerPopupEvents(e)||(e?this.createPopup():this.destroyPopup()))},e.prototype.handleFocus=function(e){var t=this;e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.isFocused||(this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this._zone.run((function(){t.onFocus.emit()}))))},e.prototype.handleBlur=function(e){var t=this,n=e&&e.relatedTarget;this.wrapper.nativeElement.contains(n)||this.isOpen&&this.popupRef.popupElement.contains(n)||(this.isFocused=!1,Object(c.hasObservers)(this.onBlur)||Lt(this.wrapper.nativeElement)?this._zone.run((function(){t.togglePopup(!1),t.onBlur.emit(),t.onTouchedCallback()})):this.togglePopup(!1))},e.prototype.focusItemAt=function(e){if(this.treeview){var t=this.treeview.itemLookup(e);!It(t)||this.treeview.isDisabled(t.item.dataItem,t.item.index)||this.treeview.focus(e)}},e.prototype.focus=function(){this.disabled||this.wrapper.nativeElement.focus()},e.prototype.blur=function(){this.disabled||this.wrapper.nativeElement.blur()},e.prototype.reset=function(){this.value=void 0,this.dataItem=void 0},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!It(t.popupRef);t.destroyPopup(),n&&t.createPopup()}))},Object.defineProperty(e.prototype,"popupContainerClasses",{get:function(){var e=["k-popup-dropdowntree"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),e.prototype.onSelectionChange=function(e){var t=e.dataItem,n=e.index;this.valueDepth=n.split("_").length-1;var i=this.getField(this.valueField,t),o=this.valuePrimitive?Object(p.d)(i)(t):t;o!==this.value&&(this.value=o,this.dataItem=t,this.emitValueChange(this.value)),this.togglePopup(!1),this.focus()},e.prototype.messageFor=function(e){return this.localization.get(e)},e.prototype.clearValue=function(e){e.stopImmediatePropagation(),this.focus(),this.value=void 0,this.dataItem=void 0,this.clearState(),this.valueChange.emit(void 0),this.emitValueChange()},Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),e.prototype.preventEventDefault=function(e){e.preventDefault()},e.prototype.writeValue=function(e){!It(e)&&It(this.value)&&(this.dataItem=null),this.value=null===e?void 0:e},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e,this.cdr.markForCheck()},e.prototype.handleFilterInputChange=function(e){var t=this;this.filterChange.next(e),this.allNodesHidden=this.nodes.every((function(e,n){return!t.isVisible(e,String(n))}))},Object.defineProperty(e.prototype,"buttonClasses",{get:function(){return this.loading?"k-i-loading":"k-i-arrow-s"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectButtonClasses",{get:function(){return(this.size?Zt("button",this.size):"")+" "+(this.fillMode?"k-button-"+this.fillMode:"")+" "+(this.fillMode?"k-button-"+this.fillMode+"-base":"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filterInputClasses",{get:function(){return(this.size?Zt("input",this.size):"")+" "+(this.fillMode?"k-input-"+this.fillMode:"")+" "+(this.rounded?qt(this.rounded):"")},enumerable:!0,configurable:!0}),e.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(!0===this.valuePrimitive&&It(this.value)&&"object"==typeof this.value)throw new Error(Hn);if(!0===this.valuePrimitive&&It(this.value)&&"object"!=typeof this.dataItem)throw new Error($n);if(!1===this.valuePrimitive&&It(this.value)&&"object"!=typeof this.value)throw new Error(Kn);if(!It(this.valueField)||!It(this.textField))throw new Error(Wn);if((Dt(this.valueField)||Dt(this.textField))&&It(this.value)&&!It(this.valueDepth))throw new Error(Un)}},e.prototype.emitValueChange=function(e){this.onChangeCallback(e),this.valueChange.emit(e)},e.prototype.getText=function(e,t){if(It(t)&&It(e)){var n=this.getField(e,t);return Object(p.d)(n)(t)}return null},e.prototype.getField=function(e,t){var n=e.length-1;return"string"==typeof e?e:It(this.valueDepth)?n<this.valueDepth?e[n]:e[this.valueDepth]:e.find((function(e){return e in t}))},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype.createPopup=function(){var e=this,t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,appendTo:this.appendTo,anchorAlign:n,content:this.popupTemplate,popupAlign:i,positionMode:"absolute",popupClass:this.popupContainerClasses});var o=this.popupRef.popupElement,r=this.width,a=r.min,s=r.max;o.style.minWidth=a,o.style.width=s,o.style.height=this.height,o.setAttribute("dir",this.direction),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()}))},e.prototype.destroyPopup=function(){var e=this;this.popupRef&&(this.popupRef.close(),this.popupRef=null,""!==this.filter&&(this.filter="",this.allNodesHidden=!1,Object(c.hasObservers)(this.filterChange)&&this._zone.run((function(){e.filterChange.emit("")}))))},e.prototype.handleEscape=function(){this.togglePopup(!1),this.focus()},e.prototype.setState=function(){if(It(this.value)&&It(this.dataItem)&&It(this.valueField)){this.text=this.getText(this.textField,this.dataItem);var e=this.getField(this.valueField,this.dataItem);this.selectBy=e,this.selectedKeys=[Object(p.d)(e)(this.dataItem)]}else this.clearState();this.cdr.markForCheck()},e.prototype.clearState=function(){this.text=void 0,this.selectedKeys=[]},e.prototype.subscribeEvents=function(){var e=this;this.subscriptions.push(this.navigationService.open.subscribe((function(){return e.togglePopup(!0)})),this.navigationService.close.subscribe((function(){e.togglePopup(!1),e.focus()})),this.navigationService.enter.pipe(Object(b.tap)((function(e){return e.originalEvent.preventDefault()}))).subscribe((function(){return e.togglePopup(!0)})),this.navigationService.esc.subscribe((function(){return e.handleEscape()})),this.navigationService.tab.subscribe((function(){return e.focus()})),this.navigationService.down.subscribe((function(t){e.treeview&&(t.originalEvent.preventDefault(),e.treeview.isActive||e.treeview.focus())})),this.navigationService.up.subscribe((function(t){e.treeview&&(t.originalEvent.preventDefault(),e.filterable&&"0"===e.treeview.navigationService.activeIndex&&e.filterInput.nativeElement.focus())})))},e.prototype.subscribeTouchEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&this.touchEnabled&&this._zone.runOutsideAngular((function(){return e.touchstartDisposeHandler=e.renderer.listen(document,"touchstart",(function(t){var n=t.target;e.isFocused&&!$t(e.wrapper,n,e.popupRef)&&e._zone.run((function(){e.isOpen&&e.treeview.blur(),e.blur()}))}))}))},e.prototype.subscribeFocusEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.handleFocus=this.handleFocus.bind(this),this.handleDocumentBlur=this.handleDocumentBlur.bind(this),this._zone.runOutsideAngular((function(){document.addEventListener("focus",e.handleFocus,!0),document.addEventListener("blur",e.handleDocumentBlur,!0)})))},e.prototype.unSubscribeFocusEvents=function(){if(Object(c.isDocumentAvailable)()){document.removeEventListener("focus",this.handleFocus,!0),document.removeEventListener("blur",this.handleDocumentBlur,!0)}},e.prototype.unsubscribeEvents=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.unSubscribeFocusEvents(),this.touchstartDisposeHandler&&this.touchstartDisposeHandler()},e.prototype.handleDocumentBlur=function(e){e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.handleBlur(e))},e.prototype.assignAriaDescribedBy=function(){var e=this.wrapper.nativeElement.getAttribute("aria-describedby")||"",t=(this.valueLabelId+" "+e.trim()).trim();this.renderer.setAttribute(this.wrapper.nativeElement,"aria-describedby",t)},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("picker",this.size)),this.rounded&&this.renderer.addClass(this.wrapper.nativeElement,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper.nativeElement,Jt("picker",this.fillMode))},Object(a.__decorate)([Object(s.HostBinding)("class.k-dropdowntree"),Object(s.HostBinding)("class.k-picker"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(s.HostBinding)("attr.aria-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.HostBinding)("attr.id"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"id",null),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.tabindex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostTabIndex",null),Object(a.__decorate)([Object(s.HostBinding)("attr.role"),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-haspopup"),Object(a.__metadata)("design:type",String)],e.prototype,"ariaHasPopup",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-expanded"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isAriaExpanded",null),Object(a.__decorate)([Object(s.HostBinding)("attr.readonly"),Object(s.HostBinding)("attr.aria-readonly"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isReadonly",null),Object(a.__decorate)([Object(s.HostListener)("click"),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"handleClick",null),Object(a.__decorate)([Object(s.HostListener)("keydown",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"handleKeydown",null),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(li,{static:!1}),Object(a.__metadata)("design:type",li)],e.prototype,"nodeTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(qn,{static:!1}),Object(a.__metadata)("design:type",qn)],e.prototype,"valueTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)("treeview",{static:!1}),Object(a.__metadata)("design:type",_e),Object(a.__metadata)("design:paramtypes",[_e])],e.prototype,"treeview",null),Object(a.__decorate)([Object(s.ViewChild)("filterInput",{static:!1}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"filterInput",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeExpand",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeCollapse",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"valueDepth",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"hasChildren",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"fetchChildren",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"dataItem",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"valuePrimitive",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"itemDisabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isNodeExpanded",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isNodeVisible",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"filter",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoDropDownTree",providers:[an,on,dn,sn,u.LocalizationService,{provide:u.L10N_PREFIX,useValue:"kendo.dropdowntree"},{multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:fe,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:be,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-dropdowntree",template:'\n <ng-container kendoDropDownTreeLocalizedMessages\n i18n-noDataText="kendo.dropdowntree.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.dropdowntree.clearTitle|The title of the clear button"\n clearTitle="clear"\n >\n </ng-container>\n <span\n [attr.id]="valueLabelId"\n class="k-input-inner"\n >\n <span class="k-input-value-text">\n <ng-template *ngIf="valueTemplate"\n [templateContext]="{\n templateRef: valueTemplate.templateRef,\n $implicit: dataItem\n }">\n </ng-template>\n <ng-template [ngIf]="!valueTemplate"> {{ text || placeholder }} </ng-template>\n </span>\n </span>\n <span\n *ngIf="!loading && !readonly && clearButton && text?.length && !disabled"\n class="k-clear-value"\n [style.visibility]="clearButtonVisiblity"\n aria-hidden="true"\n [attr.title]="messageFor(\'clearTitle\')"\n (click)="clearValue($event)"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n <button\n tabindex="-1"\n type="button"\n aria-hidden="true"\n class="k-input-button k-button k-icon-button"\n [ngClass]="selectButtonClasses"\n >\n <span\n class="k-button-icon k-icon"\n [ngClass]="buttonClasses"\n ></span>\n </button>\n <ng-template #popupTemplate>\n <span\n *ngIf="filterable"\n class="k-list-filter"\n >\n <span\n class="k-textbox k-input"\n [ngClass]="filterInputClasses"\n >\n <span class="k-input-prefix">\n <span class="k-input-icon k-icon k-i-search"></span>\n </span>\n <input\n #filterInput\n (input)="handleFilterInputChange($event.target.value)"\n [filterInput]="filterable && !touchEnabled"\n (keydown.arrowdown)="handleKeydown($event)"\n (keydown.alt.arrowup)="handleKeydown($event)"\n [(ngModel)]="filter"\n class="k-input-inner"\n role="textbox"\n aria-haspopup="true"\n aria-expanded="false"\n tabindex="0"\n aria-disabled="false"\n aria-readonly="false"\n [kendoEventsOutsideAngular]="{\n blur: handleBlur\n }"\n [scope]="this"\n >\n </span>\n </span>\n \x3c!--header template--\x3e\n <ng-template\n *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate?.templateRef\n }">\n </ng-template>\n <kendo-treeview\n #treeview\n *ngIf="data.length !== 0 && !allNodesHidden"\n [size]="size"\n [nodes]="data"\n [style.maxHeight.px]="listHeight"\n [animate]="false"\n [(selectedKeys)]="selectedKeys"\n [selectBy]="selectBy"\n [textField]="textField"\n kendoTreeViewSelectable\n [children]="children"\n [hasChildren]="hasChildren"\n [loadOnDemand]="loadOnDemand"\n [isExpanded]="isNodeExpanded"\n [isDisabled]="itemDisabled"\n [nodeTemplate]="nodeTemplate"\n [filter]="filter"\n [isVisible]="isNodeVisible"\n (focusout)="handleBlur($event)"\n (keydown)="handleKeydown($event)"\n (selectionChange)="onSelectionChange($event)"\n (expand)="nodeExpand.emit($event)"\n (collapse)="nodeCollapse.emit($event)"\n >\n </kendo-treeview>\n \x3c!--footer template--\x3e\n <ng-template\n *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate?.templateRef\n }">\n </ng-template>\n \x3c!--no-data template--\x3e\n <div class="k-no-data" *ngIf="data.length === 0 || allNodesHidden">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate?.templateRef\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ messageFor(\'noDataText\') }}</div>\n </ng-template>\n </div>\n </ng-template>\n <ng-container #container></ng-container>\n ',changeDetection:s.ChangeDetectionStrategy.OnPush}),Object(a.__param)(7,Object(s.Optional)()),Object(a.__param)(7,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[s.ElementRef,f.PopupService,dn,s.Renderer2,s.NgZone,s.ChangeDetectorRef,u.LocalizationService,Boolean])],e)}(),gi={animate:!0},vi={checkChildren:!0,checkOnClick:!0},yi=function(){return!1},_i=function(){return Object(h.of)([])},Oi=function(){return!1},ji=function(){return!0},Ci=function(){function e(e,t,n,i,o,r,a,d){this.wrapper=e,this.popupService=t,this.renderer=n,this.navigationService=i,this._zone=o,this.localization=r,this.cdr=a,this.touchEnabled=d,this.hostClasses=!0,this.role="listbox",this.ariaHasPopup="tree",this.valueDepth=[],this.placeholder="",this.listHeight=200,this.disabled=!1,this.readonly=!1,this.valuePrimitive=!1,this.loadOnDemand=!1,this.focusableId="k-"+Object(c.guid)(),this.clearButton=!0,this.filterable=!1,this.checkAll=!1,this.hasChildren=yi,this.fetchChildren=_i,this.isNodeVisible=ji,this.itemDisabled=Oi,this.tagMapper=function(e){return e||[]},this.onFocus=new s.EventEmitter,this.onBlur=new s.EventEmitter,this.open=new s.EventEmitter,this.opened=new s.EventEmitter,this.close=new s.EventEmitter,this.closed=new s.EventEmitter,this.nodeExpand=new s.EventEmitter,this.nodeCollapse=new s.EventEmitter,this.valueChange=new s.EventEmitter,this.removeTag=new s.EventEmitter,this.filterChange=new s.EventEmitter,this.filterStateChange=new s.EventEmitter,this.checkedItems=[],this.checkBy=function(e){return e},this.showAfter=0,this.allNodesHidden=!1,this.tagListId=Object(c.guid)(),this.tagPrefix="tag-"+Object(c.guid)(),this.focusedTagIndex=void 0,this._value=[],this._tabindex=0,this._popupSettings=gi,this._checkableSettings=vi,this._isFocused=!1,this._size="medium",this._rounded="medium",this._fillMode="solid",this.subscriptions=[],this.lastAction="check",this.onTouchedCallback=Vt,this.onChangeCallback=Vt,this.direction=r.rtl?"rtl":"ltr",this.subscribeEvents(),this.subscribeFocusEvents()}var t;return t=e,Object.defineProperty(e.prototype,"isDisabled",{get:function(){return this.disabled},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this.loading},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.focusableId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostTabIndex",{get:function(){return this.tabindex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isReadonly",{get:function(){return this.readonly},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaDescribedBy",{get:function(){return this.tagListId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaActiveDescendant",{get:function(){return this.focusedTagId},enumerable:!0,configurable:!0}),e.prototype.handleClick=function(){this.togglePopup(!this.isOpen)},e.prototype.handleKeydown=function(e){if(this.isWrapperActive&&e.keyCode===c.Keys.Backspace&&this.tags.length>0)this.handleBackspace();else if(!this.disabled&&!this.readonly){var t=e;this.navigationService.process({originalEvent:t})===Ae.Open&&t.preventDefault()}},Object.defineProperty(e.prototype,"treeview",{get:function(){return this._treeview},set:function(e){var t=this;this._treeview=e,e&&((this.isFocused&&!this.filterable&&!this.checkAll||this.touchEnabled)&&e.focus(),Promise.resolve(null).then((function(){return t.treeview.animate=!0})))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tabindex",{get:function(){return this.disabled?-1:this._tabindex},set:function(e){var t=Kt(e);this._tabindex=isNaN(t)?0:t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Zt("input",this.size)),e&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rounded",{get:function(){return this._rounded},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,qt(this.rounded)),e&&this.renderer.addClass(this.wrapper.nativeElement,qt(e)),this._rounded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillMode",{get:function(){return this._fillMode},set:function(e){this.renderer.removeClass(this.wrapper.nativeElement,Jt("input",this.fillMode)),e&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",e)),this._fillMode=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupSettings",{get:function(){return this._popupSettings},set:function(e){this._popupSettings=Object.assign({},gi,e),this.cdr.detectChanges()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkableSettings",{get:function(){return this._checkableSettings},set:function(e){this._checkableSettings=Object.assign({},vi,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this._nodes},set:function(e){this._nodes=e,this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this._value},set:function(e){this._value=e||[],this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataItems",{get:function(){var e=this;return this._dataItems||this.value.map((function(t,n){return{dataItem:t,index:null,level:e.valueDepth[n]||0}}))},set:function(e){var t=this;this._dataItems=(e||[]).map((function(e,n){return Nt(e,["dataItem","index","level"])?e:{dataItem:e,index:null,level:t.valueDepth[n]||0}})),this.setState()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"focusedTagId",{get:function(){if(!It(this.focusedTagIndex)||this.isOpen)return null;var e=this.tags[this.focusedTagIndex];return this.tagPrefix+"-"+Gt({dataItem:e},this.valueField)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFocused",{get:function(){return this._isFocused},set:function(e){this.renderer[e?"addClass":"removeClass"](this.wrapper.nativeElement,"k-focus"),this._isFocused=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isOpen",{get:function(){return It(this.popupRef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){var e=this.wrapper.nativeElement.offsetWidth,t=this.popupSettings.width||e;return{min:isNaN(e)?e:e+"px",max:isNaN(t)?t:t+"px"}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){var e=this.popupSettings.height;return It(e)?e+"px":"auto"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"appendTo",{get:function(){var e=this.popupSettings.appendTo;if(e&&"root"!==e)return"component"===e?this.container:e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"popupContainerClasses",{get:function(){var e=["k-popup-dropdowntree"];return this.popupSettings.popupClass&&e.push(this.popupSettings.popupClass),e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"nodes",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.fetchChildren},set:function(e){this.fetchChildren=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"expand",{get:function(){return this.nodeExpand},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collapse",{get:function(){return this.nodeCollapse},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isExpanded",{get:function(){return this.isNodeExpanded},set:function(e){this.isNodeExpanded=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.isNodeVisible},set:function(e){this.isNodeVisible=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTagFocused",{get:function(){return!this.isOpen&&void 0!==this.focusedTagIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isTreeViewActive",{get:function(){return this.treeview&&this.treeview.isActive},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isWrapperActive",{get:function(){return document.activeElement===this.wrapper.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isFilterActive",{get:function(){return this.filterInput&&document.activeElement===this.filterInput.nativeElement},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCheckAllActive",{get:function(){return this.checkAllInput&&document.activeElement===this.checkAllInput.nativeElement},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.renderer.removeAttribute(this.wrapper.nativeElement,"tabindex"),this.renderer.setAttribute(this.wrapper.nativeElement,"aria-expanded",String(this.isOpen)),this.subscriptions.push(this.localization.changes.subscribe((function(t){var n=t.rtl;e.direction=n?"rtl":"ltr",e.cdr.markForCheck()}))),this.setComponentClasses()},e.prototype.ngOnDestroy=function(){this.destroyPopup(),this.unsubscribeEvents()},e.prototype.ngOnChanges=function(e){var t=this;Object(c.anyChanged)(["textField","valueField","valuePrimitive"],e,!1)&&this.setState(),Object(c.anyChanged)(["valueDepth","value","dataItems"],e,!1)&&(!e.value||e.dataItems||this.valuePrimitive?this.dataItems=this.dataItems.map((function(e,n){return Object(a.__assign)({},e,{level:t.valueDepth[n]||0})})):this.dataItems=this.value)},e.prototype.ngAfterContentChecked=function(){this.verifySettings()},e.prototype.isEmpty=function(){return!(Boolean(this.placeholder)||It(this.value)&&0!==this.value.length)},e.prototype.focus=function(){this.disabled||this.wrapper.nativeElement.focus()},e.prototype.blur=function(){this.disabled||this.wrapper.nativeElement.blur()},e.prototype.focusItemAt=function(e){if(this.treeview){var t=this.treeview.itemLookup(e);!It(t)||this.treeview.isDisabled(t.item.dataItem,t.item.index)||this.treeview.focus(e)}},e.prototype.reset=function(){this.value=[],this.dataItems=[],this.valueDepth=[]},e.prototype.toggle=function(e){var t=this;Promise.resolve(null).then((function(){var n=It(e)?e:!It(t.popupRef);t.destroyPopup(),n&&t.createPopup()}))},e.prototype.handleFocus=function(e){var t=this;e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.isFocused||(this.isFocused=!0,Object(c.hasObservers)(this.onFocus)&&this._zone.run((function(){t.onFocus.emit()})),this.isOpen&&this.treeview&&(this.lastNodeOnFocus&&this.lastNodeOnFocus.setAttribute("tabindex","0"),this.treeview.focus())))},e.prototype.handleBlur=function(e){var t=this,n=e&&e.relatedTarget;this.wrapper.nativeElement.contains(n)||this.isOpen&&this.popupRef.popupElement.contains(n)||(this.isFocused=!1,this.togglePopup(!1),(Object(c.hasObservers)(this.onBlur)||Lt(this.wrapper.nativeElement))&&this._zone.run((function(){t.onBlur.emit(),t.onTouchedCallback()})))},e.prototype.handleNodeClick=function(e){if(!this.isFocused){var t=e.originalEvent.target.parentElement.parentElement;this.lastNodeOnFocus=t,this.focus()}},e.prototype.togglePopup=function(e){var t=this,n=this.disabled||this.readonly,i=this.isOpen===e;(this._zone.run((function(){t.focusedTagIndex=void 0})),n||i)||(this.triggerPopupEvents(e)?this.removeTreeViewFromTabOrder():e?this.createPopup():this.destroyPopup())},e.prototype.messageFor=function(e){return this.localization.get(e)},e.prototype.handleCheckedItemsChange=function(e){this.valueDepth=e.map((function(e){return e.level})),this.lastAction=e.length>this.dataItems.length?"check":"uncheck",this.dataItems=e.slice(),this.updateValue(this.dataItems)},e.prototype.handleRemoveTag=function(e){var t=this,n=e.tag,i=e.index;if(!this.disabled&&!this.readonly){var o=new ti(n);this.removeTag.emit(o),o.isDefaultPrevented()||(n instanceof Array?(this.dataItems=this.dataItems.filter((function(e,n){return n<t.showAfter||t.disabledIndices.has(n)})),this.valueDepth=this.valueDepth.filter((function(e,n){return n<t.showAfter||t.disabledIndices.has(n)}))):(this.dataItems=this.dataItems.filter((function(e,n){return n!==i||t.disabledIndices.has(n)})),this.valueDepth=this.valueDepth.filter((function(e,n){return n!==i||t.disabledIndices.has(n)}))),this.updateValue(this.dataItems),this.isFocused||this.focus())}},e.prototype.handleTagMapperChange=function(e){this.showAfter=Kt(e),this.setTags()},e.prototype.clearAll=function(e){var t=this;e.stopImmediatePropagation(),e.preventDefault(),this.focus(),this.value=this.value.filter((function(e,n){return t.disabledIndices.has(n)})),this.dataItems=this.dataItems.filter((function(e,n){return t.disabledIndices.has(n)})),this.valueDepth=this.valueDepth.filter((function(e,n){return t.disabledIndices.has(n)})),this.emitValueChange(this.value)},e.prototype.writeValue=function(e){this.value=e||[],this.valuePrimitive||(this.dataItems=this.value)},e.prototype.registerOnChange=function(e){this.onChangeCallback=e},e.prototype.registerOnTouched=function(e){this.onTouchedCallback=e},e.prototype.setDisabledState=function(e){this.disabled=e,this.cdr.markForCheck()},e.prototype.handleFilterInputChange=function(e){var t=this;this.filterChange.next(e),this.allNodesHidden=this.nodes.every((function(e,n){return!t.isVisible(e,String(n))}))},Object.defineProperty(e.prototype,"filterInputClasses",{get:function(){return(this.size?Zt("input",this.size):"")+" "+(this.fillMode?"k-input-"+this.fillMode:"")+" "+(this.rounded?qt(this.rounded):"")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checkAllCheckboxClasses",{get:function(){return""+(this.size?Zt("checkbox",this.size):"")},enumerable:!0,configurable:!0}),e.prototype.toggleCheckAll=function(){this.checkAllInput.nativeElement.focus(),this.checkAllInput.nativeElement.click()},e.prototype.verifySettings=function(){if(Object(s.isDevMode)()){if(!It(this.valueField)||!It(this.textField))throw new Error(In);if(!Dt(this.value))throw new Error(kn);if(this.value.length>0){if(this.valuePrimitive&&this.value.some((function(e){return Bt(e)})))throw new Error(wn);var e=this.dataItems.every((function(e){return Bt(e.dataItem)}));if(this.valuePrimitive&&!Dt(this.dataItems))throw new Error(xn);if(this.valuePrimitive&&!e)throw new Error(xn);if(this.valuePrimitive&&this.dataItems.length!==this.value.length)throw new Error(En);if(!this.valuePrimitive&&!Mt(this.value))throw new Error(Sn);if((Dt(this.valueField)||Dt(this.textField))&&!Dt(this.valueDepth))throw new Error(Tn);if((Dt(this.valueField)||Dt(this.textField))&&0===this.valueDepth.length)throw new Error(Tn);if((Dt(this.valueField)||Dt(this.textField))&&this.valueDepth.length!==this.value.length)throw new Error(Dn)}}},e.prototype.emitValueChange=function(e){this.onChangeCallback(e),this.valueChange.emit(e)},e.prototype.triggerPopupEvents=function(e){var t=new pn;return e?this.open.emit(t):this.close.emit(t),t.isDefaultPrevented()},e.prototype.createPopup=function(){var e=this,t="rtl"===this.direction?"right":"left",n={horizontal:t,vertical:"bottom"},i={horizontal:t,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.wrapper,appendTo:this.appendTo,anchorAlign:n,content:this.popupTemplate,popupAlign:i,positionMode:"absolute",popupClass:this.popupContainerClasses});var o=this.popupRef.popupElement,r=this.width,a=r.min,s=r.max;o.style.minWidth=a,o.style.width=s,o.style.height=this.height,this.renderer.setAttribute(o,"dir",this.direction),this.renderer.setAttribute(this.wrapper.nativeElement,"aria-expanded","true"),this.popupRef.popupOpen.subscribe((function(){e.cdr.detectChanges(),e.opened.emit()})),this.popupRef.popupClose.subscribe((function(){e.closed.emit()}))},e.prototype.destroyPopup=function(){var e=this;this.popupRef&&(this.popupRef.close(),this.popupRef=null,this.renderer.setAttribute(this.wrapper.nativeElement,"aria-expanded","false"),""!==this.filter&&(this.filter="",this.allNodesHidden=!1,Object(c.hasObservers)(this.filterChange)&&this._zone.run((function(){e.filterChange.emit("")}))))},e.prototype.subscribeEvents=function(){var e=this;this.subscriptions.push(this.navigationService.open.subscribe((function(){return e.togglePopup(!0)})),this.navigationService.enter.pipe(Object(b.tap)((function(e){return e.originalEvent.preventDefault()}))).subscribe((function(){return e.togglePopup(!0)})),Object(h.merge)(this.navigationService.close,this.navigationService.esc).subscribe((function(){e.focus(),e.togglePopup(!1)})),this.navigationService.tab.subscribe(this.handleTabKey.bind(this)),this.navigationService.up.subscribe(this.handleUpKey.bind(this)),this.navigationService.down.subscribe(this.handleDownKey.bind(this)),this.navigationService.left.pipe(Object(b.filter)((function(){return!e.isTreeViewActive}))).subscribe("rtl"===this.direction?this.handleRightKey.bind(this):this.handleLeftKey.bind(this)),this.navigationService.right.pipe(Object(b.filter)((function(){return!e.isTreeViewActive}))).subscribe("rtl"===this.direction?this.handleLeftKey.bind(this):this.handleRightKey.bind(this)),this.navigationService.home.pipe(Object(b.filter)((function(){return!e.isOpen}))).subscribe(this.handleHome.bind(this)),this.navigationService.end.pipe(Object(b.filter)((function(){return!e.isOpen}))).subscribe(this.handleEnd.bind(this)),this.navigationService.backspace.pipe(Object(b.filter)((function(){return e.isTagFocused}))).subscribe(this.handleBackspace.bind(this)),this.navigationService.delete.pipe(Object(b.filter)((function(){return e.isTagFocused}))).subscribe(this.handleDelete.bind(this)))},e.prototype.subscribeFocusEvents=function(){var e=this;Object(c.isDocumentAvailable)()&&(this.handleFocus=this.handleFocus.bind(this),this.handleDocumentBlur=this.handleDocumentBlur.bind(this),this._zone.runOutsideAngular((function(){document.addEventListener("focus",e.handleFocus,!0),document.addEventListener("blur",e.handleDocumentBlur,!0)})))},e.prototype.unSubscribeFocusEvents=function(){if(Object(c.isDocumentAvailable)()){document.removeEventListener("focus",this.handleFocus,!0),document.removeEventListener("blur",this.handleDocumentBlur,!0)}},e.prototype.handleDocumentBlur=function(e){e.target===this.wrapper.nativeElement&&(e.stopImmediatePropagation(),this.handleBlur(e))},e.prototype.handleTabKey=function(){this.focus(),this.isOpen&&(this.treeview.blur(),this.removeTreeViewFromTabOrder())},e.prototype.handleUpKey=function(e){if(this.treeview&&(e.originalEvent.preventDefault(),!this.isWrapperActive)){var t="0"===this.treeview.navigationService.activeIndex;this.filterable&&this.isFilterActive?this.focus():this.checkAll&&!this.isCheckAllActive&&t?this.checkAllInput.nativeElement.focus():(this.isCheckAllActive||t)&&(this.filterable?this.filterInput.nativeElement.focus():this.focus())}},e.prototype.handleDownKey=function(e){this.treeview&&(e.originalEvent.preventDefault(),this.filterable&&this.isWrapperActive?this.filterInput.nativeElement.focus():this.checkAll&&(this.isWrapperActive||this.isFilterActive)?this.checkAllInput.nativeElement.focus():this.treeview.isActive||this.treeview.focus(),this.focusedTagIndex=void 0)},e.prototype.handleRightKey=function(e){e.originalEvent.preventDefault();var t=this.tags.length-1;this.focusedTagIndex===t?this.focusedTagIndex=void 0:this.focusedTagIndex<t?this.focusedTagIndex++:this.focusedTagIndex||(this.focusedTagIndex=0)},e.prototype.handleLeftKey=function(e){e.originalEvent.preventDefault(),void 0===this.focusedTagIndex||this.focusedTagIndex<0?this.focusedTagIndex=this.tags.length-1:0!==this.focusedTagIndex&&this.focusedTagIndex--},e.prototype.handleEnd=function(e){e.originalEvent.preventDefault(),this.focusedTagIndex=this.tags.length-1},e.prototype.handleHome=function(e){e.originalEvent.preventDefault(),this.focusedTagIndex=0},e.prototype.handleBackspace=function(){if(void 0!==this.focusedTagIndex)this.handleDelete();else{var e=this.tags[this.tags.length-1],t=this.tags.length-1;this.handleRemoveTag({tag:e,index:t})}},e.prototype.handleDelete=function(){var e=this.tags[this.focusedTagIndex],t=this.focusedTagIndex;this.handleRemoveTag({tag:e,index:t}),this.focusedTagIndex===this.tags.length&&(this.focusedTagIndex=void 0)},e.prototype.unsubscribeEvents=function(){this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.unSubscribeFocusEvents()},e.prototype.removeTreeViewFromTabOrder=function(){var e=this;this.treeview.element.nativeElement.querySelectorAll("li").forEach((function(t){"0"===t.getAttribute("tabindex")&&(e.lastNodeOnFocus=t,e.lastNodeOnFocus.setAttribute("tabindex","-1"))}))},e.prototype.setState=function(){It(this.dataItems)&&It(this.valueField)&&(this.setTags(),this.checkedItems=this.dataItems.slice()),this.cdr.markForCheck()},e.prototype.setTags=function(){var e=this.dataItems.map((function(e){return e.dataItem}));this.tags=this.tagMapper(e),this.disabledIndices=this.disabledItemsMapper()},e.prototype.updateValue=function(e){var t=this,n=this.valuePrimitive?e.map((function(e){return Gt(e,t.valueField)})):e.map((function(e){return e.dataItem}));this.value=n,this.emitValueChange(this.value)},e.prototype.disabledItemsMapper=function(){var e=this;return new Set(this.dataItems.reduce((function(t,n,i){return e.itemDisabled(n.dataItem,n.index)&&t.push(i),t}),[]))},e.prototype.setComponentClasses=function(){this.size&&this.renderer.addClass(this.wrapper.nativeElement,Zt("input",this.size)),this.rounded&&this.renderer.addClass(this.wrapper.nativeElement,qt(this.rounded)),this.fillMode&&this.renderer.addClass(this.wrapper.nativeElement,Jt("input",this.fillMode))},Object(a.__decorate)([Object(s.HostBinding)("class.k-dropdowntree"),Object(s.HostBinding)("class.k-input"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-disabled"),Object(s.HostBinding)("attr.aria-disabled"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isDisabled",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-loading"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isLoading",null),Object(a.__decorate)([Object(s.HostBinding)("attr.id"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"id",null),Object(a.__decorate)([Object(s.HostBinding)("attr.dir"),Object(a.__metadata)("design:type",String)],e.prototype,"direction",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.tabindex"),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostTabIndex",null),Object(a.__decorate)([Object(s.HostBinding)("attr.role"),Object(a.__metadata)("design:type",String)],e.prototype,"role",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-haspopup"),Object(a.__metadata)("design:type",String)],e.prototype,"ariaHasPopup",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.readonly"),Object(s.HostBinding)("attr.aria-readonly"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"isReadonly",null),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-describedby"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"ariaDescribedBy",null),Object(a.__decorate)([Object(s.HostBinding)("attr.aria-activedescendant"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"ariaActiveDescendant",null),Object(a.__decorate)([Object(s.HostListener)("click"),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"handleClick",null),Object(a.__decorate)([Object(s.HostListener)("keydown",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"handleKeydown",null),Object(a.__decorate)([Object(s.ContentChild)(Qt,{static:!1}),Object(a.__metadata)("design:type",Qt)],e.prototype,"headerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(en,{static:!1}),Object(a.__metadata)("design:type",en)],e.prototype,"footerTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(li,{static:!1}),Object(a.__metadata)("design:type",li)],e.prototype,"nodeTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ln,{static:!1}),Object(a.__metadata)("design:type",ln)],e.prototype,"noDataTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(Qn,{static:!1}),Object(a.__metadata)("design:type",Qn)],e.prototype,"tagTemplate",void 0),Object(a.__decorate)([Object(s.ContentChild)(ei,{static:!1}),Object(a.__metadata)("design:type",ei)],e.prototype,"groupTagTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("popupTemplate",{static:!0}),Object(a.__metadata)("design:type",s.TemplateRef)],e.prototype,"popupTemplate",void 0),Object(a.__decorate)([Object(s.ViewChild)("container",{read:s.ViewContainerRef,static:!0}),Object(a.__metadata)("design:type",s.ViewContainerRef)],e.prototype,"container",void 0),Object(a.__decorate)([Object(s.ViewChild)("treeview",{static:!1}),Object(a.__metadata)("design:type",_e),Object(a.__metadata)("design:paramtypes",[_e])],e.prototype,"treeview",null),Object(a.__decorate)([Object(s.ViewChild)("filterInput",{static:!1}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"filterInput",void 0),Object(a.__decorate)([Object(s.ViewChild)("checkAllInput",{static:!1}),Object(a.__metadata)("design:type",s.ElementRef)],e.prototype,"checkAllInput",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number),Object(a.__metadata)("design:paramtypes",[Number])],e.prototype,"tabindex",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"rounded",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"fillMode",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"popupSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"checkableSettings",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"value",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"dataItems",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"valueDepth",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loading",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"placeholder",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"listHeight",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"readonly",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"valuePrimitive",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"loadOnDemand",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"focusableId",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"clearButton",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"checkAll",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"hasChildren",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"fetchChildren",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isNodeExpanded",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"isNodeVisible",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Function)],e.prototype,"itemDisabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"tagMapper",void 0),Object(a.__decorate)([Object(s.Output)("focus"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onFocus",void 0),Object(a.__decorate)([Object(s.Output)("blur"),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"onBlur",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"open",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"opened",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"close",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"closed",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeExpand",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"nodeCollapse",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"valueChange",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"removeTag",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"filterChange",void 0),e=t=Object(a.__decorate)([Object(s.Component)({exportAs:"kendoMultiSelectTree",providers:[u.LocalizationService,dn,an,sn,on,{provide:u.L10N_PREFIX,useValue:"kendo.multiselecttree"},{multi:!0,provide:d.NG_VALUE_ACCESSOR,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:fe,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:be,useExisting:Object(s.forwardRef)((function(){return t}))},{provide:c.KendoInput,useExisting:Object(s.forwardRef)((function(){return t}))}],selector:"kendo-multiselecttree",template:'\n <ng-container kendoMultiSelectTreeLocalizedMessages\n i18n-noDataText="kendo.multiselecttree.noDataText|The text displayed in the popup when there are no items"\n noDataText="NO DATA FOUND"\n\n i18n-clearTitle="kendo.multiselecttree.clearTitle|The title of the clear button"\n clearTitle="clear"\n\n i18n-checkAllText="kendo.multiselecttree.checkAllText|The text displayed for the check-all checkbox"\n checkAllText="Check all"\n >\n </ng-container>\n <kendo-taglist\n [size]="size"\n [rounded]="rounded"\n [fillMode]="fillMode"\n [id]="tagListId"\n [tags]="tags"\n [focused]="focusedTagIndex"\n [textField]="textField"\n [valueField]="valueField"\n [valueDepth]="valueDepth"\n [disabled]="disabled"\n [tagPrefix]="tagPrefix"\n [template]="tagTemplate"\n [groupTemplate]="groupTagTemplate"\n [disabledIndices]="disabledIndices"\n (removeTag)="handleRemoveTag($event)"\n >\n <span *ngIf="!tags || !tags.length"\n class="k-input-inner k-readonly"\n >\n <span class="k-input-value-text">{{ placeholder }}</span>\n </span>\n </kendo-taglist>\n <span\n *ngIf="!disabled && !loading && !readonly && clearButton && tags?.length"\n class="k-clear-value"\n [attr.title]="messageFor(\'clearTitle\')"\n role="button"\n tabindex="-1"\n (click)="clearAll($event)"\n >\n <span class="k-icon k-i-x"></span>\n </span>\n <span\n *ngIf="loading"\n class="k-icon k-i-loading"\n >\n </span>\n <ng-template #popupTemplate>\n <span\n *ngIf="filterable"\n class="k-list-filter"\n >\n <span\n class="k-textbox k-input"\n [ngClass]="filterInputClasses"\n >\n <span class="k-input-prefix">\n <span class="k-input-icon k-icon k-i-search"></span>\n </span>\n <input\n #filterInput\n (input)="handleFilterInputChange($event.target.value)"\n [filterInput]="filterable && !touchEnabled"\n (keydown)="handleKeydown($event)"\n [(ngModel)]="filter"\n class="k-input-inner"\n role="textbox"\n aria-haspopup="true"\n aria-expanded="false"\n tabindex="0"\n aria-disabled="false"\n aria-readonly="false"\n [kendoEventsOutsideAngular]="{\n blur: handleBlur\n }"\n [scope]="this"\n >\n </span>\n </span>\n \x3c!--header template--\x3e\n <ng-template\n *ngIf="headerTemplate"\n [templateContext]="{\n templateRef: headerTemplate?.templateRef\n }">\n </ng-template>\n <div *ngIf="checkAll" class="k-check-all">\n <input\n #checkAllInput\n [checkAll]="!filterable && !touchEnabled"\n type="checkbox"\n class="k-checkbox"\n [ngClass]="checkAllCheckboxClasses"\n role="checkbox"\n tabindex="0"\n aria-disabled="false"\n aria-readonly="false"\n [treeview]="treeview"\n [checkedItems]="checkedItems"\n [valueField]="valueField"\n [lastAction]="lastAction"\n (checkedItemsChange)="handleCheckedItemsChange($event)"\n (keydown)="handleKeydown($event)"\n [kendoEventsOutsideAngular]="{\n blur: handleBlur\n }"\n [scope]="this"\n >\n <span\n class="k-checkbox-label"\n (click)="toggleCheckAll()"\n (mousedown)="$event.preventDefault()"\n >\n {{ messageFor(\'checkAllText\') }}\n </span>\n </div>\n <kendo-treeview\n #treeview\n [size]="size"\n [nodes]="data"\n [style.maxHeight.px]="listHeight"\n [animate]="false"\n kendoMultiSelectTreeCheckable\n [checkable]="checkableSettings"\n [checkedItems]="checkedItems"\n [valueField]="valueField"\n [textField]="textField"\n [children]="children"\n [hasChildren]="hasChildren"\n [isExpanded]="isNodeExpanded"\n [isDisabled]="itemDisabled"\n [nodeTemplate]="nodeTemplate"\n [loadOnDemand]="loadOnDemand"\n [filter]="filter"\n [isVisible]="isNodeVisible"\n (keydown)="handleKeydown($event)"\n (nodeClick)="handleNodeClick($event)"\n (expand)="nodeExpand.emit($event)"\n (collapse)="nodeCollapse.emit($event)"\n (checkedItemsChange)="handleCheckedItemsChange($event)"\n [kendoEventsOutsideAngular]="{\n focusout: handleBlur\n }"\n [scope]="this"\n >\n </kendo-treeview>\n \x3c!--footer template--\x3e\n <ng-template\n *ngIf="footerTemplate"\n [templateContext]="{\n templateRef: footerTemplate?.templateRef\n }">\n </ng-template>\n \x3c!--no-data template--\x3e\n <div class="k-no-data" *ngIf="data?.length === 0 || allNodesHidden">\n <ng-template [ngIf]="noDataTemplate"\n [templateContext]="{\n templateRef: noDataTemplate?.templateRef\n }">\n </ng-template>\n <ng-template [ngIf]="!noDataTemplate">\n <div>{{ messageFor(\'noDataText\') }}</div>\n </ng-template>\n </div>\n </ng-template>\n <ng-container #container></ng-container>\n '}),Object(a.__param)(7,Object(s.Optional)()),Object(a.__param)(7,Object(s.Inject)(gn)),Object(a.__metadata)("design:paramtypes",[s.ElementRef,f.PopupService,s.Renderer2,dn,s.NgZone,u.LocalizationService,s.ChangeDetectorRef,Boolean])],e)}(),ki=function(e){function t(t){return e.call(this,t)||this}return Object(a.__extends)(t,e),Object(a.__decorate)([Object(s.Input)("kendoDropDownTreeFlatBinding"),Object(a.__metadata)("design:type",Array)],t.prototype,"nodes",void 0),Object(a.__decorate)([Object(s.Input)("valueField"),Object(a.__metadata)("design:type",String)],t.prototype,"idField",void 0),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownTreeFlatBinding]"}),Object(a.__metadata)("design:paramtypes",[fe])],t)}(ft),wi=function(e){function t(t){var n=e.call(this,t)||this;return n.dropDownTree=t,n}return Object(a.__extends)(t,e),Object.defineProperty(t.prototype,"data",{set:function(e){this.dropDownTree.nodes=e,this.nodes=e},enumerable:!0,configurable:!0}),Object(a.__decorate)([Object(s.Input)("kendoDropDownTreeHierarchyBinding"),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],t.prototype,"data",null),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownTreeHierarchyBinding]"}),Object(a.__metadata)("design:paramtypes",[fe])],t)}(ct),Si=function(e){function t(t){return e.call(this,t)||this}return Object(a.__extends)(t,e),Object(a.__decorate)([Object(s.Input)("kendoMultiSelectTreeFlatBinding"),Object(a.__metadata)("design:type",Array)],t.prototype,"nodes",void 0),Object(a.__decorate)([Object(s.Input)("valueField"),Object(a.__metadata)("design:type",String)],t.prototype,"idField",void 0),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectTreeFlatBinding]"}),Object(a.__metadata)("design:paramtypes",[fe])],t)}(ft),xi=function(e){function t(t){var n=e.call(this,t)||this;return n.multiSelectTree=t,n}return Object(a.__extends)(t,e),Object.defineProperty(t.prototype,"data",{set:function(e){this.multiSelectTree.nodes=e,this.nodes=e},enumerable:!0,configurable:!0}),Object(a.__decorate)([Object(s.Input)("kendoMultiSelectTreeHierarchyBinding"),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],t.prototype,"data",null),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectTreeHierarchyBinding]"}),Object(a.__metadata)("design:paramtypes",[fe])],t)}(ct),Ei=function(e){function t(t){return e.call(this,t)||this}return Object(a.__extends)(t,e),Object(a.__decorate)([Object(s.Input)("isNodeExpanded"),Object(a.__metadata)("design:type",Function)],t.prototype,"isExpanded",void 0),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownTreeExpandable], [kendoMultiSelectTreeExpandable]"}),Object(a.__metadata)("design:paramtypes",[be])],t)}(we),Ii=function(){function e(e,t){this.renderer=e,this.hostElement=t,this.rounded="medium",this.fillMode="solid",this.disabledIndices=new Set,this.removeTag=new s.EventEmitter,this.hostClasses=!0,this._size="medium"}return Object.defineProperty(e.prototype,"size",{get:function(){return this._size},set:function(e){this.renderer.removeClass(this.hostElement.nativeElement,Zt("chip-list",this.size)),e&&this.renderer.addClass(this.hostElement.nativeElement,Zt("chip-list",e)),this._size=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostId",{get:function(){return this.id},enumerable:!0,configurable:!0}),e.prototype.tagProp=function(e,t,n){var i=t&&this.getPropField(e,t,n);return Rt(e,i)},e.prototype.isTagDisabled=function(e,t){var n=this;return this.isGroupTag(e)?e.every((function(e,i){return n.disabledIndices.has(i+t)})):this.disabledIndices.has(t)},e.prototype.deleteTag=function(e,t,n){e.preventDefault(),e.stopImmediatePropagation(),this.disabled||1!==e.which||this.removeTag.emit({tag:t,index:n})},e.prototype.itemId=function(e,t){if(e)return this.tagPrefix+"-"+this.tagProp(e,this.valueField,t)},e.prototype.isGroupTag=function(e){return e instanceof Array},e.prototype.tagAriaHidden=function(e){return It(this.focused)&&this.focused!==e},e.prototype.getPropField=function(e,t,n){var i=t.length-1;if("string"==typeof t)return t;if(this.valueDepth){var o=this.valueDepth[n];return i<o?t[i]:t[o]}return t.find((function(t){return t in e}))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"tags",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"textField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"valueDepth",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"focused",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Qn)],e.prototype,"template",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",ei)],e.prototype,"groupTemplate",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"disabled",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"tagPrefix",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"id",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[String])],e.prototype,"size",null),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"rounded",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],e.prototype,"fillMode",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Set)],e.prototype,"disabledIndices",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],e.prototype,"removeTag",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-input-values"),Object(s.HostBinding)("class.k-chip-list"),Object(s.HostBinding)("class.k-selection-multiple"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"hostClasses",void 0),Object(a.__decorate)([Object(s.HostBinding)("attr.id"),Object(a.__metadata)("design:type",String),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"hostId",null),e=Object(a.__decorate)([Object(s.Component)({selector:"kendo-taglist",template:"\n <div\n *ngFor=\"let tag of tags; let index = index;\"\n role=\"option\"\n [attr.id]=\"itemId(tag, index)\"\n [attr.aria-hidden]=\"tagAriaHidden(index)\"\n aria-selected=\"true\"\n [attr.aria-setsize]=\"tags?.length\"\n class=\"k-chip\"\n [ngClass]=\"{\n 'k-focus': index === focused,\n 'k-disabled': isTagDisabled(tag, index),\n 'k-chip-sm': size === 'small',\n 'k-chip-md': size === 'medium',\n 'k-chip-lg': size === 'large',\n 'k-rounded-sm': rounded === 'small',\n 'k-rounded-md': rounded === 'medium',\n 'k-rounded-lg': rounded === 'large',\n 'k-rounded-full': rounded === 'full',\n 'k-chip-solid k-chip-solid-base': fillMode === 'solid',\n 'k-chip-flat k-chip-flat-base': fillMode === 'flat',\n 'k-chip-outline k-chip-outline-base': fillMode === 'outline'\n }\"\n >\n <span class=\"k-chip-content\">\n <ng-template *ngIf=\"isGroupTag(tag); then groupTag else singleTag\"></ng-template>\n <ng-template #groupTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"groupTemplate\"\n [templateContext]=\"{\n templateRef: groupTemplate.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!groupTemplate\">{{ tag.length }} {{ tag.length === 1 ? 'item' : 'items' }} selected</ng-template>\n </span>\n </ng-template>\n <ng-template #singleTag>\n <span class=\"k-chip-label k-text-ellipsis\">\n <ng-template *ngIf=\"template\"\n [templateContext]=\"{\n templateRef: template.templateRef,\n $implicit: tag\n }\">\n </ng-template>\n <ng-template [ngIf]=\"!template\">{{ tagProp(tag, textField, index) }}</ng-template>\n </span>\n </ng-template>\n </span>\n\n <span class=\"k-chip-actions\">\n <span aria-label=\"delete\" [attr.aria-hidden]=\"index !== focused\" class=\"k-chip-action k-chip-remove-action\">\n <span class=\"k-icon k-i-x-circle\" (mousedown)=\"deleteTag($event, tag, index)\">\n </span>\n </span>\n </span>\n </div>\n <ng-content></ng-content>\n "}),Object(a.__metadata)("design:paramtypes",[s.Renderer2,s.ElementRef])],e)}(),Ti=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(a.__extends)(t,e),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"noDataText",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"clearTitle",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"checkAllText",void 0),t}(u.ComponentMessages),Di=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(a.__extends)(t,e),n=t,t=n=Object(a.__decorate)([Object(s.Directive)({providers:[{provide:Ti,useExisting:Object(s.forwardRef)((function(){return n}))}],selector:"\n [kendoDropDownListLocalizedMessages],\n [kendoDropDownTreeLocalizedMessages],\n [kendoComboBoxLocalizedMessages],\n [kendoMultiColumnComboBoxLocalizedMessages],\n [kendoAutoCompleteLocalizedMessages],\n [kendoMultiSelectLocalizedMessages],\n [kendoMultiSelectTreeLocalizedMessages]\n "}),Object(a.__metadata)("design:paramtypes",[u.LocalizationService])],t)}(Ti),Bi=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return Object(a.__extends)(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=Object(a.__decorate)([Object(s.Component)({providers:[{provide:Ti,useExisting:Object(s.forwardRef)((function(){return n}))}],selector:"kendo-dropdownlist-messages,kendo-combobox-messages,kendo-multicolumncombobox-messages,kendo-autocomplete-messages,kendo-multiselect-messages,kendo-dropdowntree-messages,kendo-multiselecttree-messages",template:""}),Object(a.__metadata)("design:paramtypes",[u.LocalizationService])],t)}(Ti),Pi={caseSensitive:!1,operator:"startsWith"},Ai=function(){function e(e){this.component=e,this.filterable=!0,this._data=[]}return Object.defineProperty(e.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||[]},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this.component.filterable=this.filterable,this.filterChangeSubscription=this.component.filterChange.subscribe(this.handleFilterChange.bind(this))},e.prototype.ngOnDestroy=function(){It(this.filterChangeSubscription)&&this.filterChangeSubscription.unsubscribe()},e.prototype.handleFilterChange=function(e){var t=this;this.component.data=this.data.filter((function(n){return t.matchesAnyField(n,e)}))},e.prototype.matchesAnyField=function(e,t){var n=this,i=this.normalizeValue(t),o=this.filterSettings.fields;return 0===o.length?this.checkItem(e,i):o.some((function(t){return n.checkItem(Rt(e,t),i)}))},e.prototype.checkItem=function(e,t){return e=this.normalizeValue(e),"contains"===this.filterSettings.operator?-1!==e.indexOf(t):0===e.indexOf(t)},e.prototype.normalizeValue=function(e){var t=It(e)?e.toString():"";return this.filterSettings.caseSensitive?t:t.toLowerCase()},e.prototype.getFilterFields=function(e){return this.component.textField||this.component.valueField?Dt(e)&&e.length>0?e:[this.component.textField||this.component.valueField]:[]},Object.defineProperty(e.prototype,"filterSettings",{get:function(){var e=this.rawSettings,t=It(e)&&"object"==typeof e?e.fields:[];return Object.assign({},Pi,e,{fields:this.getFilterFields(t)})},enumerable:!0,configurable:!0}),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array),Object(a.__metadata)("design:paramtypes",[Array])],e.prototype,"data",null),Object(a.__decorate)([Object(s.Input)("kendoDropDownFilter"),Object(a.__metadata)("design:type",Object)],e.prototype,"rawSettings",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"filterable",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownFilter]"}),Object(a.__metadata)("design:paramtypes",[un])],e)}(),Mi=function(){function e(e,t){this.element=e,this.zone=t}return e.prototype.ngOnChanges=function(){var e=this;this.focused&&this.nextTick((function(){return e.element.nativeElement.focus()}))},e.prototype.nextTick=function(e){this.zone.runOutsideAngular((function(){return setTimeout(e)}))},Object(a.__decorate)([Object(s.Input)("filterInput"),Object(a.__metadata)("design:type",Boolean)],e.prototype,"focused",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[filterInput]"}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,s.NgZone])],e)}(),zi=[Qt,en,Yt,tn,nn,ln,qn,Qn,ei,Di,Bi,Ai,Mi],Ri=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[zi],exports:[zi]})],e)}(),Fi=function(){function e(e){this.checkboxes={enabled:!1},this.multipleSelection=!1,this.selectionService=e}return Object.defineProperty(e.prototype,"focusedClassName",{get:function(){return this.selectionService.isFocused(this.index)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedClassName",{get:function(){return!this.checkboxes.enabled&&this.selectionService.isSelected(this.index)},enumerable:!0,configurable:!0}),e.prototype.onClick=function(e){e.stopPropagation(),this.checkboxes.enabled&&!this.checkboxes.checkOnClick||(this.multipleSelection?this.selectionService.isSelected(this.index)?this.selectionService.unselect(this.index):this.selectionService.add(this.index):this.selectionService.change(this.index))},Object(a.__decorate)([Object(s.HostBinding)("attr.index"),Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"index",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"checkboxes",void 0),Object(a.__decorate)([Object(s.HostBinding)("style.height.px"),Object(s.HostBinding)("style.minHeight.px"),Object(s.Input)(),Object(a.__metadata)("design:type",Number)],e.prototype,"height",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Boolean)],e.prototype,"multipleSelection",void 0),Object(a.__decorate)([Object(s.HostBinding)("class.k-focus"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"focusedClassName",null),Object(a.__decorate)([Object(s.HostBinding)("class.k-selected"),Object(a.__metadata)("design:type",Boolean),Object(a.__metadata)("design:paramtypes",[])],e.prototype,"selectedClassName",null),Object(a.__decorate)([Object(s.HostListener)("click",["$event"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],e.prototype,"onClick",null),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoDropDownsSelectable]"}),Object(a.__metadata)("design:paramtypes",[on])],e)}(),Ni=function(){function e(e){this.viewContainerRef=e}return Object.defineProperty(e.prototype,"templateContext",{set:function(e){this.insertedViewRef&&(this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef)),this.insertedViewRef=void 0),e.templateRef&&(this.insertedViewRef=this.viewContainerRef.createEmbeddedView(e.templateRef,e))},enumerable:!0,configurable:!0}),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object),Object(a.__metadata)("design:paramtypes",[Object])],e.prototype,"templateContext",null),e=Object(a.__decorate)([Object(s.Directive)({selector:"[templateContext]"}),Object(a.__metadata)("design:paramtypes",[s.ViewContainerRef])],e)}(),Li=function(){function e(){}return e.prototype.addItem=function(e){if(!this.isItemChecked(e)){var t=Wt(e.index),n=Object(a.__assign)({},e,{level:t});this.checkedItems.push(n),this.checkedKeys.add(Gt(n,this.valueField))}},e.prototype.removeItem=function(e){var t=this;if(this.isItemChecked(e)){var n=Wt(e.index),i=Object(a.__assign)({},e,{level:n});this.checkedItems=this.checkedItems.filter((function(e){return Gt(e,t.valueField)!==Gt(i,t.valueField)})),this.checkedKeys.delete(Gt(i,this.valueField))}},e.prototype.isItemChecked=function(e){return this.checkedKeys.has(Gt(e,this.valueField))},e.prototype.updateItems=function(){var e=this;this.checkedItems=this.checkedItems||[],this.checkedKeys=new Set(this.checkedItems.map((function(t){return Gt(t,e.valueField)})))},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],e.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],e.prototype,"checkedItems",void 0),e}(),Vi=function(e){function t(t){var n=e.call(this)||this;return n.treeView=t,n.checkedItemsChange=new s.EventEmitter,n.checkedKeys=new Set,n.subscriptions=new h.Subscription,n.subscriptions.add(n.treeView.checkedChange.subscribe(n.handleCheckedChange.bind(n))),n.treeView.isChecked=n.getCheckedState.bind(n),n}return Object(a.__extends)(t,e),t.prototype.ngOnChanges=function(e){It(e.checkable)&&this.toggleCheckOnClick(),It(e.checkedItems)&&this.updateItems()},t.prototype.ngOnDestroy=function(){this.subscriptions.unsubscribe(),this.unsubscribeClick()},t.prototype.getCheckedState=function(e,t){return this.isItemChecked({dataItem:e,index:t})?"checked":this.checkable.checkChildren&&this.isItemIndeterminate(this.treeView.itemLookup(t))?"indeterminate":"none"},t.prototype.handleCheckedChange=function(e){this.checkNode(e),this.checkable.checkChildren&&this.checkParents(e.parent),this.checkedItemsChange.emit(this.checkedItems.slice())},t.prototype.toggleCheckOnClick=function(){var e=this;this.unsubscribeClick(),this.checkable.checkOnClick&&(this.clickSubscription=this.treeView.nodeClick.pipe(Object(b.filter)((function(e){return"click"===e.type}))).subscribe((function(t){var n=e.treeView.itemLookup(t.item.index);e.handleCheckedChange(n)})))},t.prototype.unsubscribeClick=function(){this.clickSubscription&&(this.clickSubscription.unsubscribe(),this.clickSubscription=null)},t.prototype.checkNode=function(e){var t=this;if(!this.treeView.isDisabled(e.item.dataItem,e.item.index)){var n=e.item,i=[n];if(this.checkable.checkChildren){Ut(e,(function(e){return t.treeView.isVisible(e.dataItem,e.index)&&!t.treeView.isDisabled(e.dataItem,e.index)})).forEach((function(e){return i.push(e.item)}))}var o=!this.isItemChecked(n);i.forEach((function(e){o?t.addItem(e):t.removeItem(e)}))}},t.prototype.checkParents=function(e){for(var t=this,n=e;n;){n.children.every((function(e){return t.isItemChecked(e)}))?this.addItem(n.item):this.removeItem(n.item),n=n.parent}},t.prototype.isItemIndeterminate=function(e){var t=e.children;if(!Array.isArray(t)||0===t.length)return!1;for(var n=0,i=t[n];It(i);){if(this.isItemChecked(i.item)||this.isItemIndeterminate(i))return!0;i=t[n+=1]}return!1},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],t.prototype,"checkable",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],t.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],t.prototype,"checkedItems",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],t.prototype,"checkedItemsChange",void 0),t=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectTreeCheckable]"}),Object(a.__metadata)("design:paramtypes",[_e])],t)}(Li),Hi=function(e){function t(t,n,i,o){var r=e.call(this)||this;return r.element=t,r.zone=n,r.cdr=i,r.renderer=o,r.checkedItemsChange=new s.EventEmitter,r.checkedKeys=new Set,r}return Object(a.__extends)(t,e),t.prototype.handleChange=function(e){var t=this;this.currentCheckedState=e.checked,this.currentIndeterminateState=this.isIndeterminate,this.treeview.nodes.map((function(e,n){var i=String(n),o=t.treeview.itemLookup(i);t.checkNode(o)})),this.checkedItemsChange.emit(this.checkedItems.slice())},Object.defineProperty(t.prototype,"isIndeterminate",{get:function(){var e=this,t=this.treeview.nodes.some((function(t,n){var i=String(n),o=e.treeview.itemLookup(i);return e.someChecked(o)}));return!this.isChecked&&t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isChecked",{get:function(){var e=this;return this.treeview.nodes.every((function(t,n){var i=String(n),o=e.treeview.itemLookup(i);return e.allChecked(o)}))},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(e){It(e.checkedItems)&&(this.updateItems(),this.renderer.setProperty(this.element.nativeElement,"checked",this.isChecked),this.renderer.setProperty(this.element.nativeElement,"indeterminate",this.isIndeterminate))},t.prototype.ngOnInit=function(){var e=this;this.focused&&this.nextTick((function(){return e.element.nativeElement.focus()}))},t.prototype.nextTick=function(e){this.zone.runOutsideAngular((function(){return setTimeout(e)}))},t.prototype.checkNode=function(e){var t=this;if(!this.treeview.isDisabled(e.item.dataItem,e.item.index)){var n=[];n.push(e.item),Ut(e,(function(e){return t.treeview.isVisible(e.dataItem,e.index)&&!t.treeview.isDisabled(e.dataItem,e.index)})).forEach((function(e){return n.push(e.item)})),n.forEach((function(e){t.currentIndeterminateState?"check"===t.lastAction?t.addItem(e):t.removeItem(e):t.currentCheckedState?t.addItem(e):t.removeItem(e)}))}},t.prototype.allChecked=function(e){var t=this,n=e&&e.children;if(Array.isArray(n))return n.every((function(e){return e.children.length?t.isItemChecked(e.item)&&t.allChecked(e):t.isItemChecked(e.item)}))&&this.isItemChecked(e.item)},t.prototype.someChecked=function(e){var t=this,n=e&&e.children;if(Array.isArray(n))return n.some((function(e){return e.children.length?t.isItemChecked(e.item)||t.someChecked(e):t.isItemChecked(e.item)}))||this.isItemChecked(e.item)},Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",String)],t.prototype,"lastAction",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",_e)],t.prototype,"treeview",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Array)],t.prototype,"checkedItems",void 0),Object(a.__decorate)([Object(s.Input)(),Object(a.__metadata)("design:type",Object)],t.prototype,"valueField",void 0),Object(a.__decorate)([Object(s.Input)("checkAll"),Object(a.__metadata)("design:type",Boolean)],t.prototype,"focused",void 0),Object(a.__decorate)([Object(s.Output)(),Object(a.__metadata)("design:type",s.EventEmitter)],t.prototype,"checkedItemsChange",void 0),Object(a.__decorate)([Object(s.HostListener)("change",["$event.target"]),Object(a.__metadata)("design:type",Function),Object(a.__metadata)("design:paramtypes",[Object]),Object(a.__metadata)("design:returntype",void 0)],t.prototype,"handleChange",null),t=Object(a.__decorate)([Object(s.Directive)({selector:"[checkAll]"}),Object(a.__metadata)("design:paramtypes",[s.ElementRef,s.NgZone,s.ChangeDetectorRef,s.Renderer2])],t)}(Li),Ki=[fn,hn,Fi,Xt,Ni,Ii,Vi,Hi],$i=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[Ki],exports:[Ki,g.CommonModule,d.FormsModule,f.PopupModule,c.ResizeSensorModule,Ri,c.EventsModule],imports:[g.CommonModule,d.FormsModule,f.PopupModule,c.ResizeSensorModule,Ri,c.EventsModule]})],e)}(),Wi=function(){function e(e){this.multiSelectTreeComponent=e,this.showAfter=0,this.createTagMapper()}return e.prototype.ngOnChanges=function(e){It(e.showAfter)&&(this.createTagMapper(),this.multiSelectTreeComponent.handleTagMapperChange(this.showAfter))},e.prototype.createTagMapper=function(){var e=Kt(this.showAfter);this.multiSelectTreeComponent.tagMapper=function(t){return t.length>e?t.slice(0,e).concat([t.slice(e)]):t}},Object(a.__decorate)([Object(s.Input)("kendoMultiSelectTreeSummaryTag"),Object(a.__metadata)("design:type",Object)],e.prototype,"showAfter",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectTreeSummaryTag]"}),Object(a.__metadata)("design:paramtypes",[Ci])],e)}(),Ui=[mi,Ci,ki,wi,Si,xi,Ei,li,Wi],Gi=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[Ui],exports:[Ui,Ri],imports:[$i,xt]})],e)}(),Zi=function(){function e(e){this.multiSelectComponent=e,this.showAfter=0,this.createTagMapper()}return e.prototype.ngOnChanges=function(e){It(e.showAfter)&&(this.createTagMapper(),this.multiSelectComponent.onTagMapperChange())},e.prototype.createTagMapper=function(){var e=Kt(this.showAfter);this.multiSelectComponent.tagMapper=function(t){if(t.length>e){var n=void 0;return(n=t.slice(0,e)).push(t.slice(e,t.length)),n}return t}},Object(a.__decorate)([Object(s.Input)("kendoMultiSelectSummaryTag"),Object(a.__metadata)("design:type",Object)],e.prototype,"showAfter",void 0),e=Object(a.__decorate)([Object(s.Directive)({selector:"[kendoMultiSelectSummaryTag]"}),Object(a.__metadata)("design:paramtypes",[ii])],e)}(),qi=[yn],Ji=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[qi],exports:[qi,Ri],imports:[$i]})],e)}(),Xi=[Zn,di,ai,ri,oi],Yi=p.h,Qi=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[Xi],exports:[Xi,Ri],imports:[$i],providers:[{provide:gn,useValue:Yi}]})],e)}(),eo=[Xn],to=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[eo],exports:[eo,Ri],imports:[$i]})],e)}(),no=[ii,Zi,Yn],io=p.h,oo=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({declarations:[no],exports:[no,Ri],imports:[$i],providers:[{provide:gn,useValue:io}]})],e)}(),ro=function(){function e(){}return e=Object(a.__decorate)([Object(s.NgModule)({exports:[Ji,Qi,to,oo,Gi]})],e)}()},function(e,t,n){"use strict";var i=function(e,t){return function(n){return t(e(n))}},o=function(e,t,n){return e.addEventListener&&e.addEventListener(t,n)},r=function(e,t,n){return e&&e.removeEventListener&&e.removeEventListener(t,n)},a=function(){},s=function(e){return e.preventDefault()},c=/touch/;function d(e){return e.type.match(c)?{pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,type:e.type,originalEvent:e,isTouch:!0}:{pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,offsetX:e.offsetX,offsetY:e.offsetY,type:e.type,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,originalEvent:e}}var l=function(e){var t=this,n=e.press;void 0===n&&(n=a);var c=e.drag;void 0===c&&(c=a);var l=e.release;void 0===l&&(l=a);var p=e.mouseOnly;void 0===p&&(p=!1),this._pressHandler=i(d,n),this._dragHandler=i(d,c),this._releaseHandler=i(d,l),this._ignoreMouse=!1,this._mouseOnly=p,this._touchstart=function(e){1===e.touches.length&&t._pressHandler(e)},this._touchmove=function(e){1===e.touches.length&&t._dragHandler(e)},this._touchend=function(e){0===e.touches.length&&1===e.changedTouches.length&&(t._releaseHandler(e),t._ignoreMouse=!0,setTimeout(t._restoreMouse,2e3))},this._restoreMouse=function(){t._ignoreMouse=!1},this._mousedown=function(e){var n=e.which;n&&n>1||t._ignoreMouse||(o(t.document,"mousemove",t._mousemove),o(t.document,"mouseup",t._mouseup),t._pressHandler(e))},this._mousemove=function(e){t._dragHandler(e)},this._mouseup=function(e){r(t.document,"mousemove",t._mousemove),r(t.document,"mouseup",t._mouseup),t._releaseHandler(e)},this._pointerdown=function(e){e.isPrimary&&0===e.button&&(o(t.document,"pointermove",t._pointermove),o(t.document,"pointerup",t._pointerup),o(t.document,"pointercancel",t._pointerup),o(t.document,"contextmenu",s),t._pressHandler(e))},this._pointermove=function(e){e.isPrimary&&t._dragHandler(e)},this._pointerup=function(e){e.isPrimary&&(r(t.document,"pointermove",t._pointermove),r(t.document,"pointerup",t._pointerup),r(t.document,"pointercancel",t._pointerup),r(t.document,"contextmenu",s),t._releaseHandler(e))}},p={document:{configurable:!0}};l.supportPointerEvent=function(){return"undefined"!=typeof window&&window.PointerEvent},p.document.get=function(){return this._element?this._element.ownerDocument:document},l.prototype.bindTo=function(e){e!==this._element&&(this._element&&this._unbindFromCurrent(),this._element=e,this._bindToCurrent())},l.prototype._bindToCurrent=function(){var e=this._element;this._usePointers()?o(e,"pointerdown",this._pointerdown):(o(e,"mousedown",this._mousedown),this._mouseOnly||(o(e,"touchstart",this._touchstart),o(e,"touchmove",this._touchmove),o(e,"touchend",this._touchend)))},l.prototype._unbindFromCurrent=function(){var e=this._element;if(this._usePointers())return r(e,"pointerdown",this._pointerdown),r(this.document,"pointermove",this._pointermove),r(this.document,"pointerup",this._pointerup),r(this.document,"contextmenu",s),void r(this.document,"pointercancel",this._pointerup);r(e,"mousedown",this._mousedown),this._mouseOnly||(r(e,"touchstart",this._touchstart),r(e,"touchmove",this._touchmove),r(e,"touchend",this._touchend))},l.prototype._usePointers=function(){return!this._mouseOnly&&l.supportPointerEvent()},l.prototype.update=function(e){var t=e.press;void 0===t&&(t=a);var n=e.drag;void 0===n&&(n=a);var o=e.release;void 0===o&&(o=a);var r=e.mouseOnly;void 0===r&&(r=!1),this._pressHandler=i(d,t),this._dragHandler=i(d,n),this._releaseHandler=i(d,o),this._mouseOnly=r},l.prototype.destroy=function(){this._unbindFromCurrent(),this._element=null},Object.defineProperties(l.prototype,p),l.default=l,t.a=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(25),a=function(){function e(){this.valueChange=new o.EventEmitter}return e.prototype.onValueChange=function(e){this.valueChange.emit(e)},e.prototype.focus=function(){this.dropDownList.focus()},i.__decorate([o.Input(),i.__metadata("design:type",Array)],e.prototype,"data",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"value",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"defaultItem",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Function)],e.prototype,"itemDisabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"title",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Number)],e.prototype,"tabindex",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("element",{static:!0}),i.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),i.__decorate([o.ViewChild("element",{read:r.DropDownListComponent,static:!0}),i.__metadata("design:type",r.DropDownListComponent)],e.prototype,"dropDownList",void 0),e=i.__decorate([o.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 "]})],e)}();t.FormatDropDownListComponent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(25),a=function(){function e(){this.valueChange=new o.EventEmitter}return e.prototype.onValueChange=function(e){this.valueChange.emit(e)},e.prototype.focus=function(){this.dropDownList.focus()},i.__decorate([o.Input(),i.__metadata("design:type",Array)],e.prototype,"data",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"value",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"defaultItem",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Function)],e.prototype,"itemDisabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"title",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Number)],e.prototype,"tabindex",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("element",{static:!0}),i.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),i.__decorate([o.ViewChild("element",{read:r.DropDownListComponent,static:!0}),i.__metadata("design:type",r.DropDownListComponent)],e.prototype,"dropDownList",void 0),e=i.__decorate([o.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 "]})],e)}();t.FontFamilyDropDownListComponent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(25),a=function(){function e(){this.valueChange=new o.EventEmitter}return e.prototype.onValueChange=function(e){this.valueChange.emit(e)},e.prototype.focus=function(){this.dropDownList.focus()},i.__decorate([o.Input(),i.__metadata("design:type",Array)],e.prototype,"data",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"value",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],e.prototype,"defaultItem",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Function)],e.prototype,"itemDisabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],e.prototype,"title",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Boolean)],e.prototype,"disabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Number)],e.prototype,"tabindex",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("element",{static:!0}),i.__metadata("design:type",o.ElementRef)],e.prototype,"element",void 0),i.__decorate([o.ViewChild("element",{read:r.DropDownListComponent,static:!0}),i.__metadata("design:type",r.DropDownListComponent)],e.prototype,"dropDownList",void 0),e=i.__decorate([o.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 "]})],e)}();t.FontSizeDropDownListComponent=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(23),s=n(6),c=n(22),d=n(7),l=n(18),p=n(39),u=n(4),h=function(e){function t(t,n,i,o){var r=e.call(this)||this;return r.editor=t,r.localization=n,r.dialogService=i,r.ngZone=o,r.tabindex=-1,r.disabled=!1,r.views=["palette"],r}var n;return i.__extends(t,e),n=t,Object.defineProperty(t.prototype,"view",{get:function(){return this.views&&this.views.length>0?this.views[0]:null},set:function(e){this.views=[e]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.localization.get(this.editorCommand)},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this.subs=this.editor.stateChange.subscribe((function(t){var n=t.style;e.disabled=n.disabled}))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},t.prototype.handleValueChange=function(e){this.editor.exec(this.editorCommand,e),this.editor.view.focus()},t.prototype.handleActiveColorClick=function(e){e.preventOpen(),this.handleValueChange(e.color)},t.prototype.onOpen=function(e){this.valueCache=e.value,e.reset()},t.prototype.onClose=function(e){var t=this;e.value||(e.value=this.valueCache),this.editor.shouldEmitFocus=!0,this.ngZone.onStable.pipe(u.take(1)).subscribe((function(){return t.editor.view.focus()}))},Object.defineProperty(t.prototype,"outerWidth",{get:function(){if(this.element)return c.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),t.prototype.openDialog=function(){var e={appendTo:this.editor.dialogContainer,content:p.ColorPickerDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(e).content.instance.setData({editor:this.editor,value:this.value,title:this.title,editorCommand:this.editorCommand,paletteSettings:this.paletteSettings,icon:this.icon,views:this.views})},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(){this.tabindex=0,this.overflows?this.colorPickerButton.nativeElement.focus():this.colorPicker.focus()},t.prototype.handleKey=function(){return this.tabindex=-1,!1},i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"value",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"icon",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Object)],t.prototype,"paletteSettings",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"editorCommand",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Boolean)],t.prototype,"disabled",void 0),i.__decorate([o.Input(),i.__metadata("design:type",Array)],t.prototype,"views",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String),i.__metadata("design:paramtypes",[String])],t.prototype,"view",null),i.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),i.__decorate([o.ViewChild("popupTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),i.__decorate([o.ViewChild("colorpicker",{read:o.ElementRef,static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),i.__decorate([o.ViewChild("colorpicker",{read:a.ColorPickerComponent,static:!1}),i.__metadata("design:type",a.ColorPickerComponent)],t.prototype,"colorPicker",void 0),i.__decorate([o.ViewChild("colorPickerButton",{read:o.ElementRef,static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"colorPickerButton",void 0),t=n=i.__decorate([o.Component({providers:[{provide:r.ToolBarToolComponent,useExisting:o.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 '}),i.__param(0,o.Host()),i.__metadata("design:paramtypes",[d.EditorComponent,s.EditorLocalizationService,l.DialogService,o.NgZone])],t)}(r.ToolBarToolComponent);t.EditorColorPickerComponent=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(48),o=n(21);t.Schema=o.Schema;var r=o.marks,a=Object.assign(o.nodes,i.semanticNodes);t.schema=new o.Schema({marks:r,nodes:a})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.data="",i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.textarea.nativeElement.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.editor.exec("setHTML",this.getData()),this.dialog.close(),this.editor.view.focus()},t.prototype.getData=function(){return this.textarea.nativeElement.value},t.prototype.setData=function(){this.data=this.indent(this.editor.getSource())},t.prototype.textFor=function(e){return this.localization.get(e)},t.prototype.indent=function(e){return e.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$/,"")},i.__decorate([o.Input(),i.__metadata("design:type",Object)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("textarea",{static:!0}),i.__metadata("design:type",o.ElementRef)],t.prototype,"textarea",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.SourceDialogComponent=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(10),a=n(18),s=n(21),c=n(22),d=n(6),l=n(2),p=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.src=new r.FormControl("",r.Validators.required),i.alt=new r.FormControl(""),i.width=new r.FormControl("",r.Validators.min(1)),i.height=new r.FormControl("",r.Validators.min(1)),i.data={alt:"",height:"",src:"",width:""},i.imageData=new r.FormGroup({alt:i.alt,height:i.height,src:i.src,width:i.width}),i}return i.__extends(t,e),t.prototype.ngOnInit=function(){this.srcInputId="k-"+l.guid(),this.altTextInputId="k-"+l.guid(),this.widthInputId="k-"+l.guid(),this.heightInputId="k-"+l.guid()},t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.srcInput.nativeElement.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.src.value&&(this.editor.exec("insertImage",this.getData()),this.dialog.close(),this.editor.view.focus())},t.prototype.setData=function(e){var t=s.getNodeFromSelection(e);t&&(this.src.patchValue(t.attrs.src),this.alt.patchValue(t.attrs.alt),this.width.patchValue(t.attrs.width),this.height.patchValue(t.attrs.height))},t.prototype.textFor=function(e){return this.localization.get(e)},t.prototype.getData=function(){return{alt:this.alt.value,height:this.normalizeDimension(this.height.value),src:this.src.value,width:this.normalizeDimension(this.width.value)}},t.prototype.normalizeDimension=function(e){return Number.isNaN(parseInt(e,10))||parseInt(e,10)<=0?"":c.safeString(parseInt(e,10))},i.__decorate([o.Input(),i.__metadata("design:type",Object)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("srcInput",{read:o.ElementRef,static:!0}),i.__metadata("design:type",o.ElementRef)],t.prototype,"srcInput",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[a.DialogRef,d.EditorLocalizationService])],t)}(a.DialogContentBase);t.ImageDialogComponent=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(10),a=n(18),s=n(21),c=n(22),d=n(6),l=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.linkForm=new r.FormGroup({href:new r.FormControl("",r.Validators.required),text:new r.FormControl({value:"",disabled:!0},r.Validators.required),title:new r.FormControl("")}),i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.hrefInput.nativeElement.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){var e=this.getData();this.editor.exec(this.command,e),this.dialog.close(),this.editor.view.focus()},Object.defineProperty(t.prototype,"titleText",{get:function(){return this.localization.get(this.command)},enumerable:!0,configurable:!0}),t.prototype.setData=function(e,t){"createLink"===this.command&&this.linkForm.addControl("target",new r.FormControl);var n=s.getMark(e,e.schema.marks.link);if(n)this.linkForm.reset({href:n.attrs.href,title:n.attrs.title,target:c.isPresent(n.attrs.target),text:this.setLinkText(e)});else if(e.selection.empty){var i=t.applyToWord?s.expandSelection(e,(function(){}),t).state:e;i.selection.empty||this.linkForm.patchValue({text:s.getSelectionText(i)})}else this.linkForm.patchValue({text:s.getSelectionText(e)})},t.prototype.textForWithPrefix=function(e){var t="createLink"===this.command?"link":"file";return this.textFor(t+e)},t.prototype.textFor=function(e){return this.localization.get(e)},t.prototype.setLinkText=function(e){var t=e.selection;if(t.empty&&t.$cursor){var n=t.$cursor,i=n.index();return n.parent.child(i).text}return s.getSelectionText(e)},t.prototype.getData=function(){var e=this.linkForm.value;return c.isPresent(this.linkForm.controls.target)&&(e.target=e.target?"_blank":null),e},i.__decorate([o.Input(),i.__metadata("design:type",Object)],t.prototype,"editor",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"command",void 0),i.__decorate([o.ViewChild("hrefInput",{read:o.ElementRef,static:!0}),i.__metadata("design:type",o.ElementRef)],t.prototype,"hrefInput",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[a.DialogRef,d.EditorLocalizationService])],t)}(a.DialogContentBase);t.FileLinkDialogComponent=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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(e){return"plugins must be a function, but received "+JSON.stringify(e)+"."},pastedContentCallbackType:function(e){return"pastedContent must be a function, but received "+JSON.stringify(e)+"."},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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=function(e){function t(t,n,i){var o=e.call(this)||this;return o.cleanedHtml=t,o.originalHtml=n,o.originalEvent=i,o}return i.__extends(t,e),t}(n(2).PreventableEvent);t.EditorPasteEvent=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=n(7),c=n(27),d=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.data=[],i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.formatDropDownList.dropDownList.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.value&&this.editor.exec("format",{tag:this.value}),this.dialog.close()},t.prototype.setData=function(e){this.editor=e.editor,this.data=e.data,this.defaultItem=e.defaultItem,this.value=e.value,this.itemDisabled=e.itemDisabled},t.prototype.textFor=function(e){return this.localization.get(e)},i.__decorate([o.Input(),i.__metadata("design:type",s.EditorComponent)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("formatDropDownList",{read:c.FormatDropDownListComponent,static:!0}),i.__metadata("design:type",c.FormatDropDownListComponent)],t.prototype,"formatDropDownList",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.FormatDialogComponent=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=n(7),c=n(23),d=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.colorPicker.focus()}))},t.prototype.handleActiveColorClick=function(e){e.preventOpen(),this.value=e.color},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.value&&this.editor.exec(this.editorCommand,this.value),this.dialog.close(),this.editor.view.focus()},t.prototype.setData=function(e){this.editor=e.editor,this.value=e.value,this.editorCommand=e.editorCommand,this.paletteSettings=e.paletteSettings,this.icon=e.icon,this.views=e.view?[e.view]:e.views},t.prototype.textFor=function(e){return this.localization.get(e)},i.__decorate([o.Input(),i.__metadata("design:type",s.EditorComponent)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("colorpicker",{read:c.ColorPickerComponent,static:!0}),i.__metadata("design:type",c.ColorPickerComponent)],t.prototype,"colorPicker",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.ColorPickerDialogComponent=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=n(7),c=n(28),d=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.data=[],i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.fontFamilyDropDownList.dropDownList.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontFamily",this.value),this.dialog.close()},t.prototype.setData=function(e){this.editor=e.editor,this.data=e.data,this.defaultItem=e.defaultItem,this.value=e.value,this.itemDisabled=e.itemDisabled},t.prototype.textFor=function(e){return this.localization.get(e)},i.__decorate([o.Input(),i.__metadata("design:type",s.EditorComponent)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("fontFamilyDropDownList",{read:c.FontFamilyDropDownListComponent,static:!0}),i.__metadata("design:type",c.FontFamilyDropDownListComponent)],t.prototype,"fontFamilyDropDownList",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.FontFamilyDialogComponent=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=n(7),c=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i}return i.__extends(t,e),t.prototype.onCancelAction=function(){this.dialog.close(),this.editor.view.focus()},t.prototype.onCellClick=function(e){this.dialog.close(),this.editor.exec("insertTable",e),this.editor.view.focus()},t.prototype.setData=function(e){this.editor=e.editor},t.prototype.textFor=function(e){return this.localization.get(e)},i.__decorate([o.Input(),i.__metadata("design:type",s.EditorComponent)],t.prototype,"editor",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.InsertTableDialogComponent=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(18),a=n(6),s=n(7),c=n(29),d=function(e){function t(t,n){var i=e.call(this,t)||this;return i.dialog=t,i.localization=n,i.data=[],i}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){var e=this;Promise.resolve(null).then((function(){e.fontSizeDropDownList.dropDownList.focus()}))},t.prototype.onCancelAction=function(){this.dialog.close()},t.prototype.onConfirmAction=function(){this.value&&this.editor.exec("fontSize",this.value),this.dialog.close()},t.prototype.setData=function(e){this.editor=e.editor,this.data=e.data,this.defaultItem=e.defaultItem,this.value=e.value,this.itemDisabled=e.itemDisabled},t.prototype.textFor=function(e){return this.localization.get(e)},i.__decorate([o.Input(),i.__metadata("design:type",s.EditorComponent)],t.prototype,"editor",void 0),i.__decorate([o.ViewChild("fontSizeDropDownList",{read:c.FontSizeDropDownListComponent,static:!0}),i.__metadata("design:type",c.FontSizeDropDownListComponent)],t.prototype,"fontSizeDropDownList",void 0),t=i.__decorate([o.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 '}),i.__metadata("design:paramtypes",[r.DialogRef,a.EditorLocalizationService])],t)}(r.DialogContentBase);t.FontSizeDialogComponent=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),o=function(){function e(e,t,n,o,r){var a=this;this.command=e,this.button=t,this.editor=n,this.localization=o,this.toolsService=r,setTimeout((function(){var e=a.localization.get(a.command);e&&(a.button.showText="overflow",a.button.showIcon="both",a.button.text=e),a.button.toolbarOptions.icon||(a.button.icon=i.commandIcons[a.command]),a.button.title=e,a.toolsService.needsCheck.next()}))}return e.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)))},e.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},e.prototype.clickHandler=function(){},e.prototype.pointerdownHandler=function(e){},e.prototype.onStateChange=function(e){},e}();t.EditorCommandBase=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"alignCenter",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"alignJustify",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"alignLeft",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"alignRight",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"backColor",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"blockquote",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"bold",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"cleanFormatting",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"createLink",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"fontFamily",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"fontSize",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"foreColor",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"format",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"indent",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"insertFile",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"insertImage",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"insertOrderedList",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"insertUnorderedList",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"italic",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"outdent",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"print",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"redo",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"selectAll",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"strikethrough",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"subscript",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"superscript",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"underline",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"undo",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"unlink",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"viewSource",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"insertTable",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"addColumnBefore",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"addColumnAfter",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"addRowBefore",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"addRowAfter",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"deleteColumn",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"deleteRow",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"deleteTable",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"dialogApply",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"dialogCancel",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"dialogInsert",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"dialogUpdate",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"fileText",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"fileTitle",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"fileWebAddress",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"imageAltText",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"imageHeight",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"imageWebAddress",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"imageWidth",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"linkOpenInNewWindow",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"linkText",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"linkTitle",void 0),i.__decorate([o.Input(),i.__metadata("design:type",String)],t.prototype,"linkWebAddress",void 0),t}(n(3).ComponentMessages);t.Messages=r},function(e,t){e.exports=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7);t.EditorComponent=i.EditorComponent;var o=n(54);t.EditorModule=o.EditorModule;var r=n(32);t.schema=r.schema,t.Schema=r.Schema;var a=n(21);t.EditorState=a.EditorState,t.Plugin=a.Plugin,t.PluginKey=a.PluginKey,t.Transaction=a.Transaction,t.EditorView=a.EditorView,t.Decoration=a.Decoration,t.DecorationSet=a.DecorationSet,t.NodeType=a.NodeType,t.Node=a.Node,t.MarkType=a.MarkType,t.Mark=a.Mark,t.InputRule=a.InputRule,t.inputRules=a.inputRules,t.wrappingInputRule=a.wrappingInputRule,t.textblockTypeInputRule=a.textblockTypeInputRule,t.keymap=a.keymap,t.baseKeymap=a.baseKeymap,t.history=a.history,t.dropCursor=a.dropCursor,t.gapCursor=a.gapCursor,t.tableNodes=a.tableNodes,t.getSelectionText=a.getSelectionText;var s=n(37);t.EditorPasteEvent=s.EditorPasteEvent},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.packageMetadata={name:"@progress/kendo-angular-editor",productName:"Kendo UI for Angular",productCodes:["KENDOUIANGULAR","KENDOUICOMPLETE"],publishDate:1645783118,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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(49);t.semanticTagNames=["article","main","nav","header","footer","aside","section"],t.semanticNodes=t.semanticTagNames.reduce((function(e,t){var n,r;return Object.assign(e,((n={})[t]=(r=t,{content:"block*",group:"block",attrs:i.__assign({},o.commonAttributes()),parseDOM:[{tag:r,getAttrs:o.getAttributes}],toDOM:function(e){return o.hasAttrs(e.attrs)?[r,o.getAttrs(e.attrs),o.hole]:[r,o.hole]}}),n))}),{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0);t.hasAttrs=function(e,t){for(var n in e)if(n&&null!==e[n]&&n!==t)return!0;return!1},t.getAttrs=function(e,t){var n={};for(var i in e)i&&null!==e[i]&&i!==t&&(n[i]=e[i]);return n},t.getAttributes=function(e){for(var t,n={},i=e.attributes,o=0;o<i.length;o++)n[(t=i[o]).name]=t.value;return n},t.serializeDOMAttrs=function(e){return Array.from(e.attributes).reduce((function(e,t){var n;return Object.assign({},e,((n={})[t.name]=t.value,n))}),{})},t.commonAttributes=function(){return i.__assign({},t.createDefaultAttributes(["class","id","style"]))},t.createDefaultAttributes=function(e){return void 0===e&&(e=[]),i.__assign({},e.reduce((function(e,t){var n;return i.__assign({},e,((n={})[t]={default:null},n))}),{}))},t.hole=0,t.isSchemaNode=function(e){return function(t){return t.type.name===e}},t.isTable=t.isSchemaNode("table"),t.isTableBody=t.isSchemaNode("table_body"),t.isTableHead=t.isSchemaNode("table_head"),t.isTableFoot=t.isSchemaNode("table_foot"),t.isTableRow=t.isSchemaNode("table_row"),t.isTableCell=t.isSchemaNode("table_cell"),t.isTableHeaderCell=t.isSchemaNode("table_header")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(21),r=n(51),a=function(e,t){return o.alignBlocks(o.alignRemoveRules)(e,t)},s={bold:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.bold,{applyToWord:e}))},cleanFormatting:function(e){return o.cleanFormatting(e)},createLink:function(e){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:e.value,applyToWord:e.applyToWord})},fontFamily:function(e){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-family",value:e.value,applyToWord:e.applyToWord})},fontSize:function(e){return o.expandToWordWrap(o.applyInlineStyle,{style:"font-size",value:e.value+"px",applyToWord:e.applyToWord})},insertFile:function(e){return o.expandToWordWrap(o.applyLink,{mark:"link",attrs:e,applyToWord:e.applyToWord})},insertText:function(e){return o.insertText(e)},italic:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.italic,{applyToWord:e}))},strikethrough:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.strikethrough,{applyToWord:e}))},subscript:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.subscript,{applyToWord:e}))},superscript:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.superscript,{applyToWord:e}))},underline:function(e){return o.expandToWordWrap(o.toggleInlineFormat,i.__assign({},o.underline,{applyToWord:e}))},unlink:function(){return o.removeLink(o.link)},foreColor:function(e){return o.expandToWordWrap(o.applyInlineStyle,{style:"color",value:e.value,applyToWord:e.applyToWord})},backColor:function(e){return o.expandToWordWrap(o.applyInlineStyle,{style:"background-color",value:e.value,applyToWord:e.applyToWord})},selectAll:function(){return function(e,t){return o.selectAll(e,t)}}},c={alignCenter:function(){return function(e,t){return o.isAligned(e,o.alignCenterRules)?a(e,t):o.alignBlocks(o.alignCenterRules)(e,t)}},alignJustify:function(){return function(e,t){return o.isAligned(e,o.alignJustifyRules)?a(e,t):o.alignBlocks(o.alignJustifyRules)(e,t)}},alignLeft:function(){return function(e,t){return o.isAligned(e,o.alignLeftRules)?a(e,t):o.alignBlocks(o.alignLeftRules)(e,t)}},alignRight:function(){return function(e,t){return o.isAligned(e,o.alignRightRules)?a(e,t):o.alignBlocks(o.alignRightRules)(e,t)}},format:function(e){return o.formatBlockElements(e.tag)},getHTML:function(){return o.getHtml},indent:function(){return o.indent},insertImage:function(e){return o.insertImage(e)},insertOrderedList:function(){return o.toggleOrderedList},insertUnorderedList:function(){return o.toggleUnorderedList},outdent:function(){return o.outdent},redo:function(){return o.redo},setHTML:function(e){var t=e.content,n=e.parseOptions;return o.setHtml(t,"setHTML",n)},undo:function(){return o.undo},blockquote:function(){return o.blockquote}},d={insertTable:function(e){return r.insertTable(e)},addColumnBefore:function(){return o.addColumnBefore},addColumnAfter:function(){return o.addColumnAfter},addRowBefore:function(){return o.addRowBefore},addRowAfter:function(){return o.addRowAfter},deleteRow:function(){return o.deleteRow},deleteColumn:function(){return o.deleteColumn},mergeCells:function(){return o.mergeCells},splitCell:function(){return o.splitCell},deleteTable:function(){return o.deleteTable}};t.editorCommands=Object.assign({},s,c,d)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(21);t.insertTable=function(e){return function(t,n){var o=i.createTable(t.schema.nodes,e.rows,e.cols);o&&i.insertNode(o,!0)(t,n)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(21),o=n(21);t.getToolbarState=function(e,t){return{alignCenter:{selected:o.isAligned(e,o.alignCenterRules),disabled:!1},alignJustify:{selected:o.isAligned(e,o.alignJustifyRules),disabled:!1},alignLeft:{selected:o.isAligned(e,o.alignLeftRules),disabled:!1},alignRight:{selected:o.isAligned(e,o.alignRightRules),disabled:!1},bold:{selected:o.hasMark(e,o.bold),disabled:!1},cleanFormatting:{selected:!1,disabled:!i.cleanFormatting()(e)},format:{selected:o.activeNode(e),disabled:!1},blockquote:{selected:!1,disabled:!i.blockquote(e)},indent:{selected:!1,disabled:!(o.canIndentAsListItem(e,e.schema.nodes.list_item)||o.canBeIndented(e,o.indentRules))},insertOrderedList:{selected:o.hasNode(e,e.schema.nodes.ordered_list),disabled:!1},insertUnorderedList:{selected:o.hasNode(e,e.schema.nodes.bullet_list),disabled:!1},italic:{selected:o.hasMark(e,o.italic),disabled:!1},unlink:{selected:!1,disabled:!o.hasMark(e,o.link)},outdent:{selected:!1,get disabled(){return!(o.hasNode(e,e.schema.nodes.blockquote)||o.canOutdentAsListItem(e,o.outdentRules)||i.isIndented(e,o.outdentRules.nodes))}},redo:{selected:!1,disabled:!o.redo(e)},selectAll:{selected:!1,disabled:!1},strikethrough:{selected:o.hasMark(e,o.strikethrough),disabled:!1},style:{selected:o.getActiveMarks(e,e.schema.marks.style),disabled:!1},subscript:{selected:o.hasMark(e,o.subscript),disabled:!1},superscript:{selected:o.hasMark(e,o.superscript),disabled:!1},underline:{selected:o.hasMark(e,o.underline),disabled:!1},undo:{selected:!1,disabled:!o.undo(e)},createLink:{selected:!1,get disabled(){var n=e.selection.empty;return t&&t.applyToWord&&n?o.expandSelection(e,(function(){}),t).state.selection.empty:n}},insertFile:{selected:!1,disabled:e.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:!o.addColumnBefore(e)},addColumnAfter:{selected:!1,disabled:!o.addColumnAfter(e)},addRowBefore:{selected:!1,disabled:!o.addRowBefore(e)},addRowAfter:{selected:!1,disabled:!o.addRowAfter(e)},deleteRow:{selected:!1,disabled:!o.deleteRow(e)},deleteColumn:{selected:!1,disabled:!o.deleteColumn(e)},mergeCells:{selected:!1,disabled:!o.mergeCells(e)},splitCell:{selected:!1,disabled:!o.splitCell(e)},deleteTable:{selected:!1,disabled:!o.deleteTable(e)}}},t.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}},t.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(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.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',t.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',t.rtlStyles="body { direction: rtl }"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(12),a=n(10),s=n(9),c=n(25),d=n(18),l=n(19),p=n(23),u=n(7),h=n(34),f=n(33),b=n(35),m=n(38),g=n(39),v=n(40),y=n(41),_=n(55),O=n(56),j=n(57),C=n(30),k=n(58),w=n(59),S=n(60),x=n(61),E=n(62),I=n(63),T=n(64),D=n(65),B=n(66),P=n(67),A=n(68),M=n(69),z=n(70),R=n(71),F=n(72),N=n(73),L=n(74),V=n(75),H=n(76),K=n(77),$=n(78),W=n(79),U=n(80),G=n(81),Z=n(82),q=n(83),J=n(84),X=n(85),Y=n(86),Q=n(87),ee=n(88),te=n(89),ne=n(90),ie=n(91),oe=n(92),re=n(93),ae=n(94),se=n(95),ce=n(27),de=n(28),le=n(29),pe=n(42),ue=n(96),he=n(97),fe=n(98),be=[S.EditorAlignLeftButtonDirective,x.EditorAlignCenterButtonDirective,E.EditorAlignRightButtonDirective,I.EditorAlignJustifyButtonDirective,G.EditorInsertFileButtonDirective,D.EditorRedoButtonDirective,B.EditorUndoButtonDirective,P.EditorInsertImageButtonDirective,A.EditorIndentButtonDirective,M.EditorOutdentButtonDirective,z.EditorCreateLinkButtonDirective,R.EditorUnlinkButtonDirective,F.EditorInsertOrderedListButtonDirective,N.EditorInsertUnorderedListButtonDirective,L.EditorViewSourceButtonDirective,V.EditorBoldButtonDirective,H.EditorItalicButtonDirective,K.EditorUnderlineButtonDirective,$.EditorStrikethroughButtonDirective,W.EditorSubscriptButtonDirective,U.EditorSuperscriptButtonDirective,Z.EditorForeColorDirective,q.EditorBackColorDirective,J.EditorCleanFormattingButtonDirective,X.EditorAddColumnBeforeButtonDirective,Y.EditorAddColumnAfterButtonDirective,Q.EditorAddRowBeforeButtonDirective,ee.EditorAddRowAfterButtonDirective,te.EditorDeleteColumnButtonDirective,ne.EditorDeleteRowButtonDirective,ie.EditorDeleteTableButtonDirective,oe.EditorMergeCellsButtonDirective,re.EditorSplitCellButtonDirective,se.CustomMessagesComponent,ae.LocalizedMessagesDirective,ue.DropDownToolDirective,he.EditorPrintDirective,fe.EditorSelectAllButtonDirective,T.EditorBlockquoteDirective],me=[O.EditorFontSizeComponent,j.EditorFontFamilyComponent,_.EditorFormatComponent,C.EditorColorPickerComponent,k.EditorInsertTableButtonComponent],ge=[b.FileLinkDialogComponent,h.ImageDialogComponent,f.SourceDialogComponent,m.FormatDialogComponent,g.ColorPickerDialogComponent,v.FontFamilyDialogComponent,pe.FontSizeDialogComponent,y.InsertTableDialogComponent],ve=[w.PopupTableGridComponent,ce.FormatDropDownListComponent,de.FontFamilyDropDownListComponent,le.FontSizeDropDownListComponent],ye=function(){function e(){}return e=i.__decorate([o.NgModule({declarations:[u.EditorComponent,be,me,ge,ve],entryComponents:[ge],exports:[u.EditorComponent,be,me,s.ToolBarModule,l.ButtonModule,a.FormsModule,a.ReactiveFormsModule,ve],imports:[r.CommonModule,a.FormsModule,a.ReactiveFormsModule,l.ButtonModule,p.ColorPickerModule,d.DialogModule,c.DropDownsModule,p.NumericTextBoxModule,p.CheckBoxModule,s.ToolBarModule,p.TextBoxModule]})],e)}();t.EditorModule=ye},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(18),s=n(22),c=n(7),d=n(6),l=n(38),p=n(27),u=n(11),h=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a.editor=t,a.dialogService=n,a.localization=i,a.toolsService=r,a.disabled=!1,a.tabindex=-1,a.valueChange=new o.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 i.__extends(t,e),n=t,Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||this._data},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this.itemDisabled=function(t){return!(e.overflows||!e.formatDropDownList||e.formatDropDownList.dropDownList.isOpen)||null===t.dataItem.tag},setTimeout((function(){e.defaultItem={text:e.title,tag:null},e.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(t){var n=t.format,i=e.data.findIndex((function(e){return e.tag===n.selected.tag}));e.value=-1!==i?n.selected.tag:null,e.disabled=n.disabled}))},t.prototype.onValueChange=function(e){s.isPresent(e)&&(this.editor.exec("format",{tag:e}),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(t){return t.tag===e}))))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(t.prototype,"outerWidth",{get:function(){var e=this.formatDropDownList.element;if(e)return s.outerWidth(e.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.localization.get("format")},enumerable:!0,configurable:!0}),t.prototype.openDialog=function(){var e={appendTo:this.editor.dialogContainer,content:l.FormatDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(e).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(){this.tabindex=0,this.overflows?this.formatButton.nativeElement.focus():this.formatDropDownList.focus()},t.prototype.handleKey=function(){return this.tabindex=-1,!1},i.__decorate([o.Input(),i.__metadata("design:type",Array),i.__metadata("design:paramtypes",[Array])],t.prototype,"data",null),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),i.__decorate([o.ViewChild("popupTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),i.__decorate([o.ViewChild("formatDropDownList",{static:!1}),i.__metadata("design:type",p.FormatDropDownListComponent)],t.prototype,"formatDropDownList",void 0),i.__decorate([o.ViewChild("formatButton",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"formatButton",void 0),t=n=i.__decorate([o.Component({providers:[{provide:r.ToolBarToolComponent,useExisting:o.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 '}),i.__param(0,o.Host()),i.__metadata("design:paramtypes",[c.EditorComponent,a.DialogService,d.EditorLocalizationService,u.EditorToolsService])],t)}(r.ToolBarToolComponent);t.EditorFormatComponent=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(22),s=n(7),c=n(6),d=n(18),l=n(42),p=n(29),u=n(11),h=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a.editor=t,a.dialogService=n,a.localization=i,a.toolsService=r,a.disabled=!1,a.tabindex=-1,a.valueChange=new o.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 i.__extends(t,e),n=t,Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||this._data},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this.itemDisabled=function(t){return!(e.overflows||!e.fontSizeDropDownList||e.fontSizeDropDownList.dropDownList.isOpen)||null===t.dataItem.size},setTimeout((function(){e.defaultItem={text:e.title,size:null},e.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(t){var n=t.style;e.value=(a.getUniqueStyleValues(n.selected,"font-size").match(/\d+/g)||[null])[0],e.disabled=n.disabled}))},t.prototype.onValueChange=function(e){a.isPresent(e)&&(this.editor.exec("fontSize",e),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(t){return t.size===parseInt(e,10)}))))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(t.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.localization.get("fontSize")},enumerable:!0,configurable:!0}),t.prototype.openDialog=function(){var e={appendTo:this.editor.dialogContainer,content:l.FontSizeDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(e).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontSizeButton.nativeElement.focus():this.fontSizeDropDownList.focus()},t.prototype.handleKey=function(){return this.tabindex=-1,!1},i.__decorate([o.Input(),i.__metadata("design:type",Array),i.__metadata("design:paramtypes",[Array])],t.prototype,"data",null),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),i.__decorate([o.ViewChild("popupTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),i.__decorate([o.ViewChild("element",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),i.__decorate([o.ViewChild("element",{read:p.FontSizeDropDownListComponent,static:!1}),i.__metadata("design:type",p.FontSizeDropDownListComponent)],t.prototype,"fontSizeDropDownList",void 0),i.__decorate([o.ViewChild("fontSizeButton",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"fontSizeButton",void 0),t=n=i.__decorate([o.Component({providers:[{provide:r.ToolBarToolComponent,useExisting:o.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 '}),i.__param(0,o.Host()),i.__metadata("design:paramtypes",[s.EditorComponent,d.DialogService,c.EditorLocalizationService,u.EditorToolsService])],t)}(r.ToolBarToolComponent);t.EditorFontSizeComponent=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(22),s=n(7),c=n(6),d=n(18),l=n(40),p=n(28),u=n(11),h=function(e){function t(t,n,i,r){var a=e.call(this)||this;return a.editor=t,a.dialogService=n,a.localization=i,a.toolsService=r,a.disabled=!1,a.tabindex=-1,a.valueChange=new o.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 i.__extends(t,e),n=t,Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(e){this._data=e||this._data},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){var e=this;this.itemDisabled=function(t){return!(e.overflows||!e.fontFamilyDropDownList||e.fontFamilyDropDownList.dropDownList.isOpen)||null===t.dataItem.fontName},setTimeout((function(){e.defaultItem={text:e.title,fontName:null},e.toolsService.needsCheck.next()})),this.subs=this.editor.stateChange.subscribe((function(t){var n=t.style;e.value=a.getUniqueStyleValues(n.selected,"font-family")||null,e.disabled=n.disabled}))},t.prototype.onValueChange=function(e){a.isPresent(e)&&(this.editor.exec("fontFamily",e),this.editor.view.focus(),this.valueChange.emit(this.data.find((function(t){return t.fontName===e}))))},t.prototype.ngOnDestroy=function(){this.subs&&this.subs.unsubscribe()},Object.defineProperty(t.prototype,"outerWidth",{get:function(){if(this.element)return a.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.localization.get("fontFamily")},enumerable:!0,configurable:!0}),t.prototype.openDialog=function(){var e={appendTo:this.editor.dialogContainer,content:l.FontFamilyDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(e).content.instance.setData({editor:this.editor,data:this.data,defaultItem:this.defaultItem,value:this.value,itemDisabled:this.itemDisabled})},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(){this.tabindex=0,this.overflows?this.fontFamilyButton.nativeElement.focus():this.fontFamilyDropDownList.focus()},t.prototype.handleKey=function(){return this.tabindex=-1,!1},i.__decorate([o.Input(),i.__metadata("design:type",Array),i.__metadata("design:paramtypes",[Array])],t.prototype,"data",null),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],t.prototype,"valueChange",void 0),i.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),i.__decorate([o.ViewChild("popupTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),i.__decorate([o.ViewChild("element",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),i.__decorate([o.ViewChild("element",{read:p.FontFamilyDropDownListComponent,static:!1}),i.__metadata("design:type",p.FontFamilyDropDownListComponent)],t.prototype,"fontFamilyDropDownList",void 0),i.__decorate([o.ViewChild("fontFamilyButton",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"fontFamilyButton",void 0),t=n=i.__decorate([o.Component({providers:[{provide:r.ToolBarToolComponent,useExisting:o.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 '}),i.__param(0,o.Host()),i.__metadata("design:paramtypes",[s.EditorComponent,d.DialogService,c.EditorLocalizationService,u.EditorToolsService])],t)}(r.ToolBarToolComponent);t.EditorFontFamilyComponent=h},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(5),a=n(4),s=n(9),c=n(16),d=n(22),l=n(7),p=n(6),u=n(18),h=n(41),f=n(2),b=function(e){function t(t,n,i,s){var c=e.call(this)||this;return c.editor=t,c.localization=n,c.popupService=i,c.dialogService=s,c.open=!1,c.buttonBlurred=new o.EventEmitter,c.cellClicked=new o.EventEmitter,c.subs=c.editor.stateChange.subscribe((function(e){var t=e.insertTable;c.disabled=t.disabled})),c.subs.add(c.buttonBlurred.pipe(a.concatMap((function(){return r.interval(200).pipe(a.take(1),a.takeUntil(c.cellClicked))}))).subscribe((function(){c.toggle(!1)}))),c}var n;return i.__extends(t,e),n=t,t.prototype.ngOnDestroy=function(){this.destroyPopup(),this.subs&&this.subs.unsubscribe()},Object.defineProperty(t.prototype,"outerWidth",{get:function(){if(this.element)return d.outerWidth(this.element.nativeElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this.localization.get("insertTable")},enumerable:!0,configurable:!0}),t.prototype.toggle=function(e){this.open=void 0===e?!this.open:e,this.destroyPopup(),this.open&&this.createPopup()},t.prototype.openDialog=function(){var e={appendTo:this.editor.dialogContainer,content:h.InsertTableDialogComponent};this.editor.toolbar.toggle(!1),this.dialogService.open(e).content.instance.setData({editor:this.editor})},t.prototype.onBlur=function(){this.tabIndex=-1,this.buttonBlurred.emit()},t.prototype.onCellClick=function(e){this.cellClicked.emit(),this.toggle(!1),this.editor.exec("insertTable",e)},t.prototype.canFocus=function(){return!this.disabled},t.prototype.focus=function(){this.tabIndex=0,this.getButton().focus()},t.prototype.handleKey=function(e){return e.keyCode===f.Keys.Space||e.keyCode===f.Keys.Enter||(this.tabIndex=-1,!1)},t.prototype.onTableWizardClick=function(){},t.prototype.createPopup=function(){var e="rtl"===this.editor.direction?"right":"left",t={horizontal:e,vertical:"bottom"},n={horizontal:e,vertical:"top"};this.popupRef=this.popupService.open({anchor:this.element,anchorAlign:t,animate:!0,content:this.popupGridTemplate,popupAlign:n,popupClass:"k-ct-popup k-group k-reset k-state-border-up",positionMode:"absolute"});var i=this.popupRef.popupElement;i.style.width="190px",i.style.height="164px",i.setAttribute("dir",this.editor.direction)},t.prototype.destroyPopup=function(){this.popupRef&&(this.popupRef.close(),this.popupRef=null)},t.prototype.getButton=function(){return(this.overflows?this.overflowElement:this.element).nativeElement},i.__decorate([o.ViewChild("toolbarTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"toolbarTemplate",void 0),i.__decorate([o.ViewChild("popupTemplate",{static:!1}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupTemplate",void 0),i.__decorate([o.ViewChild("element",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"element",void 0),i.__decorate([o.ViewChild("overflowElement",{static:!1}),i.__metadata("design:type",o.ElementRef)],t.prototype,"overflowElement",void 0),i.__decorate([o.ViewChild("popupGridTemplate",{static:!0}),i.__metadata("design:type",o.TemplateRef)],t.prototype,"popupGridTemplate",void 0),t=n=i.__decorate([o.Component({providers:[{provide:s.ToolBarToolComponent,useExisting:o.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 '}),i.__param(0,o.Host()),i.__metadata("design:paramtypes",[l.EditorComponent,p.EditorLocalizationService,c.PopupService,u.DialogService])],t)}(s.ToolBarToolComponent);t.EditorInsertTableButtonComponent=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=function(){function e(){this.cellClick=new o.EventEmitter,this.tableWizardClick=new o.EventEmitter,this.state={rows:-1,cols:-1},this.rows=6,this.cols=8}return Object.defineProperty(e.prototype,"message",{get:function(){var e=this.state,t=e.rows,n=e.cols;return"Create a "+(t>-1?t+1:"")+" "+(n>-1?"x":"")+" "+(n>-1?n+1:"")+" table"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"cells",{get:function(){return Array.from(Array(this.rows*this.cols).keys())},enumerable:!0,configurable:!0}),e.prototype.selected=function(e){var t=this.state,n=t.rows,i=t.cols,o=Math.floor(e/this.cols),r=e%this.cols;return o<=n&&r<=i},e.prototype.setState=function(e){var t=Math.floor(e/this.cols),n=e%this.cols;this.state={rows:t,cols:n}},e.prototype.resetState=function(){this.state={rows:-1,cols:-1}},e.prototype.insertTable=function(){this.cellClick.emit(this.state)},e.prototype.openTableWizard=function(){this.tableWizardClick.emit()},i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"cellClick",void 0),i.__decorate([o.Output(),i.__metadata("design:type",o.EventEmitter)],e.prototype,"tableWizardClick",void 0),e=i.__decorate([o.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 '})],e)}();t.PopupTableGridComponent=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"alignLeft",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignLeftButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAlignLeftButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"alignCenter",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignCenterButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAlignCenterButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"alignRight",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignRightButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAlignRightButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"alignJustify",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAlignJustifyButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAlignJustifyButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){var r=e.call(this,"blockquote",t,n,i,o)||this;return r.editor=n,r}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBlockquoteButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorBlockquoteDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"redo",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorRedoButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorRedoButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"undo",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUndoButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorUndoButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(24),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"insertImage",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertImageButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandDialog);t.EditorInsertImageButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"indent",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorIndentButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorIndentButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"outdent",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorOutdentButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorOutdentButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(24),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"createLink",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCreateLinkButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandDialog);t.EditorCreateLinkButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"unlink",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnlinkButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorUnlinkButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"insertOrderedList",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertOrderedListButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorInsertOrderedListButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"insertUnorderedList",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertUnorderedListButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorInsertUnorderedListButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(24),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"viewSource",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorViewSourceButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandDialog);t.EditorViewSourceButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"bold",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorBoldButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorBoldButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"italic",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorItalicButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorItalicButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"underline",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorUnderlineButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorUnderlineButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"strikethrough",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorStrikethroughButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorStrikethroughButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"subscript",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSubscriptButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorSubscriptButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"superscript",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSuperscriptButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorSuperscriptButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(7),a=n(24),s=n(9),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"insertFile",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorInsertFileButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[s.ToolBarButtonComponent,r.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(a.EditorCommandDialog);t.EditorInsertFileButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(30),a=n(31),s=function(){function e(e){this.colorPicker=e,this.colorPicker.icon=a.commandIcons.foreColor,this.colorPicker.editorCommand="foreColor"}return e=i.__decorate([o.Directive({selector:"[kendoEditorForeColor]"}),i.__metadata("design:paramtypes",[r.EditorColorPickerComponent])],e)}();t.EditorForeColorDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(30),a=n(31),s=function(){function e(e){this.colorPicker=e,this.colorPicker.icon=a.commandIcons.backColor,this.colorPicker.editorCommand="backColor"}return e=i.__decorate([o.Directive({selector:"[kendoEditorBackColor]"}),i.__metadata("design:paramtypes",[r.EditorColorPickerComponent])],e)}();t.EditorBackColorDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"cleanFormatting",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorCleanFormattingButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorCleanFormattingButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"addColumnBefore",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnBeforeButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAddColumnBeforeButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"addColumnAfter",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddColumnAfterButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAddColumnAfterButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"addRowBefore",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowBeforeButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAddRowBeforeButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"addRowAfter",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorAddRowAfterButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorAddRowAfterButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"deleteColumn",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteColumnButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorDeleteColumnButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"deleteRow",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteRowButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorDeleteRowButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"deleteTable",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorDeleteTableButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorDeleteTableButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"mergeCells",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorMergeCellsButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorMergeCellsButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"splitCell",t,n,i,o)||this}return i.__extends(t,e),t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSplitCellButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorSplitCellButtonDirective=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(3),a=n(44),s=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return i.__extends(t,e),n=t,t=n=i.__decorate([o.Directive({providers:[{provide:a.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"[kendoEditorLocalizedMessages]"}),i.__metadata("design:paramtypes",[r.LocalizationService])],t)}(a.Messages);t.LocalizedMessagesDirective=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(3),a=n(44),s=function(e){function t(t){var n=e.call(this)||this;return n.service=t,n}var n;return i.__extends(t,e),n=t,Object.defineProperty(t.prototype,"override",{get:function(){return!0},enumerable:!0,configurable:!0}),t=n=i.__decorate([o.Component({providers:[{provide:a.Messages,useExisting:o.forwardRef((function(){return n}))}],selector:"kendo-editor-messages",template:""}),i.__metadata("design:paramtypes",[r.LocalizationService])],t)}(a.Messages);t.CustomMessagesComponent=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=function(){function e(e,t){this.hostEl=e,this.zone=t,this.preventDefault=function(e){e.preventDefault()}}return Object.defineProperty(e.prototype,"hostElement",{get:function(){return this.hostEl.nativeElement},enumerable:!0,configurable:!0}),e.prototype.ngAfterViewInit=function(){var e=this;this.zone.runOutsideAngular((function(){e.hostElement.addEventListener("pointerdown",e.preventDefault)}))},e.prototype.ngOnDestroy=function(){this.hostElement.removeEventListener("pointerdown",this.preventDefault)},e=i.__decorate([o.Directive({selector:"[kendoEditorDropDownTool]"}),i.__metadata("design:paramtypes",[o.ElementRef,o.NgZone])],e)}();t.DropDownToolDirective=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(36),l=n(11),p=function(e){function t(t,n,i,o){var r=e.call(this,"print",t,n,i,o)||this;return r.editor=n,r}return i.__extends(t,e),t.prototype.ngAfterViewInit=function(){if(o.isDevMode&&!this.editor.iframe)throw new Error(d.EditorErrorMessages.printTool)},t.prototype.clickHandler=function(){if(this.editor.iframe){var e=this.editor.view,t=e&&e.dom,n=t&&t.ownerDocument,i=n&&n.defaultView;i&&i.print()}},t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorPrintButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,l.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorPrintDirective=p},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),r=n(9),a=n(7),s=n(15),c=n(6),d=n(11),l=function(e){function t(t,n,i,o){return e.call(this,"selectAll",t,n,i,o)||this}return i.__extends(t,e),t.prototype.clickHandler=function(){this.editor.shouldEmitFocus=!0,e.prototype.clickHandler.call(this)},t=i.__decorate([o.Directive({selector:"kendo-toolbar-button[kendoEditorSelectAllButton]"}),i.__param(1,o.Host()),i.__metadata("design:paramtypes",[r.ToolBarButtonComponent,a.EditorComponent,c.EditorLocalizationService,d.EditorToolsService])],t)}(s.EditorCommandButton);t.EditorSelectAllButtonDirective=l}])}));
|
|
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(/^(?: |[\u00a0\n\r\s])+/,"")};return n=n.replace(/<\/?\w+[^>]*>/g,"").replace(/ /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+[\.\)]( )+ /,""):(t.removeChild(t.firstChild),3===t.firstChild.nodeType&&/^[ivxlcdm]+\.$/i.test(t.firstChild.nodeValue)&&t.removeChild(t.firstChild),/^( |\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}])}));
|